netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Stefan Wahren <wahrenst@gmx.net>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2 net V2] net: vertexcom: mse102x: Fix tx_bytes calculation
Date: Wed, 6 Nov 2024 18:00:36 -0800	[thread overview]
Message-ID: <20241106180036.0ca3e354@kernel.org> (raw)
In-Reply-To: <20241105163545.33585-2-wahrenst@gmx.net>

On Tue,  5 Nov 2024 17:35:45 +0100 Stefan Wahren wrote:
> +			mse->ndev->stats.tx_bytes += max_t(unsigned int,
> +							   txb->len, ETH_ZLEN);

Is this enough? skb->len will include 2 bytes added by
mse102x_push_header() and 2 added by mse102x_put_footer()
(unless we went to skb_copy_expand(), which is very likely)

May be easier to save the skb->len before calling mse102x_tx_pkt_spi()

      reply	other threads:[~2024-11-07  2:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05 16:31 [PATCH 1/2 net V2] net: vertexcom: mse102x: Fix possible double free of TX skb Stefan Wahren
2024-11-05 16:35 ` [PATCH 0/2 net V2] net: vertexcom: mse102x: Fix mse102x_tx_work Stefan Wahren
2024-11-05 16:35   ` [PATCH 2/2 net V2] net: vertexcom: mse102x: Fix tx_bytes calculation Stefan Wahren
2024-11-07  2:00     ` Jakub Kicinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241106180036.0ca3e354@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=dan.carpenter@linaro.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wahrenst@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).