get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/64661/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 64661,
    "url": "http://patches.dpdk.org/api/patches/64661/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1579010128-15794-10-git-send-email-bernard.iremonger@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.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": "<1579010128-15794-10-git-send-email-bernard.iremonger@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1579010128-15794-10-git-send-email-bernard.iremonger@intel.com",
    "date": "2020-01-14T13:55:23",
    "name": "[v5,09/14] net/i40e: support ESP in Flow Director",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "09682be772ac8a4580bdf31e9088acab6ba98fd0",
    "submitter": {
        "id": 91,
        "url": "http://patches.dpdk.org/api/people/91/?format=api",
        "name": "Iremonger, Bernard",
        "email": "bernard.iremonger@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1579010128-15794-10-git-send-email-bernard.iremonger@intel.com/mbox/",
    "series": [
        {
            "id": 8053,
            "url": "http://patches.dpdk.org/api/series/8053/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8053",
            "date": "2020-01-10T15:20:16",
            "name": "net/i40e: ESP support",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/8053/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64661/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/64661/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 F4000A04FF;\n\tTue, 14 Jan 2020 14:56:59 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7C81D1C1ED;\n\tTue, 14 Jan 2020 14:55:58 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by dpdk.org (Postfix) with ESMTP id 84CF11C1BC\n for <dev@dpdk.org>; Tue, 14 Jan 2020 14:55:51 +0100 (CET)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 14 Jan 2020 05:55:51 -0800",
            "from sivswdev08.ir.intel.com (HELO localhost.localdomain)\n ([10.237.217.47])\n by fmsmga005.fm.intel.com with ESMTP; 14 Jan 2020 05:55:49 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.69,432,1571727600\"; d=\"scan'208\";a=\"423160546\"",
        "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": "Tue, 14 Jan 2020 13:55:23 +0000",
        "Message-Id": "<1579010128-15794-10-git-send-email-bernard.iremonger@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": "<1578669630-23866-1-git-send-email-bernard.iremonger@intel.com>",
        "References": "<1578669630-23866-1-git-send-email-bernard.iremonger@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 09/14] 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\n\nSigned-off-by: Bernard Iremonger <bernard.iremonger@intel.com>\n---\n drivers/net/i40e/i40e_fdir.c | 126 ++++++++++++++++++++++++++++++++++++++++---\n 1 file changed, 118 insertions(+), 8 deletions(-)",
    "diff": "diff --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": [
        "v5",
        "09/14"
    ]
}