From: Alexander Lobakin <alexandr.lobakin@intel.com>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: Alexander Lobakin <alexandr.lobakin@intel.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, ast@kernel.org,
daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
UNGLinuxDriver@microchip.com
Subject: Re: [PATCH net-next v2 1/5] net: lan966x: Add XDP_PACKET_HEADROOM
Date: Wed, 16 Nov 2022 16:45:28 +0100 [thread overview]
Message-ID: <20221116154528.3390307-1-alexandr.lobakin@intel.com> (raw)
In-Reply-To: <20221115214456.1456856-2-horatiu.vultur@microchip.com>
From: Horatiu Vultur <horatiu.vultur@microchip.com>
Date: Tue, 15 Nov 2022 22:44:52 +0100
> Update the page_pool params to allocate XDP_PACKET_HEADROOM space as
> headroom for all received frames.
> This is needed for when the XDP_TX and XDP_REDIRECT are implemented.
>
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
[...]
> @@ -466,6 +470,7 @@ static struct sk_buff *lan966x_fdma_rx_get_frame(struct lan966x_rx *rx,
>
> skb_mark_for_recycle(skb);
>
> + skb_reserve(skb, XDP_PACKET_HEADROOM);
Oh, forgot to ask previously. Just curious, which platforms do
usually have this NIC? Do those platforms have
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS set?
If no, then adding %NET_SKB_PAD to the headroom can significantly
improve performance, as currently you have 28 bytes of IFH + 14
bytes of Eth header, so IP header is not aligned to 4 bytes
boundary. Kernel and other drivers often expect IP header to be
aligned. Adding %NET_SKB_PAD to the headroom addresses that.
...but be careful, I've just realized that you have IFH in front
of Eth header, that means that it will also become unaligned after
that change, so make sure you don't access it with words bigger
than 2 bytes. Just test all the variants and pick the best :D
> skb_put(skb, FDMA_DCB_STATUS_BLOCKL(db->status));
>
> lan966x_ifh_get_timestamp(skb->data, ×tamp);
> @@ -786,7 +791,8 @@ static int lan966x_fdma_get_max_frame(struct lan966x *lan966x)
> return lan966x_fdma_get_max_mtu(lan966x) +
> IFH_LEN_BYTES +
> SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) +
> - VLAN_HLEN * 2;
> + VLAN_HLEN * 2 +
> + XDP_PACKET_HEADROOM;
> }
[...]
> --
> 2.38.0
Thanks,
Olek
next prev parent reply other threads:[~2022-11-16 15:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 21:44 [PATCH net-next v2 0/5] net: lan966x: Extend xdp support Horatiu Vultur
2022-11-15 21:44 ` [PATCH net-next v2 1/5] net: lan966x: Add XDP_PACKET_HEADROOM Horatiu Vultur
2022-11-16 15:45 ` Alexander Lobakin [this message]
2022-11-16 18:50 ` Horatiu Vultur
2022-11-15 21:44 ` [PATCH net-next v2 2/5] net: lan966x: Introduce helper functions Horatiu Vultur
2022-11-15 21:44 ` [PATCH net-next v2 3/5] net: lan966x: Add len field to lan966x_tx_dcb_buf Horatiu Vultur
2022-11-15 21:44 ` [PATCH net-next v2 4/5] net: lan966x: Add support for XDP_TX Horatiu Vultur
2022-11-16 15:34 ` Alexander Lobakin
2022-11-16 20:55 ` Horatiu Vultur
2022-11-17 15:31 ` Alexander Lobakin
2022-11-18 15:50 ` Horatiu Vultur
2022-11-15 21:44 ` [PATCH net-next v2 5/5] net: lan966x: Add support for XDP_REDIRECT Horatiu Vultur
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=20221116154528.3390307-1-alexandr.lobakin@intel.com \
--to=alexandr.lobakin@intel.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=horatiu.vultur@microchip.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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