lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACKFLikTC_xY1q2CS8orYZzkXc7e0P8GEfcb4+9wX6kBFH8srQ@mail.gmail.com>
Date: Sun, 9 Mar 2025 00:25:42 -0800
From: Michael Chan <michael.chan@...adcom.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com, 
	pabeni@...hat.com, andrew+netdev@...n.ch, horms@...nel.org, 
	pavan.chebbi@...adcom.com, przemyslaw.kitszel@...el.com
Subject: Re: [PATCH net-next v3 09/10] eth: bnxt: maintain tx pkt/byte stats
 in SW

On Wed, Mar 5, 2025 at 2:52 PM Jakub Kicinski <kuba@...nel.org> wrote:

> @@ -610,6 +612,8 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
>                                     DB_RING_IDX(&txr->tx_db, prod));
>                 WRITE_ONCE(txr->tx_prod, prod);
>
> +               if (skb->len < BNXT_MIN_ETH_SIZE)
> +                       tx_buf->extra_bytes += BNXT_MIN_ETH_SIZE - skb->len;

s/BNXT_MIN_ETH_SIZE/ETH_ZLEN

BNXT_MIN_ETH_SIZE is 52 bytes but HW will pad to 60 bytes.  So we need
to also include the HW padding.

>                 tx_buf->is_push = 1;
>                 netdev_tx_sent_queue(txq, skb->len);
>                 wmb();  /* Sync is_push and byte queue before pushing data */
> @@ -634,6 +638,8 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
>                         goto tx_kick_pending;
>                 length = BNXT_MIN_PKT_SIZE;
>         }
> +       if (skb->len < BNXT_MIN_ETH_SIZE)
> +               tx_buf->extra_bytes += BNXT_MIN_ETH_SIZE - skb->len;

Same here for non-push packets.  Thanks.

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4196 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ