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

Function rte_acl_ipv4vlan_add_rules

dpdk/app/test/test_acl.c:141–170  ·  view source on GitHub ↗

* Add ipv4vlan rules to an existing ACL context. * This function is not multi-thread safe. * * @param ctx * ACL context to add patterns to. * @param rules * Array of rules to add to the ACL context. * Note that all fields in rte_acl_ipv4vlan_rule structures are expected * to be in host byte order. * @param num * Number of elements in the input array of rules. * @return * -

Source from the content-addressed store, hash-verified

139 * - Zero if operation completed successfully.
140 */
141static int
142rte_acl_ipv4vlan_add_rules(struct rte_acl_ctx *ctx,
143 const struct rte_acl_ipv4vlan_rule *rules,
144 uint32_t num)
145{
146 int32_t rc;
147 uint32_t i;
148 struct acl_ipv4vlan_rule rv;
149
150 if (ctx == NULL || rules == NULL)
151 return -EINVAL;
152
153 /* check input rules. */
154 for (i = 0; i != num; i++) {
155 rc = acl_ipv4vlan_check_rule(rules + i);
156 if (rc != 0) {
157 RTE_LOG(ERR, ACL, "%s: rule #%u is invalid\n",
158 __func__, i + 1);
159 return rc;
160 }
161 }
162
163 /* perform conversion to the internal format and add to the context. */
164 for (i = 0, rc = 0; i != num && rc == 0; i++) {
165 acl_ipv4vlan_convert_rule(rules + i, &rv);
166 rc = rte_acl_add_rules(ctx, (struct rte_acl_rule *)&rv, 1);
167 }
168
169 return rc;
170}
171
172static void
173acl_ipv4vlan_config(struct rte_acl_config *cfg,

Callers 5

test_classify_buidFunction · 0.85
test_invalid_layoutFunction · 0.85
test_create_find_addFunction · 0.85
test_invalid_rulesFunction · 0.85
test_invalid_parametersFunction · 0.85

Calls 3

acl_ipv4vlan_check_ruleFunction · 0.85
rte_acl_add_rulesFunction · 0.85

Tested by

no test coverage detected