DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/2] net/cxgbe: minor fixes for link related changes
@ 2021-01-15 17:19 Rahul Lakkireddy
  2021-01-15 17:19 ` [dpdk-dev] [PATCH 1/2] net/cxgbe: do not link down for every link config change Rahul Lakkireddy
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rahul Lakkireddy @ 2021-01-15 17:19 UTC (permalink / raw)
  To: dev; +Cc: kaara.satwik

Patch 1 fixes issue with link status always getting set to down by
driver for every link config change request. This is not required
for some link config changes, like Tx/Rx pause on/off. Instead,
driver should rely on actual link status returned by firmware in
link config change reply.

Patch 2 fixes issue with link FEC retraining during probe. If
firmware had already saved FEC before probe is completed, then
use the saved FEC for further link configuration, instead of
triggering link retraining. Also simplifies get fec ops.

Thanks,
Rahul

Rahul Lakkireddy (2):
  net/cxgbe: do not link down for every link config change
  net/cxgbe: avoid link FEC retraining during probe

 drivers/net/cxgbe/base/t4_hw.c   | 17 ++++++++++++-----
 drivers/net/cxgbe/cxgbe_ethdev.c | 21 +++++----------------
 2 files changed, 17 insertions(+), 21 deletions(-)

-- 
2.24.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH 1/2] net/cxgbe: do not link down for every link config change
  2021-01-15 17:19 [dpdk-dev] [PATCH 0/2] net/cxgbe: minor fixes for link related changes Rahul Lakkireddy
@ 2021-01-15 17:19 ` Rahul Lakkireddy
  2021-01-15 17:19 ` [dpdk-dev] [PATCH 2/2] net/cxgbe: avoid link FEC retraining during probe Rahul Lakkireddy
  2021-01-19  1:52 ` [dpdk-dev] [PATCH 0/2] net/cxgbe: minor fixes for link related changes Ferruh Yigit
  2 siblings, 0 replies; 4+ messages in thread
From: Rahul Lakkireddy @ 2021-01-15 17:19 UTC (permalink / raw)
  To: dev; +Cc: kaara.satwik

Some commands like turning local Tx/Rx pause on/off do not need link
to go down. If there are issues with link config params, then the
firmware will explicitly indicate link down in reply. So, don't always
link down for every link config param change request. Instead, rely
on actual link status coming in firmware's link config change reply.

Fixes: 61570952b138 ("net/cxgbe: rework and simplify link handling code")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/base/t4_hw.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c
index e87823f8f..8587eec60 100644
--- a/drivers/net/cxgbe/base/t4_hw.c
+++ b/drivers/net/cxgbe/base/t4_hw.c
@@ -2844,14 +2844,12 @@ int t4_link_l1cfg_core(struct port_info *pi, u32 caps, u8 sleep_ok)
 	else
 		ret = t4_wr_mbox_ns(adap, adap->mbox, &cmd, sizeof(cmd), NULL);
 
-	if (ret == FW_SUCCESS) {
-		lc->link_ok = 0;
+	if (ret == FW_SUCCESS)
 		lc->link_caps = caps;
-	} else {
+	else
 		dev_err(adap,
 			"Requested Port Capabilities %#x rejected, error %d\n",
 			caps, ret);
-	}
 
 	return ret;
 }
-- 
2.24.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH 2/2] net/cxgbe: avoid link FEC retraining during probe
  2021-01-15 17:19 [dpdk-dev] [PATCH 0/2] net/cxgbe: minor fixes for link related changes Rahul Lakkireddy
  2021-01-15 17:19 ` [dpdk-dev] [PATCH 1/2] net/cxgbe: do not link down for every link config change Rahul Lakkireddy
@ 2021-01-15 17:19 ` Rahul Lakkireddy
  2021-01-19  1:52 ` [dpdk-dev] [PATCH 0/2] net/cxgbe: minor fixes for link related changes Ferruh Yigit
  2 siblings, 0 replies; 4+ messages in thread
From: Rahul Lakkireddy @ 2021-01-15 17:19 UTC (permalink / raw)
  To: dev; +Cc: kaara.satwik

If link FEC has already been saved by firmware during link training
in probe, then use the saved FEC value, instead of retraining the
link. If link training is still not complete in probe, then firmware
will send the actual FEC later in link config change reply after
training is complete.

Also, there can only be 1 active FEC at any time. So, simplify the
FEC get ops. If FEC is supported and if none of the supported FEC
caps are set, then assume NOFEC by default, instead of AUTO.

Fixes: b99a547371e3 ("net/cxgbe: support configuring link FEC")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/base/t4_hw.c   | 11 ++++++++++-
 drivers/net/cxgbe/cxgbe_ethdev.c | 21 +++++----------------
 2 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c
index 8587eec60..ef20dc667 100644
--- a/drivers/net/cxgbe/base/t4_hw.c
+++ b/drivers/net/cxgbe/base/t4_hw.c
@@ -4700,6 +4700,7 @@ void t4_reset_link_config(struct adapter *adap, int idx)
 void t4_init_link_config(struct port_info *pi, u32 pcaps, u32 acaps,
 			 u8 mdio_addr, u8 port_type, u8 mod_type)
 {
+	u8 fec_rs = 0, fec_baser = 0, fec_none = 0;
 	struct link_config *lc = &pi->link_cfg;
 
 	lc->pcaps = pcaps;
@@ -4722,8 +4723,16 @@ void t4_init_link_config(struct port_info *pi, u32 pcaps, u32 acaps,
 
 	/* Reset FEC caps to default values */
 	if (lc->pcaps & V_FW_PORT_CAP32_FEC(M_FW_PORT_CAP32_FEC)) {
+		if (lc->acaps & FW_PORT_CAP32_FEC_RS)
+			fec_rs = 1;
+		else if (lc->acaps & FW_PORT_CAP32_FEC_BASER_RS)
+			fec_baser = 1;
+		else
+			fec_none = 1;
+
 		lc->admin_caps &= ~V_FW_PORT_CAP32_FEC(M_FW_PORT_CAP32_FEC);
-		t4_set_link_fec(pi, 0, 0, 0, &lc->admin_caps);
+		t4_set_link_fec(pi, fec_rs, fec_baser, fec_none,
+				&lc->admin_caps);
 	}
 
 	if (lc->pcaps & FW_PORT_CAP32_FORCE_FEC)
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 6f481551d..eb4258fe1 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -1256,24 +1256,13 @@ static int cxgbe_fec_get(struct rte_eth_dev *dev, uint32_t *fec_capa)
 	if (!(lc->pcaps & V_FW_PORT_CAP32_FEC(M_FW_PORT_CAP32_FEC)))
 		return -EOPNOTSUPP;
 
-	if (caps & FW_PORT_CAP32_FEC_NO_FEC) {
-		fec_caps = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
-		goto out;
-	}
-
-	if (caps & FW_PORT_CAP32_FEC_BASER_RS) {
-		fec_caps = RTE_ETH_FEC_MODE_CAPA_MASK(BASER);
-		goto out;
-	}
-
-	if (caps & FW_PORT_CAP32_FEC_RS) {
+	if (caps & FW_PORT_CAP32_FEC_RS)
 		fec_caps = RTE_ETH_FEC_MODE_CAPA_MASK(RS);
-		goto out;
-	}
-
-	fec_caps = RTE_ETH_FEC_MODE_CAPA_MASK(AUTO);
+	else if (caps & FW_PORT_CAP32_FEC_BASER_RS)
+		fec_caps = RTE_ETH_FEC_MODE_CAPA_MASK(BASER);
+	else
+		fec_caps = RTE_ETH_FEC_MODE_CAPA_MASK(NOFEC);
 
-out:
 	*fec_capa = fec_caps;
 	return 0;
 }
-- 
2.24.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH 0/2] net/cxgbe: minor fixes for link related changes
  2021-01-15 17:19 [dpdk-dev] [PATCH 0/2] net/cxgbe: minor fixes for link related changes Rahul Lakkireddy
  2021-01-15 17:19 ` [dpdk-dev] [PATCH 1/2] net/cxgbe: do not link down for every link config change Rahul Lakkireddy
  2021-01-15 17:19 ` [dpdk-dev] [PATCH 2/2] net/cxgbe: avoid link FEC retraining during probe Rahul Lakkireddy
@ 2021-01-19  1:52 ` Ferruh Yigit
  2 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2021-01-19  1:52 UTC (permalink / raw)
  To: Rahul Lakkireddy, dev; +Cc: kaara.satwik

On 1/15/2021 5:19 PM, Rahul Lakkireddy wrote:
> Patch 1 fixes issue with link status always getting set to down by
> driver for every link config change request. This is not required
> for some link config changes, like Tx/Rx pause on/off. Instead,
> driver should rely on actual link status returned by firmware in
> link config change reply.
> 
> Patch 2 fixes issue with link FEC retraining during probe. If
> firmware had already saved FEC before probe is completed, then
> use the saved FEC for further link configuration, instead of
> triggering link retraining. Also simplifies get fec ops.
> 
> Thanks,
> Rahul
> 
> Rahul Lakkireddy (2):
>    net/cxgbe: do not link down for every link config change
>    net/cxgbe: avoid link FEC retraining during probe
> 
>   drivers/net/cxgbe/base/t4_hw.c   | 17 ++++++++++++-----
>   drivers/net/cxgbe/cxgbe_ethdev.c | 21 +++++----------------
>   2 files changed, 17 insertions(+), 21 deletions(-)
> 


Set squashed into relevant commits in next-net, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-19  1:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 17:19 [dpdk-dev] [PATCH 0/2] net/cxgbe: minor fixes for link related changes Rahul Lakkireddy
2021-01-15 17:19 ` [dpdk-dev] [PATCH 1/2] net/cxgbe: do not link down for every link config change Rahul Lakkireddy
2021-01-15 17:19 ` [dpdk-dev] [PATCH 2/2] net/cxgbe: avoid link FEC retraining during probe Rahul Lakkireddy
2021-01-19  1:52 ` [dpdk-dev] [PATCH 0/2] net/cxgbe: minor fixes for link related changes Ferruh Yigit

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git