Skip to content
Snippets Groups Projects
Commit cc673c71 authored by Stefan Wahren's avatar Stefan Wahren Committed by Greg Kroah-Hartman
Browse files

net: vertexcom: mse102x: Fix tx_bytes calculation


[ Upstream commit e68da664 ]

The tx_bytes should consider the actual size of the Ethernet frames
without the SPI encapsulation. But we still need to take care of
Ethernet padding.

Fixes: 2f207cbf ("net: vertexcom: Add MSE102x SPI support")
Signed-off-by: default avatarStefan Wahren <wahrenst@gmx.net>
Link: https://patch.msgid.link/20241108114343.6174-3-wahrenst@gmx.net


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4e87a521
No related branches found
No related tags found
No related merge requests found
......@@ -437,13 +437,15 @@ static void mse102x_tx_work(struct work_struct *work)
mse = &mses->mse102x;
while ((txb = skb_dequeue(&mse->txq))) {
unsigned int len = max_t(unsigned int, txb->len, ETH_ZLEN);
mutex_lock(&mses->lock);
ret = mse102x_tx_pkt_spi(mse, txb, work_timeout);
mutex_unlock(&mses->lock);
if (ret) {
mse->ndev->stats.tx_dropped++;
} else {
mse->ndev->stats.tx_bytes += txb->len;
mse->ndev->stats.tx_bytes += len;
mse->ndev->stats.tx_packets++;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment