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 006DBA04FD; Wed, 28 Dec 2022 09:55:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F2CC40FDF; Wed, 28 Dec 2022 09:55:31 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id E631140141 for ; Wed, 28 Dec 2022 09:55:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672217730; x=1703753730; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=50N/quPi4inDnrevFclzoTu7wA7axmaDWH+HNK8gPTY=; b=R/93q6Kq3aLt7HlFCXP99C/xqWXTS1nGEAnnCCxNmeWx1mfiBqeYqGoc Srzu5jZSnJhWWukjogPgQ6/DUVAfD1NXL+HJaFMwjHEqdytAQTFXv05aQ lEiMErJMUD2nEyeldjHOSn4njuMGw/qUSnCeKxpikOFEtTXTiXerppc1b 6vQFu3dPwjk8NkoYv4n4tPc+JKIjpQMcPGgF8xc7JefFCud+DkWOdyZ6k awIyExNoN/5hreT+c9vWJxp4w/U8uOWDGoKAczrVE0kizMNrIEeeMdr7E 0Kkxvmxax7iUoLj8HL2MNe2VMVTvnbPtLJE8mcvWF3lQcEqlFq9pUc6Cc g==; X-IronPort-AV: E=McAfee;i="6500,9779,10573"; a="320918000" X-IronPort-AV: E=Sophos;i="5.96,280,1665471600"; d="scan'208";a="320918000" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2022 00:55:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10573"; a="898620159" X-IronPort-AV: E=Sophos;i="5.96,280,1665471600"; d="scan'208";a="898620159" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga006.fm.intel.com with ESMTP; 28 Dec 2022 00:55:28 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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; Wed, 28 Dec 2022 00:55:28 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Wed, 28 Dec 2022 00:55:28 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.109) 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; Wed, 28 Dec 2022 00:55:27 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mZezN+7Oi5li7ltsVzyTMxPYmGL5iUOfQ7itHFEWYal3/EMz7PnfWMIviPeFdYfqwuLNvYDXndRIdfj8jgLfz5H+76NpToGUYBTzUZd7ZqNk5AJHEvczm69PvVaQL4VT+n2aELc87qIzs9PaR8j6S0owQmtK0zHnM+BPfoJheqGDMtS0hjI1o4gqJmXDKVND9OtknZi+JGEbW9U+GgwJ0DwEKtazxasD9sVVgoc26LE5p+HGY0hfGYMW9bDAU8H606JkmN5x4JSgzShXSHFrEh/5n2oTdoP6xAjk3HWvklJZ/9D3gdActdIUmdFxUPzzhQjGuw5g1HfgBDm8X67TeA== 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=zHsUX5GOVVkaEinzjv1wWVZOHHuLkXIr8h573OeL8og=; b=CpnLEb02LR4IEr7KhqNGzi/TaGqy9oNtNC3O3t9rZXxrQRfh5bwsEVsR59TtL0Af3CboV5wLyVafdx+OoxhfM/iG0mQnfyBTAyW848bXoM/LAcx7JRtFMUswcE8uGtSw19piNZjmvDv4Wbe5E2zmmsjX+Pg44fSIFm0TjG1jn9Ftr+jP2HaiTagFMHnwXVJ0ckMfpotulstXARAP7B6JTku5MTxJpI5rNe9ptowv1if1G1GFw3yVUhHk5XoO+VBR9O/W30SpLD+LylgXkKxbt+Z512F4JX3x4bvv4Ewtj9CDGZt4JWH6mv/9VlyRK8Mr8/rSrqCi1M3YAdpGho9phw== 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 PH7PR11MB5984.namprd11.prod.outlook.com (2603:10b6:510:1e3::15) by DS7PR11MB7807.namprd11.prod.outlook.com (2603:10b6:8:e3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.15; Wed, 28 Dec 2022 08:55:26 +0000 Received: from PH7PR11MB5984.namprd11.prod.outlook.com ([fe80::4750:caf0:7127:adc7]) by PH7PR11MB5984.namprd11.prod.outlook.com ([fe80::4750:caf0:7127:adc7%9]) with mapi id 15.20.5924.016; Wed, 28 Dec 2022 08:55:26 +0000 From: "Zhang, Ke1X" To: "Zhang, Qi Z" , "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: AQHZFPLsgFgCauAys0eqWaWrKnudS65/uMQAgANQSDA= Date: Wed, 28 Dec 2022 08:55:25 +0000 Message-ID: References: <20221125025124.805466-1-ke1x.zhang@intel.com> <20221221035804.1241780-1-ke1x.zhang@intel.com> In-Reply-To: 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: PH7PR11MB5984:EE_|DS7PR11MB7807:EE_ x-ms-office365-filtering-correlation-id: b76e0bdd-d81d-4242-9cb1-08dae8b14323 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: /BIk3+s77d7cVnhNvRjyWhlrdUA7PACqUDgvONSYtmbZbKPEZJOpfC9ycTtuGg3QT4nVI+eANSNjophxBTCUdkLDKfEi3qvljG/VTuigRFNMya8QlZeyCzMTvl89V8yAX/G2nq2E6DGZQCMGuUsAf+JPbMRXCibB9YyPxVkP+Cr08LkYoWU0e5SZPslevb+hcd3rFyG5FdnDdx3jMeGVeireKHWjj/MmkiDU9mhZSjWgj7YIbPLSsm2rB03Yl6U1CMAFSAChg5HS6qdwud3he3SHX/RQyqq/0ijiGdTrvA5ExpWutc6B4k92ubXlZOJ9vs1yUIqJ3OPSEf1OL7qfE4pJKfxbpnAx4pndvgcNFxxT46Njft9wuH23s7g/0s3G1V5smuEc5eg/P8lyJjDgsTIzBztkVPPeMwBJlMZFOswLszjJexzhf+/drHjieG4U1EtHPy/xBy8nRCd7m9zlvzC6LS1rv5ilHX0sObOLdMXTr/kkfcdWZe4o6efgI42P3BGszUsbKXK1vPZScYb4UlTBxxdrH+NUFegtovV0zjpblEdqrLz4v+FitocgptmUqCm9VjFevQHrbaBttPNGZK9sbH02psiC7iPn29BijPBO5CjjXOfXy+dd3yQU1lMzzAi+dwvqPTn+kulmW+w6zx+hXM6LuzrVlmb5TFlF4zNUHc0TPUxVMi6gLQG6Pjl8cv/nF5E69a+be6axkv8SRA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR11MB5984.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(39860400002)(136003)(376002)(396003)(346002)(366004)(451199015)(110136005)(83380400001)(33656002)(2906002)(316002)(38070700005)(478600001)(26005)(122000001)(38100700002)(82960400001)(186003)(9686003)(6506007)(53546011)(71200400001)(7696005)(86362001)(64756008)(66946007)(76116006)(52536014)(66476007)(66556008)(41300700001)(55016003)(66446008)(8676002)(8936002)(5660300002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iwxDT3NttSuJOTQTPcwmIAqu3Xdqag01/yuzTYH2C0czntUFnOy1fzAynbja?= =?us-ascii?Q?v0quUta8Y/7ehdhRK75dU80ZvTISxc9yBQe3aBDFC8HV+KVApr62Zw3nuL0N?= =?us-ascii?Q?jc7AudFAQR45QxYoRmA3IIrUpf3GDsIUGIhCYaYOj4KubKJbNL5wJQtztQs/?= =?us-ascii?Q?I6pJEEjJBjhkgBI4KDLtcFG02TayBfwdrnZQ5d6GUtvEbP0ALPr0gEtEbTlM?= =?us-ascii?Q?I9IOKH1f5YZm/Q7w3hPbqHo225Z5zEVrEquke9uKAAFhi2igw0nTy85IpsqC?= =?us-ascii?Q?0kBySS8nFLPjFmb6kqiHewCAPhivGWnHgMhnudbggyZLKWK8fqZR023NqqPi?= =?us-ascii?Q?dBvD7sS8tdkOVGTlDJnLTu4RkMPlmqMuJ+CKay3LpUQ/Fhp19MMGV/t+Nt4X?= =?us-ascii?Q?eikRkV7icEEjYZ/ojqg/76SyI8p/gpR/m4MoTuKDZ78RPK/d5hBKpcqaesOJ?= =?us-ascii?Q?ojqNIegSph3iKxvLm1K+hovJSgLpZSNfeScYnZd1/dGnlAPkxxqb0Olkl2R6?= =?us-ascii?Q?3CjittT0LIXy2zSrv+d5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mFFIGrYup?= =?us-ascii?Q?6G22uTNMnIw2vbp/icEnqbIVTbDHt7nBtPQL2xF3/ngyxbrexnZ3X7j7rjmc?= =?us-ascii?Q?ekH7q1DlQnLhbx8s2kQn1eHKiXMffJOIv4u7fO7h83lAXKrx9Jb5o3TgoY8y?= =?us-ascii?Q?FEBE7xP5DQzhHEluDWEOBC0V/M6Th5X+WfismN7a?= 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: PH7PR11MB5984.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b76e0bdd-d81d-4242-9cb1-08dae8b14323 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Dec 2022 08:55:25.9296 (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: wPXqFqxdhhCL9bZZLjdZdQxfNd2bduv94HoBs3A/j+IYVBSK2yYGrI3pkMdDSxxpAi5UPZXLTN/htSTQQHCpoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB7807 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, Qi Z > Sent: Monday, December 26, 2022 2:15 PM > To: Zhang, Ke1X ; Zhang, Yuying > ; dev@dpdk.org > Subject: RE: [PATCH v2] net/ice: add devargs for disabling mac filter >=20 >=20 >=20 > > -----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 > > > > From: "ke1x.zhang" > > > > 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 fi= le. > > > > Mac filter is not disabled in default. > > > > 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(+) > > > > 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=3D1 > > > > +- ``Disable Mac Filter Support`` (default ``0``) >=20 > I think better to name the feature as "No default Mac" , as we still supp= ort > 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_filte= r()? 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. >=20 > > + > > + Add the feature that support to disable mac filter which will be > > + used by ice driver when setting dpdk_devargs config field in the TRe= x > config file. > > + >=20 > No need to mention TRex here, just describe what's the expected behavior > when user set this flag. >=20 > > + 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`` > > > > 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[] =3D { > > 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 =3D ICE_VSI_TO_HW(vsi); > > + struct ice_adapter *ad =3D (struct ice_adapter *)hw->back; > > int ret =3D 0; > > > > + 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; > > > > + 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>"); > > > > 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; > > } > > > > + 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; > > + } > > + } >=20 > Why we need this? >=20 > We don't need to mix this patch with the rte_flow "drop any" rule. >=20