[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200124072338.75163-1-sven.auhagen@voleatech.de>
Date: Fri, 24 Jan 2020 07:23:39 +0000
From: Sven Auhagen <sven.auhagen@...eatech.de>
To: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: "lorenzo.bianconi@...hat.com" <lorenzo.bianconi@...hat.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"thomas.petazzoni@...tlin.com" <thomas.petazzoni@...tlin.com>,
"brouer@...hat.com" <brouer@...hat.com>,
"ilias.apalodimas@...aro.org" <ilias.apalodimas@...aro.org>,
"matteo.croce@...hat.com" <matteo.croce@...hat.com>,
"jakub.kicinski@...ronome.com" <jakub.kicinski@...ronome.com>
Subject: [PATCH v3] mvneta driver disallow XDP program on hardware buffer
management
Recently XDP Support was added to the mvneta driver
for software buffer management only.
It is still possible to attach an XDP program if
hardware buffer management is used.
It is not doing anything at that point.
The patch disallows attaching XDP programs to mvneta
if hardware buffer management is used.
Signed-off-by: Sven Auhagen <sven.auhagen@...eatech.de>
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 71a872d46bc4..a2e9ba9b918f 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2158,7 +2158,7 @@ mvneta_swbm_rx_frame(struct mvneta_port *pp,
prefetch(data);
xdp->data_hard_start = data;
- xdp->data = data + pp->rx_offset_correction + MVNETA_MH_SIZE;
+ xdp->data = data + pp->rx_offset_correction;
xdp->data_end = xdp->data + data_len;
xdp_set_data_meta_invalid(xdp);
@@ -4960,9 +4960,10 @@ static int mvneta_probe(struct platform_device *pdev)
* NET_SKB_PAD, exceeds 64B. It should be 64B for 64-bit
* platforms and 0B for 32-bit ones.
*/
- pp->rx_offset_correction = max(0,
- NET_SKB_PAD -
- MVNETA_RX_PKT_OFFSET_CORRECTION);
+ if (pp->bm_priv)
+ pp->rx_offset_correction = max(0,
+ NET_SKB_PAD -
+ MVNETA_RX_PKT_OFFSET_CORRECTION);
}
of_node_put(bm_node);
Powered by blists - more mailing lists