From: "Wang, Haiyue" <haiyue.wang@intel.com>
To: "Su, Simei" <simei.su@intel.com>,
"Zhang, Qi Z" <qi.z.zhang@intel.com>,
"Yang, Qiming" <qiming.yang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "Xing, Beilei" <beilei.xing@intel.com>
Subject: Re: [dpdk-dev] [PATCH v1 2/3] net/ice: add devarg for ACL ipv4 rule number
Date: Thu, 10 Sep 2020 07:53:58 +0000 [thread overview]
Message-ID: <BN8PR11MB3795EBF32CC712CA7711C157F7270@BN8PR11MB3795.namprd11.prod.outlook.com> (raw)
In-Reply-To: <1599723455-353059-3-git-send-email-simei.su@intel.com>
> -----Original Message-----
> From: Su, Simei <simei.su@intel.com>
> Sent: Thursday, September 10, 2020 15:38
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, Qiming <qiming.yang@intel.com>
> Cc: dev@dpdk.org; Wang, Haiyue <haiyue.wang@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Su,
> Simei <simei.su@intel.com>
> Subject: [PATCH v1 2/3] net/ice: add devarg for ACL ipv4 rule number
>
> This patch enables devargs for ACL ipv4 rule number and refactor
> DCF capability selection API to be more flexible.
>
> Signed-off-by: Simei Su <simei.su@intel.com>
> ---
>
> static int
> -ice_dcf_cap_check_handler(__rte_unused const char *key,
> - const char *value, __rte_unused void *opaque)
> +handle_dcf_arg(__rte_unused const char *key, const char *value,
> + __rte_unused void *arg)
> {
> - if (strcmp(value, "dcf"))
> - return -1;
> + bool *dcf = arg;
> +
> + if (arg == NULL || value == NULL)
> + return -EINVAL;
> +
> + if (strcmp(value, "dcf") == 0)
> + *dcf = true;
> + else
> + *dcf = false;
>
> return 0;
> }
>
> -static int
> -ice_dcf_cap_selected(struct rte_devargs *devargs)
> +static bool
> +check_cap_dcf_enable(struct rte_devargs *devargs)
> {
> struct rte_kvargs *kvlist;
> - const char *key = "cap";
> - int ret = 0;
> + bool enable = false;
>
> if (devargs == NULL)
> - return 0;
> + return false;
>
> kvlist = rte_kvargs_parse(devargs->args, NULL);
> if (kvlist == NULL)
> - return 0;
> -
> - if (!rte_kvargs_count(kvlist, key))
> - goto exit;
> -
> - /* dcf capability selected when there's a key-value pair: cap=dcf */
> - if (rte_kvargs_process(kvlist, key,
> - ice_dcf_cap_check_handler, NULL) < 0)
> - goto exit;
> + return false;
>
> - ret = 1;
> + rte_kvargs_process(kvlist, ICE_DCF_CAP, handle_dcf_arg, &enable);
>
> -exit:
> rte_kvargs_free(kvlist);
> - return ret;
> +
> + return enable;
> }
>
> static int eth_ice_dcf_pci_probe(__rte_unused struct rte_pci_driver *pci_drv,
> struct rte_pci_device *pci_dev)
> {
> - if (!ice_dcf_cap_selected(pci_dev->device.devargs))
> - return 1;
> + if (!check_cap_dcf_enable(pci_dev->device.devargs))
> + return 1; /* continue to probe */
>
I didn't see how flexible about DCF capability selection. ;-)
And you add the unneeded comment "/* continue to probe */" that I did before.
> return rte_eth_dev_pci_generic_probe(pci_dev,
> sizeof(struct ice_dcf_adapter),
> diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h
> index 758caa8..13f4167 100644
> --- a/drivers/net/ice/ice_ethdev.h
> +++ b/drivers/net/ice/ice_ethdev.h
> @@ -447,6 +447,7 @@ struct ice_devargs {
> int pipe_mode_support;
> int flow_mark_support;
> uint8_t proto_xtr[ICE_MAX_QUEUE_NUM];
> + int acl_ipv4_rules_num;
> };
>
> /**
> --
> 1.8.3.1
next prev parent reply other threads:[~2020-09-10 7:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-10 7:37 [dpdk-dev] [PATCH v1 0/3] net/ice: support DCF ACL capabiltiy Simei Su
2020-09-10 7:37 ` [dpdk-dev] [PATCH v1 1/3] net/ice: get PF VSI map Simei Su
2020-09-10 7:37 ` [dpdk-dev] [PATCH v1 2/3] net/ice: add devarg for ACL ipv4 rule number Simei Su
2020-09-10 7:53 ` Wang, Haiyue [this message]
2020-09-10 7:37 ` [dpdk-dev] [PATCH v1 3/3] net/ice: support ACL filter in DCF Simei Su
2020-09-29 1:56 ` [dpdk-dev] [PATCH v2 0/4] net/ice: support DCF ACL capabiltiy Simei Su
2020-09-29 1:56 ` [dpdk-dev] [PATCH v2 1/4] net/ice/base: change API from static to non-static Simei Su
2020-09-29 1:56 ` [dpdk-dev] [PATCH v2 2/4] net/ice: get PF VSI map Simei Su
2020-09-29 1:56 ` [dpdk-dev] [PATCH v2 3/4] net/ice: support ACL filter in DCF Simei Su
2020-09-29 1:56 ` [dpdk-dev] [PATCH v2 4/4] net/ice: add devarg for ACL ipv4 rule number Simei Su
2020-10-14 8:54 ` [dpdk-dev] [PATCH v3 0/3] net/ice: support DCF ACL capabiltiy Simei Su
2020-10-14 8:54 ` [dpdk-dev] [PATCH v3 1/3] net/ice/base: change API from static to non-static Simei Su
2020-10-14 8:54 ` [dpdk-dev] [PATCH v3 2/3] net/ice: get PF VSI map Simei Su
2020-10-14 8:54 ` [dpdk-dev] [PATCH v3 3/3] net/ice: support ACL filter in DCF Simei Su
2020-10-15 5:10 ` Zhang, Qi Z
2020-10-15 7:08 ` Su, Simei
2020-10-16 8:44 ` [dpdk-dev] [PATCH v4 0/3] net/ice: support DCF ACL capabiltiy Simei Su
2020-10-16 8:44 ` [dpdk-dev] [PATCH v4 1/3] net/ice/base: change API from static to non-static Simei Su
2020-10-16 8:44 ` [dpdk-dev] [PATCH v4 2/3] net/ice: get PF VSI map Simei Su
2020-10-16 8:44 ` [dpdk-dev] [PATCH v4 3/3] net/ice: support ACL filter in DCF Simei Su
2020-10-20 11:32 ` [dpdk-dev] [PATCH v5 0/3] net/ice: support DCF ACL capabiltiy Simei Su
2020-10-20 11:32 ` [dpdk-dev] [PATCH v5 1/3] net/ice/base: change API from static to non-static Simei Su
2020-10-20 11:32 ` [dpdk-dev] [PATCH v5 2/3] net/ice: get PF VSI map Simei Su
2020-10-20 11:32 ` [dpdk-dev] [PATCH v5 3/3] net/ice: support ACL filter in DCF Simei Su
2020-10-20 12:37 ` [dpdk-dev] [PATCH v5 0/3] net/ice: support DCF ACL capabiltiy Zhang, Qi Z
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=BN8PR11MB3795EBF32CC712CA7711C157F7270@BN8PR11MB3795.namprd11.prod.outlook.com \
--to=haiyue.wang@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@intel.com \
--cc=simei.su@intel.com \
/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).