get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64217,
    "url": "http://patches.dpdk.org/api/patches/64217/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200106033851.43978-3-qi.z.zhang@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": "<20200106033851.43978-3-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200106033851.43978-3-qi.z.zhang@intel.com",
    "date": "2020-01-06T03:38:41",
    "name": "[v2,02/12] net/ice/base: support MAC/VLAN with TCP/UDP in switch",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c8c4abc680190806b11da997064da76f16705316",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "http://patches.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200106033851.43978-3-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 7984,
            "url": "http://patches.dpdk.org/api/series/7984/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7984",
            "date": "2020-01-06T03:38:39",
            "name": "base code update",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/7984/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64217/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/64217/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 3E904A04F1;\n\tMon,  6 Jan 2020 04:36:04 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 18B811D52E;\n\tMon,  6 Jan 2020 04:35:52 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by dpdk.org (Postfix) with ESMTP id 7D1721D517\n for <dev@dpdk.org>; Mon,  6 Jan 2020 04:35:48 +0100 (CET)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 05 Jan 2020 19:35:48 -0800",
            "from dpdk51.sh.intel.com ([10.67.110.245])\n by fmsmga007.fm.intel.com with ESMTP; 05 Jan 2020 19:35:46 -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,401,1571727600\"; d=\"scan'208\";a=\"216726332\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "qiming.yang@intel.com",
        "Cc": "dev@dpdk.org, xiaolong.ye@intel.com, Qi Zhang <qi.z.zhang@intel.com>,\n Kiran Patil <kiran.patil@intel.com>,\n Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>",
        "Date": "Mon,  6 Jan 2020 11:38:41 +0800",
        "Message-Id": "<20200106033851.43978-3-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20200106033851.43978-1-qi.z.zhang@intel.com>",
        "References": "<20191205123847.39579-1-qi.z.zhang@intel.com>\n <20200106033851.43978-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 02/12] net/ice/base: support MAC/VLAN with\n\tTCP/UDP in switch",
        "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 a feature to allow user to add switch filter using input like\nMAC + VLAN (C-tag only) + L4 (TCP/UDP) port. API \"ice_add_adv_rule\"\nis extended to handle this filter type.\n\nSigned-off-by: Kiran Patil <kiran.patil@intel.com>\nSigned-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\nAcked-by: Qiming Yang <qiming.yang@intel.com>\n---\n drivers/net/ice/base/ice_switch.c | 206 ++++++++++++++++++++++++++++++++++----\n 1 file changed, 188 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c\nindex afa4fe30d..f8f5fde3c 100644\n--- a/drivers/net/ice/base/ice_switch.c\n+++ b/drivers/net/ice/base/ice_switch.c\n@@ -251,8 +251,8 @@ u8 dummy_udp_tun_udp_packet[] = {\n \t0x00, 0x08, 0x00, 0x00,\n };\n \n-static const\n-struct ice_dummy_pkt_offsets dummy_udp_packet_offsets[] = {\n+/* offset info for MAC + IPv4 + UDP dummy packet */\n+static const struct ice_dummy_pkt_offsets dummy_udp_packet_offsets[] = {\n \t{ ICE_MAC_OFOS,\t\t0 },\n \t{ ICE_ETYPE_OL,\t\t12 },\n \t{ ICE_IPV4_OFOS,\t14 },\n@@ -260,8 +260,8 @@ struct ice_dummy_pkt_offsets dummy_udp_packet_offsets[] = {\n \t{ ICE_PROTOCOL_LAST,\t0 },\n };\n \n-static const u8\n-dummy_udp_packet[] = {\n+/* Dummy packet for MAC + IPv4 + UDP */\n+static const u8 dummy_udp_packet[] = {\n \t0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */\n \t0x00, 0x00, 0x00, 0x00,\n \t0x00, 0x00, 0x00, 0x00,\n@@ -280,8 +280,40 @@ dummy_udp_packet[] = {\n \t0x00, 0x00,\t/* 2 bytes for 4 byte alignment */\n };\n \n-static const\n-struct ice_dummy_pkt_offsets dummy_tcp_packet_offsets[] = {\n+/* offset info for MAC + VLAN + IPv4 + UDP dummy packet */\n+static const struct ice_dummy_pkt_offsets dummy_vlan_udp_packet_offsets[] = {\n+\t{ ICE_MAC_OFOS,\t\t0 },\n+\t{ ICE_ETYPE_OL,\t\t12 },\n+\t{ ICE_VLAN_OFOS,\t14 },\n+\t{ ICE_IPV4_OFOS,\t18 },\n+\t{ ICE_UDP_ILOS,\t\t38 },\n+\t{ ICE_PROTOCOL_LAST,\t0 },\n+};\n+\n+/* C-tag (801.1Q), IPv4:UDP dummy packet */\n+static const u8 dummy_vlan_udp_packet[] = {\n+\t0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\n+\t0x81, 0x00,\t\t/* ICE_ETYPE_OL 12 */\n+\n+\t0x00, 0x00, 0x08, 0x00, /* ICE_VLAN_OFOS 14 */\n+\n+\t0x45, 0x00, 0x00, 0x1c, /* ICE_IPV4_OFOS 18 */\n+\t0x00, 0x01, 0x00, 0x00,\n+\t0x00, 0x11, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\n+\t0x00, 0x00, 0x00, 0x00, /* ICE_UDP_ILOS 38 */\n+\t0x00, 0x08, 0x00, 0x00,\n+\n+\t0x00, 0x00,\t/* 2 bytes for 4 byte alignment */\n+};\n+\n+/* offset info for MAC + IPv4 + TCP dummy packet */\n+static const struct ice_dummy_pkt_offsets dummy_tcp_packet_offsets[] = {\n \t{ ICE_MAC_OFOS,\t\t0 },\n \t{ ICE_ETYPE_OL,\t\t12 },\n \t{ ICE_IPV4_OFOS,\t14 },\n@@ -289,8 +321,8 @@ struct ice_dummy_pkt_offsets dummy_tcp_packet_offsets[] = {\n \t{ ICE_PROTOCOL_LAST,\t0 },\n };\n \n-static const u8\n-dummy_tcp_packet[] = {\n+/* Dummy packet for MAC + IPv4 + TCP */\n+static const u8 dummy_tcp_packet[] = {\n \t0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */\n \t0x00, 0x00, 0x00, 0x00,\n \t0x00, 0x00, 0x00, 0x00,\n@@ -312,8 +344,42 @@ dummy_tcp_packet[] = {\n \t0x00, 0x00,\t/* 2 bytes for 4 byte alignment */\n };\n \n-static const\n-struct ice_dummy_pkt_offsets dummy_tcp_ipv6_packet_offsets[] = {\n+/* offset info for MAC + VLAN (C-tag, 802.1Q) + IPv4 + TCP dummy packet */\n+static const struct ice_dummy_pkt_offsets dummy_vlan_tcp_packet_offsets[] = {\n+\t{ ICE_MAC_OFOS,\t\t0 },\n+\t{ ICE_ETYPE_OL,\t\t12 },\n+\t{ ICE_VLAN_OFOS,\t14 },\n+\t{ ICE_IPV4_OFOS,\t18 },\n+\t{ ICE_TCP_IL,\t\t38 },\n+\t{ ICE_PROTOCOL_LAST,\t0 },\n+};\n+\n+/* C-tag (801.1Q), IPv4:TCP dummy packet */\n+static const u8 dummy_vlan_tcp_packet[] = {\n+\t0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\n+\t0x81, 0x00,\t\t/* ICE_ETYPE_OL 12 */\n+\n+\t0x00, 0x00, 0x08, 0x00, /* ICE_VLAN_OFOS 14 */\n+\n+\t0x45, 0x00, 0x00, 0x28, /* ICE_IPV4_OFOS 18 */\n+\t0x00, 0x01, 0x00, 0x00,\n+\t0x00, 0x06, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\n+\t0x00, 0x00, 0x00, 0x00, /* ICE_TCP_IL 38 */\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x50, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\n+\t0x00, 0x00,\t/* 2 bytes for 4 byte alignment */\n+};\n+\n+static const struct ice_dummy_pkt_offsets dummy_tcp_ipv6_packet_offsets[] = {\n \t{ ICE_MAC_OFOS,\t\t0 },\n \t{ ICE_ETYPE_OL,\t\t12 },\n \t{ ICE_IPV6_OFOS,\t14 },\n@@ -349,8 +415,49 @@ dummy_tcp_ipv6_packet[] = {\n \t0x00, 0x00, /* 2 bytes for 4 byte alignment */\n };\n \n-static const\n-struct ice_dummy_pkt_offsets dummy_udp_ipv6_packet_offsets[] = {\n+/* C-tag (802.1Q): IPv6 + TCP */\n+static const struct ice_dummy_pkt_offsets\n+dummy_vlan_tcp_ipv6_packet_offsets[] = {\n+\t{ ICE_MAC_OFOS,\t\t0 },\n+\t{ ICE_ETYPE_OL,\t\t12 },\n+\t{ ICE_VLAN_OFOS,\t14 },\n+\t{ ICE_IPV6_OFOS,\t18 },\n+\t{ ICE_TCP_IL,\t\t58 },\n+\t{ ICE_PROTOCOL_LAST,\t0 },\n+};\n+\n+/* C-tag (802.1Q), IPv6 + TCP dummy packet */\n+static const u8 dummy_vlan_tcp_ipv6_packet[] = {\n+\t0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\n+\t0x81, 0x00,\t\t/* ICE_ETYPE_OL 12 */\n+\n+\t0x00, 0x00, 0x86, 0xDD, /* ICE_VLAN_OFOS 14 */\n+\n+\t0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 18 */\n+\t0x00, 0x14, 0x06, 0x00, /* Next header is TCP */\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\n+\t0x00, 0x00, 0x00, 0x00, /* ICE_TCP_IL 58 */\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x50, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\n+\t0x00, 0x00, /* 2 bytes for 4 byte alignment */\n+};\n+\n+/* IPv6 + UDP */\n+static const struct ice_dummy_pkt_offsets dummy_udp_ipv6_packet_offsets[] = {\n \t{ ICE_MAC_OFOS,\t\t0 },\n \t{ ICE_ETYPE_OL,\t\t12 },\n \t{ ICE_IPV6_OFOS,\t14 },\n@@ -383,8 +490,45 @@ dummy_udp_ipv6_packet[] = {\n \t0x00, 0x00, /* 2 bytes for 4 byte alignment */\n };\n \n-static const\n-struct ice_dummy_pkt_offsets dummy_udp_gtp_packet_offsets[] = {\n+/* C-tag (802.1Q): IPv6 + UDP */\n+static const struct ice_dummy_pkt_offsets\n+dummy_vlan_udp_ipv6_packet_offsets[] = {\n+\t{ ICE_MAC_OFOS,\t\t0 },\n+\t{ ICE_ETYPE_OL,\t\t12 },\n+\t{ ICE_VLAN_OFOS,\t14 },\n+\t{ ICE_IPV6_OFOS,\t18 },\n+\t{ ICE_UDP_ILOS,\t\t58 },\n+\t{ ICE_PROTOCOL_LAST,\t0 },\n+};\n+\n+/* C-tag (802.1Q), IPv6 + UDP dummy packet */\n+static const u8 dummy_vlan_udp_ipv6_packet[] = {\n+\t0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\n+\t0x81, 0x00,\t\t/* ICE_ETYPE_OL 12 */\n+\n+\t0x00, 0x00, 0x86, 0xDD, /* ICE_VLAN_OFOS 14 */\n+\n+\t0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 18 */\n+\t0x00, 0x08, 0x11, 0x00, /* Next header UDP */\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\t0x00, 0x00, 0x00, 0x00,\n+\n+\t0x00, 0x00, 0x00, 0x00, /* ICE_UDP_ILOS 58 */\n+\t0x00, 0x08, 0x00, 0x00,\n+\n+\t0x00, 0x00, /* 2 bytes for 4 byte alignment */\n+};\n+\n+static const struct ice_dummy_pkt_offsets dummy_udp_gtp_packet_offsets[] = {\n \t{ ICE_MAC_OFOS,\t\t0 },\n \t{ ICE_IPV4_OFOS,\t14 },\n \t{ ICE_UDP_OF,\t\t34 },\n@@ -5643,7 +5787,7 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,\n \t\t      u16 *pkt_len,\n \t\t      const struct ice_dummy_pkt_offsets **offsets)\n {\n-\tbool tcp = false, udp = false, ipv6 = false;\n+\tbool tcp = false, udp = false, ipv6 = false, vlan = false;\n \tu16 i;\n \n \tif (tun_type == ICE_SW_TUN_GTP) {\n@@ -5665,6 +5809,8 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,\n \t\t\ttcp = true;\n \t\telse if (lkups[i].type == ICE_IPV6_OFOS)\n \t\t\tipv6 = true;\n+\t\telse if (lkups[i].type == ICE_VLAN_OFOS)\n+\t\t\tvlan = true;\n \t}\n \n \tif (tun_type == ICE_ALL_TUNNELS) {\n@@ -5704,25 +5850,49 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,\n \t}\n \n \tif (udp && !ipv6) {\n+\t\tif (vlan) {\n+\t\t\t*pkt = dummy_vlan_udp_packet;\n+\t\t\t*pkt_len = sizeof(dummy_vlan_udp_packet);\n+\t\t\t*offsets = dummy_vlan_udp_packet_offsets;\n+\t\t\treturn;\n+\t\t}\n \t\t*pkt = dummy_udp_packet;\n \t\t*pkt_len = sizeof(dummy_udp_packet);\n \t\t*offsets = dummy_udp_packet_offsets;\n \t\treturn;\n \t} else if (udp && ipv6) {\n+\t\tif (vlan) {\n+\t\t\t*pkt = dummy_vlan_udp_ipv6_packet;\n+\t\t\t*pkt_len = sizeof(dummy_vlan_udp_ipv6_packet);\n+\t\t\t*offsets = dummy_vlan_udp_ipv6_packet_offsets;\n+\t\t\treturn;\n+\t\t}\n \t\t*pkt = dummy_udp_ipv6_packet;\n \t\t*pkt_len = sizeof(dummy_udp_ipv6_packet);\n \t\t*offsets = dummy_udp_ipv6_packet_offsets;\n \t\treturn;\n \t} else if ((tcp && ipv6) || ipv6) {\n+\t\tif (vlan) {\n+\t\t\t*pkt = dummy_vlan_tcp_ipv6_packet;\n+\t\t\t*pkt_len = sizeof(dummy_vlan_tcp_ipv6_packet);\n+\t\t\t*offsets = dummy_vlan_tcp_ipv6_packet_offsets;\n+\t\t\treturn;\n+\t\t}\n \t\t*pkt = dummy_tcp_ipv6_packet;\n \t\t*pkt_len = sizeof(dummy_tcp_ipv6_packet);\n \t\t*offsets = dummy_tcp_ipv6_packet_offsets;\n \t\treturn;\n \t}\n \n-\t*pkt = dummy_tcp_packet;\n-\t*pkt_len = sizeof(dummy_tcp_packet);\n-\t*offsets = dummy_tcp_packet_offsets;\n+\tif (vlan) {\n+\t\t*pkt = dummy_vlan_tcp_packet;\n+\t\t*pkt_len = sizeof(dummy_vlan_tcp_packet);\n+\t\t*offsets = dummy_vlan_tcp_packet_offsets;\n+\t} else {\n+\t\t*pkt = dummy_tcp_packet;\n+\t\t*pkt_len = sizeof(dummy_tcp_packet);\n+\t\t*offsets = dummy_tcp_packet_offsets;\n+\t}\n }\n \n /**\n",
    "prefixes": [
        "v2",
        "02/12"
    ]
}