From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 61A94A0553 for ; Mon, 17 Feb 2020 18:47:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5AD721DAA7; Mon, 17 Feb 2020 18:47:11 +0100 (CET) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 0C0401DA12 for ; Mon, 17 Feb 2020 18:47:10 +0100 (CET) Received: by mail-wm1-f67.google.com with SMTP id t14so173598wmi.5 for ; Mon, 17 Feb 2020 09:47:10 -0800 (PST) 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=0fE13bKvnORJXQvYxkR2TYsXxg3AYnwv72kBVb5Tldw=; b=BucEBxisifEZoTefse2GRaroVdrgHN0KUxO09KY0AM6InmFyua0CURR0/nkDxYFV/n rN0wbAfmXXDn1ZHDjl0kg6NSIgbcjihIcUnct9VCd34rK4MtAxJqY/5S3vsm0O5xjldw MS59NXqrS4rzAWiOkGaXY8dtDgoFfB3i4KdxmsfjsgSIW7eyuIcbu/nfJTyTK8nU/MJg KLxC4L+g347MbGhraxnux9pZ3Pxrd6INHFjMJPDerkDepruvnJCvwU7ejboKxw5lnJ6T hvj/ofjYdMsi8RD9uHbxJ14ttyivBupqIXiZYjP+ZnWZ71NbhMQWKKOeVz0YHEQW83tV wN2Q== 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=0fE13bKvnORJXQvYxkR2TYsXxg3AYnwv72kBVb5Tldw=; b=Odp3rcjPmcMs/KxG1CXP9Oz0Fvwax9jr3Rykol00HfwSbY7e10unsHUvjk0zkH1y+w 5NjoQGkg8r5apdiVCc6pIcnn/v3D47xm3uvWlVFKGbHqO4N90jY1q6krEKZThyp+8HH9 Cf/8YkvI8mfrBLFXcBSwXYTPC1FBePtooP8wsSDL175kkl3rGRk+uIMq/eq6qkEnWnGR g3S8bOQJN6sgitaNU5E2RcrSmvfboPPIbyyAWvCdNG1zfzjjx+bRCGyLgNmVTZDmN2S6 /tPWCtkaJGHcSIAo0axeDRQQrSNry/+9udng2/3gACP7bdEphih5D990YLhoBXY0zVlT NI3A== X-Gm-Message-State: APjAAAVF25xDCPfPDX1YCcUKMv2t02JyZf7/XAlw53/hJlOfsdtQZVa0 wNQSsLB9nEtRZtzd3ZlyjXyAgL9/v1h70Q== X-Google-Smtp-Source: APXvYqyW9KSdW6bTmhzV0VYjmRmJXs64GKgErAUGpq+whE1FXFevA43jmp7kxZRLGybwsBdHo6sUqw== X-Received: by 2002:a1c:9646:: with SMTP id y67mr181441wmd.42.1581961629714; Mon, 17 Feb 2020 09:47:09 -0800 (PST) Received: from localhost (userh634.uk.uudial.com. [194.69.103.7]) by smtp.gmail.com with ESMTPSA id y8sm209909wma.10.2020.02.17.09.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 09:47:09 -0800 (PST) From: luca.boccassi@gmail.com To: Vamsi Attunuru Cc: Jerin Jacob , dpdk stable Date: Mon, 17 Feb 2020 17:45:39 +0000 Message-Id: <20200217174546.25334-47-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200217174546.25334-1-luca.boccassi@gmail.com> References: <20200211112216.3929-190-luca.boccassi@gmail.com> <20200217174546.25334-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/octeontx2: fix flow control initial state' has been queued to stable release 19.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 19.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/19/20. 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. Thanks. Luca Boccassi --- >From cf55204d8141dd100818ffc5955ec03e9fa3201d Mon Sep 17 00:00:00 2001 From: Vamsi Attunuru Date: Thu, 6 Feb 2020 09:57:13 +0530 Subject: [PATCH] net/octeontx2: fix flow control initial state [ upstream commit 29bb974576a559daa96fc7894aaa432014ed12f2 ] Currently when application requests for RTE_FC_NONE earlier than PMD's internal fc mode update, flow control set routine is returning without updating the flow control state. Patch updates the PMD's internal fc mode details during dev_configure to ensure any flow control set requests issued later are handled properly. Fixes: 609945f1ce90 ("net/octeontx2: support flow control") Signed-off-by: Vamsi Attunuru Acked-by: Jerin Jacob --- drivers/net/octeontx2/otx2_ethdev.c | 6 +++++ drivers/net/octeontx2/otx2_ethdev.h | 2 ++ drivers/net/octeontx2/otx2_flow_ctrl.c | 35 +++++++++++++++++++++++--- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index 268b383dbd..c86165b5ec 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -1721,6 +1721,12 @@ otx2_nix_configure(struct rte_eth_dev *eth_dev) goto cq_fini; } + rc = otx2_nix_flow_ctrl_init(eth_dev); + if (rc) { + otx2_err("Failed to init flow ctrl mode %d", rc); + goto cq_fini; + } + rc = otx2_nix_mc_addr_list_install(eth_dev); if (rc < 0) { otx2_err("Failed to install mc address list rc=%d", rc); diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h index 987e7607c4..483535ab12 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -504,6 +504,8 @@ int otx2_cgx_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr); /* Flow Control */ +int otx2_nix_flow_ctrl_init(struct rte_eth_dev *eth_dev); + int otx2_nix_flow_ctrl_get(struct rte_eth_dev *eth_dev, struct rte_eth_fc_conf *fc_conf); diff --git a/drivers/net/octeontx2/otx2_flow_ctrl.c b/drivers/net/octeontx2/otx2_flow_ctrl.c index 1c6929e764..76bf481001 100644 --- a/drivers/net/octeontx2/otx2_flow_ctrl.c +++ b/drivers/net/octeontx2/otx2_flow_ctrl.c @@ -200,16 +200,14 @@ int otx2_nix_update_flow_ctrl_mode(struct rte_eth_dev *eth_dev) { struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); + struct otx2_fc_info *fc = &dev->fc_info; struct rte_eth_fc_conf fc_conf; if (otx2_dev_is_lbk(dev) || otx2_dev_is_sdp(dev)) return 0; memset(&fc_conf, 0, sizeof(struct rte_eth_fc_conf)); - /* Both Rx & Tx flow ctrl get enabled(RTE_FC_FULL) in HW - * by AF driver, update those info in PMD structure. - */ - otx2_nix_flow_ctrl_get(eth_dev, &fc_conf); + fc_conf.mode = fc->mode; /* To avoid Link credit deadlock on Ax, disable Tx FC if it's enabled */ if (otx2_dev_is_Ax(dev) && @@ -223,3 +221,32 @@ otx2_nix_update_flow_ctrl_mode(struct rte_eth_dev *eth_dev) return otx2_nix_flow_ctrl_set(eth_dev, &fc_conf); } + +int +otx2_nix_flow_ctrl_init(struct rte_eth_dev *eth_dev) +{ + struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); + struct otx2_fc_info *fc = &dev->fc_info; + struct rte_eth_fc_conf fc_conf; + int rc; + + if (otx2_dev_is_lbk(dev) || otx2_dev_is_sdp(dev)) + return 0; + + memset(&fc_conf, 0, sizeof(struct rte_eth_fc_conf)); + /* Both Rx & Tx flow ctrl get enabled(RTE_FC_FULL) in HW + * by AF driver, update those info in PMD structure. + */ + rc = otx2_nix_flow_ctrl_get(eth_dev, &fc_conf); + if (rc) + goto exit; + + fc->mode = fc_conf.mode; + fc->rx_pause = (fc_conf.mode == RTE_FC_FULL) || + (fc_conf.mode == RTE_FC_RX_PAUSE); + fc->tx_pause = (fc_conf.mode == RTE_FC_FULL) || + (fc_conf.mode == RTE_FC_TX_PAUSE); + +exit: + return rc; +} -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-17 17:00:16.623703703 +0000 +++ 0047-net-octeontx2-fix-flow-control-initial-state.patch 2020-02-17 17:00:15.375951419 +0000 @@ -1,8 +1,10 @@ -From 29bb974576a559daa96fc7894aaa432014ed12f2 Mon Sep 17 00:00:00 2001 +From cf55204d8141dd100818ffc5955ec03e9fa3201d Mon Sep 17 00:00:00 2001 From: Vamsi Attunuru Date: Thu, 6 Feb 2020 09:57:13 +0530 Subject: [PATCH] net/octeontx2: fix flow control initial state +[ upstream commit 29bb974576a559daa96fc7894aaa432014ed12f2 ] + Currently when application requests for RTE_FC_NONE earlier than PMD's internal fc mode update, flow control set routine is returning without updating the flow control state. @@ -12,7 +14,6 @@ issued later are handled properly. Fixes: 609945f1ce90 ("net/octeontx2: support flow control") -Cc: stable@dpdk.org Signed-off-by: Vamsi Attunuru Acked-by: Jerin Jacob @@ -23,12 +24,12 @@ 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c -index e18435d494..e60f4901c4 100644 +index 268b383dbd..c86165b5ec 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c -@@ -1744,6 +1744,12 @@ otx2_nix_configure(struct rte_eth_dev *eth_dev) - if (rc) +@@ -1721,6 +1721,12 @@ otx2_nix_configure(struct rte_eth_dev *eth_dev) goto cq_fini; + } + rc = otx2_nix_flow_ctrl_init(eth_dev); + if (rc) { @@ -40,10 +41,10 @@ if (rc < 0) { otx2_err("Failed to install mc address list rc=%d", rc); diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h -index 5cb5953dcd..e5684f9f00 100644 +index 987e7607c4..483535ab12 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h -@@ -511,6 +511,8 @@ int otx2_cgx_mac_addr_set(struct rte_eth_dev *eth_dev, +@@ -504,6 +504,8 @@ int otx2_cgx_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *addr); /* Flow Control */