From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 21FC2A00C5; Mon, 26 Dec 2022 07:14:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1328242C24; Mon, 26 Dec 2022 07:14:48 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id DF5B342D17 for ; Mon, 26 Dec 2022 07:14:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672035287; x=1703571287; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=D41ReBln78Gz8PbpU9k+PCHczp4OOYjCjt1mpQz5NsY=; b=HFALIimFWiSKZ7U8ratgxSDnFd4xlf3v6oC7SsU4CX1DUVg4qUvuHE2Y m72KBMfibnTBs9tzgGy7BSCJ9qWLDbE+uu0pUztUAS6IVwmEDOH7xb3OB Xp7Dy7xo66z94shbFZDR3KNOgMJc953iq6B23HjVW+6cYMj8OsdVppqpT quCXp2BELu1CXmAj8AsRUKJ17vLuN9h8MkjdYAGpMX9JhRiphIpjj1Jc4 xWa0mvx7ZpgAlm/iHWI9XDCjF5Spk3pPp6tjuex/75wpX5PGtmoJGm/io K5HV78Ylb8fc9w78yrtXwi6OD24pWs7/7g1Or4xtwnJFg8MxuS2QAxTlJ w==; X-IronPort-AV: E=McAfee;i="6500,9779,10571"; a="318197672" X-IronPort-AV: E=Sophos;i="5.96,274,1665471600"; d="scan'208";a="318197672" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2022 22:14:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10571"; a="898042464" X-IronPort-AV: E=Sophos;i="5.96,274,1665471600"; d="scan'208";a="898042464" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga006.fm.intel.com with ESMTP; 25 Dec 2022 22:14:46 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sun, 25 Dec 2022 22:14:45 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Sun, 25 Dec 2022 22:14:45 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Sun, 25 Dec 2022 22:14:45 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LE1wF8zlMC6sm98JpI58LB736CUKDGLv0DfAo3DKkAVTYRACMcVHsfRyc3HNb+TNJrWwkWnhX2hZrkQ5M10BiZZ2Y0B4qBjZ+g6ohPffLww0CK98ZiI7MN0Mv6CGvUvGhz4Fw/mmi7yIWduz3HnS78dm6kRAgX/K9XJLYU3c7TdrjJbIDkSEp3RT22UjjSslu05cw2JrFwTz3zeAytOj1UnjxfxQbXm5unmTBGxgoQKfOVXHFJVVyMZFEHHRQfN3Fmex2PwiXoRnov5Lc0wNGOSTbdMySy+vIn6zav7qn7YXhuue07oIrOcjwb3uEGuGu84LBlAanQGguCji/FKSJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zcBF6/YVbBf4j+EKoYWJymWCRMimghsRd5OjP6X//qs=; b=jQf9Lw7T11VMKof1HKnFK0B4gpQFJd+WnjvmkcEjDUvyUczd8wl0aXAF5glCs/ZphasA6g7eqaZmwVnW05L4I39WOWZoLFqRnM6Yelxpeexle5q9fDym/lfsXcybdXBTBmFJfCwJuof34NSxRDoMbYfaKApD8SlEvh83XQoy+CjOZfnDIvRhHwBwyg4U1N8geIfKsNro/vYa2mrdbJPhWC5rkJ3mQOzlNpqBvDaHIyLsWj6l3gwdUH2xmHQV/Yo2WuMwmOmZWhe3kr1lcHDIeSXIGeFwH3FrYptVjq3kDx8SRu8kx29x1O9H1CnOXOCDiDSXWT640kFqvQVjk9KFmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM4PR11MB5994.namprd11.prod.outlook.com (2603:10b6:8:5d::20) by BL1PR11MB5542.namprd11.prod.outlook.com (2603:10b6:208:31d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Mon, 26 Dec 2022 06:14:38 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::4c85:56d0:cb0b:e9ce]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::4c85:56d0:cb0b:e9ce%3]) with mapi id 15.20.5944.012; Mon, 26 Dec 2022 06:14:38 +0000 From: "Zhang, Qi Z" To: "Zhang, Ke1X" , "Zhang, Yuying" , "dev@dpdk.org" Subject: RE: [PATCH v2] net/ice: add devargs for disabling mac filter Thread-Topic: [PATCH v2] net/ice: add devargs for disabling mac filter Thread-Index: AQHZFPLs8qINmIc1BEuIpmjv/BRGXa5/tmaQ Date: Mon, 26 Dec 2022 06:14:38 +0000 Message-ID: References: <20221125025124.805466-1-ke1x.zhang@intel.com> <20221221035804.1241780-1-ke1x.zhang@intel.com> In-Reply-To: <20221221035804.1241780-1-ke1x.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB5994:EE_|BL1PR11MB5542:EE_ x-ms-office365-filtering-correlation-id: 1be20f57-cf9d-475d-5343-08dae70877cc x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mMZODbGUF60kQPhIdzw1iscV6uAq5GZjyQq6f4N17d9Til6Bn1D0f3Hf8JRr0+nERD5+yIhU7Wo3CzybFCcOD3DCWTfdDjYmL5di465HWHTJVw+QsoN5jSdebeN0ESwyA+B+OZ2cRpdQZhNpKk2k4ypqPI7sGTEvV3g0VLXabar/T+jE8LZRlp3hl30cxq6brfLlKl1kiKADnXUHEIy3s9rYEyWyMYmu3vfSk7PU8YsTzLEpBZVImuWtu0JA+YjH8FoKa0QEKNXRxxSdgMwzbFZP77UKXu566kK7UDVnofhz1XfsVja2ivvYWGxkiMs49Ke+2H/DaENxYORJ4Iu3iJSSzv8PeFRlouhgpY6nf2RSTTWtujdyQF7YgjwwNT0iqqu8ttF3YVOot10PY+m3WMwtnmyM+ETaGot+OoYMSeYqKuKlOVXtylDiWNLCwLs1kgJkINu6FNEWPFKryqf7DnL49tS9kidBdNmt2Q5a8aQr0wu1OrQJgSRs6ntqhKn0++UZsCwCLcTO/yZ5CxExM51COzQPLr19vhq98ss2oEkK6wAv9NbjRmbhiryNWp6YHDQzdEhw1UvEy93lgolcWUvoEE3UAnn9zd0Pz8WiRzacCtc/mS0ZeEmhDw6z7KohC/kDRY9l1+SrDhCziGpnw1kU87I4214yhfZu1mxO2a4M5GkPu7/uGEt8oKmFHbIRyy+UPe9+cDYnfvh+BavfsA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5994.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(346002)(136003)(39860400002)(366004)(396003)(451199015)(33656002)(478600001)(2906002)(110136005)(316002)(71200400001)(53546011)(83380400001)(82960400001)(38070700005)(38100700002)(122000001)(26005)(7696005)(6506007)(186003)(9686003)(86362001)(55016003)(52536014)(8936002)(8676002)(5660300002)(66446008)(66476007)(76116006)(66556008)(66946007)(41300700001)(64756008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WIExFaMsIZpnZ3kqsDI2R+1XkldEho8IyZhrHttL8QoF3CUmWtwjDdsyn/9D?= =?us-ascii?Q?2rwJTW81kFIEH1WEBZgcvlajtncHQHLXcqhDAcxurfE9bPwVnx5xDXC05VMt?= =?us-ascii?Q?7479s6BSW0CwUC2QLq6+uxSlXzxoRJIEb9Mc2cLWEUXfDes3DOVo5peqIllM?= =?us-ascii?Q?iguFgZuOod+UQlnE/5fdZudYdz8yWzdXxkl4gQcHytDIF5LV7ds42sP0mJ5A?= =?us-ascii?Q?l63pmpDaCRZDvap6DyJndscIjSSSZXd+4+79MtWoOaQUUUeBolhhJ7NXyXzp?= =?us-ascii?Q?jic5iUdMgHtCFXcIdHM+hfuGPSaCQ7iILgrCpRmOv/dE+jVLGnht/xz/I6G4?= =?us-ascii?Q?rtEBofHa4l+Ga+AC273lwj3wwOkfHYCG9J/G5wSR45PXFKyDvtoxeoPjbr4H?= =?us-ascii?Q?jhakzS2ynBiyQE07Wt9lAePUcRVZWUc+JFJ+cQ33HSs/LyWBiiY/Fs6F4yTn?= =?us-ascii?Q?Ghx35wZQGOyi88blUT7lvCJxHLMUUj7kFxjqFKtPutQ8e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D2RnB2papV3/cMavmF7lF/re+KVOWbtKq6ttJOh+NWUjdJ3QIVz?= =?us-ascii?Q?ALb49VcW9VMpQ8jNycTLRxgJoUXopWRRDiUusPEVu9KOwQLuVaUHLl6RZldy?= =?us-ascii?Q?y3LiUWA24QtrQOAA1ko4TaCJL8i00xCP6QAx6IV+n94bRdTrf2XSgQupLawq?= =?us-ascii?Q?HozM4c70yyi12Dd2ektQHmj1TYqf4yf1WtALmyOn?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5994.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1be20f57-cf9d-475d-5343-08dae70877cc X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Dec 2022 06:14:38.1668 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: V1Hd4zTYeT22XcoSazUjy5PksyeiPXCaIsrj2SGTL1t7OUrEy/vNvOaUBFBjjs0Q5jC7+WtPLkmKp22gLrp7JA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5542 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Zhang, Ke1X > Sent: Wednesday, December 21, 2022 11:58 AM > To: Zhang, Qi Z ; Zhang, Yuying > ; dev@dpdk.org > Cc: Zhang, Ke1X > Subject: [PATCH v2] net/ice: add devargs for disabling mac filter >=20 > From: "ke1x.zhang" >=20 > This patch adds support to disable mac filter which will be used by ice d= river > when setting dpdk_devargs config field in the TRex config file. >=20 > Mac filter is not disabled in default. >=20 > Signed-off-by: ke1x.zhang > --- > 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(+) >=20 > 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 >=20 > -a 80:00.0,pipeline-mode-support=3D1 >=20 > +- ``Disable Mac Filter Support`` (default ``0``) I think better to name the feature as "No default Mac" , as we still suppor= t add/del MAC filter. > + > + 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 confi= g file. > + =20 No need to mention TRex here, just describe what's the expected behavior wh= en 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=3D1 > + > - ``Protocol extraction for per queue`` >=20 > Configure the RX queues to do protocol extraction into mbuf for protoc= ol > 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[] =3D { > ICE_HW_DEBUG_MASK_ARG, > ICE_ONE_PPS_OUT_ARG, > ICE_RX_LOW_LATENCY_ARG, > + ICE_MAC_FILTER_DISABLE, > NULL > }; >=20 > @@ -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 =3D ICE_VSI_TO_HW(vsi); > + struct ice_adapter *ad =3D (struct ice_adapter *)hw->back; > int ret =3D 0; >=20 > + if (ad->devargs.mac_filter_disable =3D=3D 1) { > + PMD_DRV_LOG(ERR, "This MAC filter is disabled."); > + return 0; > + } > /* If it's added and configured, return */ > f =3D 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; >=20 > + ret =3D rte_kvargs_process(kvlist, ICE_MAC_FILTER_DISABLE, > + &parse_bool, &ad- > >devargs.mac_filter_disable); > + if (ret) > + goto bail; > + > ret =3D 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 > "=3D[queue:]" > ICE_SAFE_MODE_SUPPORT_ARG "=3D<0|1>" > ICE_PIPELINE_MODE_SUPPORT_ARG "=3D<0|1>" > + ICE_MAC_FILTER_DISABLE "=3D<0|1>" > ICE_RX_LOW_LATENCY_ARG "=3D<0|1>"); >=20 > 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 =3D ICE_DEV_PRIVATE_TO_PF(dev->data- > >dev_private); > + struct ice_adapter *ad =3D > + ICE_DEV_PRIVATE_TO_ADAPTER(dev->data- > >dev_private); > struct rte_flow *flow =3D NULL; > int ret; > struct ice_flow_engine *engine =3D NULL; @@ -2476,6 +2478,14 @@ > ice_flow_create(struct rte_eth_dev *dev, > return flow; > } >=20 > + if (ad->devargs.mac_filter_disable =3D=3D 1) { > + if ((pattern[0].type =3D=3D RTE_FLOW_ITEM_TYPE_ANY) > + && (actions[0].type =3D=3D > RTE_FLOW_ACTION_TYPE_DROP)) { > + flow->rule =3D NULL; > + return flow; > + } > + } Why we need this? We don't need to mix this patch with the rte_flow "drop any" rule.