Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/815223/?format=api
{ "id": 815223, "url": "http://patchwork.ozlabs.org/api/patches/815223/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170919003904.5124-13-tom@quantonium.net/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "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": "<20170919003904.5124-13-tom@quantonium.net>", "list_archive_url": null, "date": "2017-09-19T00:39:02", "name": "[net-next,12/14] gtp: Configuration for zero UDP checksum", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "640db5862efb091ab1ea43876a04869625ee5629", "submitter": { "id": 72064, "url": "http://patchwork.ozlabs.org/api/people/72064/?format=api", "name": "Tom Herbert", "email": "tom@quantonium.net" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170919003904.5124-13-tom@quantonium.net/mbox/", "series": [ { "id": 3758, "url": "http://patchwork.ozlabs.org/api/series/3758/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=3758", "date": "2017-09-19T00:38:50", "name": "gtp: Additional feature support", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/3758/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/815223/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/815223/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>)", "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=quantonium-net.20150623.gappssmtp.com\n\theader.i=@quantonium-net.20150623.gappssmtp.com\n\theader.b=\"Ua1aM4iJ\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xx3tY4bvxz9s5L\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 19 Sep 2017 10:40:05 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751539AbdISAkD (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 18 Sep 2017 20:40:03 -0400", "from mail-pg0-f49.google.com ([74.125.83.49]:55317 \"EHLO\n\tmail-pg0-f49.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751499AbdISAkB (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 18 Sep 2017 20:40:01 -0400", "by mail-pg0-f49.google.com with SMTP id b11so1081389pgn.12\n\tfor <netdev@vger.kernel.org>; Mon, 18 Sep 2017 17:40:00 -0700 (PDT)", "from localhost.localdomain (c-73-162-13-107.hsd1.ca.comcast.net.\n\t[73.162.13.107]) by smtp.gmail.com with ESMTPSA id\n\tk78sm662018pfb.157.2017.09.18.17.39.58\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 18 Sep 2017 17:39:59 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=quantonium-net.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=RR4DxypPfqZ8aeG8beor0M3BzaJnXlqfm+25oYwqfi8=;\n\tb=Ua1aM4iJ2tH+2+Nx8OL9ZJtwRvApmuVCWHC6xqK8Gk1T2A2mhGngwPchKOwj1FtFum\n\tg8Qb5OnfMbFeqm8N22plk3xGxg7rbyhU8YQdxl4c1Dx8fjHOTswoIWw8kuwBjOjob1sF\n\tvtfwMTHLclFs/QDnskSHxyR1jWXVbg8bLK26i0ubBNGzYk3+SG8GZBlD27C9O6ij2Ng3\n\tR6x7SdAxc9/L7Pj7c6YjQLjJUIh7BYMCcSborRIEULO/zxyCTsRO2lErv/aV0o8zghqm\n\t+ruvHUDpT+M9lj4dETiZvzA5VZrSmAHSqCXJgdFcmbkJulnU61Pim5Fb2SdckM3TdxxF\n\t63/g==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=RR4DxypPfqZ8aeG8beor0M3BzaJnXlqfm+25oYwqfi8=;\n\tb=FvYs68ENFmUbvkGSUCou1PJ+qpy/LsxZGy7cJB3QJAUAnCFFkI2PGezSR52+oxrO/Y\n\tLGzemMfTM0tnq5jyI5DGtzCPvily4JqoMLORaUt66A4qBlOJmj2s4V+VfveHDuyk0Ufq\n\ts6Hlhys3uP51aey9mAB0mc6QRsAul30d3x28se9mNQy/1R1qCdwtHImag++xuLNEg880\n\tSdpAiAOShG44PcSjMkdcUZaBlhU/KOXpWp9/M4NTdlZ8V7Q+4VjDnHMf19cCYxHjH4/8\n\tEKrSFYcTQG+y+dvsnAoXN6tj73MnKRxM40a3GeGtXnW1Q0CTwjgTgDG2wQvc1bjn6i0H\n\tfo1g==", "X-Gm-Message-State": "AHPjjUjNa0nE0G7322bXPZgQDZ/+8ewjn3NedWEd5Eg5sbHAFirg3cpf\n\tTGCr7oMZwRX7rn3U", "X-Google-Smtp-Source": "AOwi7QDd/WVUFcfCsomvvSI/d9ZpR6dY6FlZKKnuYLBW0FFiPxfWYtkJ7JW8w/3gC2zBTE2GgbL2YA==", "X-Received": "by 10.84.216.87 with SMTP id f23mr335308plj.307.1505781600402;\n\tMon, 18 Sep 2017 17:40:00 -0700 (PDT)", "From": "Tom Herbert <tom@quantonium.net>", "To": "davem@davemloft.net", "Cc": "netdev@vger.kernel.org, pablo@netfilter.org, laforge@gnumonks.org,\n\trohit@quantonium.net, Tom Herbert <tom@quantonium.net>", "Subject": "[PATCH net-next 12/14] gtp: Configuration for zero UDP checksum", "Date": "Mon, 18 Sep 2017 17:39:02 -0700", "Message-Id": "<20170919003904.5124-13-tom@quantonium.net>", "X-Mailer": "git-send-email 2.11.0", "In-Reply-To": "<20170919003904.5124-1-tom@quantonium.net>", "References": "<20170919003904.5124-1-tom@quantonium.net>", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "Add configuration to control use of zero checksums on transmit for both\nIPv4 and IPv6, and control over accepting zero IPv6 checksums on\nreceive.\n\nSigned-off-by: Tom Herbert <tom@quantonium.net>\n---\n drivers/net/gtp.c | 35 +++++++++++++++++++++++++++++++++--\n include/uapi/linux/if_link.h | 4 ++++\n 2 files changed, 37 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c\nindex 393f63cb2576..b53946f8b10b 100644\n--- a/drivers/net/gtp.c\n+++ b/drivers/net/gtp.c\n@@ -75,6 +75,13 @@ struct pdp_ctx {\n \tstruct rcu_head\t\trcu_head;\n \n \tstruct dst_cache\tdst_cache;\n+\n+\tunsigned int\t\tcfg_flags;\n+\n+#define GTP_F_UDP_ZERO_CSUM_TX\t\t0x1\n+#define GTP_F_UDP_ZERO_CSUM6_TX\t\t0x2\n+#define GTP_F_UDP_ZERO_CSUM6_RX\t\t0x4\n+\n };\n \n /* One instance of the GTP device. */\n@@ -536,6 +543,7 @@ static int gtp_xmit(struct sk_buff *skb, struct net_device *dev,\n \tstruct gtp_dev *gtp = netdev_priv(dev);\n \tbool xnet = !net_eq(gtp->net, dev_net(gtp->dev));\n \tstruct sock *sk = pctx->sk;\n+\tbool udp_csum;\n \tint err = 0;\n \n \t/* Ensure there is sufficient headroom. */\n@@ -563,11 +571,12 @@ static int gtp_xmit(struct sk_buff *skb, struct net_device *dev,\n \t\tskb_dst_drop(skb);\n \n \t\tgtp_push_header(skb, pctx);\n+\t\tudp_csum = !(pctx->cfg_flags & GTP_F_UDP_ZERO_CSUM_TX);\n \t\tudp_tunnel_xmit_skb(rt, sk, skb, saddr,\n \t\t\t\t pctx->peer_addr_ip4.s_addr,\n \t\t\t\t 0, ip4_dst_hoplimit(&rt->dst), 0,\n \t\t\t\t pctx->gtp_port, pctx->gtp_port,\n-\t\t\t\t xnet, false);\n+\t\t\t\t xnet, !udp_csum);\n \n \t\tnetdev_dbg(dev, \"gtp -> IP src: %pI4 dst: %pI4\\n\",\n \t\t\t &saddr, &pctx->peer_addr_ip4.s_addr);\n@@ -591,11 +600,12 @@ static int gtp_xmit(struct sk_buff *skb, struct net_device *dev,\n \t\tskb_dst_drop(skb);\n \n \t\tgtp_push_header(skb, pctx);\n+\t\tudp_csum = !(pctx->cfg_flags & GTP_F_UDP_ZERO_CSUM6_TX);\n \t\tudp_tunnel6_xmit_skb(dst, sk, skb, dev,\n \t\t\t\t &saddr, &pctx->peer_addr_ip6,\n \t\t\t\t 0, ip6_dst_hoplimit(dst), 0,\n \t\t\t\t pctx->gtp_port, pctx->gtp_port,\n-\t\t\t\t true);\n+\t\t\t\t !udp_csum);\n \n \t\tnetdev_dbg(dev, \"gtp -> IP src: %pI6 dst: %pI6\\n\",\n \t\t\t &saddr, &pctx->peer_addr_ip6);\n@@ -728,6 +738,7 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev,\n {\n \tunsigned int role = GTP_ROLE_GGSN;\n \tbool have_fd, have_ports;\n+\tunsigned int flags = 0;\n \tbool is_ipv6 = false;\n \tstruct gtp_dev *gtp;\n \tstruct gtp_net *gn;\n@@ -747,6 +758,21 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev,\n \t\t\treturn -EINVAL;\n \t}\n \n+\tif (data[IFLA_GTP_UDP_CSUM]) {\n+\t\tif (!nla_get_u8(data[IFLA_GTP_UDP_CSUM]))\n+\t\t\tflags |= GTP_F_UDP_ZERO_CSUM_TX;\n+\t}\n+\n+\tif (data[IFLA_GTP_UDP_ZERO_CSUM6_TX]) {\n+\t\tif (nla_get_u8(data[IFLA_GTP_UDP_ZERO_CSUM6_TX]))\n+\t\t\tflags |= GTP_F_UDP_ZERO_CSUM6_TX;\n+\t}\n+\n+\tif (data[IFLA_GTP_UDP_ZERO_CSUM6_RX]) {\n+\t\tif (nla_get_u8(data[IFLA_GTP_UDP_ZERO_CSUM6_RX]))\n+\t\t\tflags |= GTP_F_UDP_ZERO_CSUM6_RX;\n+\t}\n+\n \tif (data[IFLA_GTP_AF]) {\n \t\tu16 af = nla_get_u16(data[IFLA_GTP_AF]);\n \n@@ -819,6 +845,9 @@ static const struct nla_policy gtp_policy[IFLA_GTP_MAX + 1] = {\n \t[IFLA_GTP_ROLE]\t\t\t= { .type = NLA_U32 },\n \t[IFLA_GTP_PORT0]\t\t= { .type = NLA_U16 },\n \t[IFLA_GTP_PORT1]\t\t= { .type = NLA_U16 },\n+\t[IFLA_GTP_UDP_CSUM]\t\t= { .type = NLA_U8 },\n+\t[IFLA_GTP_UDP_ZERO_CSUM6_TX]\t= { .type = NLA_U8 },\n+\t[IFLA_GTP_UDP_ZERO_CSUM6_RX]\t= { .type = NLA_U8 },\n };\n \n static int gtp_validate(struct nlattr *tb[], struct nlattr *data[],\n@@ -990,6 +1019,8 @@ static struct socket *gtp_create_sock(struct net *net, bool ipv6,\n \n \tif (ipv6) {\n \t\tudp_conf.family = AF_INET6;\n+\t\tudp_conf.use_udp6_rx_checksums =\n+\t\t !(flags & GTP_F_UDP_ZERO_CSUM6_RX);\n \t\tudp_conf.ipv6_v6only = 1;\n \t} else {\n \t\tudp_conf.family = AF_INET;\ndiff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h\nindex 81c26864abeb..14a32d745e24 100644\n--- a/include/uapi/linux/if_link.h\n+++ b/include/uapi/linux/if_link.h\n@@ -555,6 +555,10 @@ enum {\n \tIFLA_GTP_AF,\n \tIFLA_GTP_PORT0,\n \tIFLA_GTP_PORT1,\n+\tIFLA_GTP_UDP_CSUM,\n+\tIFLA_GTP_UDP_ZERO_CSUM6_TX,\n+\tIFLA_GTP_UDP_ZERO_CSUM6_RX,\n+\n \t__IFLA_GTP_MAX,\n };\n #define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)\n", "prefixes": [ "net-next", "12/14" ] }