{"id":809503,"url":"http://patchwork.ozlabs.org/api/1.2/patches/809503/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/patch/1504496169-31190-2-git-send-email-jasowang@redhat.com/","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.2/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1504496169-31190-2-git-send-email-jasowang@redhat.com>","list_archive_url":null,"date":"2017-09-04T03:36:09","name":"[net-next,2/2] tun: rename generic_xdp to skb_xdp","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"babfa97c43245fc13f5aa90f567334bfe6205d14","submitter":{"id":5225,"url":"http://patchwork.ozlabs.org/api/1.2/people/5225/?format=json","name":"Jason Wang","email":"jasowang@redhat.com"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.2/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/1504496169-31190-2-git-send-email-jasowang@redhat.com/mbox/","series":[{"id":1297,"url":"http://patchwork.ozlabs.org/api/1.2/series/1297/?format=json","web_url":"http://patchwork.ozlabs.org/project/netdev/list/?series=1297","date":"2017-09-04T03:36:09","name":"[net-next,1/2] tun: reserve extra headroom only when XDP is set","version":1,"mbox":"http://patchwork.ozlabs.org/series/1297/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/809503/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/809503/checks/","tags":{},"related":[],"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx01.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jasowang@redhat.com"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xlwWF6mcZz9s82\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon,  4 Sep 2017 13:36:41 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753285AbdIDDgW (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSun, 3 Sep 2017 23:36:22 -0400","from mx1.redhat.com ([209.132.183.28]:56930 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1753198AbdIDDgU (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tSun, 3 Sep 2017 23:36:20 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id D47058535D;\n\tMon,  4 Sep 2017 03:36:19 +0000 (UTC)","from jason-ThinkPad-T450s.redhat.com (ovpn-12-84.pek2.redhat.com\n\t[10.72.12.84])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 712D860462;\n\tMon,  4 Sep 2017 03:36:17 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com D47058535D","From":"Jason Wang <jasowang@redhat.com>","To":"netdev@vger.kernel.org, linux-kernel@vger.kernel.org","Cc":"mst@redhat.com, Jason Wang <jasowang@redhat.com>,\n\tDaniel Borkmann <daniel@iogearbox.net>","Subject":"[PATCH net-next 2/2] tun: rename generic_xdp to skb_xdp","Date":"Mon,  4 Sep 2017 11:36:09 +0800","Message-Id":"<1504496169-31190-2-git-send-email-jasowang@redhat.com>","In-Reply-To":"<1504496169-31190-1-git-send-email-jasowang@redhat.com>","References":"<1504496169-31190-1-git-send-email-jasowang@redhat.com>","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tMon, 04 Sep 2017 03:36:20 +0000 (UTC)","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"Rename \"generic_xdp\" to \"skb_xdp\" to avoid confusing it with the\ngeneric XDP which will be done at netif_receive_skb().\n\nCc: Daniel Borkmann <daniel@iogearbox.net>\nSigned-off-by: Jason Wang <jasowang@redhat.com>\n---\n drivers/net/tun.c | 18 +++++++++++-------\n 1 file changed, 11 insertions(+), 7 deletions(-)","diff":"diff --git a/drivers/net/tun.c b/drivers/net/tun.c\nindex 80ac18f..3c9985f 100644\n--- a/drivers/net/tun.c\n+++ b/drivers/net/tun.c\n@@ -1267,7 +1267,7 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun,\n \t\t\t\t     struct tun_file *tfile,\n \t\t\t\t     struct iov_iter *from,\n \t\t\t\t     struct virtio_net_hdr *hdr,\n-\t\t\t\t     int len, int *generic_xdp)\n+\t\t\t\t     int len, int *skb_xdp)\n {\n \tstruct page_frag *alloc_frag = &current->task_frag;\n \tstruct sk_buff *skb;\n@@ -1301,13 +1301,13 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun,\n \t * we do XDP on skb in case the headroom is not enough.\n \t */\n \tif (hdr->gso_type || !xdp_prog)\n-\t\t*generic_xdp = 1;\n+\t\t*skb_xdp = 1;\n \telse\n-\t\t*generic_xdp = 0;\n+\t\t*skb_xdp = 0;\n \n \trcu_read_lock();\n \txdp_prog = rcu_dereference(tun->xdp_prog);\n-\tif (xdp_prog && !*generic_xdp) {\n+\tif (xdp_prog && !*skb_xdp) {\n \t\tstruct xdp_buff xdp;\n \t\tvoid *orig_data;\n \t\tu32 act;\n@@ -1389,7 +1389,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,\n \tbool zerocopy = false;\n \tint err;\n \tu32 rxhash;\n-\tint generic_xdp = 1;\n+\tint skb_xdp = 1;\n \n \tif (!(tun->dev->flags & IFF_UP))\n \t\treturn -EIO;\n@@ -1448,7 +1448,11 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,\n \t}\n \n \tif (tun_can_build_skb(tun, tfile, len, noblock, zerocopy)) {\n-\t\tskb = tun_build_skb(tun, tfile, from, &gso, len, &generic_xdp);\n+\t\t/* For the packet that is not easy to be processed\n+\t\t * (e.g gso or jumbo packet), we will do it at after\n+\t\t * skb was created with generic XDP routine.\n+\t\t */\n+\t\tskb = tun_build_skb(tun, tfile, from, &gso, len, &skb_xdp);\n \t\tif (IS_ERR(skb)) {\n \t\t\tthis_cpu_inc(tun->pcpu_stats->rx_dropped);\n \t\t\treturn PTR_ERR(skb);\n@@ -1528,7 +1532,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,\n \tskb_reset_network_header(skb);\n \tskb_probe_transport_header(skb, 0);\n \n-\tif (generic_xdp) {\n+\tif (skb_xdp) {\n \t\tstruct bpf_prog *xdp_prog;\n \t\tint ret;\n \n","prefixes":["net-next","2/2"]}