DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Ke1X" <ke1x.zhang@intel.com>
To: "Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"Zhang, Yuying" <yuying.zhang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH v2] net/ice: add devargs for disabling mac filter
Date: Wed, 28 Dec 2022 08:55:25 +0000	[thread overview]
Message-ID: <PH7PR11MB5984C28C18C6DA6300D52620DCF29@PH7PR11MB5984.namprd11.prod.outlook.com> (raw)
In-Reply-To: <DM4PR11MB5994CC5A839FE144072CB92ED7EC9@DM4PR11MB5994.namprd11.prod.outlook.com>



> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Monday, December 26, 2022 2:15 PM
> To: Zhang, Ke1X <ke1x.zhang@intel.com>; Zhang, Yuying
> <yuying.zhang@intel.com>; dev@dpdk.org
> Subject: RE: [PATCH v2] net/ice: add devargs for disabling mac filter
> 
> 
> 
> > -----Original Message-----
> > From: Zhang, Ke1X <ke1x.zhang@intel.com>
> > Sent: Wednesday, December 21, 2022 11:58 AM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhang, Yuying
> > <yuying.zhang@intel.com>; dev@dpdk.org
> > Cc: Zhang, Ke1X <ke1x.zhang@intel.com>
> > Subject: [PATCH v2] net/ice: add devargs for disabling mac filter
> >
> > From: "ke1x.zhang" <ke1x.zhang@intel.com>
> >
> > This patch adds support to disable mac filter which will be used by
> > ice driver when setting dpdk_devargs config field in the TRex config file.
> >
> > Mac filter is not disabled in default.
> >
> > Signed-off-by: ke1x.zhang <ke1x.zhang@intel.com>
> > ---
> >  doc/guides/nics/ice.rst            | 11 +++++++++++
> >  drivers/net/ice/ice_ethdev.c       | 13 +++++++++++++
> >  drivers/net/ice/ice_ethdev.h       |  1 +
> >  drivers/net/ice/ice_generic_flow.c | 15 +++++++++++++++
> >  4 files changed, 40 insertions(+)
> >
> > diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst index
> > ce075e067c..18b4d12048 100644
> > --- a/doc/guides/nics/ice.rst
> > +++ b/doc/guides/nics/ice.rst
> > @@ -105,6 +105,17 @@ Runtime Config Options
> >
> >      -a 80:00.0,pipeline-mode-support=1
> >
> > +- ``Disable Mac Filter Support`` (default ``0``)
> 
> I think better to name the feature as "No default Mac" , as we still support
> add/del MAC filter.

Thanks for your comments, there is a question:
If we still support add/del MAC filter, what should do in ice_add_mac_filter()?
In ice_add_mac_filter(), I don't know the caller, maybe it is a initiliazer to add defaut mac or
add mac filter command.




> 
> > +
> > +  Add the feature that support to disable mac filter which will be
> > + used by ice driver  when setting dpdk_devargs config field in the TRex
> config file.
> > +
> 
> No need to mention TRex here, just describe what's the expected behavior
> when user set this flag.
> 
> > +  Mac filter is not disabled in default, user can choose to disable
> > + the mac filter  by setting ``devargs`` parameter
> > + ``mac-filter-disable``, for example::
> > +
> > +    -a 80:00.0,mac-filter-disable=1
> > +
> >  - ``Protocol extraction for per queue``
> >
> >    Configure the RX queues to do protocol extraction into mbuf for
> > protocol diff --git a/drivers/net/ice/ice_ethdev.c
> > b/drivers/net/ice/ice_ethdev.c index
> > 0bc739daf0..0c9f66eb88 100644
> > --- a/drivers/net/ice/ice_ethdev.c
> > +++ b/drivers/net/ice/ice_ethdev.c
> > @@ -28,6 +28,7 @@
> >  /* devargs */
> >  #define ICE_SAFE_MODE_SUPPORT_ARG "safe-mode-support"
> >  #define ICE_PIPELINE_MODE_SUPPORT_ARG  "pipeline-mode-support"
> > +#define ICE_MAC_FILTER_DISABLE  "mac-filter-disable"
> >  #define ICE_PROTO_XTR_ARG         "proto_xtr"
> >  #define ICE_FIELD_OFFS_ARG		  "field_offs"
> >  #define ICE_FIELD_NAME_ARG		  "field_name"
> > @@ -49,6 +50,7 @@ static const char * const ice_valid_args[] = {
> >  	ICE_HW_DEBUG_MASK_ARG,
> >  	ICE_ONE_PPS_OUT_ARG,
> >  	ICE_RX_LOW_LATENCY_ARG,
> > +	ICE_MAC_FILTER_DISABLE,
> >  	NULL
> >  };
> >
> > @@ -962,8 +964,13 @@ ice_add_mac_filter(struct ice_vsi *vsi, struct
> > rte_ether_addr *mac_addr)
> >  	struct ice_mac_filter *f;
> >  	struct LIST_HEAD_TYPE list_head;
> >  	struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
> > +	struct ice_adapter *ad = (struct ice_adapter *)hw->back;
> >  	int ret = 0;
> >
> > +	if (ad->devargs.mac_filter_disable == 1) {
> > +		PMD_DRV_LOG(ERR, "This MAC filter is disabled.");
> > +		return 0;
> > +	}
> >  	/* If it's added and configured, return */
> >  	f = ice_find_mac_filter(vsi, mac_addr);
> >  	if (f) {
> > @@ -2075,6 +2082,11 @@ static int ice_parse_devargs(struct rte_eth_dev
> > *dev)
> >  	if (ret)
> >  		goto bail;
> >
> > +	ret = rte_kvargs_process(kvlist, ICE_MAC_FILTER_DISABLE,
> > +				&parse_bool, &ad-
> > >devargs.mac_filter_disable);
> > +	if (ret)
> > +		goto bail;
> > +
> >  	ret = rte_kvargs_process(kvlist, ICE_HW_DEBUG_MASK_ARG,
> >  				 &parse_u64, &ad->hw.debug_mask);
> >  	if (ret)
> > @@ -6050,6 +6062,7 @@ RTE_PMD_REGISTER_PARAM_STRING(net_ice,
> >  			      ICE_PROTO_XTR_ARG
> > "=[queue:]<vlan|ipv4|ipv6|ipv6_flow|tcp|ip_offset>"
> >  			      ICE_SAFE_MODE_SUPPORT_ARG "=<0|1>"
> >  			      ICE_PIPELINE_MODE_SUPPORT_ARG "=<0|1>"
> > +			      ICE_MAC_FILTER_DISABLE "=<0|1>"
> >  			      ICE_RX_LOW_LATENCY_ARG "=<0|1>");
> >
> >  RTE_LOG_REGISTER_SUFFIX(ice_logtype_init, init, NOTICE); diff --git
> > a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index
> > c8311be179..b4036d5fb0 100644
> > --- a/drivers/net/ice/ice_ethdev.h
> > +++ b/drivers/net/ice/ice_ethdev.h
> > @@ -563,6 +563,7 @@ struct ice_devargs {
> >  	int safe_mode_support;
> >  	uint8_t proto_xtr_dflt;
> >  	int pipe_mode_support;
> > +	uint8_t mac_filter_disable;
> >  	uint8_t proto_xtr[ICE_MAX_QUEUE_NUM];
> >  	uint8_t pin_idx;
> >  	uint8_t pps_out_ena;
> > diff --git a/drivers/net/ice/ice_generic_flow.c
> > b/drivers/net/ice/ice_generic_flow.c
> > index d496c28dec..bca38f5a52 100644
> > --- a/drivers/net/ice/ice_generic_flow.c
> > +++ b/drivers/net/ice/ice_generic_flow.c
> > @@ -2464,6 +2464,8 @@ ice_flow_create(struct rte_eth_dev *dev,
> >  		struct rte_flow_error *error)
> >  {
> >  	struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data-
> > >dev_private);
> > +	struct ice_adapter *ad =
> > +			ICE_DEV_PRIVATE_TO_ADAPTER(dev->data-
> > >dev_private);
> >  	struct rte_flow *flow = NULL;
> >  	int ret;
> >  	struct ice_flow_engine *engine = NULL; @@ -2476,6 +2478,14 @@
> > ice_flow_create(struct rte_eth_dev *dev,
> >  		return flow;
> >  	}
> >
> > +	if (ad->devargs.mac_filter_disable == 1) {
> > +		if ((pattern[0].type == RTE_FLOW_ITEM_TYPE_ANY)
> > +			&& (actions[0].type ==
> > RTE_FLOW_ACTION_TYPE_DROP)) {
> > +			flow->rule = NULL;
> > +			return flow;
> > +		}
> > +	}
> 
> Why we need this?
> 
> We don't need to mix this patch with the rte_flow "drop any" rule.
> 


  reply	other threads:[~2022-12-28  8:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25  2:51 [PATCH] " Ke Zhang
2022-12-13  2:03 ` Zhang, Qi Z
2022-12-13  3:51 ` Stephen Hemminger
2022-12-13  5:43   ` Zhang, Ke1X
2022-12-13  5:44   ` Zhang, Ke1X
2022-12-17 15:22   ` Zhang, Ke1X
2022-12-17 17:20     ` Stephen Hemminger
2022-12-21  3:58 ` [PATCH v2] " Ke Zhang
2022-12-26  6:14   ` Zhang, Qi Z
2022-12-28  8:55     ` Zhang, Ke1X [this message]
2023-01-12  7:55   ` [PATCH v3] net/ice: add devargs for disabling default mac Ke Zhang
2023-01-12 16:32     ` Stephen Hemminger
2023-01-16 13:38       ` Zhang, Ke1X
2023-02-01  8:22     ` Zhang, Qi Z
2023-02-03  2:02     ` [PATCH v4] " Ke Zhang
2023-02-13  1:48       ` 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=PH7PR11MB5984C28C18C6DA6300D52620DCF29@PH7PR11MB5984.namprd11.prod.outlook.com \
    --to=ke1x.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=yuying.zhang@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).