Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/862765/?format=api
{ "id": 862765, "url": "http://patchwork.ozlabs.org/api/patches/862765/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1516253586-7261-1-git-send-email-shannon.nelson@oracle.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1516253586-7261-1-git-send-email-shannon.nelson@oracle.com>", "list_archive_url": null, "date": "2018-01-18T05:33:06", "name": "ixgbe: fix ipv6 support for ipsec offload", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "9b6012a15275f9fc660f0b68876ba7632474a4fe", "submitter": { "id": 70766, "url": "http://patchwork.ozlabs.org/api/people/70766/?format=api", "name": "Shannon Nelson", "email": "shannon.nelson@oracle.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1516253586-7261-1-git-send-email-shannon.nelson@oracle.com/mbox/", "series": [ { "id": 24069, "url": "http://patchwork.ozlabs.org/api/series/24069/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=24069", "date": "2018-01-18T05:33:06", "name": "ixgbe: fix ipv6 support for ipsec offload", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/24069/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/862765/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/862765/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=oracle.com header.i=@oracle.com\n\theader.b=\"t4eUmml9\"; dkim-atps=neutral" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3zMXgH63ZRz9t1t\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 18 Jan 2018 16:33:30 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 2695E88DDA;\n\tThu, 18 Jan 2018 05:33:28 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id FeIouNjGrXns; Thu, 18 Jan 2018 05:33:27 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 4141C88DE9;\n\tThu, 18 Jan 2018 05:33:27 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 3DDB61BF20B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Jan 2018 05:33:26 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 3728088DE9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Jan 2018 05:33:26 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id rtCslY0LI-+f for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Jan 2018 05:33:25 +0000 (UTC)", "from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 785E288DDA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 18 Jan 2018 05:33:25 +0000 (UTC)", "from pps.filterd (aserp2120.oracle.com [127.0.0.1])\n\tby aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id\n\tw0I5VohF165664; Thu, 18 Jan 2018 05:33:23 GMT", "from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])\n\tby aserp2120.oracle.com with ESMTP id 2fjnbr8117-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Thu, 18 Jan 2018 05:33:22 +0000", "from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])\n\tby userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tw0I5XLV4004959\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=FAIL); Thu, 18 Jan 2018 05:33:21 GMT", "from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24])\n\tby aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tw0I5XK2J022342; Thu, 18 Jan 2018 05:33:20 GMT", "from slnelson-mint18.us.oracle.com (/10.39.237.134)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Wed, 17 Jan 2018 21:33:20 -0800" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;\n\th=from : to : cc :\n\tsubject : date : message-id; s=corp-2017-10-26;\n\tbh=2qQzyqk7Ag2cPwXB0MdmNdyYT+5kECgBYmD/zW5n+hc=;\n\tb=t4eUmml954ZH19CGFAja+ZztyDQxMk1zTE5WxRB3yKoNpPMEiT3GzGNwdDmoAygcDGmF\n\tD6a1Dc+whgaUou9z01g9WDYrBoL5CUN4Dyb+L+A7UtONzc/1aWPwN7aQIHnhgDHXt7X1\n\tnIKd8MiTV4QFVsUjdzW/hIxe2JBMfVHjDPQFf2/GGbJnsEEEKGtDTvZOxcM0aMtFwLg+\n\th15tIwsUxZNiFAVnKOhwomsb4MdBry5cJPTcp3lKS/I+wSxCn5tVMOeSLnvT82iqIp0n\n\tWFggp6yODnhz7hv0EIP2zQFBGr2R0hJWe8Op0CpnPxHtRLfzQp1CWAhiH7AcPQX19+ih\n\tYg== ", "From": "Shannon Nelson <shannon.nelson@oracle.com>", "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com", "Date": "Wed, 17 Jan 2018 21:33:06 -0800", "Message-Id": "<1516253586-7261-1-git-send-email-shannon.nelson@oracle.com>", "X-Mailer": "git-send-email 2.7.4", "X-Proofpoint-Virus-Version": "vendor=nai engine=5900 definitions=8777\n\tsignatures=668653", "X-Proofpoint-Spam-Details": "rule=notspam policy=default score=0 suspectscore=0\n\tmalwarescore=0\n\tphishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=877\n\tadultscore=0 classifier=spam adjust=0 reason=mlx scancount=1\n\tengine=8.0.1-1711220000 definitions=main-1801180079", "Subject": "[Intel-wired-lan] [PATCH] ixgbe: fix ipv6 support for ipsec offload", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Cc": "steffen.klassert@secunet.com, sowmini.varadhan@oracle.com,\n\tnetdev@vger.kernel.org", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "Fix up the Rx path to watch for and decode ipv6 headers that might be\ncarrying ipsec headers. To do so, we first change the search function\nto be able to take both ipv4 and ipv6 addresses from a pointer, and add\nan argument that tells which we are using. Then in the Rx handler we\nadd a check for ipv4 vs ipv6 and then parse the headers accordingly.\nWe can assume simple headers because this device won't decode packets\nwith vlan or with ipv4/ipv6 extensions.\n\nWe also change a flag used in the ...add_sa() function as it seems the\nXFRM stack doesn't actually ever set the XFRM_OFFLOAD_IPV6 flag bit.\n\nSigned-off-by: Shannon Nelson <shannon.nelson@oracle.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 39 ++++++++++++++++++--------\n 1 file changed, 27 insertions(+), 12 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c\nindex 587fd8f..93eacdd 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c\n@@ -379,12 +379,13 @@ static int ixgbe_ipsec_find_empty_idx(struct ixgbe_ipsec *ipsec, bool rxtable)\n * @daddr: inbound address to match\n * @proto: protocol to match\n * @spi: SPI to match\n+ * @ip4: true if using an ipv4 address\n *\n * Returns a pointer to the matching SA state information\n **/\n static struct xfrm_state *ixgbe_ipsec_find_rx_state(struct ixgbe_ipsec *ipsec,\n-\t\t\t\t\t\t __be32 daddr, u8 proto,\n-\t\t\t\t\t\t __be32 spi)\n+\t\t\t\t\t\t __be32 *daddr, u8 proto,\n+\t\t\t\t\t\t __be32 spi, bool ip4)\n {\n \tstruct rx_sa *rsa;\n \tstruct xfrm_state *ret = NULL;\n@@ -392,7 +393,9 @@ static struct xfrm_state *ixgbe_ipsec_find_rx_state(struct ixgbe_ipsec *ipsec,\n \trcu_read_lock();\n \thash_for_each_possible_rcu(ipsec->rx_sa_list, rsa, hlist, spi)\n \t\tif (spi == rsa->xs->id.spi &&\n-\t\t daddr == rsa->xs->id.daddr.a4 &&\n+\t\t ((ip4 && *daddr == rsa->xs->id.daddr.a4) ||\n+\t\t (!ip4 && !memcmp(daddr, &rsa->xs->id.daddr.a6,\n+\t\t\t\t sizeof(rsa->xs->id.daddr.a6)))) &&\n \t\t proto == rsa->xs->id.proto) {\n \t\t\tret = rsa->xs;\n \t\t\txfrm_state_hold(ret);\n@@ -505,7 +508,7 @@ static int ixgbe_ipsec_add_sa(struct xfrm_state *xs)\n \t\t}\n \n \t\t/* get ip for rx sa table */\n-\t\tif (xs->xso.flags & XFRM_OFFLOAD_IPV6)\n+\t\tif (xs->props.family == AF_INET6)\n \t\t\tmemcpy(rsa.ipaddr, &xs->id.daddr.a6, 16);\n \t\telse\n \t\t\tmemcpy(&rsa.ipaddr[3], &xs->id.daddr.a4, 4);\n@@ -570,7 +573,7 @@ static int ixgbe_ipsec_add_sa(struct xfrm_state *xs)\n \t\t\trsa.mode |= IXGBE_RXMOD_PROTO_ESP;\n \t\tif (rsa.decrypt)\n \t\t\trsa.mode |= IXGBE_RXMOD_DECRYPT;\n-\t\tif (rsa.xs->xso.flags & XFRM_OFFLOAD_IPV6)\n+\t\tif (rsa.xs->props.family == AF_INET6)\n \t\t\trsa.mode |= IXGBE_RXMOD_IPV6;\n \n \t\t/* the preparations worked, so save the info */\n@@ -812,18 +815,30 @@ void ixgbe_ipsec_rx(struct ixgbe_ring *rx_ring,\n \tstruct ixgbe_ipsec *ipsec = adapter->ipsec;\n \tstruct xfrm_offload *xo = NULL;\n \tstruct xfrm_state *xs = NULL;\n-\tstruct iphdr *iph;\n-\tu8 *c_hdr;\n+\tstruct ipv6hdr *ip6 = NULL;\n+\tstruct iphdr *ip4 = NULL;\n+\tvoid *daddr;\n \t__be32 spi;\n+\tu8 *c_hdr;\n \tu8 proto;\n \n-\t/* we can assume no vlan header in the way, b/c the\n+\t/* Find the ip and crypto headers in the data.\n+\t * We can assume no vlan header in the way, b/c the\n \t * hw won't recognize the IPsec packet and anyway the\n \t * currently vlan device doesn't support xfrm offload.\n \t */\n-\t/* TODO: not supporting IPv6 yet */\n-\tiph = (struct iphdr *)(skb->data + ETH_HLEN);\n-\tc_hdr = (u8 *)iph + iph->ihl * 4;\n+\tif (pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_IPV4)) {\n+\t\tip4 = (struct iphdr *)(skb->data + ETH_HLEN);\n+\t\tdaddr = &ip4->daddr;\n+\t\tc_hdr = (u8 *)ip4 + ip4->ihl * 4;\n+\t} else if (pkt_info & cpu_to_le16(IXGBE_RXDADV_PKTTYPE_IPV6)) {\n+\t\tip6 = (struct ipv6hdr *)(skb->data + ETH_HLEN);\n+\t\tdaddr = &ip6->daddr;\n+\t\tc_hdr = (u8 *)ip6 + sizeof(struct ipv6hdr);\n+\t} else {\n+\t\treturn;\n+\t}\n+\n \tswitch (pkt_info & ipsec_pkt_types) {\n \tcase cpu_to_le16(IXGBE_RXDADV_PKTTYPE_IPSEC_AH):\n \t\tspi = ((struct ip_auth_hdr *)c_hdr)->spi;\n@@ -837,7 +852,7 @@ void ixgbe_ipsec_rx(struct ixgbe_ring *rx_ring,\n \t\treturn;\n \t}\n \n-\txs = ixgbe_ipsec_find_rx_state(ipsec, iph->daddr, proto, spi);\n+\txs = ixgbe_ipsec_find_rx_state(ipsec, daddr, proto, spi, !!ip4);\n \tif (unlikely(!xs))\n \t\treturn;\n \n", "prefixes": [] }