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 9ED80A0C4C for ; Mon, 12 Jul 2021 15:12:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96CE34069D; Mon, 12 Jul 2021 15:12:06 +0200 (CEST) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mails.dpdk.org (Postfix) with ESMTP id 3E5E34069E for ; Mon, 12 Jul 2021 15:12:05 +0200 (CEST) Received: by mail-wm1-f46.google.com with SMTP id y21-20020a7bc1950000b02902161fccabf1so11216480wmi.2 for ; Mon, 12 Jul 2021 06:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mNyNfJVYErzBs9LVUY5+FIbs6I8Gsd6129hdutZ4tlI=; b=MlaI4AmZCHXvgMeM3D13E/mlP2gm/XGWme0cJntN4etlVjF2pzseT6jZ1NTHeirDjk Qwo/mxIa6ayA7cz/NodAbHRgv05+WEZb4ofnXkSDsFdnqAW+NjnBjRXjCym8/hSVnKRS oQv45ulVw4xk8/5AefZnIsm/hCbgEXgJJIRsZNZ2xyo5m13Vtx/bHh1b74sSckXAGPEH CfFne1fSt+e8aTooWxfiT9/UAWH9TPFVA6ja9ueQC+iRVB6+aY3Wejx66cshy5Lx9SJI xkCygQxqV72FlNNRzJec2KoXXtxqb4045J0GvXyAIaJv+C4Gjbav0CKtRA1a4JwA9g7a ijJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mNyNfJVYErzBs9LVUY5+FIbs6I8Gsd6129hdutZ4tlI=; b=dSS+zDKjiqlyUba+OnQLVGGpEqW6XQPIq81tBR6Iv3+RgX1v26s6vF+VTwNL7gXsQF rgmMF0Dv0JLsuHcBU5qYciNpxIFv9e8i1lT/bDq4jgQ1tQWxZIC2zLD4Kw5CcR/F4Src XR6B4r8CeLP69MFqEgGhuZUCVTdJOClVUyLLCwPxbF1Pa9xT2PJ1NXoaEqen4mx0PwoN FnQdtEBpbnXAiqvCJpejmeuzvJgQb6TOqtzrJSiDX3qG/y7qh0MW1xlega/HAmUMfSE0 wCo72nx2y1GU34u9IoU1zuNeu6b4oAldfDb/jRxfD3gqkrFSmDhbb79q7b+KWqCIEBtT JzgQ== X-Gm-Message-State: AOAM530asgO1ZhMTLd1SiG0wqXRXprLGFq3XWiYPfOyB5pri7opNExOL UFe3vGHszM8ZpG2HswtnkSj2pQcU3Dn/NQ== X-Google-Smtp-Source: ABdhPJwyLn/+4ZiKNjRAH3syVTqnyINc5jXirJMSsm3kWm3X/SuZ+E5E+VNm638wjt7QRbjvz3x/Bg== X-Received: by 2002:a05:600c:cb:: with SMTP id u11mr31311002wmm.66.1626095525058; Mon, 12 Jul 2021 06:12:05 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id u15sm19744393wmq.48.2021.07.12.06.12.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:12:04 -0700 (PDT) From: luca.boccassi@gmail.com To: Viacheslav Ovsiienko Cc: Matan Azrad , dpdk stable Date: Mon, 12 Jul 2021 14:04:33 +0100 Message-Id: <20210712130551.2462159-38-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix switchdev mode recognition' has been queued to stable release 20.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/2bff62754f101af9e7d60a8dc9ab5b2603c3daaa Thanks. Luca Boccassi --- >From 2bff62754f101af9e7d60a8dc9ab5b2603c3daaa Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Fri, 11 Jun 2021 18:37:19 +0300 Subject: [PATCH] net/mlx5: fix switchdev mode recognition [ upstream commit 6b157f3bfa64b734a069772bdbb4a3d3a8d26b83 ] The new kernels might add the switch_id attribute to the Netlink replies and this caused the wrong recognition of the E-Switch presence. The single uplink device was erroneously recognized as master and it caused the extending match for source vport index on all installed flows, including the default ones, and adding extra hops in the steering engine, that affected the maximal throughput packet rate. The extra check for the new device name format (it supposes the new kernel) and the device is only one is added. If this check succeeds the E-Switch presence is considered as wrongly detected and overridden. Fixes: 30a86157f6d5 ("net/mlx5: support PF representor") Signed-off-by: Viacheslav Ovsiienko Acked-by: Matan Azrad --- drivers/net/mlx5/linux/mlx5_os.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 800df92997..71837e34fe 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -2114,6 +2114,18 @@ mlx5_os_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, ret = -rte_errno; goto exit; } + /* + * New kernels may add the switch_id attribute for the case + * there is no E-Switch and we wrongly recognized the + * only device as master. Override this if there is the + * single device with single port and new device name + * format present. + */ + if (nd == 1 && + list[0].info.name_type == MLX5_PHYS_PORT_NAME_TYPE_UPLINK) { + list[0].info.master = 0; + list[0].info.representor = 0; + } } MLX5_ASSERT(ns); /* -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:38.655304661 +0100 +++ 0038-net-mlx5-fix-switchdev-mode-recognition.patch 2021-07-12 13:41:36.314118944 +0100 @@ -1 +1 @@ -From 6b157f3bfa64b734a069772bdbb4a3d3a8d26b83 Mon Sep 17 00:00:00 2001 +From 2bff62754f101af9e7d60a8dc9ab5b2603c3daaa Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6b157f3bfa64b734a069772bdbb4a3d3a8d26b83 ] + @@ -21 +22,0 @@ -Cc: stable@dpdk.org @@ -30 +31 @@ -index 534a56a555..302a881310 100644 +index 800df92997..71837e34fe 100644 @@ -33 +34 @@ -@@ -2298,6 +2298,18 @@ mlx5_os_pci_probe_pf(struct rte_pci_device *pci_dev, +@@ -2114,6 +2114,18 @@ mlx5_os_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,