* [PATCH net-next] net: mvneta: fix build skb for bm capable devices
@ 2019-11-13 23:25 Lorenzo Bianconi
2019-11-14 0:06 ` Andrew Lunn
2019-11-15 2:04 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2019-11-13 23:25 UTC (permalink / raw)
To: netdev; +Cc: davem, andrew, ilias.apalodimas, brouer, lorenzo.bianconi
Fix build_skb for bm capable devices when they fall-back using swbm path
(e.g. when bm properties are configured in device tree but
CONFIG_MVNETA_BM_ENABLE is not set). In this case rx_offset_correction is
overwritten so we need to use it building skb instead of
MVNETA_SKB_HEADROOM directly
Fixes: 8dc9a0888f4c ("net: mvneta: rely on build_skb in mvneta_rx_swbm poll routine")
Fixes: 0db51da7a8e9 ("net: mvneta: add basic XDP support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/ethernet/marvell/mvneta.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 274ac39c0f0f..12e03b15f0ab 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2154,7 +2154,7 @@ mvneta_swbm_rx_frame(struct mvneta_port *pp,
prefetch(data);
xdp->data_hard_start = data;
- xdp->data = data + MVNETA_SKB_HEADROOM + MVNETA_MH_SIZE;
+ xdp->data = data + pp->rx_offset_correction + MVNETA_MH_SIZE;
xdp->data_end = xdp->data + data_len;
xdp_set_data_meta_invalid(xdp);
@@ -2219,7 +2219,7 @@ mvneta_swbm_add_rx_fragment(struct mvneta_port *pp,
/* refill descriptor with new buffer later */
skb_add_rx_frag(rxq->skb,
skb_shinfo(rxq->skb)->nr_frags,
- page, MVNETA_SKB_HEADROOM, data_len,
+ page, pp->rx_offset_correction, data_len,
PAGE_SIZE);
}
page_pool_release_page(rxq->page_pool, page);
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net-next] net: mvneta: fix build skb for bm capable devices
2019-11-13 23:25 [PATCH net-next] net: mvneta: fix build skb for bm capable devices Lorenzo Bianconi
@ 2019-11-14 0:06 ` Andrew Lunn
2019-11-15 2:04 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2019-11-14 0:06 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: netdev, davem, ilias.apalodimas, brouer, lorenzo.bianconi
On Thu, Nov 14, 2019 at 01:25:55AM +0200, Lorenzo Bianconi wrote:
> Fix build_skb for bm capable devices when they fall-back using swbm path
> (e.g. when bm properties are configured in device tree but
> CONFIG_MVNETA_BM_ENABLE is not set). In this case rx_offset_correction is
> overwritten so we need to use it building skb instead of
> MVNETA_SKB_HEADROOM directly
>
> Fixes: 8dc9a0888f4c ("net: mvneta: rely on build_skb in mvneta_rx_swbm poll routine")
> Fixes: 0db51da7a8e9 ("net: mvneta: add basic XDP support")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reported-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net-next] net: mvneta: fix build skb for bm capable devices
2019-11-13 23:25 [PATCH net-next] net: mvneta: fix build skb for bm capable devices Lorenzo Bianconi
2019-11-14 0:06 ` Andrew Lunn
@ 2019-11-15 2:04 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-11-15 2:04 UTC (permalink / raw)
To: lorenzo; +Cc: netdev, andrew, ilias.apalodimas, brouer, lorenzo.bianconi
From: Lorenzo Bianconi <lorenzo@kernel.org>
Date: Thu, 14 Nov 2019 01:25:55 +0200
> Fix build_skb for bm capable devices when they fall-back using swbm path
> (e.g. when bm properties are configured in device tree but
> CONFIG_MVNETA_BM_ENABLE is not set). In this case rx_offset_correction is
> overwritten so we need to use it building skb instead of
> MVNETA_SKB_HEADROOM directly
>
> Fixes: 8dc9a0888f4c ("net: mvneta: rely on build_skb in mvneta_rx_swbm poll routine")
> Fixes: 0db51da7a8e9 ("net: mvneta: add basic XDP support")
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-15 2:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-13 23:25 [PATCH net-next] net: mvneta: fix build skb for bm capable devices Lorenzo Bianconi
2019-11-14 0:06 ` Andrew Lunn
2019-11-15 2:04 ` David Miller
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).