Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp583475iog; Mon, 13 Jun 2022 08:34:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u5NIl2P6ibqdLjUJm3G3Ccd2JsZ89/H0lYbejXmoS/HZeNHNj75DFTyosR8HgiyADOQICj X-Received: by 2002:a05:6402:1d48:b0:42d:d1a2:7c6d with SMTP id dz8-20020a0564021d4800b0042dd1a27c6dmr325228edb.43.1655134484088; Mon, 13 Jun 2022 08:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655134484; cv=none; d=google.com; s=arc-20160816; b=gsbMnDfGUF7YLNXC58c5TA/+sO88Bdcx8MczkccHWZHkLj4/EiooaKz3qHw0PMd0Of +VAjhcxr2iWYs0ADAP41t73YD0wbOLFiLx7V1ywabiXn5y3rlPtgApV0Tj6xu6vd4DM4 ADmhVGd2I2jKI5eNSPrpy2oUSKIdH9Gw1yav5Zn0s8s628XSS1lRo1Cy2wd8rD+dqpGs pluucDJHuLGqoklQps0na6tSLap/GEqx/0NFI7Js+N62NgOw3bYw2pXzUjW+Mx7SwQV3 SYFq4Vkpkawv2NVSzmWUauEaOXIqINbWegvUXRc/GzEkiAIq61RbODOmGs+EIpM4SK53 zEyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sOEnaWEwsWK+hhr8dKdz8q7yEWesucg7VJfQsgra0+Y=; b=B4RwPFkknSh7UiTtLee1s+MqpBuFhducaN4qqV77+pSZeDgbjlNHVSpXSPvCZ/osKS Hy29gXgPMsvwV6tpiYaaWr6UlZqx2nMgFsYjuvyhFGGseke9BKuziFKvbRz8CXQeo5f4 8dSYfsEzxbCObuYbGK+P8NzW90V3HDS3hHDFdBbgHqArlU32yIFkquy+QCAS47ZDaywO 4+BcndZ4+kZ7dckbrSBs+GeNYMEoe0yVJ2WVJdq3uQBNR6u1oKhsi9gCFD7vNZaVCEIR e/V5Tu1WM+eAA1dwSwiyGCecV6M4GiuUxa481ZpUhU40XttiQHSSBTHr2G+sssUstjjY gxtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="L3q7P9/m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020a056402354d00b0042ae36e2432si9626754edd.132.2022.06.13.08.34.19; Mon, 13 Jun 2022 08:34:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="L3q7P9/m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377303AbiFMNZm (ORCPT + 99 others); Mon, 13 Jun 2022 09:25:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376298AbiFMNVO (ORCPT ); Mon, 13 Jun 2022 09:21:14 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E26E6B035; Mon, 13 Jun 2022 04:23:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id EB4F4CE116E; Mon, 13 Jun 2022 11:23:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0983C34114; Mon, 13 Jun 2022 11:23:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655119416; bh=2kdVZxq7QhwiMhHg48ux5Jq1HvMBVruEQH6DiUTxjWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L3q7P9/mzssLMznn+O2Fnm0Igy5ZwoI46Mayh6es4A3CQDwB5X5O1j4GnTwX6iewL o6EIA3gtJYmi6rm1iE7BdYUtq2P9utnU4YmbD3FEHvfUI4Uf3exB87JPlbBX9/+NP7 3NQPzMC1vwLVdJmO2bu5+spaO7qS6gODGTMh0jyI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolas Dichtel , Olivier Matz , Konrad Jankowski , Tony Nguyen Subject: [PATCH 5.15 231/247] ixgbe: fix unexpected VLAN Rx in promisc mode on VF Date: Mon, 13 Jun 2022 12:12:13 +0200 Message-Id: <20220613094929.951843152@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094922.843438024@linuxfoundation.org> References: <20220613094922.843438024@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Olivier Matz commit 7bb0fb7c63df95d6027dc50d6af3bc3bbbc25483 upstream. When the promiscuous mode is enabled on a VF, the IXGBE_VMOLR_VPE bit (VLAN Promiscuous Enable) is set. This means that the VF will receive packets whose VLAN is not the same than the VLAN of the VF. For instance, in this situation: ┌────────┐ ┌────────┐ ┌────────┐ │ │ │ │ │ │ │ │ │ │ │ │ │ VF0├────┤VF1 VF2├────┤VF3 │ │ │ │ │ │ │ └────────┘ └────────┘ └────────┘ VM1 VM2 VM3 vf 0: vlan 1000 vf 1: vlan 1000 vf 2: vlan 1001 vf 3: vlan 1001 If we tcpdump on VF3, we see all the packets, even those transmitted on vlan 1000. This behavior prevents to bridge VF1 and VF2 in VM2, because it will create a loop: packets transmitted on VF1 will be received by VF2 and vice-versa, and bridged again through the software bridge. This patch remove the activation of VLAN Promiscuous when a VF enables the promiscuous mode. However, the IXGBE_VMOLR_UPE bit (Unicast Promiscuous) is kept, so that a VF receives all packets that has the same VLAN, whatever the destination MAC address. Fixes: 8443c1a4b192 ("ixgbe, ixgbevf: Add new mbox API xcast mode") Cc: stable@vger.kernel.org Cc: Nicolas Dichtel Signed-off-by: Olivier Matz Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c @@ -1181,9 +1181,9 @@ static int ixgbe_update_vf_xcast_mode(st return -EPERM; } - disable = 0; + disable = IXGBE_VMOLR_VPE; enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE | - IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE; + IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE; break; default: return -EOPNOTSUPP;