Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/64793/?format=api
http://patchwork.dpdk.org/api/patches/64793/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1579178697-31777-9-git-send-email-bernard.iremonger@intel.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1579178697-31777-9-git-send-email-bernard.iremonger@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1579178697-31777-9-git-send-email-bernard.iremonger@intel.com", "date": "2020-01-16T12:44:55", "name": "[v7,08/10] net/i40e: support ESP in Flow Director", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "1b195008e5875dca3e2666dfa123bf1a8b764662", "submitter": { "id": 91, "url": "http://patchwork.dpdk.org/api/people/91/?format=api", "name": "Iremonger, Bernard", "email": "bernard.iremonger@intel.com" }, "delegate": { "id": 319, "url": "http://patchwork.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1579178697-31777-9-git-send-email-bernard.iremonger@intel.com/mbox/", "series": [ { "id": 8169, "url": "http://patchwork.dpdk.org/api/series/8169/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=8169", "date": "2020-01-16T12:44:55", "name": null, "version": 7, "mbox": "http://patchwork.dpdk.org/series/8169/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/64793/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/64793/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 5ED81A0352;\n\tThu, 16 Jan 2020 13:46:22 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3FCC31D41A;\n\tThu, 16 Jan 2020 13:45:24 +0100 (CET)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by dpdk.org (Postfix) with ESMTP id 6E83A1D17D\n for <dev@dpdk.org>; Thu, 16 Jan 2020 13:45:19 +0100 (CET)", "from orsmga006.jf.intel.com ([10.7.209.51])\n by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 16 Jan 2020 04:45:19 -0800", "from sivswdev08.ir.intel.com (HELO localhost.localdomain)\n ([10.237.217.47])\n by orsmga006.jf.intel.com with ESMTP; 16 Jan 2020 04:45:17 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.70,326,1574150400\"; d=\"scan'208\";a=\"226641681\"", "From": "Bernard Iremonger <bernard.iremonger@intel.com>", "To": "dev@dpdk.org, beilei.xing@intel.com, qi.z.zhang@intel.com,\n declan.doherty@intel.com", "Cc": "konstantin.ananyev@intel.com, stephen1.byrne@intel.com,\n helin.zhang@intel.com, Bernard Iremonger <bernard.iremonger@intel.com>", "Date": "Thu, 16 Jan 2020 12:44:55 +0000", "Message-Id": "<1579178697-31777-9-git-send-email-bernard.iremonger@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": "<1579103627-31985-1-git-send-email-bernard.iremonger@intel.com>", "References": "<1579103627-31985-1-git-send-email-bernard.iremonger@intel.com>", "Subject": "[dpdk-dev] [PATCH v7 08/10] net/i40e: support ESP in Flow Director", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "add fill_ip6_head()\nhardcode udp destination port to 4500\nhandle ESP and AH pctypes in ESP-AH profile\nupdate the i40e user guide with ESP information.\nupdate release notes for i40e changes\n\nSigned-off-by: Bernard Iremonger <bernard.iremonger@intel.com>\nAcked-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n doc/guides/nics/i40e.rst | 4 +-\n doc/guides/rel_notes/release_20_02.rst | 6 ++\n drivers/net/i40e/i40e_fdir.c | 126 ++++++++++++++++++++++++++++++---\n 3 files changed, 127 insertions(+), 9 deletions(-)", "diff": "diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst\nindex 38acf59..5cf34d9 100644\n--- a/doc/guides/nics/i40e.rst\n+++ b/doc/guides/nics/i40e.rst\n@@ -457,7 +457,7 @@ which is used to configure hardware by downloading a profile to support\n protocols/filters which are not supported by default. The DDP\n functionality requires a NIC firmware version of 6.0 or greater.\n \n-Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP,\n+Current implementation supports GTP-C/GTP-U/PPPoE/PPPoL2TP/ESP,\n steering can be used with rte_flow API.\n \n GTPv1 package is released, and it can be downloaded from\n@@ -466,6 +466,8 @@ https://downloadcenter.intel.com/download/27587.\n PPPoE package is released, and it can be downloaded from\n https://downloadcenter.intel.com/download/28040.\n \n+ESP-AH package is not released yet.\n+\n Load a profile which supports GTP and store backup profile:\n \n .. code-block:: console\ndiff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst\nindex 057b7ee..cd4f6eb 100644\n--- a/doc/guides/rel_notes/release_20_02.rst\n+++ b/doc/guides/rel_notes/release_20_02.rst\n@@ -60,6 +60,12 @@ New Features\n \n Added support for ESP rte_flow patterns to the testpmd application.\n \n+* **Updated i40e driver to support ESP.**\n+\n+ Updated the i40e PMD to support ESP-AH supporting profiles which can be\n+ programmed by the dynamic device personalization (DDP) process.\n+\n+\n \n Removed Items\n -------------\ndiff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c\nindex dee007d..5f85703 100644\n--- a/drivers/net/i40e/i40e_fdir.c\n+++ b/drivers/net/i40e/i40e_fdir.c\n@@ -54,6 +54,8 @@\n #define I40E_FDIR_GTP_MSG_TYPE_0X01 0x01\n #define I40E_FDIR_GTP_MSG_TYPE_0XFF 0xFF\n \n+#define I40E_FDIR_ESP_DST_PORT 4500\n+\n /* Wait time for fdir filter programming */\n #define I40E_FDIR_MAX_WAIT_US 10000\n \n@@ -971,6 +973,37 @@ i40e_flow_fdir_find_customized_pctype(struct i40e_pf *pf, uint8_t pctype)\n }\n \n static inline int\n+fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt,\n+\t\tuint8_t next_proto, uint8_t len, uint16_t *ether_type)\n+{\n+\tstruct rte_ipv6_hdr *ip6;\n+\n+\tip6 = (struct rte_ipv6_hdr *)raw_pkt;\n+\n+\t*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6);\n+\tip6->vtc_flow = rte_cpu_to_be_32(I40E_FDIR_IPv6_DEFAULT_VTC_FLOW |\n+\t\t(fdir_input->flow.ipv6_flow.tc << I40E_FDIR_IPv6_TC_OFFSET));\n+\tip6->payload_len = rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);\n+\tip6->proto = fdir_input->flow.ipv6_flow.proto ?\n+\t\tfdir_input->flow.ipv6_flow.proto : next_proto;\n+\tip6->hop_limits = fdir_input->flow.ipv6_flow.hop_limits ?\n+\t\tfdir_input->flow.ipv6_flow.hop_limits :\n+\t\tI40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;\n+\t/**\n+\t * The source and destination fields in the transmitted packet\n+\t * need to be presented in a reversed order with respect\n+\t * to the expected received packets.\n+\t */\n+\trte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip,\n+\t\tIPV6_ADDR_LEN);\n+\trte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,\n+\t\tIPV6_ADDR_LEN);\n+\tlen += sizeof(struct rte_ipv6_hdr);\n+\n+\treturn len;\n+}\n+\n+static inline int\n i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,\n \t\t\t\tconst struct i40e_fdir_input *fdir_input,\n \t\t\t\tunsigned char *raw_pkt,\n@@ -1045,16 +1078,29 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,\n \t\tip->src_addr = fdir_input->flow.ip4_flow.dst_ip;\n \t\tip->dst_addr = fdir_input->flow.ip4_flow.src_ip;\n \n-\t\tif (!is_customized_pctype)\n+\t\tif (!is_customized_pctype) {\n \t\t\tip->next_proto_id = fdir_input->flow.ip4_flow.proto ?\n \t\t\t\tfdir_input->flow.ip4_flow.proto :\n \t\t\t\tnext_proto[fdir_input->pctype];\n-\t\telse if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||\n+\t\t\tlen += sizeof(struct rte_ipv4_hdr);\n+\t\t} else if (cus_pctype->index == I40E_CUSTOMIZED_GTPC ||\n \t\t\t cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4 ||\n \t\t\t cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 ||\n-\t\t\t cus_pctype->index == I40E_CUSTOMIZED_GTPU)\n+\t\t\t cus_pctype->index == I40E_CUSTOMIZED_GTPU) {\n \t\t\tip->next_proto_id = IPPROTO_UDP;\n-\t\tlen += sizeof(struct rte_ipv4_hdr);\n+\t\t\tlen += sizeof(struct rte_ipv4_hdr);\n+\t\t} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {\n+\t\t\tip->next_proto_id = IPPROTO_ESP;\n+\t\t\tlen += sizeof(struct rte_ipv4_hdr);\n+\t\t} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP) {\n+\t\t\tip->next_proto_id = IPPROTO_UDP;\n+\t\t\tlen += sizeof(struct rte_ipv4_hdr);\n+\t\t} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6)\n+\t\t\tlen = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_ESP,\n+\t\t\t\t\tlen, ether_type);\n+\t\telse if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP)\n+\t\t\tlen = fill_ip6_head(fdir_input, raw_pkt, IPPROTO_UDP,\n+\t\t\t\t\tlen, ether_type);\n \t} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP ||\n \t\t pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP ||\n \t\t pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP ||\n@@ -1088,8 +1134,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,\n \t\t\t IPV6_ADDR_LEN);\n \t\tlen += sizeof(struct rte_ipv6_hdr);\n \t} else {\n-\t\tPMD_DRV_LOG(ERR, \"unknown pctype %u.\",\n-\t\t\t fdir_input->pctype);\n+\t\tPMD_DRV_LOG(ERR, \"unknown pctype %u.\", fdir_input->pctype);\n \t\treturn -1;\n \t}\n \n@@ -1115,6 +1160,10 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,\n \tstruct rte_flow_item_gtp *gtp;\n \tstruct rte_ipv4_hdr *gtp_ipv4;\n \tstruct rte_ipv6_hdr *gtp_ipv6;\n+\tstruct rte_flow_item_esp *esp;\n+\tstruct rte_ipv4_hdr *esp_ipv4;\n+\tstruct rte_ipv6_hdr *esp_ipv6;\n+\n \tuint8_t size, dst = 0;\n \tuint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/\n \tint len;\n@@ -1285,10 +1334,71 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,\n \t\t\t} else\n \t\t\t\tpayload = (unsigned char *)gtp +\n \t\t\t\t\tsizeof(struct rte_flow_item_gtp);\n+\t\t} else if (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4 ||\n+\t\t\tcus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6 ||\n+\t\t\tcus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4_UDP ||\n+\t\t\tcus_pctype->index == I40E_CUSTOMIZED_ESP_IPV6_UDP) {\n+\t\t\tif (cus_pctype->index == I40E_CUSTOMIZED_ESP_IPV4) {\n+\t\t\t\tesp_ipv4 = (struct rte_ipv4_hdr *)\n+\t\t\t\t\t(raw_pkt + len);\n+\t\t\t\tesp = (struct rte_flow_item_esp *)esp_ipv4;\n+\t\t\t\tesp->hdr.spi =\n+\t\t\t\t\tfdir_input->flow.esp_ipv4_flow.spi;\n+\t\t\t\tpayload = (unsigned char *)esp +\n+\t\t\t\t\tsizeof(struct rte_esp_hdr);\n+\t\t\t\tlen += sizeof(struct rte_esp_hdr);\n+\t\t\t} else if (cus_pctype->index ==\n+\t\t\t\t\tI40E_CUSTOMIZED_ESP_IPV4_UDP) {\n+\t\t\t\tesp_ipv4 = (struct rte_ipv4_hdr *)\n+\t\t\t\t\t(raw_pkt + len);\n+\t\t\t\tudp = (struct rte_udp_hdr *)esp_ipv4;\n+\t\t\t\tudp->dst_port = rte_cpu_to_be_16\n+\t\t\t\t\t(I40E_FDIR_ESP_DST_PORT);\n+\n+\t\t\t\tudp->dgram_len = rte_cpu_to_be_16\n+\t\t\t\t\t\t(I40E_FDIR_UDP_DEFAULT_LEN);\n+\t\t\t\tesp = (struct rte_flow_item_esp *)\n+\t\t\t\t\t((unsigned char *)esp_ipv4 +\n+\t\t\t\t\t\tsizeof(struct rte_udp_hdr));\n+\t\t\t\tesp->hdr.spi =\n+\t\t\t\t\tfdir_input->flow.esp_ipv4_udp_flow.spi;\n+\t\t\t\tpayload = (unsigned char *)esp +\n+\t\t\t\t\tsizeof(struct rte_esp_hdr);\n+\t\t\t\tlen += sizeof(struct rte_udp_hdr) +\n+\t\t\t\t\t\tsizeof(struct rte_esp_hdr);\n+\t\t\t} else if (cus_pctype->index ==\n+\t\t\t\t\tI40E_CUSTOMIZED_ESP_IPV6) {\n+\t\t\t\tesp_ipv6 = (struct rte_ipv6_hdr *)\n+\t\t\t\t\t(raw_pkt + len);\n+\t\t\t\tesp = (struct rte_flow_item_esp *)esp_ipv6;\n+\t\t\t\tesp->hdr.spi =\n+\t\t\t\t\tfdir_input->flow.esp_ipv6_flow.spi;\n+\t\t\t\tpayload = (unsigned char *)esp +\n+\t\t\t\t\tsizeof(struct rte_esp_hdr);\n+\t\t\t\tlen += sizeof(struct rte_esp_hdr);\n+\t\t\t} else if (cus_pctype->index ==\n+\t\t\t\t\tI40E_CUSTOMIZED_ESP_IPV6_UDP) {\n+\t\t\t\tesp_ipv6 = (struct rte_ipv6_hdr *)\n+\t\t\t\t\t(raw_pkt + len);\n+\t\t\t\tudp = (struct rte_udp_hdr *)esp_ipv6;\n+\t\t\t\tudp->dst_port =\trte_cpu_to_be_16\n+\t\t\t\t\t(I40E_FDIR_ESP_DST_PORT);\n+\n+\t\t\t\tudp->dgram_len = rte_cpu_to_be_16\n+\t\t\t\t\t(I40E_FDIR_UDP_DEFAULT_LEN);\n+\t\t\t\tesp = (struct rte_flow_item_esp *)\n+\t\t\t\t\t((unsigned char *)esp_ipv6 +\n+\t\t\t\t\t\tsizeof(struct rte_udp_hdr));\n+\t\t\t\tesp->hdr.spi =\n+\t\t\t\t\tfdir_input->flow.esp_ipv6_udp_flow.spi;\n+\t\t\t\tpayload = (unsigned char *)esp +\n+\t\t\t\t\tsizeof(struct rte_esp_hdr);\n+\t\t\t\tlen += sizeof(struct rte_udp_hdr) +\n+\t\t\t\t\t\tsizeof(struct rte_esp_hdr);\n+\t\t\t}\n \t\t}\n \t} else {\n-\t\tPMD_DRV_LOG(ERR, \"unknown pctype %u.\",\n-\t\t\t fdir_input->pctype);\n+\t\tPMD_DRV_LOG(ERR, \"unknown pctype %u.\", fdir_input->pctype);\n \t\treturn -1;\n \t}\n \n", "prefixes": [ "v7", "08/10" ] }{ "id": 64793, "url": "