bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] veth: xdp: use head instead of hard_start
@ 2020-03-30 10:26 Mao Wenan
  2020-03-30 11:34 ` Jesper Dangaard Brouer
  0 siblings, 1 reply; 14+ messages in thread
From: Mao Wenan @ 2020-03-30 10:26 UTC (permalink / raw)
  To: davem, ast, daniel, kuba, hawk, john.fastabend, kafai,
	songliubraving, yhs, andriin, jwi, toshiaki.makita1,
	jianglidong3, edumazet
  Cc: netdev, linux-kernel, bpf, kernel-janitors

xdp.data_hard_start is mapped to the first
address of xdp_frame, but the pointer hard_start
is the offset(sizeof(struct xdp_frame)) of xdp_frame,
it should use head instead of hard_start to
set xdp.data_hard_start. Otherwise, if BPF program
calls helper_function such as bpf_xdp_adjust_head, it
will be confused for xdp_frame_end.

Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
 drivers/net/veth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index d4cbb9e8c63f..5ea550884bf8 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -506,7 +506,7 @@ static struct sk_buff *veth_xdp_rcv_one(struct veth_rq *rq,
 		struct xdp_buff xdp;
 		u32 act;
 
-		xdp.data_hard_start = hard_start;
+		xdp.data_hard_start = head;
 		xdp.data = frame->data;
 		xdp.data_end = frame->data + frame->len;
 		xdp.data_meta = frame->data - frame->metasize;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-04-03 21:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-30 10:26 [PATCH net] veth: xdp: use head instead of hard_start Mao Wenan
2020-03-30 11:34 ` Jesper Dangaard Brouer
2020-03-30 23:35   ` Toshiaki Makita
2020-03-31  3:56     ` maowenan
2020-03-31  5:45       ` Toshiaki Makita
2020-03-31  6:06         ` [PATCH net v2] " Mao Wenan
2020-03-31  6:16           ` Toshiaki Makita
2020-04-01 16:15             ` Jesper Dangaard Brouer
2020-04-02  0:47               ` Toshiaki Makita
2020-04-02  9:06                 ` Jesper Dangaard Brouer
2020-04-02 15:40                   ` Alexei Starovoitov
2020-04-03  7:58                     ` Jesper Dangaard Brouer
2020-04-03 21:12                       ` Alexei Starovoitov
2020-04-02  1:23               ` maowenan

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).