DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] Fixes for txgbe
@ 2021-08-12  2:00 Jiawen Wu
  2021-08-12  2:00 ` [dpdk-dev] [PATCH 1/3] net/txgbe: fix link status when device stopped Jiawen Wu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jiawen Wu @ 2021-08-12  2:00 UTC (permalink / raw)
  To: dev; +Cc: Jiawen Wu

These patches fix link status, module info and flow director.

Jiawen Wu (3):
  net/txgbe: fix link status when device stopped
  net/txgbe: fix to read SFP module's SFF-8472 data
  net/txgbe: fix L4 port mask in FDIR

 drivers/net/txgbe/base/txgbe_phy.c  | 18 +++++++-----------
 drivers/net/txgbe/base/txgbe_type.h |  1 +
 drivers/net/txgbe/txgbe_ethdev.c    |  4 ++++
 drivers/net/txgbe/txgbe_ethdev_vf.c |  2 ++
 drivers/net/txgbe/txgbe_fdir.c      | 18 +++---------------
 5 files changed, 17 insertions(+), 26 deletions(-)

-- 
2.21.0.windows.1




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

* [dpdk-dev] [PATCH 1/3] net/txgbe: fix link status when device stopped
  2021-08-12  2:00 [dpdk-dev] [PATCH 0/3] Fixes for txgbe Jiawen Wu
@ 2021-08-12  2:00 ` Jiawen Wu
  2021-08-12  2:00 ` [dpdk-dev] [PATCH 2/3] net/txgbe: fix to read SFP module's SFF-8472 data Jiawen Wu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jiawen Wu @ 2021-08-12  2:00 UTC (permalink / raw)
  To: dev; +Cc: Jiawen Wu, stable

When device is stopped, the port status is not changed and only the Tx
laser is turned off by hardware design.

Fixes: 0c061eadec59 ("net/txgbe: add link status change")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/base/txgbe_type.h | 1 +
 drivers/net/txgbe/txgbe_ethdev.c    | 4 ++++
 drivers/net/txgbe/txgbe_ethdev_vf.c | 2 ++
 3 files changed, 7 insertions(+)

diff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h
index 823c6756e7..d95467f9f8 100644
--- a/drivers/net/txgbe/base/txgbe_type.h
+++ b/drivers/net/txgbe/base/txgbe_type.h
@@ -781,6 +781,7 @@ struct txgbe_hw {
 	int api_version;
 	bool allow_unsupported_sfp;
 	bool need_crosstalk_fix;
+	bool dev_start;
 	struct txgbe_devargs devarg;
 
 	uint64_t isb_dma;
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index e62675520a..0063994688 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -1664,6 +1664,7 @@ txgbe_dev_start(struct rte_eth_dev *dev)
 		return -1;
 	hw->mac.start_hw(hw);
 	hw->mac.get_link_status = true;
+	hw->dev_start = true;
 
 	/* configure PF module if SRIOV enabled */
 	txgbe_pf_host_configure(dev);
@@ -1933,6 +1934,7 @@ txgbe_dev_stop(struct rte_eth_dev *dev)
 
 	hw->adapter_stopped = true;
 	dev->data->dev_started = 0;
+	hw->dev_start = false;
 
 	return 0;
 }
@@ -2735,6 +2737,8 @@ txgbe_dev_link_update_share(struct rte_eth_dev *dev,
 				txgbe_dev_setup_link_alarm_handler, dev);
 		}
 		return rte_eth_linkstatus_set(dev, &link);
+	} else if (!hw->dev_start) {
+		return rte_eth_linkstatus_set(dev, &link);
 	}
 
 	intr->flags &= ~TXGBE_FLAG_NEED_LINK_CONFIG;
diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c
index 0bae6ffd1f..18ed94bd27 100644
--- a/drivers/net/txgbe/txgbe_ethdev_vf.c
+++ b/drivers/net/txgbe/txgbe_ethdev_vf.c
@@ -628,6 +628,7 @@ txgbevf_dev_start(struct rte_eth_dev *dev)
 		return err;
 	}
 	hw->mac.get_link_status = true;
+	hw->dev_start = true;
 
 	/* negotiate mailbox API version to use with the PF. */
 	txgbevf_negotiate_api(hw);
@@ -749,6 +750,7 @@ txgbevf_dev_stop(struct rte_eth_dev *dev)
 	}
 
 	adapter->rss_reta_updated = 0;
+	hw->dev_start = false;
 
 	return 0;
 }
-- 
2.21.0.windows.1




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

* [dpdk-dev] [PATCH 2/3] net/txgbe: fix to read SFP module's SFF-8472 data
  2021-08-12  2:00 [dpdk-dev] [PATCH 0/3] Fixes for txgbe Jiawen Wu
  2021-08-12  2:00 ` [dpdk-dev] [PATCH 1/3] net/txgbe: fix link status when device stopped Jiawen Wu
@ 2021-08-12  2:00 ` Jiawen Wu
  2021-08-12  2:00 ` [dpdk-dev] [PATCH 3/3] net/txgbe: fix L4 port mask in FDIR Jiawen Wu
  2021-08-18 14:06 ` [dpdk-dev] [PATCH 0/3] Fixes for txgbe Ferruh Yigit
  3 siblings, 0 replies; 5+ messages in thread
From: Jiawen Wu @ 2021-08-12  2:00 UTC (permalink / raw)
  To: dev; +Cc: Jiawen Wu, stable

Fix the I2C target address selection to read SFP module's SFF-8472 data.

Fixes: 8f09fb4642fa ("net/txgbe: add module identify")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/base/txgbe_phy.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/net/txgbe/base/txgbe_phy.c b/drivers/net/txgbe/base/txgbe_phy.c
index 3e9f507212..2db87ae0c5 100644
--- a/drivers/net/txgbe/base/txgbe_phy.c
+++ b/drivers/net/txgbe/base/txgbe_phy.c
@@ -8,7 +8,7 @@
 #include "txgbe_mng.h"
 #include "txgbe_phy.h"
 
-static void txgbe_i2c_start(struct txgbe_hw *hw);
+static void txgbe_i2c_start(struct txgbe_hw *hw, u8 dev_addr);
 static void txgbe_i2c_stop(struct txgbe_hw *hw);
 static s32 txgbe_handle_bp_flow(u32 link_mode, struct txgbe_hw *hw);
 static void txgbe_get_bp_ability(struct txgbe_backplane_ability *ability,
@@ -1248,11 +1248,9 @@ s32 txgbe_write_i2c_eeprom(struct txgbe_hw *hw, u8 byte_offset,
 s32 txgbe_read_i2c_byte_unlocked(struct txgbe_hw *hw, u8 byte_offset,
 					   u8 dev_addr, u8 *data)
 {
-	UNREFERENCED_PARAMETER(dev_addr);
-
 	DEBUGFUNC("txgbe_read_i2c_byte");
 
-	txgbe_i2c_start(hw);
+	txgbe_i2c_start(hw, dev_addr);
 
 	/* wait tx empty */
 	if (!po32m(hw, TXGBE_I2CICR, TXGBE_I2CICR_TXEMPTY,
@@ -1314,11 +1312,9 @@ s32 txgbe_read_i2c_byte(struct txgbe_hw *hw, u8 byte_offset,
 s32 txgbe_write_i2c_byte_unlocked(struct txgbe_hw *hw, u8 byte_offset,
 					    u8 dev_addr, u8 data)
 {
-	UNREFERENCED_PARAMETER(dev_addr);
-
 	DEBUGFUNC("txgbe_write_i2c_byte");
 
-	txgbe_i2c_start(hw);
+	txgbe_i2c_start(hw, dev_addr);
 
 	/* wait tx empty */
 	if (!po32m(hw, TXGBE_I2CICR, TXGBE_I2CICR_TXEMPTY,
@@ -1369,7 +1365,7 @@ s32 txgbe_write_i2c_byte(struct txgbe_hw *hw, u8 byte_offset,
  *
  *  Sets I2C start condition (High -> Low on SDA while SCL is High)
  **/
-static void txgbe_i2c_start(struct txgbe_hw *hw)
+static void txgbe_i2c_start(struct txgbe_hw *hw, u8 dev_addr)
 {
 	DEBUGFUNC("txgbe_i2c_start");
 
@@ -1380,9 +1376,9 @@ static void txgbe_i2c_start(struct txgbe_hw *hw)
 		TXGBE_I2CCON_SPEED(1) |
 		TXGBE_I2CCON_RESTART |
 		TXGBE_I2CCON_SDIA));
-	wr32(hw, TXGBE_I2CTAR, TXGBE_I2C_SLAVEADDR);
-	wr32(hw, TXGBE_I2CSSSCLHCNT, 600);
-	wr32(hw, TXGBE_I2CSSSCLLCNT, 600);
+	wr32(hw, TXGBE_I2CTAR, dev_addr >> 1);
+	wr32(hw, TXGBE_I2CSSSCLHCNT, 200);
+	wr32(hw, TXGBE_I2CSSSCLLCNT, 200);
 	wr32(hw, TXGBE_I2CRXTL, 0); /* 1byte for rx full signal */
 	wr32(hw, TXGBE_I2CTXTL, 4);
 	wr32(hw, TXGBE_I2CSCLTMOUT, 0xFFFFFF);
-- 
2.21.0.windows.1




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

* [dpdk-dev] [PATCH 3/3] net/txgbe: fix L4 port mask in FDIR
  2021-08-12  2:00 [dpdk-dev] [PATCH 0/3] Fixes for txgbe Jiawen Wu
  2021-08-12  2:00 ` [dpdk-dev] [PATCH 1/3] net/txgbe: fix link status when device stopped Jiawen Wu
  2021-08-12  2:00 ` [dpdk-dev] [PATCH 2/3] net/txgbe: fix to read SFP module's SFF-8472 data Jiawen Wu
@ 2021-08-12  2:00 ` Jiawen Wu
  2021-08-18 14:06 ` [dpdk-dev] [PATCH 0/3] Fixes for txgbe Ferruh Yigit
  3 siblings, 0 replies; 5+ messages in thread
From: Jiawen Wu @ 2021-08-12  2:00 UTC (permalink / raw)
  To: dev; +Cc: Jiawen Wu, stable

Remove bit reverse for TCP/UDP port mask, since it causes the flows with
some TCP/UDP ports to disobey the flow director rules.

Fixes: ea230dda16ad ("net/txgbe: configure flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/txgbe_fdir.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_fdir.c b/drivers/net/txgbe/txgbe_fdir.c
index c8ff4b142c..8abb862286 100644
--- a/drivers/net/txgbe/txgbe_fdir.c
+++ b/drivers/net/txgbe/txgbe_fdir.c
@@ -165,18 +165,6 @@ configure_fdir_flags(const struct rte_fdir_conf *conf,
 	return 0;
 }
 
-static inline uint32_t
-reverse_fdir_bmks(uint16_t hi_dword, uint16_t lo_dword)
-{
-	uint32_t mask = hi_dword << 16;
-
-	mask |= lo_dword;
-	mask = ((mask & 0x55555555) << 1) | ((mask & 0xAAAAAAAA) >> 1);
-	mask = ((mask & 0x33333333) << 2) | ((mask & 0xCCCCCCCC) >> 2);
-	mask = ((mask & 0x0F0F0F0F) << 4) | ((mask & 0xF0F0F0F0) >> 4);
-	return ((mask & 0x00FF00FF) << 8) | ((mask & 0xFF00FF00) >> 8);
-}
-
 int
 txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
 {
@@ -213,9 +201,9 @@ txgbe_fdir_set_input_mask(struct rte_eth_dev *dev)
 	/* TBD: don't support encapsulation yet */
 	wr32(hw, TXGBE_FDIRMSK, fdirm);
 
-	/* store the TCP/UDP port masks, bit reversed from port layout */
-	fdirtcpm = reverse_fdir_bmks(rte_be_to_cpu_16(info->mask.dst_port_mask),
-			rte_be_to_cpu_16(info->mask.src_port_mask));
+	/* store the TCP/UDP port masks */
+	fdirtcpm = rte_be_to_cpu_16(info->mask.dst_port_mask) << 16;
+	fdirtcpm |= rte_be_to_cpu_16(info->mask.src_port_mask);
 
 	/* write all the same so that UDP, TCP and SCTP use the same mask
 	 * (little-endian)
-- 
2.21.0.windows.1




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

* Re: [dpdk-dev] [PATCH 0/3] Fixes for txgbe
  2021-08-12  2:00 [dpdk-dev] [PATCH 0/3] Fixes for txgbe Jiawen Wu
                   ` (2 preceding siblings ...)
  2021-08-12  2:00 ` [dpdk-dev] [PATCH 3/3] net/txgbe: fix L4 port mask in FDIR Jiawen Wu
@ 2021-08-18 14:06 ` Ferruh Yigit
  3 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2021-08-18 14:06 UTC (permalink / raw)
  To: Jiawen Wu, dev

On 8/12/2021 3:00 AM, Jiawen Wu wrote:
> These patches fix link status, module info and flow director.
> 
> Jiawen Wu (3):
>   net/txgbe: fix link status when device stopped
>   net/txgbe: fix to read SFP module's SFF-8472 data
>   net/txgbe: fix L4 port mask in FDIR
> 

Series applied to dpdk-next-net/main, thanks.

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

end of thread, other threads:[~2021-08-18 14:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12  2:00 [dpdk-dev] [PATCH 0/3] Fixes for txgbe Jiawen Wu
2021-08-12  2:00 ` [dpdk-dev] [PATCH 1/3] net/txgbe: fix link status when device stopped Jiawen Wu
2021-08-12  2:00 ` [dpdk-dev] [PATCH 2/3] net/txgbe: fix to read SFP module's SFF-8472 data Jiawen Wu
2021-08-12  2:00 ` [dpdk-dev] [PATCH 3/3] net/txgbe: fix L4 port mask in FDIR Jiawen Wu
2021-08-18 14:06 ` [dpdk-dev] [PATCH 0/3] Fixes for txgbe Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).