Thread (32 messages) 32 messages, 4 authors, 2023-04-04

Re: [PATCH net-next 8/8] virtio_net: introduce receive_small_xdp()

From: "Michael S. Tsirkin" <mst@redhat.com>
Date: 2023-03-31 07:25:55
Also in: bpf, virtualization

On Fri, Mar 31, 2023 at 03:20:35PM +0800, Xuan Zhuo wrote:
On Thu, 30 Mar 2023 12:48:22 +0200, Paolo Abeni [off-list ref] wrote:
quoted
On Tue, 2023-03-28 at 20:04 +0800, Xuan Zhuo wrote:
quoted
@@ -949,15 +1042,11 @@ static struct sk_buff *receive_small(struct net_device *dev,
 {
 	struct sk_buff *skb;
 	struct bpf_prog *xdp_prog;
-	unsigned int xdp_headroom = (unsigned long)ctx;
-	unsigned int header_offset = VIRTNET_RX_PAD + xdp_headroom;
+	unsigned int header_offset = VIRTNET_RX_PAD;
 	unsigned int headroom = vi->hdr_len + header_offset;
This changes (reduces) the headroom for non-xpd-pass skbs.

[...]
quoted
+	buf += header_offset;
+	memcpy(skb_vnet_hdr(skb), buf, vi->hdr_len);
AFAICS, that also means that receive_small(), for such packets, will
look for the virtio header in a different location. Is that expected?

That is a mistake.

Will fix.

Thanks.
Do try to test small and big packet configurations though, too.
quoted
Thanks.

Paolo
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help