Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp633252iog; Mon, 13 Jun 2022 09:32:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOR5aqS4jQ2v0XEO2rfBtwiOcGlhVwmLWInfQl58WuhAV0HMJYE+86D4/vHBFuK5zbw8SK X-Received: by 2002:a17:90b:4c88:b0:1e6:71da:5eb0 with SMTP id my8-20020a17090b4c8800b001e671da5eb0mr16848057pjb.185.1655137968203; Mon, 13 Jun 2022 09:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655137968; cv=none; d=google.com; s=arc-20160816; b=BdFUYZelyncbGOyuaDmk2AdMON8MvuAD3eEprfVRPY3k+T0n5mvZfL5KDA21C6xHE9 y+sBuHy5tjXP9nd32xPywO8VAVfNdUt9lU0AsoK1dYB0fmPcfMa0BipMn2Vw5Q4mVbEq z0QG3cowTZO1nLjJ3c9tajzrSXH614Hh4Vg+fOmzZYSl8THVi+6eq/GBgRkL0Rot5mdF khhZrHjPwECQCVQg+35geZRFQiETdrRK490U3PKfkz7vrd8iyFi5f960OkWjY+a9sXSL JrDafMnE22i3XpacBPktIPMiK7MjFaqnkovwuapTau42rmJscg0FtNCfs8UeQPGoVNxu FJOA== 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=MBhw8NM8ZgCdOKLSONz5793ljsTap1PgmDiPT2sejK8=; b=ohIu6IgDeYEt30Jd01LA6rsDEYviZr/3qyNQt+Q7zo1aDrTOHDyZZWeWbchxjjNLir makBLuz59VmhJo/yA9jqA9iqYYfdWT/fQvE/aQ7CtnWM2sg+7rK95rYOyE7wa54LjjUJ 6zIZ6xmF/GELAHPIGT5OsOzCwqk5dIkdARvb66C0pQLaAQa09zpxnbI5UQodHI1Dr0Za VAR5m3bLc/RceIMJn9E7N5/BkPJxneLP4vyWgAKZHHjfmplyGFEH1tiU0vjIU0nOdNO6 nzO2Ta8KdrntqfGonBun3+IqO6D6/nfin6TgcR2ftmCA8B+cpNNAXSwrQhAyirjGVjYZ vQgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fHHDVKuf; 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 c19-20020a637253000000b0039da72fcd63si9418513pgn.472.2022.06.13.09.32.35; Mon, 13 Jun 2022 09:32:48 -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=fHHDVKuf; 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 S1381156AbiFMOH4 (ORCPT + 99 others); Mon, 13 Jun 2022 10:07:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380901AbiFMOCl (ORCPT ); Mon, 13 Jun 2022 10:02:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 081198FD41; Mon, 13 Jun 2022 04:38:17 -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 ams.source.kernel.org (Postfix) with ESMTPS id 517C3B80E2C; Mon, 13 Jun 2022 11:38:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C31BDC34114; Mon, 13 Jun 2022 11:38:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655120295; bh=wY5OO8+bRJitJI7tVcOO8KmKkYfRGZhRGEXSNp5PWHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fHHDVKufRer6tPLS17BjRXtowjiFFZsx0vdGCF/jOj7gGA+e4Bof079ETj3zqL0WA ZSZ6WvwmdJy1xtk5QDvRmJ36QaLi/cCme0ci1J7f8MMhs8wnOiMCaWPAaDMboIigVb hdc11BLErf8RQEUp9Km0HJLQWVjqEuU9XwKbVXIM= 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.18 321/339] ixgbe: fix unexpected VLAN Rx in promisc mode on VF Date: Mon, 13 Jun 2022 12:12:26 +0200 Message-Id: <20220613094936.482964838@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094926.497929857@linuxfoundation.org> References: <20220613094926.497929857@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 @@ -1208,9 +1208,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;