Message ID | 20200125080702.81712-1-sven.auhagen@voleatech.de |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
Series | [v5] mvneta driver disallow XDP program on hardware buffer management | expand |
> 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. > [...] > --- a/drivers/net/ethernet/marvell/mvneta.c > +++ b/drivers/net/ethernet/marvell/mvneta.c > @@ -4225,6 +4225,12 @@ static int mvneta_xdp_setup(struct net_device *dev, struct bpf_prog *prog, > return -EOPNOTSUPP; > } > > +if (pp->bm_priv) { > +NL_SET_ERR_MSG_MOD(extack, > + "Hardware Buffer Management not supported on XDP"); > +return -EOPNOTSUPP; > +} Could you please fix the following checkpatch warnings? $ <kernel_dir>/scripts/checkpatch.pl --strict file.patch WARNING: suspect code indent for conditional statements (0, 0) #53: FILE: drivers/net/ethernet/marvell/mvneta.c:4228: +if (pp->bm_priv) { +NL_SET_ERR_MSG_MOD(extack, CHECK: Alignment should match open parenthesis #55: FILE: drivers/net/ethernet/marvell/mvneta.c:4230: +NL_SET_ERR_MSG_MOD(extack, + "Hardware Buffer Management not supported on XDP"); WARNING: please, no spaces at the start of a line #55: FILE: drivers/net/ethernet/marvell/mvneta.c:4230: + "Hardware Buffer Management not supported on XDP");$ total: 0 errors, 2 warnings, 12 lines checked 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. >
On Sat, Jan 25, 2020 at 09:48:12AM +0100, lorenzo.bianconi@redhat.com wrote: > > 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. > > > > [...] > > > --- a/drivers/net/ethernet/marvell/mvneta.c > > +++ b/drivers/net/ethernet/marvell/mvneta.c > > @@ -4225,6 +4225,12 @@ static int mvneta_xdp_setup(struct net_device *dev, struct bpf_prog *prog, > > return -EOPNOTSUPP; > > } > > > > +if (pp->bm_priv) { > > +NL_SET_ERR_MSG_MOD(extack, > > + "Hardware Buffer Management not supported on XDP"); > > +return -EOPNOTSUPP; > > +} > > Could you please fix the following checkpatch warnings? > > $ <kernel_dir>/scripts/checkpatch.pl --strict file.patch > > WARNING: suspect code indent for conditional statements (0, 0) > #53: FILE: drivers/net/ethernet/marvell/mvneta.c:4228: > +if (pp->bm_priv) { > +NL_SET_ERR_MSG_MOD(extack, > > CHECK: Alignment should match open parenthesis > #55: FILE: drivers/net/ethernet/marvell/mvneta.c:4230: > +NL_SET_ERR_MSG_MOD(extack, > + "Hardware Buffer Management not supported on XDP"); > > WARNING: please, no spaces at the start of a line > #55: FILE: drivers/net/ethernet/marvell/mvneta.c:4230: > + "Hardware Buffer Management not supported on XDP");$ > > total: 0 errors, 2 warnings, 12 lines checked > > Regards, > Lorenzo I double checked and I do not have those warning on my end with v5. I also redownloaded the patch from my submission on patchwork. What am I missing? Best Sven > > > + > > 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. > >
From: Sven Auhagen <sven.auhagen@voleatech.de> Date: Sat, 25 Jan 2020 08:07:03 +0000 > 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. > > I am sorry about that. It is my first submission and I am having > some troubles with the format of my emails. > > v4 -> v5: > - Remove extra tabs > > v3 -> v4: > - Please ignore v3 I accidentally submitted > my other patch with git-send-mail and v4 is correct > > v2 -> v3: > - My mailserver corrupted the patch > resubmission with git-send-email > > v1 -> v2: > - Fixing the patches indentation > > Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de> Applied and queued up for -stable, thakns.
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 71a872d46bc4..96593b9fbd9b 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -4225,6 +4225,12 @@ static int mvneta_xdp_setup(struct net_device *dev, struct bpf_prog *prog, 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);
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. I am sorry about that. It is my first submission and I am having some troubles with the format of my emails. v4 -> v5: - Remove extra tabs v3 -> v4: - Please ignore v3 I accidentally submitted my other patch with git-send-mail and v4 is correct v2 -> v3: - My mailserver corrupted the patch resubmission with git-send-email v1 -> v2: - Fixing the patches indentation Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>