get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50754,
    "url": "http://patches.dpdk.org/api/patches/50754/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190302104251.32565-9-hyonkim@cisco.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": "<20190302104251.32565-9-hyonkim@cisco.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190302104251.32565-9-hyonkim@cisco.com",
    "date": "2019-03-02T10:42:46",
    "name": "[v2,08/13] net/enic: move arguments into struct",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8ad4abd126671f2a37fe9c868d7aa77bc741b675",
    "submitter": {
        "id": 948,
        "url": "http://patches.dpdk.org/api/people/948/?format=api",
        "name": "Hyong Youb Kim (hyonkim)",
        "email": "hyonkim@cisco.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/20190302104251.32565-9-hyonkim@cisco.com/mbox/",
    "series": [
        {
            "id": 3613,
            "url": "http://patches.dpdk.org/api/series/3613/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3613",
            "date": "2019-03-02T10:42:38",
            "name": "net/enic: 19.05 updates",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/3613/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/50754/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/50754/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 826662B9E;\n\tSat,  2 Mar 2019 11:45:05 +0100 (CET)",
            "from rcdn-iport-5.cisco.com (rcdn-iport-5.cisco.com [173.37.86.76])\n\tby dpdk.org (Postfix) with ESMTP id 0EB0B1E34\n\tfor <dev@dpdk.org>; Sat,  2 Mar 2019 11:45:03 +0100 (CET)",
            "from alln-core-6.cisco.com ([173.36.13.139])\n\tby rcdn-iport-5.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Mar 2019 10:45:03 +0000",
            "from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48])\n\tby alln-core-6.cisco.com (8.15.2/8.15.2) with ESMTP id x22Aj21w026749;\n\tSat, 2 Mar 2019 10:45:03 GMT",
            "by cisco.com (Postfix, from userid 508933)\n\tid BB7B120F2001; Sat,  2 Mar 2019 02:45:02 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=12796; q=dns/txt;\n\ts=iport; t=1551523504; x=1552733104;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=rdHxnqIyQBskoLwua9qplxTUODQ0Fv+xtWRCk9m64Sg=;\n\tb=iveQ3F6nt/C50F/1aWWRMRoE2lCevR6Aq4fCKRlfUm22qFsD7U8QymE0\n\tmm70VJ4aUNzm86hdstHPNWaFvzkOm0AfXXDvR8bipZ/NDYnGnU3vjFReO\n\tMHDGXkEYBEg5sGPxj4o8ZHS1AJKr5bI/btHzIO7MJg6h/5bisZZ6HHyLH 8=;",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,431,1544486400\"; d=\"scan'208\";a=\"309375933\"",
        "From": "Hyong Youb Kim <hyonkim@cisco.com>",
        "To": "Ferruh Yigit <ferruh.yigit@intel.com>",
        "Cc": "dev@dpdk.org, John Daley <johndale@cisco.com>,\n\tHyong Youb Kim <hyonkim@cisco.com>",
        "Date": "Sat,  2 Mar 2019 02:42:46 -0800",
        "Message-Id": "<20190302104251.32565-9-hyonkim@cisco.com>",
        "X-Mailer": "git-send-email 2.16.2",
        "In-Reply-To": "<20190302104251.32565-1-hyonkim@cisco.com>",
        "References": "<20190302104251.32565-1-hyonkim@cisco.com>",
        "X-Outbound-SMTP-Client": "10.193.184.48, savbu-usnic-a.cisco.com",
        "X-Outbound-Node": "alln-core-6.cisco.com",
        "Subject": "[dpdk-dev] [PATCH v2 08/13] net/enic: move arguments into struct",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "There are many copy_item functions, all with the same arguments, which\nmakes it difficult to add/change arguments. Move the arguments into a\nstruct to help subsequent commits that will add/fix features. Also\nremove self-explanatory verbose comments for these local functions.\n\nThese changes are purely mechanical and have no impact on\nfunctionalities.\n\nSigned-off-by: Hyong Youb Kim <hyonkim@cisco.com>\n---\n drivers/net/enic/enic_flow.c | 209 ++++++++++++++-----------------------------\n 1 file changed, 67 insertions(+), 142 deletions(-)",
    "diff": "diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c\nindex c6ed9e1b9..fda641b6f 100644\n--- a/drivers/net/enic/enic_flow.c\n+++ b/drivers/net/enic/enic_flow.c\n@@ -23,11 +23,27 @@\n \trte_log(RTE_LOG_ ## level, enicpmd_logtype_flow, \\\n \t\tfmt \"\\n\", ##args)\n \n+/*\n+ * Common arguments passed to copy_item functions. Use this structure\n+ * so we can easily add new arguments.\n+ * item: Item specification.\n+ * filter: Partially filled in NIC filter structure.\n+ * inner_ofst: If zero, this is an outer header. If non-zero, this is\n+ *   the offset into L5 where the header begins.\n+ */\n+struct copy_item_args {\n+\tconst struct rte_flow_item *item;\n+\tstruct filter_v2 *filter;\n+\tuint8_t *inner_ofst;\n+};\n+\n+/* functions for copying items into enic filters */\n+typedef int (enic_copy_item_fn)(struct copy_item_args *arg);\n+\n /** Info about how to copy items into enic filters. */\n struct enic_items {\n \t/** Function for copying and validating an item. */\n-\tint (*copy_item)(const struct rte_flow_item *item,\n-\t\t\t struct filter_v2 *enic_filter, u8 *inner_ofst);\n+\tenic_copy_item_fn *copy_item;\n \t/** List of valid previous items. */\n \tconst enum rte_flow_item_type * const prev_items;\n \t/** True if it's OK for this item to be the first item. For some NIC\n@@ -49,10 +65,6 @@ typedef int (copy_action_fn)(struct enic *enic,\n \t\t\t     const struct rte_flow_action actions[],\n \t\t\t     struct filter_action_v2 *enic_action);\n \n-/* functions for copying items into enic filters */\n-typedef int(enic_copy_item_fn)(const struct rte_flow_item *item,\n-\t\t\t  struct filter_v2 *enic_filter, u8 *inner_ofst);\n-\n /** Action capabilities for various NICs. */\n struct enic_action_cap {\n \t/** list of valid actions */\n@@ -340,20 +352,12 @@ mask_exact_match(const u8 *supported, const u8 *supplied,\n \treturn 1;\n }\n \n-/**\n- * Copy IPv4 item into version 1 NIC filter.\n- *\n- * @param item[in]\n- *   Item specification.\n- * @param enic_filter[out]\n- *   Partially filled in NIC filter structure.\n- * @param inner_ofst[in]\n- *   Should always be 0 for version 1.\n- */\n static int\n-enic_copy_item_ipv4_v1(const struct rte_flow_item *item,\n-\t\t       struct filter_v2 *enic_filter, u8 *inner_ofst)\n+enic_copy_item_ipv4_v1(struct copy_item_args *arg)\n {\n+\tconst struct rte_flow_item *item = arg->item;\n+\tstruct filter_v2 *enic_filter = arg->filter;\n+\tuint8_t *inner_ofst = arg->inner_ofst;\n \tconst struct rte_flow_item_ipv4 *spec = item->spec;\n \tconst struct rte_flow_item_ipv4 *mask = item->mask;\n \tstruct filter_ipv4_5tuple *enic_5tup = &enic_filter->u.ipv4;\n@@ -390,20 +394,12 @@ enic_copy_item_ipv4_v1(const struct rte_flow_item *item,\n \treturn 0;\n }\n \n-/**\n- * Copy UDP item into version 1 NIC filter.\n- *\n- * @param item[in]\n- *   Item specification.\n- * @param enic_filter[out]\n- *   Partially filled in NIC filter structure.\n- * @param inner_ofst[in]\n- *   Should always be 0 for version 1.\n- */\n static int\n-enic_copy_item_udp_v1(const struct rte_flow_item *item,\n-\t\t      struct filter_v2 *enic_filter, u8 *inner_ofst)\n+enic_copy_item_udp_v1(struct copy_item_args *arg)\n {\n+\tconst struct rte_flow_item *item = arg->item;\n+\tstruct filter_v2 *enic_filter = arg->filter;\n+\tuint8_t *inner_ofst = arg->inner_ofst;\n \tconst struct rte_flow_item_udp *spec = item->spec;\n \tconst struct rte_flow_item_udp *mask = item->mask;\n \tstruct filter_ipv4_5tuple *enic_5tup = &enic_filter->u.ipv4;\n@@ -441,20 +437,12 @@ enic_copy_item_udp_v1(const struct rte_flow_item *item,\n \treturn 0;\n }\n \n-/**\n- * Copy TCP item into version 1 NIC filter.\n- *\n- * @param item[in]\n- *   Item specification.\n- * @param enic_filter[out]\n- *   Partially filled in NIC filter structure.\n- * @param inner_ofst[in]\n- *   Should always be 0 for version 1.\n- */\n static int\n-enic_copy_item_tcp_v1(const struct rte_flow_item *item,\n-\t\t      struct filter_v2 *enic_filter, u8 *inner_ofst)\n+enic_copy_item_tcp_v1(struct copy_item_args *arg)\n {\n+\tconst struct rte_flow_item *item = arg->item;\n+\tstruct filter_v2 *enic_filter = arg->filter;\n+\tuint8_t *inner_ofst = arg->inner_ofst;\n \tconst struct rte_flow_item_tcp *spec = item->spec;\n \tconst struct rte_flow_item_tcp *mask = item->mask;\n \tstruct filter_ipv4_5tuple *enic_5tup = &enic_filter->u.ipv4;\n@@ -492,21 +480,12 @@ enic_copy_item_tcp_v1(const struct rte_flow_item *item,\n \treturn 0;\n }\n \n-/**\n- * Copy ETH item into version 2 NIC filter.\n- *\n- * @param item[in]\n- *   Item specification.\n- * @param enic_filter[out]\n- *   Partially filled in NIC filter structure.\n- * @param inner_ofst[in]\n- *   If zero, this is an outer header. If non-zero, this is the offset into L5\n- *   where the header begins.\n- */\n static int\n-enic_copy_item_eth_v2(const struct rte_flow_item *item,\n-\t\t      struct filter_v2 *enic_filter, u8 *inner_ofst)\n+enic_copy_item_eth_v2(struct copy_item_args *arg)\n {\n+\tconst struct rte_flow_item *item = arg->item;\n+\tstruct filter_v2 *enic_filter = arg->filter;\n+\tuint8_t *inner_ofst = arg->inner_ofst;\n \tstruct ether_hdr enic_spec;\n \tstruct ether_hdr enic_mask;\n \tconst struct rte_flow_item_eth *spec = item->spec;\n@@ -555,21 +534,12 @@ enic_copy_item_eth_v2(const struct rte_flow_item *item,\n \treturn 0;\n }\n \n-/**\n- * Copy VLAN item into version 2 NIC filter.\n- *\n- * @param item[in]\n- *   Item specification.\n- * @param enic_filter[out]\n- *   Partially filled in NIC filter structure.\n- * @param inner_ofst[in]\n- *   If zero, this is an outer header. If non-zero, this is the offset into L5\n- *   where the header begins.\n- */\n static int\n-enic_copy_item_vlan_v2(const struct rte_flow_item *item,\n-\t\t       struct filter_v2 *enic_filter, u8 *inner_ofst)\n+enic_copy_item_vlan_v2(struct copy_item_args *arg)\n {\n+\tconst struct rte_flow_item *item = arg->item;\n+\tstruct filter_v2 *enic_filter = arg->filter;\n+\tuint8_t *inner_ofst = arg->inner_ofst;\n \tconst struct rte_flow_item_vlan *spec = item->spec;\n \tconst struct rte_flow_item_vlan *mask = item->mask;\n \tstruct filter_generic_1 *gp = &enic_filter->u.generic_1;\n@@ -612,20 +582,12 @@ enic_copy_item_vlan_v2(const struct rte_flow_item *item,\n \treturn 0;\n }\n \n-/**\n- * Copy IPv4 item into version 2 NIC filter.\n- *\n- * @param item[in]\n- *   Item specification.\n- * @param enic_filter[out]\n- *   Partially filled in NIC filter structure.\n- * @param inner_ofst[in]\n- *   Must be 0. Don't support inner IPv4 filtering.\n- */\n static int\n-enic_copy_item_ipv4_v2(const struct rte_flow_item *item,\n-\t\t       struct filter_v2 *enic_filter, u8 *inner_ofst)\n+enic_copy_item_ipv4_v2(struct copy_item_args *arg)\n {\n+\tconst struct rte_flow_item *item = arg->item;\n+\tstruct filter_v2 *enic_filter = arg->filter;\n+\tuint8_t *inner_ofst = arg->inner_ofst;\n \tconst struct rte_flow_item_ipv4 *spec = item->spec;\n \tconst struct rte_flow_item_ipv4 *mask = item->mask;\n \tstruct filter_generic_1 *gp = &enic_filter->u.generic_1;\n@@ -662,20 +624,12 @@ enic_copy_item_ipv4_v2(const struct rte_flow_item *item,\n \treturn 0;\n }\n \n-/**\n- * Copy IPv6 item into version 2 NIC filter.\n- *\n- * @param item[in]\n- *   Item specification.\n- * @param enic_filter[out]\n- *   Partially filled in NIC filter structure.\n- * @param inner_ofst[in]\n- *   Must be 0. Don't support inner IPv6 filtering.\n- */\n static int\n-enic_copy_item_ipv6_v2(const struct rte_flow_item *item,\n-\t\t       struct filter_v2 *enic_filter, u8 *inner_ofst)\n+enic_copy_item_ipv6_v2(struct copy_item_args *arg)\n {\n+\tconst struct rte_flow_item *item = arg->item;\n+\tstruct filter_v2 *enic_filter = arg->filter;\n+\tuint8_t *inner_ofst = arg->inner_ofst;\n \tconst struct rte_flow_item_ipv6 *spec = item->spec;\n \tconst struct rte_flow_item_ipv6 *mask = item->mask;\n \tstruct filter_generic_1 *gp = &enic_filter->u.generic_1;\n@@ -712,20 +666,12 @@ enic_copy_item_ipv6_v2(const struct rte_flow_item *item,\n \treturn 0;\n }\n \n-/**\n- * Copy UDP item into version 2 NIC filter.\n- *\n- * @param item[in]\n- *   Item specification.\n- * @param enic_filter[out]\n- *   Partially filled in NIC filter structure.\n- * @param inner_ofst[in]\n- *   Must be 0. Don't support inner UDP filtering.\n- */\n static int\n-enic_copy_item_udp_v2(const struct rte_flow_item *item,\n-\t\t      struct filter_v2 *enic_filter, u8 *inner_ofst)\n+enic_copy_item_udp_v2(struct copy_item_args *arg)\n {\n+\tconst struct rte_flow_item *item = arg->item;\n+\tstruct filter_v2 *enic_filter = arg->filter;\n+\tuint8_t *inner_ofst = arg->inner_ofst;\n \tconst struct rte_flow_item_udp *spec = item->spec;\n \tconst struct rte_flow_item_udp *mask = item->mask;\n \tstruct filter_generic_1 *gp = &enic_filter->u.generic_1;\n@@ -762,20 +708,12 @@ enic_copy_item_udp_v2(const struct rte_flow_item *item,\n \treturn 0;\n }\n \n-/**\n- * Copy TCP item into version 2 NIC filter.\n- *\n- * @param item[in]\n- *   Item specification.\n- * @param enic_filter[out]\n- *   Partially filled in NIC filter structure.\n- * @param inner_ofst[in]\n- *   Must be 0. Don't support inner TCP filtering.\n- */\n static int\n-enic_copy_item_tcp_v2(const struct rte_flow_item *item,\n-\t\t      struct filter_v2 *enic_filter, u8 *inner_ofst)\n+enic_copy_item_tcp_v2(struct copy_item_args *arg)\n {\n+\tconst struct rte_flow_item *item = arg->item;\n+\tstruct filter_v2 *enic_filter = arg->filter;\n+\tuint8_t *inner_ofst = arg->inner_ofst;\n \tconst struct rte_flow_item_tcp *spec = item->spec;\n \tconst struct rte_flow_item_tcp *mask = item->mask;\n \tstruct filter_generic_1 *gp = &enic_filter->u.generic_1;\n@@ -812,20 +750,12 @@ enic_copy_item_tcp_v2(const struct rte_flow_item *item,\n \treturn 0;\n }\n \n-/**\n- * Copy SCTP item into version 2 NIC filter.\n- *\n- * @param item[in]\n- *   Item specification.\n- * @param enic_filter[out]\n- *   Partially filled in NIC filter structure.\n- * @param inner_ofst[in]\n- *   Must be 0. Don't support inner SCTP filtering.\n- */\n static int\n-enic_copy_item_sctp_v2(const struct rte_flow_item *item,\n-\t\t       struct filter_v2 *enic_filter, u8 *inner_ofst)\n+enic_copy_item_sctp_v2(struct copy_item_args *arg)\n {\n+\tconst struct rte_flow_item *item = arg->item;\n+\tstruct filter_v2 *enic_filter = arg->filter;\n+\tuint8_t *inner_ofst = arg->inner_ofst;\n \tconst struct rte_flow_item_sctp *spec = item->spec;\n \tconst struct rte_flow_item_sctp *mask = item->mask;\n \tstruct filter_generic_1 *gp = &enic_filter->u.generic_1;\n@@ -874,20 +804,12 @@ enic_copy_item_sctp_v2(const struct rte_flow_item *item,\n \treturn 0;\n }\n \n-/**\n- * Copy UDP item into version 2 NIC filter.\n- *\n- * @param item[in]\n- *   Item specification.\n- * @param enic_filter[out]\n- *   Partially filled in NIC filter structure.\n- * @param inner_ofst[in]\n- *   Must be 0. VxLAN headers always start at the beginning of L5.\n- */\n static int\n-enic_copy_item_vxlan_v2(const struct rte_flow_item *item,\n-\t\t\tstruct filter_v2 *enic_filter, u8 *inner_ofst)\n+enic_copy_item_vxlan_v2(struct copy_item_args *arg)\n {\n+\tconst struct rte_flow_item *item = arg->item;\n+\tstruct filter_v2 *enic_filter = arg->filter;\n+\tuint8_t *inner_ofst = arg->inner_ofst;\n \tconst struct rte_flow_item_vxlan *spec = item->spec;\n \tconst struct rte_flow_item_vxlan *mask = item->mask;\n \tstruct filter_generic_1 *gp = &enic_filter->u.generic_1;\n@@ -966,13 +888,15 @@ enic_copy_filter(const struct rte_flow_item pattern[],\n \tu8 inner_ofst = 0; /* If encapsulated, ofst into L5 */\n \tenum rte_flow_item_type prev_item;\n \tconst struct enic_items *item_info;\n-\n+\tstruct copy_item_args args;\n \tu8 is_first_item = 1;\n \n \tFLOW_TRACE();\n \n \tprev_item = 0;\n \n+\targs.filter = enic_filter;\n+\targs.inner_ofst = &inner_ofst;\n \tfor (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {\n \t\t/* Get info about how to validate and copy the item. If NULL\n \t\t * is returned the nic does not support the item.\n@@ -993,7 +917,8 @@ enic_copy_filter(const struct rte_flow_item pattern[],\n \t\tif (!item_stacking_valid(prev_item, item_info, is_first_item))\n \t\t\tgoto stacking_error;\n \n-\t\tret = item_info->copy_item(item, enic_filter, &inner_ofst);\n+\t\targs.item = item;\n+\t\tret = item_info->copy_item(&args);\n \t\tif (ret)\n \t\t\tgoto item_not_supported;\n \t\tprev_item = item->type;\n",
    "prefixes": [
        "v2",
        "08/13"
    ]
}