From: "Morrissey, Sean" <sean.morrissey@intel.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
Thomas Monjalon <thomas@monjalon.net>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [PATCH v4] examples/l3fwd: merge l3fwd-acl into l3fwd
Date: Fri, 8 Apr 2022 20:01:00 +0100 [thread overview]
Message-ID: <cb24bd5f-35b0-68ef-d669-2ead913e1a40@intel.com> (raw)
In-Reply-To: <DM6PR11MB4491440359F332CB1405176F9AE99@DM6PR11MB4491.namprd11.prod.outlook.com>
Hi Konstantin,
Comment on some of your feedback below. I will make the rest of the
changes and send a new version.
On 08/04/2022 18:26, Ananyev, Konstantin wrote:
> Hi Sean,
>
> Few nits, that I didn't spot previously, pls see below.
>
>> +
>> +/* Setup ACL context. 8< */
> Looks like some typo within comments.
I believe these characters are needed in the comments to state the start
and end of the automated code snippets for the docs.
>> +static struct rte_acl_ctx*
>> +app_acl_init(struct rte_acl_rule *route_base,
>> + struct rte_acl_rule *acl_base, unsigned int route_num,
>> + unsigned int acl_num, int ipv6, int socketid)
>> +{
>> + char name[PATH_MAX];
>> + struct rte_acl_param acl_param;
>> + struct rte_acl_config acl_build_param;
>> + struct rte_acl_ctx *context;
>> + int dim = ipv6 ? RTE_DIM(ipv6_defs) : RTE_DIM(ipv4_defs);
>> +
>> + /* Create ACL contexts */
>> + snprintf(name, sizeof(name), "%s%d",
>> + ipv6 ? L3FWD_ACL_IPV6_NAME : L3FWD_ACL_IPV4_NAME,
>> + socketid);
>> +
>> + acl_param.name = name;
>> + acl_param.socket_id = socketid;
>> + acl_param.rule_size = RTE_ACL_RULE_SZ(dim);
>> + acl_param.max_rule_num = MAX_ACL_RULE_NUM;
>> +
>> + context = rte_acl_create(&acl_param);
>> + if (context == NULL)
>> + rte_exit(EXIT_FAILURE, "Failed to create ACL context\n");
>> +
>> + if (parm_config.alg != RTE_ACL_CLASSIFY_DEFAULT &&
>> + rte_acl_set_ctx_classify(context, parm_config.alg) != 0)
>> + rte_exit(EXIT_FAILURE,
>> + "Failed to setup classify method for ACL context\n");
>> +
>> + if (rte_acl_add_rules(context, route_base, route_num) < 0)
>> + rte_exit(EXIT_FAILURE, "add rules failed\n");
>> +
>> + if (rte_acl_add_rules(context, acl_base, acl_num) < 0)
>> + rte_exit(EXIT_FAILURE, "add rules failed\n");
>> +
>> + /* Perform builds */
>> + memset(&acl_build_param, 0, sizeof(acl_build_param));
>> +
>> + acl_build_param.num_categories = DEFAULT_MAX_CATEGORIES;
>> + acl_build_param.num_fields = dim;
>> + memcpy(&acl_build_param.defs, ipv6 ? ipv6_defs : ipv4_defs,
>> + ipv6 ? sizeof(ipv6_defs) : sizeof(ipv4_defs));
>> +
>> + if (rte_acl_build(context, &acl_build_param) != 0)
>> + rte_exit(EXIT_FAILURE, "Failed to build ACL trie\n");
>> +
>> + rte_acl_dump(context);
>> +
>> + return context;
>> +}
>> +/* >8 End of ACL context setup. */
> Typo in comments.
Same as above.
next prev parent reply other threads:[~2022-04-08 19:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-25 15:14 [PATCH v1] " Sean Morrissey
2022-03-29 10:28 ` Bruce Richardson
2022-03-29 10:33 ` Ananyev, Konstantin
2022-03-30 14:04 ` [PATCH v2] " Sean Morrissey
2022-04-02 13:53 ` Ananyev, Konstantin
2022-04-06 10:29 ` [PATCH v3] " Sean Morrissey
2022-04-06 11:47 ` David Marchand
2022-04-06 12:06 ` [PATCH v4] " Sean Morrissey
2022-04-08 17:26 ` Ananyev, Konstantin
2022-04-08 19:01 ` Morrissey, Sean [this message]
2022-04-09 11:58 ` Ananyev, Konstantin
2022-04-11 8:41 ` [PATCH v5] " Sean Morrissey
2022-04-11 11:38 ` Ananyev, Konstantin
2022-04-22 9:57 ` [PATCH v6] " Sean Morrissey
2022-06-08 9:50 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cb24bd5f-35b0-68ef-d669-2ead913e1a40@intel.com \
--to=sean.morrissey@intel.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).