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 7D0F8A00C3; Fri, 14 Oct 2022 03:15:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 763F04282E; Fri, 14 Oct 2022 03:15:51 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 123CF42829 for ; Fri, 14 Oct 2022 03:15:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665710150; x=1697246150; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=a4ci1807+wIH4R+VwBv48fTxFXe8I4CeUbX4s08Qc+Y=; b=SWvTnUdr+jrdQT5ZFrTz4xXfIkW03tFoXM4+p+83tD55QkFrsII7rMvG LeyG4KoPNGbO76vRxjztPou8DelCqs5mYuia6u4SjtonFLG6zHuiVedOd /RgNnswLdwRbbcQsQDLBEs8ui131mXhX8vDiRcBsEF/BVGisQQugBLoE8 jIdPce7USguahH/KGS1upbTn/q70MrCHeX9YQ5IC38ssiplfsn0xzgwuB vLOqdhS9ahFmSpbSKQGGkRwf8GQjmAh6EaukltmypmyJe1bpqIlJCxLVK 8iljKMDDx0jjl2AzyzjGmzEgx9BGwY4ZbtjiXjQkeugSKJnMLdOMOZECi w==; X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="284974224" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="284974224" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2022 18:15:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="956394830" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="956394830" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga005.fm.intel.com with ESMTP; 13 Oct 2022 18:15:48 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 13 Oct 2022 18:14:32 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 13 Oct 2022 18:14:32 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 13 Oct 2022 18:14:32 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 13 Oct 2022 18:14:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OVKitkiTjQiZzBfKxD7xEJdpTVFmS5BRY45WwoP7HFRYEmYL6PYOjsJIISM8AIDWp0bYVlC361WdRaBQE5So0eAOTyRI6Lx+6fG24ispTXvlhOcTW2GYKE2vEH2FLO5rKnpAKWgBeyJ6mmeBEL/Icy0LVXXOpXN814pZS/TTcuWnDoSsKtm6uBXZYx4RaTkUw2CdFkhB1F+xd5QisApB/Et9NXNzHixI8MjYTrf7dtxMxY5DxKivuFl2VVuZC4qS/WBWLr9PqE/H6MixcRRFInBslLzzuFowv1q1tCpHqYsBTrKRfUomNXaowbkyeEaI81BAw54aTc3XrmPgLVB+zg== 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=Q0IuX5DXQW86v4y7vv37DZpQKf1yEgMXg8Kpn72gMb8=; b=dVyM/wwt5ieB6bJ7Bm1KXcHvC4q+T5Zhh9lEgqgcM5eB+b0FjXPNWfsUTUYzBbZP+ooT4kSxJhg/LZzZy37msQZrVX4ybkBYBVS9LMH4h3unZHT8bGfD7G0vxRB42ddgvwROJOtsHv2plAthVgNkP8oMlubshJ/E85Mofd63u5CfLZocUTpuBZjBJcEqNAmXLVusQkA+9ONt3FaCbr6n7YI2tUMxFLnwNd9psITci+ETJMWbNbDtp9OD08OcHaJWScV/9MAgerLTzXGHjfrE8Dqy4cYs5mKEYSJaofDyUK0K29rr5DW3WO4boPRkEVzwVfQZmEv3tMPs3phZ58x5Iw== 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 SA0PR11MB4575.namprd11.prod.outlook.com (2603:10b6:806:9b::18) by SJ0PR11MB5056.namprd11.prod.outlook.com (2603:10b6:a03:2d5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Fri, 14 Oct 2022 01:14:28 +0000 Received: from SA0PR11MB4575.namprd11.prod.outlook.com ([fe80::95dc:6564:8d3b:bcf]) by SA0PR11MB4575.namprd11.prod.outlook.com ([fe80::95dc:6564:8d3b:bcf%3]) with mapi id 15.20.5723.022; Fri, 14 Oct 2022 01:14:29 +0000 From: "Wu, Wenjun1" To: "Matz, Olivier" CC: "dev@dpdk.org" , "Yang, Qiming" , "Zhao1, Wei" Subject: RE: [PATCH] net/ixgbevf: fix promiscuous and allmulti Thread-Topic: [PATCH] net/ixgbevf: fix promiscuous and allmulti Thread-Index: AQHY0/4gFK+cMnlTQU6HU9YcRpoama4G5cNQgAWXMYCAAK8M4A== Date: Fri, 14 Oct 2022 01:14:29 +0000 Message-ID: References: <20220929122155.816-1-olivier.matz@6wind.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.500.17 dlp-reaction: no-action 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: SA0PR11MB4575:EE_|SJ0PR11MB5056:EE_ x-ms-office365-filtering-correlation-id: 05c41e43-c337-4cf4-8097-08daad81718f x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EP+BgeHSdrHOMPrOB8u+fdNlrU56Gq5uOLReaQNTuDff4UENWx7aqaavlB0vMRbIouQnzvF0VXU/LBBxsnoJwyxh774LO5GPvTQuLVknCOiLX6Df5sfa4snUJEmu3g4eRNGEfcn7he7FBvjWcYQfZagKkIvAEwj56JqBZXJyL/bS3lRY3iOIap0py95ZMrupfWmR4FcgpDSmfQJ/M9qGmvL9ja+yG0pgnZGr9sYeXVuGxCmp1ZrpUdcqh7TEXTqg2UmQKszyK89ArxL3pwQR1eeqVdWwp3aIyTN33wEP3o1MXLngo8bpmzEaWe9j/zMhNifiB85oxOVr0N2b8ko0W5cOdP2tI+j+/3f8Y+ZFeOb3VmUVNfIvABu1In+N5xOETdhRFjzRfC7kxMvaE+rr7ICwjs2rj82Z+0QwmdQvAGvAiwut8gTVLGjhlb7vnTMymqHXpBRkJC1pVHAiWV0UfCJ3sw+xvCzOlqKlE49sMNd7PAtxsS29YQ2BoX3jp6J/DQnNs4jvVZaEX0Twu+W+r1DMp/WfD0hBjYIn8Nyd+2YxCfkYma6hUSJGlt0kiA2OA3OpdHCWUA4AVBxtIhGr7V9p52T4wnmyN6SJxcLkPuMvC3xwViQKMFAojFiQxioYJN/kaZrz4fiqLkWG51wcSD3M1JvksnHASz9iaZDJGespyslpWNO57vzDj7olX3AZGg/0USGcMnsW0dGSSsORtWHI8H2Yc2thvASUyP5AA8VGdSgO/UXzLQGsaMn8XnnokOuToyt9juHtPOQwSlCoQQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA0PR11MB4575.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(136003)(366004)(376002)(396003)(39860400002)(451199015)(66946007)(38070700005)(66476007)(316002)(66446008)(33656002)(8676002)(76116006)(2906002)(4326008)(71200400001)(41300700001)(8936002)(6916009)(86362001)(54906003)(52536014)(478600001)(186003)(55016003)(83380400001)(82960400001)(64756008)(5660300002)(9686003)(107886003)(122000001)(38100700002)(66556008)(26005)(53546011)(7696005)(6506007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?IwLgGkFaGXjayhIYrxzqChFtH14qPusK8bUJTOrO4PHZzY5VTDG3UDd+8QUy?= =?us-ascii?Q?RaUjoY7nXHYcF6vCh6QbBaf6E0iKgwLJ2CTjQ7kNF0vHEZhNfy9PtF7zcx8h?= =?us-ascii?Q?5CD1HWKxCCzvXqWBmF1qBBL0MGiv5/H1e+4m9GdTjxY/y6ytGbVcQTBqXNE9?= =?us-ascii?Q?kSWknzc2Wy46xsrtEGB8PPwUL9m9NecmDk3A6AEuDw09TF67ElnZ4BxqTBjk?= =?us-ascii?Q?qJwaCui27TFnkgUKJ04Tjh9Jummk5U3tRlpiau3jk5t7c6Sha/haLejtsOmB?= =?us-ascii?Q?KgWHGPsLqsj2EJ0/x/RW3er4OYOttrpQz86+nXPo16KfmhjZUGOivHnv/hsA?= =?us-ascii?Q?/DAtASsaQuYaphdMiSu1dEnI8TA3uo/51kS9rV428E7ydn1XqyV/F3axH3YT?= =?us-ascii?Q?kp3K1CPUx8AaLCOe8e5bEVDb4XciTbOkv/TnAGnIlnXkJ0DIe91mLNueffP8?= =?us-ascii?Q?JY0gPunW7JruXiJy/GE9zpNwxZg90IIUauJ9pUyZ2n0g5VAYsFFU/oh5soUE?= =?us-ascii?Q?5ChuKXKSsYUxEg3t5IhXBt3crvundvbmagMcPUkTZNCDw18i+4RYeghN1JhV?= =?us-ascii?Q?CsNO5OX11333cQu9rSdEOYWfqS1npynLNaK6XN2U+vq6feierSh1s4j9OVVZ?= =?us-ascii?Q?cNWGjvOlNiLlYw7W23WofJ3gn53NtZ0vi+roTW+qqsJnjcBm4EZnWklJSnML?= =?us-ascii?Q?HjrELjr7LKNt0GigGVPvnhMg6vgfziu0y5cCEPJtEIIDdXULVV8btS1sTGo2?= =?us-ascii?Q?NHMd3INk+kgl3yh1z4w2NHgyN3DeH48rVcTWFxfZZG5CwTUkL5OWs/o1w5TB?= =?us-ascii?Q?G9G8tpBg8ZHEB0qas6+ecnXD4QsldX36TifBkMKY98GUBF9ildW1WjthsKyC?= =?us-ascii?Q?DmV6jlUd0N+ajTYsWzev+biALCgukALop/0Il4mI7HYVMEoN5o1S7YEbjo7o?= =?us-ascii?Q?oEfxxdd+FUQanrBFGrrIGP12xT+yoqo7GYwJljZoQSAIzgyjtmbhSPZtRIvJ?= =?us-ascii?Q?Eg+2xJWZFrPB+AecdLuitgXF07xokvo22/UULfjUrmHyzGxNNmNlj1RU84TC?= =?us-ascii?Q?3MVA0s2xKgQQsEW1fpPGl+Hpp7FddEh5hY1jWcUmOl+zx81aQLYOe/0wmph2?= =?us-ascii?Q?ZvxyukXv0nc8hUNXYEBlFjVK+pM8XL7S3LTnvxjP45lfWyyYoIRGtQoWlLSm?= =?us-ascii?Q?Xgm+jhb0se38o06nkNDNkNJwHYNwwFvIS68xvz44jtWYjYvtCl12qSS3XPk9?= =?us-ascii?Q?A/feT+y59NS16vhCKtGA5HGhRAi6eKeWVnJEhpq9Nl9HXtYh7m2e4aFlx2uP?= =?us-ascii?Q?+7GPKcF60g6ILgSPkjIufX5efEOsigV0yRYq74MYgiSbG9WYmP9xNiGGLGR/?= =?us-ascii?Q?esdVQxbuviWH4BEHJhcOF+4SDo4807RF7sOI9dD3jwV/8FFQPINrcjPhyjWP?= =?us-ascii?Q?aj6qH9bfh8U4bFsusZWKA8M9TjU+XFg+uduaTNktz18GME/1bcR3A9lumKVU?= =?us-ascii?Q?Mwpk4706SaF5nqeK9i9OifE2sYYb1XYYNBa/G978IezmM7URd5z1j1/AHLyq?= =?us-ascii?Q?Ulz6aoGAMRnsLRPxSwvcAsTV+k5Wls4yhxFrrYat?= 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: SA0PR11MB4575.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05c41e43-c337-4cf4-8097-08daad81718f X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2022 01:14:29.3338 (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: QMCUeNPEKDUCK43ogloGUIpxOtA/V7YOPll9QhR+xH5gSOwWFYgXX7f6bPFl+uTDosUUmfAHQbTn8VOtZ4B8lg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5056 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: Olivier Matz > Sent: Thursday, October 13, 2022 10:46 PM > To: Wu, Wenjun1 > Cc: dev@dpdk.org; Yang, Qiming ; Zhao1, Wei > > Subject: Re: [PATCH] net/ixgbevf: fix promiscuous and allmulti >=20 > Hi Wenjun, >=20 > On Mon, Oct 10, 2022 at 01:30:54AM +0000, Wu, Wenjun1 wrote: > > Hi Olivier, > > > > > -----Original Message----- > > > From: Olivier Matz > > > Sent: Thursday, September 29, 2022 8:22 PM > > > To: dev@dpdk.org > > > Cc: Yang, Qiming ; Wu, Wenjun1 > > > ; Zhao1, Wei > > > Subject: [PATCH] net/ixgbevf: fix promiscuous and allmulti > > > > > > The configuration of allmulti and promiscuous modes conflicts > > > together. For instance, if we enable promiscuous mode, then enable > > > and disable allmulti, then the promiscuous mode is wrongly disabled. > > > > > > Fix this behavior by: > > > - doing nothing when we set/unset allmulti if promiscuous mode is on > > > - restorting the proper mode (none or allmulti) when we disable > > > promiscuous mode > > > > > > Fixes: 1f4564ed7696 ("net/ixgbevf: enable promiscuous mode") > > > > > > Signed-off-by: Olivier Matz > > > --- > > > > > > Hi, > > > > > > For reference, this was tested with this plan: > > > > > > echo 8 > "/sys/bus/pci/devices/0000:01:00.1/sriov_numvfs" > > > ip link set dev eno2 up > > > ip link set dev eno2 promisc on > > > bridge link set dev eno2 hwmode veb > > > ip link set dev eno2 mtu 9000 > > > > > > ip link set dev eno2 vf 0 mac ac:1f:6b:fe:ba:b0 ip link set dev eno2 > > > vf 0 spoofchk off ip link set dev eno2 vf 0 trust on > > > > > > ip link set dev eno2 vf 1 mac ac:1f:6b:fe:ba:b1 ip link set dev eno2 > > > vf 1 spoofchk off ip link set dev eno2 vf 1 trust on > > > > > > python3 usertools/dpdk-devbind.py -s > > > python3 usertools/dpdk-devbind.py -b vfio-pci 0000:01:10.1 # vf 0 > > > python3 usertools/dpdk-devbind.py -b ixgbevf 0000:01:10.3 # vf 1 > > > > > > > > > # in another terminal > > > scapy > > > while True: > > > sendp(Ether(dst=3D'ac:1f:6b:00:00:00'), iface=3D'eno2v1') # wrong = mac > > > sendp(Ether(dst=3D'ac:1f:6b:fe:ba:b0'), iface=3D'eno2v1') # correc= t mac > > > time.sleep(1) > > > > > > > > > ./build/app/dpdk-testpmd -l 1,2 -a 0000:01:10.1 -- -i --total-num- > > > mbufs=3D32768 show port info all set fwd rxonly set verbose 1 set > > > promisc all off set allmulti all off start > > > > > > # ok, only packets to dst=3D'ac:1f:6b:fe:ba:b0' are received > > > > > > > > > # ok, both packets are received > > > set promisc all on > > > > > > > > > # nok, only packets to dst=3D'ac:1f:6b:fe:ba:b0' are received set > > > allmulti all on set allmulti all off > > > > > > > > > drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++++++- > > > 1 file changed, 11 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > > > b/drivers/net/ixgbe/ixgbe_ethdev.c > > > index 8cec951d94..cc8383c5a9 100644 > > > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > > > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > > > @@ -7785,9 +7785,13 @@ static int > > > ixgbevf_dev_promiscuous_disable(struct rte_eth_dev *dev) { > > > struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data- > > > >dev_private); > > > + int mode =3D IXGBEVF_XCAST_MODE_NONE; > > > int ret; > > > > > > - switch (hw->mac.ops.update_xcast_mode(hw, > > > IXGBEVF_XCAST_MODE_NONE)) { > > > + if (dev->data->all_multicast) > > > + mode =3D IXGBEVF_XCAST_MODE_ALLMULTI; > > > + > > > + switch (hw->mac.ops.update_xcast_mode(hw, mode)) { > > > case IXGBE_SUCCESS: > > > ret =3D 0; > > > break; > > > @@ -7809,6 +7813,9 @@ ixgbevf_dev_allmulticast_enable(struct > > > rte_eth_dev *dev) > > > int ret; > > > int mode =3D IXGBEVF_XCAST_MODE_ALLMULTI; > > > > > > + if (dev->data->promiscuous) > > > + return 0; > > > + > > > switch (hw->mac.ops.update_xcast_mode(hw, mode)) { > > > case IXGBE_SUCCESS: > > > ret =3D 0; > > > @@ -7830,6 +7837,9 @@ ixgbevf_dev_allmulticast_disable(struct > > > rte_eth_dev *dev) > > > struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data- > > > >dev_private); > > > int ret; > > > > > > + if (dev->data->promiscuous) > > > + return 0; > > > + > > > > It seems that we cannot actually turn off allmulticast mode when > > promiscuous mode is enabled, so can we return error and add a log > > message here as a reminder? >=20 > I think we should not return an error here: when we disable all_multi, th= ere > are > 2 cases: >=20 > 1/ promiscuous is off: no issue here, we do as before, we ask the PF to > disable > the all_multi mode >=20 > 2/ promiscuous is on: we have nothing to ask to the PF, because we still = want > to stay in promisc mode. We just need to remember that all_multi is > disabled, > and this is done already done by the ethdev layer. >=20 > On the PF dpdk driver, the behavior is the same: we can enable or disable > promisc and all_multi independently, and changing the all_multi value whe= n > promisc is enabled is allowed and does not impact the rx traffic. >=20 >=20 > Thanks, > Olivier >=20 No more concern if the behavior is consistent. > > Thanks, > > Wenjun > > > > > switch (hw->mac.ops.update_xcast_mode(hw, > > > IXGBEVF_XCAST_MODE_MULTI)) { > > > case IXGBE_SUCCESS: > > > ret =3D 0; > > > -- > > > 2.30.2 > > Acked-by: Wenjun Wu Thanks, Wenjun