[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191126100744.5083-11-prashantbhole.linux@gmail.com>
Date: Tue, 26 Nov 2019 19:07:36 +0900
From: Prashant Bhole <prashantbhole.linux@...il.com>
To: "David S . Miller" <davem@...emloft.net>,
"Michael S . Tsirkin" <mst@...hat.com>
Cc: Prashant Bhole <prashantbhole.linux@...il.com>,
Jason Wang <jasowang@...hat.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Andrii Nakryiko <andriin@...com>, netdev@...r.kernel.org,
qemu-devel@...gnu.org, kvm@...r.kernel.org
Subject: [RFC net-next 10/18] tun: handle XDP_TX action of offloaded program
When offloaded program returns XDP_TX, we need to inject the packet in
Rx path of tun. This patch injects such packets in Rx path using
tun_xdp_one.
Signed-off-by: Prashant Bhole <prashantbhole.linux@...il.com>
---
drivers/net/tun.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 8d6cdd3e5139..084ca95358fe 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -2249,7 +2249,13 @@ static u32 tun_do_xdp_offload(struct tun_struct *tun, struct tun_file *tfile,
case XDP_PASS:
break;
case XDP_TX:
- /* fall through */
+ tpage.page = NULL;
+ tpage.count = 0;
+ tun_xdp_one(tun, tfile, &xdp, &flush, &tpage, false);
+ tun_put_page(&tpage);
+ if (flush)
+ xdp_do_flush_map();
+ break;
case XDP_REDIRECT:
/* fall through */
default:
--
2.20.1
Powered by blists - more mailing lists