MCPcopy Create free account
hub / github.com/F-Stack/f-stack / table_action_profile_create

Function table_action_profile_create

dpdk/examples/ip_pipeline/action.c:176–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176struct table_action_profile *
177table_action_profile_create(const char *name,
178 struct table_action_profile_params *params)
179{
180 struct table_action_profile *profile;
181 struct rte_table_action_profile *ap;
182 int status;
183
184 /* Check input params */
185 if ((name == NULL) ||
186 table_action_profile_find(name) ||
187 (params == NULL) ||
188 ((params->action_mask & (1LLU << RTE_TABLE_ACTION_FWD)) == 0))
189 return NULL;
190
191 if ((params->action_mask & (1LLU << RTE_TABLE_ACTION_LB)) &&
192 (params->lb.f_hash == NULL)) {
193 switch (params->lb.key_size) {
194 case 8:
195 params->lb.f_hash = rte_table_hash_crc_key8;
196 break;
197
198 case 16:
199 params->lb.f_hash = rte_table_hash_crc_key16;
200 break;
201
202 case 24:
203 params->lb.f_hash = rte_table_hash_crc_key24;
204 break;
205
206 case 32:
207 params->lb.f_hash = rte_table_hash_crc_key32;
208 break;
209
210 case 40:
211 params->lb.f_hash = rte_table_hash_crc_key40;
212 break;
213
214 case 48:
215 params->lb.f_hash = rte_table_hash_crc_key48;
216 break;
217
218 case 56:
219 params->lb.f_hash = rte_table_hash_crc_key56;
220 break;
221
222 case 64:
223 params->lb.f_hash = rte_table_hash_crc_key64;
224 break;
225
226 default:
227 return NULL;
228 }
229
230 params->lb.seed = 0;
231 }
232
233 /* Resource */

Callers 1

cmd_table_action_profileFunction · 0.85

Calls 8

callocFunction · 0.85
strlcpyFunction · 0.50
memcpyFunction · 0.50

Tested by

no test coverage detected