* [PATCH] mvneta driver disallow XDP program on hardware buffer management
@ 2020-01-22 8:56 Sven Auhagen
2020-01-22 23:04 ` Lorenzo Bianconi
0 siblings, 1 reply; 2+ messages in thread
From: Sven Auhagen @ 2020-01-22 8:56 UTC (permalink / raw)
To: netdev@vger.kernel.org
Cc: lorenzo.bianconi@redhat.com, davem@davemloft.net,
thomas.petazzoni@bootlin.com, brouer@redhat.com,
ilias.apalodimas@linaro.org, matteo.croce@redhat.com,
mw@semihalf.com, jakub.kicinski@netronome.com
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@voleatech.de>
--- drivers/net/ethernet/marvell/mvneta.c 2020-01-22 08:44:05.611395960 +0000
+++ drivers/net/ethernet/marvell/mvneta.c 2020-01-22 08:45:23.472263795 +0000
@@ -4225,6 +4225,11 @@ static int mvneta_xdp_setup(struct net_d
return -EOPNOTSUPP;
}
+ if (pp->bm_priv) {
+ NL_SET_ERR_MSG_MOD(extack, "Hardware Buffer Management not supported on XDP");
+ return -EOPNOTSUPP;
+ }
+
need_update = !!pp->xdp_prog != !!prog;
if (running && need_update)
mvneta_stop(dev);
+++ Voleatech auf der E-World, 11. bis 13. Februar 2020, Halle 5, Stand 521 +++
Beste Grüße/Best regards
Sven Auhagen
Dipl. Math. oec., M.Sc.
Voleatech GmbH
HRB: B 754643
USTID: DE303643180
Grathwohlstr. 5
72762 Reutlingen
Tel: +49 7121539550
Fax: +49 7121539551
E-Mail: sven.auhagen@voleatech.de
www.voleatech.de<https://www.voleatech.de>
Diese Information ist ausschließlich für den Adressaten bestimmt und kann vertraulich oder gesetzlich geschützte Informationen enthalten. Wenn Sie nicht der bestimmungsgemäße Adressat sind, unterrichten Sie bitte den Absender und vernichten Sie diese Mail. Anderen als dem bestimmungsgemäßen Adressaten ist es untersagt, diese E-Mail zu lesen, zu speichern, weiterzuleiten oder ihren Inhalt auf welche Weise auch immer zu verwenden. Für den Adressaten sind die Informationen in dieser Mail nur zum persönlichen Gebrauch. Eine Weiterleitung darf nur nach Rücksprache mit dem Absender erfolgen. Wir verwenden aktuelle Virenschutzprogramme. Für Schäden, die dem Empfänger gleichwohl durch von uns zugesandte mit Viren befallene E-Mails entstehen, schließen wir jede Haftung aus.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mvneta driver disallow XDP program on hardware buffer management
2020-01-22 8:56 [PATCH] mvneta driver disallow XDP program on hardware buffer management Sven Auhagen
@ 2020-01-22 23:04 ` Lorenzo Bianconi
0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Bianconi @ 2020-01-22 23:04 UTC (permalink / raw)
To: Sven Auhagen
Cc: netdev@vger.kernel.org, davem@davemloft.net,
thomas.petazzoni@bootlin.com, brouer@redhat.com,
ilias.apalodimas@linaro.org, matteo.croce@redhat.com,
mw@semihalf.com, jakub.kicinski@netronome.com
[-- Attachment #1: Type: text/plain, Size: 2464 bytes --]
> 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@voleatech.de>
>
> --- drivers/net/ethernet/marvell/mvneta.c 2020-01-22 08:44:05.611395960 +0000
> +++ drivers/net/ethernet/marvell/mvneta.c 2020-01-22 08:45:23.472263795 +0000
> @@ -4225,6 +4225,11 @@ static int mvneta_xdp_setup(struct net_d
> return -EOPNOTSUPP;
> }
>
> + if (pp->bm_priv) {
> + NL_SET_ERR_MSG_MOD(extack, "Hardware Buffer Management not supported on XDP");
> + return -EOPNOTSUPP;
> + }
> +
This patch is logically correct since we do not support XDP for hw buffer
devices for the moment. Could you please fix the errors reported by checkpatch?
Regards,
Lorenzo
> need_update = !!pp->xdp_prog != !!prog;
> if (running && need_update)
> mvneta_stop(dev);
>
>
>
> +++ Voleatech auf der E-World, 11. bis 13. Februar 2020, Halle 5, Stand 521 +++
>
> Beste Grüße/Best regards
>
> Sven Auhagen
> Dipl. Math. oec., M.Sc.
> Voleatech GmbH
> HRB: B 754643
> USTID: DE303643180
> Grathwohlstr. 5
> 72762 Reutlingen
> Tel: +49 7121539550
> Fax: +49 7121539551
> E-Mail: sven.auhagen@voleatech.de
> www.voleatech.de<https://www.voleatech.de>
> Diese Information ist ausschließlich für den Adressaten bestimmt und kann vertraulich oder gesetzlich geschützte Informationen enthalten. Wenn Sie nicht der bestimmungsgemäße Adressat sind, unterrichten Sie bitte den Absender und vernichten Sie diese Mail. Anderen als dem bestimmungsgemäßen Adressaten ist es untersagt, diese E-Mail zu lesen, zu speichern, weiterzuleiten oder ihren Inhalt auf welche Weise auch immer zu verwenden. Für den Adressaten sind die Informationen in dieser Mail nur zum persönlichen Gebrauch. Eine Weiterleitung darf nur nach Rücksprache mit dem Absender erfolgen. Wir verwenden aktuelle Virenschutzprogramme. Für Schäden, die dem Empfänger gleichwohl durch von uns zugesandte mit Viren befallene E-Mails entstehen, schließen wir jede Haftung aus.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-22 23:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-22 8:56 [PATCH] mvneta driver disallow XDP program on hardware buffer management Sven Auhagen
2020-01-22 23:04 ` Lorenzo Bianconi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox