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 9653BA00C2; Thu, 17 Nov 2022 05:15:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36C0340DDA; Thu, 17 Nov 2022 05:15:49 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 659CC40141 for ; Thu, 17 Nov 2022 05:15:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668658547; x=1700194547; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=ZqbD7dAkKpg0+vH7xaZ7YYbBN3fUCakHfI194AOHTCw=; b=jyGZgvDC3FZxf7LcaHRvcockw/0gwNKUtbjVg7Pa/cYntExR0LVKXkwJ JQMNJoZLosY3FhJi3EgO/+MkY9uDkU67EVZcRfndUJuCloCshPwJNmYPY gSvVgNgQzbHjU9+OmXDW3xMKZXpMSL248/aBoRPX2cby/Imix0el6k9KF Pmmirig1e36FduzP6hosFy8jeZWIgKYpRkKWefcrYkvXs4+CUgwz3CX/F RPUMyWAi3JBSLVN1xur9SuDp5K2SpQyU6wcr1s7OOGFbpetH/v4YbWOAT wzHG9kq/VOuWvhQfj4nj8mD3qAnoN63C1u9vjdSOUyFtndpIWbHS350Qj g==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="296114531" X-IronPort-AV: E=Sophos;i="5.96,169,1665471600"; d="scan'208";a="296114531" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 20:15:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="617453134" X-IronPort-AV: E=Sophos;i="5.96,169,1665471600"; d="scan'208";a="617453134" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 16 Nov 2022 20:15:46 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.2375.31; Wed, 16 Nov 2022 20:15:45 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.2375.31 via Frontend Transport; Wed, 16 Nov 2022 20:15:45 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Wed, 16 Nov 2022 20:15:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PTTk/4sH/VJAr1U8cj8/r5LEYTQy3vtLMv03D4skOBszXuw6yvngsdYlMVWD19NDP8MhgnNhR+nO6CM1M5cUqmxCFIV98ggUhIK4dRY4//OBsVtmzs713lzkN4g1wiX6RPUYlqFvD099ufWham8WseUTligxAmBWgcNqwmsEzTodZanGRIt7JaF5oKITzRlpPbH2cqKkRYMA7PU4xLQ3NgCgs1vOsCerAHVQq7i+yhHLuh/lO19ppNgo+Dr1tEcyTH0f7pRByAl6Uh3waeh/xbPKFi5Jv4D6w0h2lxPYWS0C7q2IIA/oLbRKPMFMwnp5jMH72hAHTjEdjqT4WKpPLw== 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=yhM7OdcPeFAqBfr2hWjJiCgITqYJ3WVITEetHOGYCmU=; b=gfvxtViM6uwlMtgAA7pRl1HjqC/19VILeHaylBIa88XYfzECtzaOLGvCL1QYmm5FtB12fy3uMUq+YabpF96GNgCvI7f1rSg48IKzfdSA8XZ5JtJyVCEhV2Ahby1d0Qm/M8dOPKcglHyyPgqRd/VwD85U+qaKNBBrpzx1ZXF1PnY533+mXbVVWl3/ll/WDFzNMDOGzHcMTX7r6h8eC1J53fWHSN3T4qI+xrCqdPLjOK98Uyvc8o0AzIKDmOAKkdVpaEfS/ZzmGzN0vCVxaDyJJAeFT8tc0Ot56xiTYu/xbNyqg8hHF9EpblfqJyyD8Ib9oAibbMh93nnivCnYkeOCOw== 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 SJ0PR11MB5104.namprd11.prod.outlook.com (2603:10b6:a03:2db::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.19; Thu, 17 Nov 2022 04:15:35 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::e2ac:cde3:4d74:3fa7]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::e2ac:cde3:4d74:3fa7%3]) with mapi id 15.20.5813.019; Thu, 17 Nov 2022 04:15:35 +0000 From: "Zhang, Qi Z" To: "Wu, Wenjun1" , "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/4n7Kpxb00IU0+S0Mmu1mnO+a4G5+QAgAWVEICAAK+tgIA1ocqQ Date: Thu, 17 Nov 2022 04:15:35 +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-reaction: no-action dlp-version: 11.6.500.17 dlp-product: dlpe-windows 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_|SJ0PR11MB5104:EE_ x-ms-office365-filtering-correlation-id: ec00b691-0017-4031-d397-08dac852608c 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: pAtniamZnH6J3HvC4ajzuNgB2Cuk+kJCJ3iBj3Z/Wqf3mMm66OtuXn/5S5B79F5zRiZJe8UHrYxRtIsKSgzxpYzd5r8CLbS3Q1Yuieul36/DQpfbt9yVzx52xZLQvrqdrhVTHnlgwqZ/wIRu5Abh1nNbnVVATIdhDfYmc2vwLv45L6VEhAQVveT74oMr5iDN4Uu4KoqCDN0Q+knE6CYA4CN8VsIWx1lMzWTakq13RKltR+5tJNgeAT5PJ2RYxMZbqOZDBQzjm/kXlCZBvEegAjqNriaeTwpy8ePrcrFmGzo2z6MtzCCiFm81Qpt7zt+wxUBzSSeY+CCYav0tAx+mhjlaEvd3Ipe21rD+iBIeqlKG1LZVXT1i1CLQvi6PyHqfMg7ScL+oP4ggF64ohDH3eOKoKIY+Ku/iBhLdX30jktUiimt+UAfD3HwG4TQYdnf4pu4JkLchHP3QTSuYF0FMcEwDhYFlsyg8+EmtsGoVBXPliNlMDv81G4N947mDPOJTjYgU/gl+UPd5uUM/HH1Tq4USQTTZu5+4aU184psjSyUQIOO0BIAS0cCdeummhal/QTZLqdawonxt1n3fgnOm3GKZKHnJ4XDz0eylc0e1KPp0EjT6COWy5nQ+9VymBeZccaZy1xNSmikU6WOkgewJczvOCJ3NI5TyuHJLtYl0DlqEW/j84kG9g6xX6OFZimWpEsi1wLIzNUkf08BO5i1lQJKNmVw6OcfiNlz2ZZPpxrLSMrS+kGwbEO5TC0CCwzzXf4ahfXQeU5ijzU+WnJbhvg== 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)(39860400002)(346002)(396003)(136003)(366004)(451199015)(5660300002)(8936002)(52536014)(41300700001)(2906002)(316002)(76116006)(66556008)(66946007)(54906003)(110136005)(478600001)(64756008)(66446008)(66476007)(107886003)(71200400001)(55016003)(7696005)(6506007)(33656002)(53546011)(4326008)(8676002)(26005)(9686003)(86362001)(83380400001)(38070700005)(186003)(122000001)(38100700002)(82960400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?d/MOcBjG925E+T+0mN6FVoRrLkNWY9PlrAHayrr0IaV5jpdjhieVuW+xpW2W?= =?us-ascii?Q?ePuhvH4gq395dsIYHFl/OQtuLOMObYY5idHMnwFQHzNgPNXWg/3pLSzQT/QI?= =?us-ascii?Q?lpchL9DaQb2YBJZOa/PCqXc+DLWxduZAL7LYOxOXOXuA5mBZ/Zc5SK7jyFVX?= =?us-ascii?Q?CvCLvhpxLCmDQmsj+uBXmf4/QhhmPs+GrXh5VeB9mRjQBe32+l6oG8XMQ5r4?= =?us-ascii?Q?LGuEJlazqmBVz0PnODfkU71HA8r4m2bqjzOWR/g0+DclFitpMUQbPquTUx9e?= =?us-ascii?Q?HN1hDbZkdAn4A1ZSXfHmkF49a1J/4oHFJddsPqegWS4nCEEh2oN9ZT28sxN6?= =?us-ascii?Q?5xa/lx7pSyS1llJAU9biTDy6KQx2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?Q?dZwMKyLocqf0w+xfHISmWrgyv1NsbDs3hteI0hcMJ3J3AazMN4kw3BDqPXPo?= =?us-ascii?Q?0AtcKS3SIjYC1taAicMegmPIV84AwxFHmwb4ksp9nWbWCSoIjcuqkw3mgVi6?= =?us-ascii?Q?l5GM+UQ6qt4O9hCtOSC7z99U1U7Dyskv89HpmGUNVf4mVYg+lTIhxuCcIDxg?= =?us-ascii?Q?Zbfn5pKbQqyeO+j1B0BqLMBWbDTv9bZ+N6h7CJRspCuOhluHHH62UYbL4kbR?= =?us-ascii?Q?CfR/5pqfTzmOo2rA4yQCIOeSvx6lOqWfpqcr+LW5aBDtezR4jmv8YZ3HlAJC?= =?us-ascii?Q?5H0B0AFJqkg4qzsDiSu5Hix5q5+DCXdQCxLgy9Gc?= 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: ec00b691-0017-4031-d397-08dac852608c X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Nov 2022 04:15:35.8905 (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: YLbRB1ipAB7Qy/gKgX6BROeC2OK0NwYbyf4uNZ2rCgyHiVXybapjgAh6GagvLVfGrDWYQKCQvrAyJK3bF7ccmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5104 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: Wu, Wenjun1 > Sent: Friday, October 14, 2022 9:14 AM > To: Matz, Olivier > Cc: dev@dpdk.org; Yang, Qiming ; Zhao1, Wei > > Subject: RE: [PATCH] net/ixgbevf: fix promiscuous and allmulti >=20 >=20 >=20 > > -----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 > > > > Hi Wenjun, > > > > 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') # wron= g mac > > > > sendp(Ether(dst=3D'ac:1f:6b:fe:ba:b0'), iface=3D'eno2v1') # corr= ect 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? > > > > I think we should not return an error here: when we disable all_multi, > > there are > > 2 cases: > > > > 1/ promiscuous is off: no issue here, we do as before, we ask the PF > > to disable > > the all_multi mode > > > > 2/ promiscuous is on: we have nothing to ask to the PF, because we stil= l > 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. > > > > 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 when promisc is enabled is allowed and does not impact = the > rx traffic. > > > > > > Thanks, > > Olivier > > >=20 > No more concern if the behavior is consistent. >=20 > > > Thanks, > > > Wenjun > > > > > > > switch (hw->mac.ops.update_xcast_mode(hw, > > > > IXGBEVF_XCAST_MODE_MULTI)) { > > > > case IXGBE_SUCCESS: > > > > ret =3D 0; > > > > -- > > > > 2.30.2 > > > >=20 > Acked-by: Wenjun Wu Applied to dpdk-next-net-intel. Thanks Qi >=20 > Thanks, > Wenjun