DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/4] bug fixes for txgbe
@ 2021-03-04 10:06 Jiawen Wu
  2021-03-04 10:06 ` [dpdk-dev] [PATCH 1/4] net/txgbe: remove unused functions Jiawen Wu
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Jiawen Wu @ 2021-03-04 10:06 UTC (permalink / raw)
  To: dev; +Cc: Jiawen Wu

This series fix some bugs and remove unused functions.

Jiawen Wu (4):
  net/txgbe: remove unused functions
  net/txgbe: fix Rx missed packet counter
  net/txgbe: update packet type
  net/txgbe: fix the process of adding crypto SA

 drivers/net/txgbe/base/txgbe_eeprom.c | 76 +--------------------------
 drivers/net/txgbe/base/txgbe_eeprom.h |  2 -
 drivers/net/txgbe/base/txgbe_type.h   |  1 +
 drivers/net/txgbe/txgbe_ethdev.c      |  4 +-
 drivers/net/txgbe/txgbe_ipsec.c       |  6 +--
 drivers/net/txgbe/txgbe_ptypes.c      |  4 +-
 6 files changed, 12 insertions(+), 81 deletions(-)

-- 
2.21.0.windows.1




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

* [dpdk-dev] [PATCH 1/4] net/txgbe: remove unused functions
  2021-03-04 10:06 [dpdk-dev] [PATCH 0/4] bug fixes for txgbe Jiawen Wu
@ 2021-03-04 10:06 ` Jiawen Wu
  2021-03-04 10:06 ` [dpdk-dev] [PATCH 2/4] net/txgbe: fix Rx missed packet counter Jiawen Wu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Jiawen Wu @ 2021-03-04 10:06 UTC (permalink / raw)
  To: dev; +Cc: Jiawen Wu

Remove unused functions for EEPROM read and write.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/base/txgbe_eeprom.c | 76 +--------------------------
 drivers/net/txgbe/base/txgbe_eeprom.h |  2 -
 2 files changed, 2 insertions(+), 76 deletions(-)

diff --git a/drivers/net/txgbe/base/txgbe_eeprom.c b/drivers/net/txgbe/base/txgbe_eeprom.c
index 72cd3ff30..bcbf3503c 100644
--- a/drivers/net/txgbe/base/txgbe_eeprom.c
+++ b/drivers/net/txgbe/base/txgbe_eeprom.c
@@ -193,7 +193,7 @@ s32 txgbe_ee_read16(struct txgbe_hw *hw, u32 offset,
 }
 
 /**
- *  txgbe_ee_read_buffer- Read EEPROM word(s) using hostif
+ *  txgbe_ee_readw_buffer- Read EEPROM word(s) using hostif
  *  @hw: pointer to hardware structure
  *  @offset: offset of  word in the EEPROM to read
  *  @words: number of words
@@ -274,42 +274,6 @@ s32 txgbe_ee_read32(struct txgbe_hw *hw, u32 addr, u32 *data)
 	return err;
 }
 
-/**
- *  txgbe_ee_read_buffer - Read EEPROM byte(s) using hostif
- *  @hw: pointer to hardware structure
- *  @addr: offset of bytes in the EEPROM to read
- *  @len: number of bytes
- *  @data: byte(s) read from the EEPROM
- *
- *  Reads a 8 bit byte(s) from the EEPROM using the hostif.
- **/
-s32 txgbe_ee_read_buffer(struct txgbe_hw *hw,
-				     u32 addr, u32 len, void *data)
-{
-	const u32 mask = TXGBE_MNGSEM_SWMBX | TXGBE_MNGSEM_SWFLASH;
-	u8 *buf = (u8 *)data;
-	int err;
-
-	err = hw->mac.acquire_swfw_sync(hw, mask);
-	if (err)
-		return err;
-
-	while (len) {
-		u32 seg = (len <= TXGBE_PMMBX_DATA_SIZE
-				? len : TXGBE_PMMBX_DATA_SIZE);
-
-		err = txgbe_hic_sr_read(hw, addr, buf, seg);
-		if (err)
-			break;
-
-		len -= seg;
-		buf += seg;
-	}
-
-	hw->mac.release_swfw_sync(hw, mask);
-	return err;
-}
-
 /**
  *  txgbe_ee_write - Write EEPROM word using hostif
  *  @hw: pointer to hardware structure
@@ -339,7 +303,7 @@ s32 txgbe_ee_write16(struct txgbe_hw *hw, u32 offset,
 }
 
 /**
- *  txgbe_ee_write_buffer - Write EEPROM word(s) using hostif
+ *  txgbe_ee_writew_buffer - Write EEPROM word(s) using hostif
  *  @hw: pointer to hardware structure
  *  @offset: offset of  word in the EEPROM to write
  *  @words: number of words
@@ -420,42 +384,6 @@ s32 txgbe_ee_write32(struct txgbe_hw *hw, u32 addr, u32 data)
 	return err;
 }
 
-/**
- *  txgbe_ee_write_buffer - Write EEPROM byte(s) using hostif
- *  @hw: pointer to hardware structure
- *  @addr: offset of bytes in the EEPROM to write
- *  @len: number of bytes
- *  @data: word(s) write to the EEPROM
- *
- *  Write a 8 bit byte(s) to the EEPROM using the hostif.
- **/
-s32 txgbe_ee_write_buffer(struct txgbe_hw *hw,
-				      u32 addr, u32 len, void *data)
-{
-	const u32 mask = TXGBE_MNGSEM_SWMBX | TXGBE_MNGSEM_SWFLASH;
-	u8 *buf = (u8 *)data;
-	int err;
-
-	err = hw->mac.acquire_swfw_sync(hw, mask);
-	if (err)
-		return err;
-
-	while (len) {
-		u32 seg = (len <= TXGBE_PMMBX_DATA_SIZE
-				? len : TXGBE_PMMBX_DATA_SIZE);
-
-		err = txgbe_hic_sr_write(hw, addr, buf, seg);
-		if (err)
-			break;
-
-		len -= seg;
-		buf += seg;
-	}
-
-	hw->mac.release_swfw_sync(hw, mask);
-	return err;
-}
-
 /**
  *  txgbe_calc_eeprom_checksum - Calculates and returns the checksum
  *  @hw: pointer to hardware structure
diff --git a/drivers/net/txgbe/base/txgbe_eeprom.h b/drivers/net/txgbe/base/txgbe_eeprom.h
index d0e142dba..78b8af978 100644
--- a/drivers/net/txgbe/base/txgbe_eeprom.h
+++ b/drivers/net/txgbe/base/txgbe_eeprom.h
@@ -51,14 +51,12 @@ s32 txgbe_ee_readw_sw(struct txgbe_hw *hw, u32 offset, u16 *data);
 s32 txgbe_ee_readw_buffer(struct txgbe_hw *hw, u32 offset, u32 words,
 				void *data);
 s32 txgbe_ee_read32(struct txgbe_hw *hw, u32 addr, u32 *data);
-s32 txgbe_ee_read_buffer(struct txgbe_hw *hw, u32 addr, u32 len, void *data);
 
 s32 txgbe_ee_write16(struct txgbe_hw *hw, u32 offset, u16 data);
 s32 txgbe_ee_writew_sw(struct txgbe_hw *hw, u32 offset, u16 data);
 s32 txgbe_ee_writew_buffer(struct txgbe_hw *hw, u32 offset, u32 words,
 				void *data);
 s32 txgbe_ee_write32(struct txgbe_hw *hw, u32 addr, u32 data);
-s32 txgbe_ee_write_buffer(struct txgbe_hw *hw, u32 addr, u32 len, void *data);
 
 
 #endif /* _TXGBE_EEPROM_H_ */
-- 
2.21.0.windows.1




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

* [dpdk-dev] [PATCH 2/4] net/txgbe: fix Rx missed packet counter
  2021-03-04 10:06 [dpdk-dev] [PATCH 0/4] bug fixes for txgbe Jiawen Wu
  2021-03-04 10:06 ` [dpdk-dev] [PATCH 1/4] net/txgbe: remove unused functions Jiawen Wu
@ 2021-03-04 10:06 ` Jiawen Wu
  2021-03-04 10:06 ` [dpdk-dev] [PATCH 3/4] net/txgbe: update packet type Jiawen Wu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Jiawen Wu @ 2021-03-04 10:06 UTC (permalink / raw)
  To: dev; +Cc: Jiawen Wu

Add the Rx dropped packet counter into stats->imissed, to ensure the
stats correct.

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

diff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h
index ef8358ae3..2c8a3866a 100644
--- a/drivers/net/txgbe/base/txgbe_type.h
+++ b/drivers/net/txgbe/base/txgbe_type.h
@@ -353,6 +353,7 @@ struct txgbe_hw_stats {
 	u64 rx_management_packets;
 	u64 tx_management_packets;
 	u64 rx_management_dropped;
+	u64 rx_dma_drop;
 	u64 rx_drop_packets;
 
 	/* Basic Error */
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 90137d0ce..1ab8d2cde 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -2080,6 +2080,7 @@ txgbe_read_stats_registers(struct txgbe_hw *hw,
 
 	hw_stats->rx_bytes += rd64(hw, TXGBE_DMARXOCTL);
 	hw_stats->tx_bytes += rd64(hw, TXGBE_DMATXOCTL);
+	hw_stats->rx_dma_drop += rd32(hw, TXGBE_DMARXDROP);
 	hw_stats->rx_drop_packets += rd32(hw, TXGBE_PBRXDROP);
 
 	/* MAC Stats */
@@ -2228,7 +2229,8 @@ txgbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 	}
 
 	/* Rx Errors */
-	stats->imissed  = hw_stats->rx_total_missed_packets;
+	stats->imissed  = hw_stats->rx_total_missed_packets +
+			  hw_stats->rx_dma_drop;
 	stats->ierrors  = hw_stats->rx_crc_errors +
 			  hw_stats->rx_mac_short_packet_dropped +
 			  hw_stats->rx_length_errors +
-- 
2.21.0.windows.1




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

* [dpdk-dev] [PATCH 3/4] net/txgbe: update packet type
  2021-03-04 10:06 [dpdk-dev] [PATCH 0/4] bug fixes for txgbe Jiawen Wu
  2021-03-04 10:06 ` [dpdk-dev] [PATCH 1/4] net/txgbe: remove unused functions Jiawen Wu
  2021-03-04 10:06 ` [dpdk-dev] [PATCH 2/4] net/txgbe: fix Rx missed packet counter Jiawen Wu
@ 2021-03-04 10:06 ` Jiawen Wu
  2021-03-04 10:07 ` [dpdk-dev] [PATCH 4/4] net/txgbe: fix the process of adding crypto SA Jiawen Wu
  2021-03-04 16:48 ` [dpdk-dev] [PATCH 0/4] bug fixes for txgbe Ferruh Yigit
  4 siblings, 0 replies; 7+ messages in thread
From: Jiawen Wu @ 2021-03-04 10:06 UTC (permalink / raw)
  To: dev; +Cc: Jiawen Wu

Update the packet type lookup table according to the HW design.
Fix the bug that inner L3 and L4 type can not be parsed when
QINQ insert in tunnel packet.

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

diff --git a/drivers/net/txgbe/txgbe_ptypes.c b/drivers/net/txgbe/txgbe_ptypes.c
index cd160ebba..7009f2082 100644
--- a/drivers/net/txgbe/txgbe_ptypes.c
+++ b/drivers/net/txgbe/txgbe_ptypes.c
@@ -50,6 +50,7 @@
 static u32 txgbe_ptype_lookup[TXGBE_PTID_MAX] __rte_cache_aligned = {
 	/* L2:0-3 L3:4-7 L4:8-11 TUN:12-15 EL2:16-19 EL3:20-23 EL2:24-27 */
 	/* L2: ETH */
+	TPTE(0x10, ETHER,          NONE, NONE, NONE, NONE, NONE, NONE),
 	TPTE(0x11, ETHER,          NONE, NONE, NONE, NONE, NONE, NONE),
 	TPTE(0x12, ETHER_TIMESYNC, NONE, NONE, NONE, NONE, NONE, NONE),
 	TPTE(0x13, ETHER_FIP,      NONE, NONE, NONE, NONE, NONE, NONE),
@@ -67,6 +68,7 @@ static u32 txgbe_ptype_lookup[TXGBE_PTID_MAX] __rte_cache_aligned = {
 	TPTE(0x1E, ETHER_FILTER,   NONE, NONE, NONE, NONE, NONE, NONE),
 	TPTE(0x1F, ETHER_FILTER,   NONE, NONE, NONE, NONE, NONE, NONE),
 	/* L3: IP */
+	TPTE(0x20, ETHER, IPV4, NONFRAG, NONE, NONE, NONE, NONE),
 	TPTE(0x21, ETHER, IPV4, FRAG,    NONE, NONE, NONE, NONE),
 	TPTE(0x22, ETHER, IPV4, NONFRAG, NONE, NONE, NONE, NONE),
 	TPTE(0x23, ETHER, IPV4, UDP,     NONE, NONE, NONE, NONE),
@@ -339,7 +341,7 @@ txgbe_encode_ptype_tunnel(u32 ptype)
 		break;
 	case RTE_PTYPE_INNER_L2_ETHER_QINQ:
 		ptid |= TXGBE_PTID_TUN_EIGMV;
-		return ptid;
+		break;
 	default:
 		break;
 	}
-- 
2.21.0.windows.1




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

* [dpdk-dev] [PATCH 4/4] net/txgbe: fix the process of adding crypto SA
  2021-03-04 10:06 [dpdk-dev] [PATCH 0/4] bug fixes for txgbe Jiawen Wu
                   ` (2 preceding siblings ...)
  2021-03-04 10:06 ` [dpdk-dev] [PATCH 3/4] net/txgbe: update packet type Jiawen Wu
@ 2021-03-04 10:07 ` Jiawen Wu
  2021-03-04 16:48 ` [dpdk-dev] [PATCH 0/4] bug fixes for txgbe Ferruh Yigit
  4 siblings, 0 replies; 7+ messages in thread
From: Jiawen Wu @ 2021-03-04 10:07 UTC (permalink / raw)
  To: dev; +Cc: Jiawen Wu

By register definition, Ipsec Rx IPv4 address should to be written
in the reg(0).

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

diff --git a/drivers/net/txgbe/txgbe_ipsec.c b/drivers/net/txgbe/txgbe_ipsec.c
index 9f4eee408..a43b95aa2 100644
--- a/drivers/net/txgbe/txgbe_ipsec.c
+++ b/drivers/net/txgbe/txgbe_ipsec.c
@@ -145,11 +145,11 @@ txgbe_crypto_add_sa(struct txgbe_crypto_session *ic_session)
 		reg_val = TXGBE_IPSRXIDX_ENA | TXGBE_IPSRXIDX_WRITE |
 				TXGBE_IPSRXIDX_TB_IP | (ip_index << 3);
 		if (priv->rx_ip_tbl[ip_index].ip.type == IPv4) {
-			wr32(hw, TXGBE_IPSRXADDR(0), 0);
+			uint32_t ipv4 = priv->rx_ip_tbl[ip_index].ip.ipv4;
+			wr32(hw, TXGBE_IPSRXADDR(0), rte_cpu_to_be_32(ipv4));
 			wr32(hw, TXGBE_IPSRXADDR(1), 0);
 			wr32(hw, TXGBE_IPSRXADDR(2), 0);
-			wr32(hw, TXGBE_IPSRXADDR(3),
-					priv->rx_ip_tbl[ip_index].ip.ipv4);
+			wr32(hw, TXGBE_IPSRXADDR(3), 0);
 		} else {
 			wr32(hw, TXGBE_IPSRXADDR(0),
 					priv->rx_ip_tbl[ip_index].ip.ipv6[0]);
-- 
2.21.0.windows.1




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

* Re: [dpdk-dev] [PATCH 0/4] bug fixes for txgbe
  2021-03-04 10:06 [dpdk-dev] [PATCH 0/4] bug fixes for txgbe Jiawen Wu
                   ` (3 preceding siblings ...)
  2021-03-04 10:07 ` [dpdk-dev] [PATCH 4/4] net/txgbe: fix the process of adding crypto SA Jiawen Wu
@ 2021-03-04 16:48 ` Ferruh Yigit
  2021-03-05  1:48   ` Jiawen Wu
  4 siblings, 1 reply; 7+ messages in thread
From: Ferruh Yigit @ 2021-03-04 16:48 UTC (permalink / raw)
  To: Jiawen Wu; +Cc: dev

On 3/4/2021 10:06 AM, Jiawen Wu wrote:
> This series fix some bugs and remove unused functions.
> 
> Jiawen Wu (4):
>    net/txgbe: remove unused functions
>    net/txgbe: fix Rx missed packet counter
>    net/txgbe: update packet type
>    net/txgbe: fix the process of adding crypto SA
> 

Hi Jiawen,

Can you please add fixes line for all of them?
So that LTS maintainers can figure out where to backport the ones that can be 
backported.

Fixes line is commit that introduces the issue fixed by that commit. It has a 
defined syntax which can be get via a git alias:
git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h (\"%s\")%nCc: %ae'"

(as documented in 
"https://doc.dpdk.org/guides/contributing/patches.html#commit-messages-body")

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

* Re: [dpdk-dev] [PATCH 0/4] bug fixes for txgbe
  2021-03-04 16:48 ` [dpdk-dev] [PATCH 0/4] bug fixes for txgbe Ferruh Yigit
@ 2021-03-05  1:48   ` Jiawen Wu
  0 siblings, 0 replies; 7+ messages in thread
From: Jiawen Wu @ 2021-03-05  1:48 UTC (permalink / raw)
  To: 'Ferruh Yigit'; +Cc: dev

On Friday, March 5, 2021 12:49 AM, Ferruh Yigit wrote:
> On 3/4/2021 10:06 AM, Jiawen Wu wrote:
> > This series fix some bugs and remove unused functions.
> >
> > Jiawen Wu (4):
> >    net/txgbe: remove unused functions
> >    net/txgbe: fix Rx missed packet counter
> >    net/txgbe: update packet type
> >    net/txgbe: fix the process of adding crypto SA
> >
> 
> Hi Jiawen,
> 
> Can you please add fixes line for all of them?
> So that LTS maintainers can figure out where to backport the ones that can be
> backported.
> 
> Fixes line is commit that introduces the issue fixed by that commit. It has a
> defined syntax which can be get via a git alias:
> git config alias.fixline "log -1 --abbrev=12 --format='Fixes: %h
> (\"%s\")%nCc: %ae'"
> 
> (as documented in
> "https://doc.dpdk.org/guides/contributing/patches.html#commit-messages-bo
> dy")

Ok, I will add it.
Thanks for the guidance.




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

end of thread, other threads:[~2021-03-05  1:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 10:06 [dpdk-dev] [PATCH 0/4] bug fixes for txgbe Jiawen Wu
2021-03-04 10:06 ` [dpdk-dev] [PATCH 1/4] net/txgbe: remove unused functions Jiawen Wu
2021-03-04 10:06 ` [dpdk-dev] [PATCH 2/4] net/txgbe: fix Rx missed packet counter Jiawen Wu
2021-03-04 10:06 ` [dpdk-dev] [PATCH 3/4] net/txgbe: update packet type Jiawen Wu
2021-03-04 10:07 ` [dpdk-dev] [PATCH 4/4] net/txgbe: fix the process of adding crypto SA Jiawen Wu
2021-03-04 16:48 ` [dpdk-dev] [PATCH 0/4] bug fixes for txgbe Ferruh Yigit
2021-03-05  1:48   ` Jiawen Wu

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).