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 8F22EA0544; Mon, 10 Oct 2022 03:31:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A251400D5; Mon, 10 Oct 2022 03:31:15 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id DBD3340042 for ; Mon, 10 Oct 2022 03:31:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665365474; x=1696901474; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=A3jml8WyVFjg9u7yEZhkBRWpgeHjZK6MZbHplQkm/r8=; b=fK6zmeIjTUWlsqNPK6kpy8VqPdiY2ynV/1nN2Pz7D+0is4E5Add2ydSh PeFMsI9j3HlnPnVySiQmvB5yiEQPJlEbiBf5/HOXWRzQTJQvV5FDmMmWQ K/z4rv0BD5Lxt8LOQoj+AnBCOtvQmhSa07mJrq8HvCQxRrNMM+xcq4ELY 0rz3W9qRCHNm0KqKNNNfU1TIVbnm1W6aSqxurehSXt5aE5BdqKSfpb7XU 9oi/avDvKxZyjqXJ5cAxhAxj7XKghflHiU3pmQMGAOi8PapW/lrstw/4k 7sEd0j/BuxGsACOVs0ZIFIWdupouLlQwvXNGmV0wDDgloDQYqfxQ+eycF g==; X-IronPort-AV: E=McAfee;i="6500,9779,10495"; a="305144203" X-IronPort-AV: E=Sophos;i="5.95,172,1661842800"; d="scan'208";a="305144203" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2022 18:31:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10495"; a="800921911" X-IronPort-AV: E=Sophos;i="5.95,172,1661842800"; d="scan'208";a="800921911" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga005.jf.intel.com with ESMTP; 09 Oct 2022 18:30:58 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sun, 9 Oct 2022 18:30:57 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sun, 9 Oct 2022 18:30:57 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Sun, 9 Oct 2022 18:30:57 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.47) 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.2375.31; Sun, 9 Oct 2022 18:30:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jj5rQ9YWAxy8DpTZcU3Fw7KvigvYJEIAUNTY6UIjzPxjrVk+iY9mREEDAJiljtuu10gZhmP2Z7LzNL+wycW3BBGrpnUtl7+5eTAhcEftkD2tJHbeSxNMRXTZngHSB5cEjs7Xx929VZ1t5gLprAxHB4y0sZig1C0rYLEByyT0pYQrDl26DmcY7/7kXJ9VuFrtlGQDCQoNwGXZ+LmMsKg3dLOPiuKQJ/Ex/FjBpgvjmg7QGLck56k5tvMw4/U+f61kvcqEeMt+iO6cUh3kpyuGUJvN22Yd4Kdu96MOjH02z4Z2VYMg5xWQgmySM7PuT4Uj2SeClPaJgO/JJmuYgfltaw== 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=x0CvvcUfpzBwru769QbN/9bc3J6bVfgnzm7KtyG2qq4=; b=FLjkPAxhT2ghvoAaIxzY2LqgC7RUmpSeBeLqWAdsHHQKayG0ep/7HK0OYEkrI4ddoWJlTGhhAJCkGvE6Mvv7NMHyQsROpFvnW5g5Yu6J5NdiTj7ombQnssN51kb4X+2swtOGQy37MkdaAExJYDfmLwxrY7l1+I+wsOmg0D8GKz0cwOUXZ/JeVM07kgW6dBkCGUpzQvxFnPk9V/arccr8q00F67zPG89jpyoFighJ/GpgdApuYyLpkkV2A5DgMdxobasLG0t7+S2kDYSCYdIEN4ZhfxfG1wNQ93kXgMtfZQvtl7cjiyzBwJjD70OA44epPFnHykyOPGEtdYZRhrNpIw== 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 DM4PR11MB6190.namprd11.prod.outlook.com (2603:10b6:8:ad::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.34; Mon, 10 Oct 2022 01:30:55 +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.5709.015; Mon, 10 Oct 2022 01:30:55 +0000 From: "Wu, Wenjun1" To: "Matz, Olivier" , "dev@dpdk.org" CC: "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+cMnlTQU6HU9YcRpoama4G5cNQ Date: Mon, 10 Oct 2022 01:30:54 +0000 Message-ID: References: <20220929122155.816-1-olivier.matz@6wind.com> In-Reply-To: <20220929122155.816-1-olivier.matz@6wind.com> 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_|DM4PR11MB6190:EE_ x-ms-office365-filtering-correlation-id: e59662a1-a7d7-4636-f0e7-08daaa5f1362 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: bfODN2zxn6nV+NBO/On4Z2uejuSIy/ZGs2r4zGNtePtao9+kFVqagChcLIHojDoPfuusjaVEbd+5Vkb8Mo8kSVBwWCixeeRtGliOhh1WOuz9gdGJ+fcKpEjF7FLxIZvwv1/hroE4A1Lyxtcl+GGOT050+vIFHknT02yweJYOjvzKetznEdvUTD29dwc25qkWIKE0baFOACxVJm3a8cp+wzBtpr59YjbfdgsIdXkWJUiqOY6kMdiHN9l/4rbwn/u8fGuZbDK6lBTq8kHBC0V9cRaREqRyM03RZwhvc0dbBdgHFFpEvgiwcSqSGrIcdK1nk6eKznCENq91UvFfCZ6degNaVHy4dpOWaRHirRufFCk5ru/nYsBlUGvo+RcwF4IEFFcLVMAxtDx/hKT3wClaT0NjZwaV3rfVTjBaj57gBXZ4qc0CY6s5SuyC0Aki3H8XI+F2rLLea8FPv+/FKbBFkXAU1VYGLjZOfnGi6VmSdvI2z+DZXGv7tku4abRlEOyZZCkW2+4wkxWVIG2m01UoV9vFo4Zi5VZbXmLGRExUj4O1r3BIMqD7s+UHb7cxW2swIwNF+6NWHBuE4sLFRWdzheI4Dhy3mrIaNnDb6oPKCWfpX+G/yETHf96TfF5fIw5vHFhkLkNbxN3Qoc/mLvZ2U0fqau691Q+lMM7wyMzMLSIWa6V4pCS9Si3kK2jWLBxbTaMforh37B+T71g/uOCg820Nj6dgfcLLkjJ6axTAquLgSBJ8g9cuCyLBB8yPke7D 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)(376002)(396003)(366004)(136003)(39860400002)(346002)(451199015)(9686003)(33656002)(478600001)(26005)(2906002)(107886003)(83380400001)(53546011)(71200400001)(38100700002)(41300700001)(82960400001)(66476007)(64756008)(316002)(8676002)(66556008)(66446008)(66946007)(76116006)(86362001)(6506007)(55016003)(54906003)(38070700005)(52536014)(110136005)(122000001)(5660300002)(4326008)(7696005)(8936002)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6Cyec/lnLaC0gELYZezsXY+6CDm3n1ixFhXII1BHXYQgfNAbuHXKa/VVKj6h?= =?us-ascii?Q?Wn9QiZ8S6s/Stul0Ue2krmLJ0ugLDCCquGfPtS4BsbY+KrbUKcMabla/EOV0?= =?us-ascii?Q?uBaoQ/n6ZeQ9JE2D5NGWKisfZSEIMeTwCqkjGdaiGmgK53fTVwkvQfLL0pbq?= =?us-ascii?Q?emRXvZFXBf0a51YVWwCdaczH7X7vEmNtNS4X08puqYN7KjGlKO5BIyjC5wkN?= =?us-ascii?Q?HOQeRudXjO7v09zN6BCrHz7IFzw7muJyRL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q?18ASfhrjS1ba2i9f1noLq50AFRAHH1qjs8ZY6M69s6VpqeH+vdIvl7EqYSn7?= =?us-ascii?Q?R5wG9AH3KNg7W15buqCrPPDcY3Tmq+uQAHeuo1Z5YIUHC1k4zoIxnkcUAvbr?= =?us-ascii?Q?sl+oHThteqrkLWOywMHYbVDGg0kiaXRS24YAI9B/5b+GnPUUqSmdS8+1h+I9?= =?us-ascii?Q?gUlNkOV84LRqnc0I7mbINVPO/EtMHChBLdiVKto/xoU/v+1ei+EExA0gI0mk?= =?us-ascii?Q?U1LN8bRKlBaOkgOfxR3OHhPpwaarOZiOCkM+kM/z+mIo1ky8TNwy0dbq+0j+?= =?us-ascii?Q?r3scF+AAABBM+X0LuFuwMQYgCMYL6KnbXsX7PtBTsUjb1Wkv0E5ViTj3CRvl?= =?us-ascii?Q?0sdYbusV7qdQlI+jm8sStoeAGQTCC4MX0YhFV2UF8KgIdMBWixJYrMY+avZ+?= =?us-ascii?Q?CSz06j1InxfzKKs1RSs=3D?= 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: e59662a1-a7d7-4636-f0e7-08daaa5f1362 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Oct 2022 01:30:54.9744 (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: 9LGQ7DbHc58btKIG7/D3udNLxfhB3C38mBIQwoOcjSWCE8Zz9Fs59QVDfCKc4BtZSvPMJEZa7v2Z8i4k0NNhDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6190 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 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 >=20 > The configuration of allmulti and promiscuous modes conflicts together. F= or > instance, if we enable promiscuous mode, then enable and disable allmulti= , > then the promiscuous mode is wrongly disabled. >=20 > 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 >=20 > Fixes: 1f4564ed7696 ("net/ixgbevf: enable promiscuous mode") >=20 > Signed-off-by: Olivier Matz > --- >=20 > Hi, >=20 > For reference, this was tested with this plan: >=20 > 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 >=20 > 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 >=20 > 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 >=20 > 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 >=20 >=20 > # 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') # correct ma= c > time.sleep(1) >=20 >=20 > ./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 >=20 > # ok, only packets to dst=3D'ac:1f:6b:fe:ba:b0' are received >=20 >=20 > # ok, both packets are received > set promisc all on >=20 >=20 > # nok, only packets to dst=3D'ac:1f:6b:fe:ba:b0' are received set allmult= i all on > set allmulti all off >=20 >=20 > drivers/net/ixgbe/ixgbe_ethdev.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) >=20 > 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; >=20 > - 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; >=20 > + 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; >=20 > + if (dev->data->promiscuous) > + return 0; > + It seems that we cannot actually turn off allmulticast mode when promiscuou= s mode is enabled, so can we return error and add a log message here as a reminder? Thanks, Wenjun > switch (hw->mac.ops.update_xcast_mode(hw, > IXGBEVF_XCAST_MODE_MULTI)) { > case IXGBE_SUCCESS: > ret =3D 0; > -- > 2.30.2