From patchwork Fri Mar 25 14:02:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Matz X-Patchwork-Id: 554331 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CF9EC4332F for ; Fri, 25 Mar 2022 14:05:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359165AbiCYOGd (ORCPT ); Fri, 25 Mar 2022 10:06:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359258AbiCYOGc (ORCPT ); Fri, 25 Mar 2022 10:06:32 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E27BED8F4A for ; Fri, 25 Mar 2022 07:04:57 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id j18so11024704wrd.6 for ; Fri, 25 Mar 2022 07:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/Nv9j1e4+IUpQrNAPBL9SKDMzyA/AU6XhoGzvZ4sFzY=; b=SPrtQCcMqgzJTwdsDPLBcBPWVT3nB5H5ZXb8GGCy+oaYgzbFW5cU7jok4OpZWAwm+4 OyEjd/uhpV5C4P/cT/iPa2wR/fN2VMTRByg3VJeNZjRUtjAsycDZh7GCj4WESx9bT6Kp f6ERyJoUhDX6h0KL0SqyMHVE2wIt+nCixbY8hUBCZJx4YVeO0PRmTYS0kUBu6IVfNPLT Cxt89UJTFxKk9OuCWFQRId7rGUNVsJFDLHAY+03QN2XT0xAT07tM5fTC9GGXJb0KUpSn vtz/S7cNimKrDQR/TaPIvtG+uvuKn9CL022Pnc53odCvP5ZWZq/JuVx0xpF9EM/59DzH 8G1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/Nv9j1e4+IUpQrNAPBL9SKDMzyA/AU6XhoGzvZ4sFzY=; b=ZhtBKQ7YxROgX3qTrpsu0fRu+R47g2++25Ym70B++Q7l25MlNkQT7CebAF21VnYUdK jsvr7Ri53mOT3bL3+AXq0gSJThbnG9yQOB9tkb+vRIqRK/pIwRUNoXGWmni0fRxzEgny 47PcQ2ahQAJXujVtsc3VvmJl7CpopngXTWmW4ZronZzjDRaF5A5lVQeSfbchJxqNN0h6 77YNH8Kgtu9jltpKBVckXqdXWIWPCII0oRsAvLGvJSY89k6lF+FJGPjLcZS3m1ACOYEV zZnvBC3Y9psjUttVXGZSFh9H9mgCTO9jWpcVOiEPBqsrzxi0wMdfMhUprdK7cCP2F64q puJQ== X-Gm-Message-State: AOAM530KWnq4kkj/UOVJ+1QPt4E2LLH2qYpZ3uD9NVlv3y77AU15FuVU ArkhxyOJye/51SXYXcp6VkJ68A== X-Google-Smtp-Source: ABdhPJwQbqQ9FiF/nP0DA/h9UtBxy3aIsPOkxKlnHke76yQrdqMFCyCGIAgHv9OuG249apV/XRG3Dw== X-Received: by 2002:a5d:64ed:0:b0:205:9805:1e0a with SMTP id g13-20020a5d64ed000000b0020598051e0amr7382318wri.362.1648217096458; Fri, 25 Mar 2022 07:04:56 -0700 (PDT) Received: from gojira.dev.6wind.com ([185.13.181.2]) by smtp.gmail.com with ESMTPSA id o8-20020a5d6488000000b002051f1028f6sm6347642wri.111.2022.03.25.07.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 07:04:56 -0700 (PDT) From: Olivier Matz To: netdev@vger.kernel.org Cc: Jesse Brandeburg , Tony Nguyen , "David S . Miller" , Jakub Kicinski , Paolo Abeni , stable@vger.kernel.org, Hiroshi Shimamoto , Nicolas Dichtel Subject: [PATCH net 1/2] ixgbe: fix bcast packets Rx on VF after promisc removal Date: Fri, 25 Mar 2022 15:02:49 +0100 Message-Id: <20220325140250.21663-2-olivier.matz@6wind.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220325140250.21663-1-olivier.matz@6wind.com> References: <20220325140250.21663-1-olivier.matz@6wind.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org After a VF requested to remove the promiscuous flag on an interface, the broadcast packets are not received anymore. This breaks some protocols like ARP. In ixgbe_update_vf_xcast_mode(), we should keep the IXGBE_VMOLR_BAM bit (Broadcast Accept) on promiscuous removal. This flag is already set by default in ixgbe_set_vmolr() on VF reset. Fixes: 8443c1a4b192 ("ixgbe, ixgbevf: Add new mbox API xcast mode") Cc: stable@vger.kernel.org Cc: Hiroshi Shimamoto Cc: Nicolas Dichtel Signed-off-by: Olivier Matz --- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c index 7f11c0a8e7a9..8d108a78941b 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c @@ -1184,9 +1184,9 @@ static int ixgbe_update_vf_xcast_mode(struct ixgbe_adapter *adapter, switch (xcast_mode) { case IXGBEVF_XCAST_MODE_NONE: - disable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE | + disable = IXGBE_VMOLR_ROMPE | IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE; - enable = 0; + enable = IXGBE_VMOLR_BAM; break; case IXGBEVF_XCAST_MODE_MULTI: disable = IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE; From patchwork Fri Mar 25 14:02:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Olivier Matz X-Patchwork-Id: 554632 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4124CC433EF for ; Fri, 25 Mar 2022 14:05:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359265AbiCYOGf (ORCPT ); Fri, 25 Mar 2022 10:06:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359263AbiCYOGd (ORCPT ); Fri, 25 Mar 2022 10:06:33 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13F1BD8F45 for ; Fri, 25 Mar 2022 07:04:59 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id a1so11023105wrh.10 for ; Fri, 25 Mar 2022 07:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V8rESgnRRVosu5hPSZc35M3ikXmcWBK5NfYg41ecw5c=; b=HOgZGTvcQJx8GrOHPi+59IHKDvj0sqsLKe/NXu5r6bLevjhiQ1kHSGQC8pyhEktGrX opJ0ULprPb+vSoZJJ/Y0JBv3z8z15ZWBbrPfNIxnSFA4dhmpgZ9V/pF+ykMCCNKcEKMy WS5is4qykGuGCiSEgxZRh0+x7c19u1tnrOs0t8bRWqMHI5PKTUoLSmA53Yl2o6ru+hye iaV24SEO2h4Fj2p6X7GxEe5UZgQ/VO7Q+alfS4grdSApAnPy/rG2UeX6pG8lnCR0d7nS BgyBt36iirhodUgPM5kWSgWlu50IXBdH3RAS8LIr1I8KqliwhDKUk4ep08h4IGHMygZV DAOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V8rESgnRRVosu5hPSZc35M3ikXmcWBK5NfYg41ecw5c=; b=ZBp5NYdbS6QeT8MhnTmhBirsxJuSAVA9zyE1AnhSby5sluLYV2N+Negfs6HcFQEYEl nB4hX2GV5tFGs0wfyysZMV1LCghc7oHepjtZYDhVH4evaJjWoGNDtC5vPLEjCiZecRFC dnIXvw1apRS3Sw+zLNOVnSdzouMjlZ7U43qHTnLinhYAfs/WhwZkWrvDT2uphf41C6Fc X9A8Un/Xtb4nmNTEl6RMz7SJHPgS4T96AznYv33CGYY6ev0bRsd41XSwHf2JM/rQR3pD Fb9D7xVmwIT+TApF0sOgzJnHA51ArAWwaguT6xb/R8iqgxYZ6dtSUrInA+KIPayH0Crd EU7g== X-Gm-Message-State: AOAM533WDCNaJ1AGsMAdrxiUQttjKY7rSQwfuIZPlI+RHvODz++QS/i6 mWS3+08spyCi+U7yAXn90C//Tw== X-Google-Smtp-Source: ABdhPJwM9U2Rklxk8YNFWBlR+9dB4/9mjYDp0kY7KH/RjKqVlCMK1g1Xgo8ACtEY6qXy+WHwP/cwTw== X-Received: by 2002:a5d:67cb:0:b0:204:674:fd12 with SMTP id n11-20020a5d67cb000000b002040674fd12mr9447051wrw.528.1648217097627; Fri, 25 Mar 2022 07:04:57 -0700 (PDT) Received: from gojira.dev.6wind.com ([185.13.181.2]) by smtp.gmail.com with ESMTPSA id o8-20020a5d6488000000b002051f1028f6sm6347642wri.111.2022.03.25.07.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 07:04:56 -0700 (PDT) From: Olivier Matz To: netdev@vger.kernel.org Cc: Jesse Brandeburg , Tony Nguyen , "David S . Miller" , Jakub Kicinski , Paolo Abeni , stable@vger.kernel.org, Hiroshi Shimamoto , Nicolas Dichtel Subject: [PATCH net 2/2] ixgbe: fix unexpected VLAN Rx in promisc mode on VF Date: Fri, 25 Mar 2022 15:02:50 +0100 Message-Id: <20220325140250.21663-3-olivier.matz@6wind.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220325140250.21663-1-olivier.matz@6wind.com> References: <20220325140250.21663-1-olivier.matz@6wind.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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: Hiroshi Shimamoto Cc: Nicolas Dichtel Signed-off-by: Olivier Matz --- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c index 8d108a78941b..d4e63f0644c3 100644 --- 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(struct ixgbe_adapter *adapter, 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;