diff mbox series

[net] r8169: don't increment tx_dropped in case of NETDEV_TX_BUSY

Message ID bbba9c48-8bac-4932-9aa1-d2ed63bc9433@gmail.com (mailing list archive)
State Accepted
Commit d516b187a9cc2e842030dd005be2735db3e8f395
Delegated to: Netdev Maintainers
Headers show
Series [net] r8169: don't increment tx_dropped in case of NETDEV_TX_BUSY | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 42 this patch: 42
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 1 blamed authors not CCed: romieu@fr.zoreil.com; 1 maintainers not CCed: romieu@fr.zoreil.com
netdev/build_clang success Errors and warnings before: 43 this patch: 43
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 43 this patch: 43
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-07-31--12-00 (tests: 707)

Commit Message

Heiner Kallweit July 30, 2024, 7:51 p.m. UTC
The skb isn't consumed in case of NETDEV_TX_BUSY, therefore don't
increment the tx_dropped counter.

Fixes: 188f4af04618 ("r8169: use NETDEV_TX_{BUSY/OK}")
Cc: stable@vger.kernel.org
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Wojciech Drewek July 31, 2024, 8:59 a.m. UTC | #1
On 30.07.2024 21:51, Heiner Kallweit wrote:
> The skb isn't consumed in case of NETDEV_TX_BUSY, therefore don't
> increment the tx_dropped counter.
> 
> Fixes: 188f4af04618 ("r8169: use NETDEV_TX_{BUSY/OK}")
> Cc: stable@vger.kernel.org
> Suggested-by: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---

Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>

>  drivers/net/ethernet/realtek/r8169_main.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
> index 714d2e804..3507c2e28 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -4349,7 +4349,8 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
>  	if (unlikely(!rtl_tx_slots_avail(tp))) {
>  		if (net_ratelimit())
>  			netdev_err(dev, "BUG! Tx Ring full when queue awake!\n");
> -		goto err_stop_0;
> +		netif_stop_queue(dev);
> +		return NETDEV_TX_BUSY;
>  	}
>  
>  	opts[1] = rtl8169_tx_vlan_tag(skb);
> @@ -4405,11 +4406,6 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
>  	dev_kfree_skb_any(skb);
>  	dev->stats.tx_dropped++;
>  	return NETDEV_TX_OK;
> -
> -err_stop_0:
> -	netif_stop_queue(dev);
> -	dev->stats.tx_dropped++;
> -	return NETDEV_TX_BUSY;
>  }
>  
>  static unsigned int rtl_last_frag_len(struct sk_buff *skb)
patchwork-bot+netdevbpf@kernel.org Aug. 1, 2024, 1:10 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 30 Jul 2024 21:51:52 +0200 you wrote:
> The skb isn't consumed in case of NETDEV_TX_BUSY, therefore don't
> increment the tx_dropped counter.
> 
> Fixes: 188f4af04618 ("r8169: use NETDEV_TX_{BUSY/OK}")
> Cc: stable@vger.kernel.org
> Suggested-by: Jakub Kicinski <kuba@kernel.org>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> 
> [...]

Here is the summary with links:
  - [net] r8169: don't increment tx_dropped in case of NETDEV_TX_BUSY
    https://git.kernel.org/netdev/net/c/d516b187a9cc

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 714d2e804..3507c2e28 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4349,7 +4349,8 @@  static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 	if (unlikely(!rtl_tx_slots_avail(tp))) {
 		if (net_ratelimit())
 			netdev_err(dev, "BUG! Tx Ring full when queue awake!\n");
-		goto err_stop_0;
+		netif_stop_queue(dev);
+		return NETDEV_TX_BUSY;
 	}
 
 	opts[1] = rtl8169_tx_vlan_tag(skb);
@@ -4405,11 +4406,6 @@  static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 	dev_kfree_skb_any(skb);
 	dev->stats.tx_dropped++;
 	return NETDEV_TX_OK;
-
-err_stop_0:
-	netif_stop_queue(dev);
-	dev->stats.tx_dropped++;
-	return NETDEV_TX_BUSY;
 }
 
 static unsigned int rtl_last_frag_len(struct sk_buff *skb)