Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp441477iog; Mon, 13 Jun 2022 06:05:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmXUxtD3XdwVvUbmzmZVP8lNyzI+rzShb0fIiL+kVITgCKG1EmONdUFSW7TQJONAq3cnTU X-Received: by 2002:a17:90b:4c8d:b0:1ea:8c6a:6aa with SMTP id my13-20020a17090b4c8d00b001ea8c6a06aamr15240040pjb.56.1655125505051; Mon, 13 Jun 2022 06:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125505; cv=none; d=google.com; s=arc-20160816; b=sn5qsQSRc9fYr10E2v6a08FzGPdn9MGzMBWHs04ZOhaSwtJMNoOrfSGOiuOO0WmfZR WMoFUjDgxbojnunnBmc6N1D/ZlqFVSIjItiWxtacADC/DNpS47OEwiLYVsuqEMEkt3GQ /9mPwW1L34HhwHDOfspdEOjTbzBpDuUybAsXZ2OvTxx8++R8oUXAkT4FngLa9KXNSsqn eUknEzljpfHu7IdQ5JPwf4lqkwROBG3B7TfjuhjeUnkLo6YWDb8aDvdurSVgQOWRwfcm SwUf+WyD9Luu3w72UZNMlg1M5LosIMFq6U2tDgERqdthXrIwL3uicWLI4PZsZNHJ/3tS wX6g== 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=3IjumqCCsCh39OqH+7HYoF6cGq7pzm0BjHDwejYVFEw=; b=dhNm7go1gFAOk8GB28UKgUGDh8IezVdoJCHo/8mhszbPoTJq0ICs/0kv6uOUUgx5n2 g+YCa6Z+LYwORxaELiuwPb0Li8YRnyroAvkIx1pYD5iBnNiGL11H8r1vGTocW+Oo1eod cJ8LAOOSKEyXIfdIvVNKFkJ4boawCAEhGM+s6T5qzyFoN83etGwXxXsrnVXdBChcXBRV 5N3hnvVvc33/iN0gXopjjZl2DPBQ1vvMcQM4qyQzCMZD7KxALd3YNElTtjazdsoZJyTu ruozY+JcSvdl5eyEXJF02m+UHu7b3mfNuqUFcOY8g5fGEBFwZz+M2PWyMichonnUlZCX 2zMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SJrps7Il; 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 m125-20020a632683000000b003fe2bc67bbdsi9542440pgm.116.2022.06.13.06.04.51; Mon, 13 Jun 2022 06:05:05 -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=SJrps7Il; 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 S1353752AbiFMLQR (ORCPT + 99 others); Mon, 13 Jun 2022 07:16:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352222AbiFMLLQ (ORCPT ); Mon, 13 Jun 2022 07:11:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06E5834BBA; Mon, 13 Jun 2022 03:35:56 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 1167E60FDB; Mon, 13 Jun 2022 10:35:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F3B9C34114; Mon, 13 Jun 2022 10:35:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116555; bh=XdAA8TQwNS8kuy6WS49eaMKAHDDJvzxJNsDL4g4Nx0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SJrps7IliKfCChqg2kqz4eCvmjvD8uW1Si+1XIq1PcJ7OFR5JiAJ9CORQdErgjWLE SES/bnekCx2fo3TTZ8Ytg067DSV90oWDqHydU/1FJGCtrCHcU14QDhbYn29hA7LmF4 gBMxFFNpoNIk4xAE2+pbkzbMa0IaTXS6gDIlqHwA= 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 4.14 212/218] ixgbe: fix unexpected VLAN Rx in promisc mode on VF Date: Mon, 13 Jun 2022 12:11:10 +0200 Message-Id: <20220613094927.055031997@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094908.257446132@linuxfoundation.org> References: <20220613094908.257446132@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 @@ -1180,9 +1180,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;