netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "lorenzo.bianconi@redhat.com" <lorenzo.bianconi@redhat.com>
To: Sven Auhagen <sven.auhagen@voleatech.de>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"thomas.petazzoni@bootlin.com" <thomas.petazzoni@bootlin.com>,
	"brouer@redhat.com" <brouer@redhat.com>,
	"ilias.apalodimas@linaro.org" <ilias.apalodimas@linaro.org>,
	"matteo.croce@redhat.com" <matteo.croce@redhat.com>,
	"mw@semihalf.com" <mw@semihalf.com>,
	"jakub.kicinski@netronome.com" <jakub.kicinski@netronome.com>
Subject: Re: [PATCH] mvneta driver XDP fixes armhf
Date: Wed, 22 Jan 2020 23:57:40 +0100	[thread overview]
Message-ID: <20200122225740.GA3384@localhost.localdomain> (raw)
In-Reply-To: <C39F91BD-26BA-4373-A056-CE2E6B9D750E@voleatech.de>

[-- Attachment #1: Type: text/plain, Size: 3513 bytes --]

Hi Sven,

> Recently XDP Support was added to the mvneta driver for software buffer management.
> I tested XDP with my armada 388 board. It has hardware buffer management defined in the device tree file.
> I disabled the mvneta_bm module to test XDP.
> 
> I found multiple problems.
> 
> 1. With hardware buffer management enabled and mvneta_bm disabled the rx_offset was set to 0 with armhf (32 bit) which leads to no headroom in XDP and therefore the XDP Redirect did not work.
> 2. Removing the hardware buffer management from the device tree file completely made the mvneta driver unusable as it did not work anymore.

Do you mean removing 'buffer-manager' property from the device tree?

> 
> After some debugging I found out that xdp->data = data + pp->rx_offset_correction + MVNETA_MH_SIZE;  has to be xdp->data = data + pp->rx_offset_correction; if pp->rx_offset_correction > 0.
> I am not sure why and I am looking for help if someone is seeing the same on an arm64 board.

Are you sure the hw does not insert the mvneta header before the data? It seems
to me that it is added even for hw buffer devices (according to the code).

> 
> Attached is a patch that fixes the problem on my armhf platform, as said I am not sure if this is a universal fix or armhf only.
> 
> Any feedback is appreciated.
> 
> Signed-off-by: Sven Auhagen <sven.auhagen@voleatech.de>
> 
> --- a/drivers/net/ethernet/marvell/mvneta.c2020-01-22 08:44:05.611395960 +0000
> +++ b/drivers/net/ethernet/marvell/mvneta.c2020-01-22 08:59:27.053739433 +0000
> @@ -2158,7 +2158,7 @@ mvneta_swbm_rx_frame(struct mvneta_port
>  prefetch(data);
> 
>  xdp->data_hard_start = data;
> -xdp->data = data + pp->rx_offset_correction + MVNETA_MH_SIZE;
> +xdp->data = data + pp->rx_offset_correction;

This will break XDP support for 'real' sw buffer devices like Espressobin.

Regards,
Lorenzo

>  xdp->data_end = xdp->data + data_len;
>  xdp_set_data_meta_invalid(xdp);
> 
> @@ -4960,7 +4960,8 @@ static int mvneta_probe(struct platform_
>   * 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,
> +if (pp->bm_priv)
> +pp->rx_offset_correction = max(0,
>         NET_SKB_PAD -
>         MVNETA_RX_PKT_OFFSET_CORRECTION);
>  }
> 
> 
> 
> 
> +++ 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 --]

  reply	other threads:[~2020-01-22 22:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22 10:05 [PATCH] mvneta driver XDP fixes armhf Sven Auhagen
2020-01-22 22:57 ` lorenzo.bianconi [this message]
2020-01-24 12:03   ` Sven Auhagen
2020-01-25 11:11     ` Sven Auhagen
2020-01-25 16:30       ` Lorenzo Bianconi
2020-01-27  9:04         ` Sven Auhagen
2020-01-27  9:37           ` Lorenzo Bianconi
2020-01-27  9:56             ` Sven Auhagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200122225740.GA3384@localhost.localdomain \
    --to=lorenzo.bianconi@redhat.com \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=matteo.croce@redhat.com \
    --cc=mw@semihalf.com \
    --cc=netdev@vger.kernel.org \
    --cc=sven.auhagen@voleatech.de \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).