netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf)
@ 2023-10-03 22:36 Tony Nguyen
  2023-10-03 22:36 ` [PATCH net-next v2 1/2] i40e: Add rx_missed_errors for buffer exhaustion Tony Nguyen
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Tony Nguyen @ 2023-10-03 22:36 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev; +Cc: Tony Nguyen

This series contains updates to i40e and iavf drivers.

Yajun Deng aligns reporting of buffer exhaustion statistics to follow
documentation for i40e.

Jake removes undesired 'inline' from functions in iavf.
---
v2:
- Drop, previous patch 3, as a better solution [1] is upcoming [2]

[1] https://lore.kernel.org/intel-wired-lan/abf8d279-b579-4a03-9ae9-053cf5efec3d@wanadoo.fr/
[2] https://lore.kernel.org/intel-wired-lan/20231003183603.3887546-2-jesse.brandeburg@intel.com/

v1: https://lore.kernel.org/netdev/20231002185034.1575127-1-anthony.l.nguyen@intel.com/

The following are changes since commit 8989682a1cb600bac1149ed17b1ce929ab472e79:
  Merge branch 'documentation-fixes-for-dpll-subsystem'
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue 40GbE

Jacob Keller (1):
  iavf: remove "inline" functions from iavf_txrx.c

Yajun Deng (1):
  i40e: Add rx_missed_errors for buffer exhaustion

 .../net/ethernet/intel/i40e/i40e_ethtool.c    |  3 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c   | 18 +++-----
 .../ethernet/intel/i40e/i40e_virtchnl_pf.c    |  2 +-
 drivers/net/ethernet/intel/iavf/iavf_txrx.c   | 46 +++++++++----------
 4 files changed, 33 insertions(+), 36 deletions(-)

-- 
2.38.1


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

* [PATCH net-next v2 1/2] i40e: Add rx_missed_errors for buffer exhaustion
  2023-10-03 22:36 [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf) Tony Nguyen
@ 2023-10-03 22:36 ` Tony Nguyen
  2023-10-03 22:36 ` [PATCH net-next v2 2/2] iavf: remove "inline" functions from iavf_txrx.c Tony Nguyen
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2023-10-03 22:36 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Yajun Deng, anthony.l.nguyen, Arpana Arland

From: Yajun Deng <yajun.deng@linux.dev>

As the comment in struct rtnl_link_stats64, rx_dropped should not
include packets dropped by the device due to buffer exhaustion.
They are counted in rx_missed_errors, procfs folds those two counters
together.

Add rx_missed_errors for buffer exhaustion, rx_missed_errors corresponds
to rx_discards, rx_dropped corresponds to rx_discards_other.

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Tested-by: Arpana Arland <arpanax.arland@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c |  3 ++-
 drivers/net/ethernet/intel/i40e/i40e_main.c    | 18 +++++++-----------
 .../net/ethernet/intel/i40e/i40e_virtchnl_pf.c |  2 +-
 3 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index bd1321bf7e26..77e4ac103866 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -245,6 +245,7 @@ static const struct i40e_stats i40e_gstrings_net_stats[] = {
 	I40E_NETDEV_STAT(rx_errors),
 	I40E_NETDEV_STAT(tx_errors),
 	I40E_NETDEV_STAT(rx_dropped),
+	I40E_NETDEV_STAT(rx_missed_errors),
 	I40E_NETDEV_STAT(tx_dropped),
 	I40E_NETDEV_STAT(collisions),
 	I40E_NETDEV_STAT(rx_length_errors),
@@ -321,7 +322,7 @@ static const struct i40e_stats i40e_gstrings_stats[] = {
 	I40E_PF_STAT("port.rx_broadcast", stats.eth.rx_broadcast),
 	I40E_PF_STAT("port.tx_broadcast", stats.eth.tx_broadcast),
 	I40E_PF_STAT("port.tx_errors", stats.eth.tx_errors),
-	I40E_PF_STAT("port.rx_dropped", stats.eth.rx_discards),
+	I40E_PF_STAT("port.rx_discards", stats.eth.rx_discards),
 	I40E_PF_STAT("port.tx_dropped_link_down", stats.tx_dropped_link_down),
 	I40E_PF_STAT("port.rx_crc_errors", stats.crc_errors),
 	I40E_PF_STAT("port.illegal_bytes", stats.illegal_bytes),
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 00ca2b88165c..4b9788d2ded7 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -489,6 +489,7 @@ static void i40e_get_netdev_stats_struct(struct net_device *netdev,
 	stats->tx_dropped	= vsi_stats->tx_dropped;
 	stats->rx_errors	= vsi_stats->rx_errors;
 	stats->rx_dropped	= vsi_stats->rx_dropped;
+	stats->rx_missed_errors	= vsi_stats->rx_missed_errors;
 	stats->rx_crc_errors	= vsi_stats->rx_crc_errors;
 	stats->rx_length_errors	= vsi_stats->rx_length_errors;
 }
@@ -680,17 +681,13 @@ i40e_stats_update_rx_discards(struct i40e_vsi *vsi, struct i40e_hw *hw,
 			      struct i40e_eth_stats *stat_offset,
 			      struct i40e_eth_stats *stat)
 {
-	u64 rx_rdpc, rx_rxerr;
-
 	i40e_stat_update32(hw, I40E_GLV_RDPC(stat_idx), offset_loaded,
-			   &stat_offset->rx_discards, &rx_rdpc);
+			   &stat_offset->rx_discards, &stat->rx_discards);
 	i40e_stat_update64(hw,
 			   I40E_GL_RXERR1H(i40e_compute_pci_to_hw_id(vsi, hw)),
 			   I40E_GL_RXERR1L(i40e_compute_pci_to_hw_id(vsi, hw)),
 			   offset_loaded, &stat_offset->rx_discards_other,
-			   &rx_rxerr);
-
-	stat->rx_discards = rx_rdpc + rx_rxerr;
+			   &stat->rx_discards_other);
 }
 
 /**
@@ -712,9 +709,6 @@ void i40e_update_eth_stats(struct i40e_vsi *vsi)
 	i40e_stat_update32(hw, I40E_GLV_TEPC(stat_idx),
 			   vsi->stat_offsets_loaded,
 			   &oes->tx_errors, &es->tx_errors);
-	i40e_stat_update32(hw, I40E_GLV_RDPC(stat_idx),
-			   vsi->stat_offsets_loaded,
-			   &oes->rx_discards, &es->rx_discards);
 	i40e_stat_update32(hw, I40E_GLV_RUPP(stat_idx),
 			   vsi->stat_offsets_loaded,
 			   &oes->rx_unknown_protocol, &es->rx_unknown_protocol);
@@ -971,8 +965,10 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
 	ns->tx_errors = es->tx_errors;
 	ons->multicast = oes->rx_multicast;
 	ns->multicast = es->rx_multicast;
-	ons->rx_dropped = oes->rx_discards;
-	ns->rx_dropped = es->rx_discards;
+	ons->rx_dropped = oes->rx_discards_other;
+	ns->rx_dropped = es->rx_discards_other;
+	ons->rx_missed_errors = oes->rx_discards;
+	ns->rx_missed_errors = es->rx_discards;
 	ons->tx_dropped = oes->tx_discards;
 	ns->tx_dropped = es->tx_discards;
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index d3d6415553ed..186b1130dbaf 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -4916,7 +4916,7 @@ int i40e_get_vf_stats(struct net_device *netdev, int vf_id,
 	vf_stats->tx_bytes   = stats->tx_bytes;
 	vf_stats->broadcast  = stats->rx_broadcast;
 	vf_stats->multicast  = stats->rx_multicast;
-	vf_stats->rx_dropped = stats->rx_discards;
+	vf_stats->rx_dropped = stats->rx_discards + stats->rx_discards_other;
 	vf_stats->tx_dropped = stats->tx_discards;
 
 	return 0;
-- 
2.38.1


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

* [PATCH net-next v2 2/2] iavf: remove "inline" functions from iavf_txrx.c
  2023-10-03 22:36 [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf) Tony Nguyen
  2023-10-03 22:36 ` [PATCH net-next v2 1/2] i40e: Add rx_missed_errors for buffer exhaustion Tony Nguyen
@ 2023-10-03 22:36 ` Tony Nguyen
  2023-10-05  0:28 ` [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf) Jakub Kicinski
  2023-10-05  0:30 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2023-10-03 22:36 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Jacob Keller, anthony.l.nguyen, Ahmed Zaki

From: Jacob Keller <jacob.e.keller@intel.com>

The iAVF txrx hotpath code has several functions that are marked as
"static inline" in the iavf_txrx.c file. This use of inline is frowned
upon in the netdev community and explicitly marked as something to avoid
in the Linux coding-style document (section 15).

Even though these functions are only used once, it is expected that GCC
is smart enough to decide when to perform function inlining where
appropriate without the "hint".

./scripts/bloat-o-meter is showing zero difference with this changes.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf_txrx.c | 46 ++++++++++-----------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
index 8c5f6096b002..d64c4997136b 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
@@ -7,8 +7,8 @@
 #include "iavf_trace.h"
 #include "iavf_prototype.h"
 
-static inline __le64 build_ctob(u32 td_cmd, u32 td_offset, unsigned int size,
-				u32 td_tag)
+static __le64 build_ctob(u32 td_cmd, u32 td_offset, unsigned int size,
+			 u32 td_tag)
 {
 	return cpu_to_le64(IAVF_TX_DESC_DTYPE_DATA |
 			   ((u64)td_cmd  << IAVF_TXD_QW1_CMD_SHIFT) |
@@ -370,8 +370,8 @@ static void iavf_enable_wb_on_itr(struct iavf_vsi *vsi,
 	q_vector->arm_wb_state = true;
 }
 
-static inline bool iavf_container_is_rx(struct iavf_q_vector *q_vector,
-					struct iavf_ring_container *rc)
+static bool iavf_container_is_rx(struct iavf_q_vector *q_vector,
+				 struct iavf_ring_container *rc)
 {
 	return &q_vector->rx == rc;
 }
@@ -806,7 +806,7 @@ int iavf_setup_rx_descriptors(struct iavf_ring *rx_ring)
  * @rx_ring: ring to bump
  * @val: new head index
  **/
-static inline void iavf_release_rx_desc(struct iavf_ring *rx_ring, u32 val)
+static void iavf_release_rx_desc(struct iavf_ring *rx_ring, u32 val)
 {
 	rx_ring->next_to_use = val;
 
@@ -828,7 +828,7 @@ static inline void iavf_release_rx_desc(struct iavf_ring *rx_ring, u32 val)
  *
  * Returns the offset value for ring into the data buffer.
  */
-static inline unsigned int iavf_rx_offset(struct iavf_ring *rx_ring)
+static unsigned int iavf_rx_offset(struct iavf_ring *rx_ring)
 {
 	return ring_uses_build_skb(rx_ring) ? IAVF_SKB_PAD : 0;
 }
@@ -977,9 +977,9 @@ bool iavf_alloc_rx_buffers(struct iavf_ring *rx_ring, u16 cleaned_count)
  * @skb: skb currently being received and modified
  * @rx_desc: the receive descriptor
  **/
-static inline void iavf_rx_checksum(struct iavf_vsi *vsi,
-				    struct sk_buff *skb,
-				    union iavf_rx_desc *rx_desc)
+static void iavf_rx_checksum(struct iavf_vsi *vsi,
+			     struct sk_buff *skb,
+			     union iavf_rx_desc *rx_desc)
 {
 	struct iavf_rx_ptype_decoded decoded;
 	u32 rx_error, rx_status;
@@ -1061,7 +1061,7 @@ static inline void iavf_rx_checksum(struct iavf_vsi *vsi,
  *
  * Returns a hash type to be used by skb_set_hash
  **/
-static inline int iavf_ptype_to_htype(u8 ptype)
+static int iavf_ptype_to_htype(u8 ptype)
 {
 	struct iavf_rx_ptype_decoded decoded = decode_rx_desc_ptype(ptype);
 
@@ -1085,10 +1085,10 @@ static inline int iavf_ptype_to_htype(u8 ptype)
  * @skb: skb currently being received and modified
  * @rx_ptype: Rx packet type
  **/
-static inline void iavf_rx_hash(struct iavf_ring *ring,
-				union iavf_rx_desc *rx_desc,
-				struct sk_buff *skb,
-				u8 rx_ptype)
+static void iavf_rx_hash(struct iavf_ring *ring,
+			 union iavf_rx_desc *rx_desc,
+			 struct sk_buff *skb,
+			 u8 rx_ptype)
 {
 	u32 hash;
 	const __le64 rss_mask =
@@ -1115,10 +1115,10 @@ static inline void iavf_rx_hash(struct iavf_ring *ring,
  * order to populate the hash, checksum, VLAN, protocol, and
  * other fields within the skb.
  **/
-static inline
-void iavf_process_skb_fields(struct iavf_ring *rx_ring,
-			     union iavf_rx_desc *rx_desc, struct sk_buff *skb,
-			     u8 rx_ptype)
+static void
+iavf_process_skb_fields(struct iavf_ring *rx_ring,
+			union iavf_rx_desc *rx_desc, struct sk_buff *skb,
+			u8 rx_ptype)
 {
 	iavf_rx_hash(rx_ring, rx_desc, skb, rx_ptype);
 
@@ -1662,8 +1662,8 @@ static inline u32 iavf_buildreg_itr(const int type, u16 itr)
  * @q_vector: q_vector for which itr is being updated and interrupt enabled
  *
  **/
-static inline void iavf_update_enable_itr(struct iavf_vsi *vsi,
-					  struct iavf_q_vector *q_vector)
+static void iavf_update_enable_itr(struct iavf_vsi *vsi,
+				   struct iavf_q_vector *q_vector)
 {
 	struct iavf_hw *hw = &vsi->back->hw;
 	u32 intval;
@@ -2275,9 +2275,9 @@ int __iavf_maybe_stop_tx(struct iavf_ring *tx_ring, int size)
  * @td_cmd:   the command field in the descriptor
  * @td_offset: offset for checksum or crc
  **/
-static inline void iavf_tx_map(struct iavf_ring *tx_ring, struct sk_buff *skb,
-			       struct iavf_tx_buffer *first, u32 tx_flags,
-			       const u8 hdr_len, u32 td_cmd, u32 td_offset)
+static void iavf_tx_map(struct iavf_ring *tx_ring, struct sk_buff *skb,
+			struct iavf_tx_buffer *first, u32 tx_flags,
+			const u8 hdr_len, u32 td_cmd, u32 td_offset)
 {
 	unsigned int data_len = skb->data_len;
 	unsigned int size = skb_headlen(skb);
-- 
2.38.1


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

* Re: [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf)
  2023-10-03 22:36 [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf) Tony Nguyen
  2023-10-03 22:36 ` [PATCH net-next v2 1/2] i40e: Add rx_missed_errors for buffer exhaustion Tony Nguyen
  2023-10-03 22:36 ` [PATCH net-next v2 2/2] iavf: remove "inline" functions from iavf_txrx.c Tony Nguyen
@ 2023-10-05  0:28 ` Jakub Kicinski
  2023-10-05 16:07   ` Tony Nguyen
  2023-10-05  0:30 ` patchwork-bot+netdevbpf
  3 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2023-10-05  0:28 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, pabeni, edumazet, netdev

On Tue,  3 Oct 2023 15:36:08 -0700 Tony Nguyen wrote:
> This series contains updates to i40e and iavf drivers.
> 
> Yajun Deng aligns reporting of buffer exhaustion statistics to follow
> documentation for i40e.
> 
> Jake removes undesired 'inline' from functions in iavf.
> ---
> v2:
> - Drop, previous patch 3, as a better solution [1] is upcoming [2]

Ah, here it is. Maybe it'd be safer not to change the title of 
the cover letter for v2? Sooner or later it may trip some jet
lagged netdev maintainer if patchwork doesn't recognize v2
and auto-supersede v1 ;)

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

* Re: [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf)
  2023-10-03 22:36 [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf) Tony Nguyen
                   ` (2 preceding siblings ...)
  2023-10-05  0:28 ` [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf) Jakub Kicinski
@ 2023-10-05  0:30 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-05  0:30 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, pabeni, edumazet, netdev

Hello:

This series was applied to netdev/net-next.git (main)
by Tony Nguyen <anthony.l.nguyen@intel.com>:

On Tue,  3 Oct 2023 15:36:08 -0700 you wrote:
> This series contains updates to i40e and iavf drivers.
> 
> Yajun Deng aligns reporting of buffer exhaustion statistics to follow
> documentation for i40e.
> 
> Jake removes undesired 'inline' from functions in iavf.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/2] i40e: Add rx_missed_errors for buffer exhaustion
    https://git.kernel.org/netdev/net-next/c/5337d2949733
  - [net-next,v2,2/2] iavf: remove "inline" functions from iavf_txrx.c
    https://git.kernel.org/netdev/net-next/c/70dc7ab7645a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf)
  2023-10-05  0:28 ` [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf) Jakub Kicinski
@ 2023-10-05 16:07   ` Tony Nguyen
  0 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2023-10-05 16:07 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, pabeni, edumazet, netdev



On 10/4/2023 5:28 PM, Jakub Kicinski wrote:
> On Tue,  3 Oct 2023 15:36:08 -0700 Tony Nguyen wrote:
>> This series contains updates to i40e and iavf drivers.
>>
>> Yajun Deng aligns reporting of buffer exhaustion statistics to follow
>> documentation for i40e.
>>
>> Jake removes undesired 'inline' from functions in iavf.
>> ---
>> v2:
>> - Drop, previous patch 3, as a better solution [1] is upcoming [2]
> 
> Ah, here it is. Maybe it'd be safer not to change the title of
> the cover letter for v2? Sooner or later it may trip some jet
> lagged netdev maintainer if patchwork doesn't recognize v2
> and auto-supersede v1 ;)

Ack. Will keep the titles (date) on cover letter consistent through 
revisions.

Thanks,
Tony

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

end of thread, other threads:[~2023-10-05 16:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-03 22:36 [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf) Tony Nguyen
2023-10-03 22:36 ` [PATCH net-next v2 1/2] i40e: Add rx_missed_errors for buffer exhaustion Tony Nguyen
2023-10-03 22:36 ` [PATCH net-next v2 2/2] iavf: remove "inline" functions from iavf_txrx.c Tony Nguyen
2023-10-05  0:28 ` [PATCH net-next v2 0/2][pull request] Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf) Jakub Kicinski
2023-10-05 16:07   ` Tony Nguyen
2023-10-05  0:30 ` patchwork-bot+netdevbpf

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