Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/24330/?format=api
http://patches.dpdk.org/api/patches/24330/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20170517030348.2663-4-johndale@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": "<20170517030348.2663-4-johndale@cisco.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20170517030348.2663-4-johndale@cisco.com", "date": "2017-05-17T03:03:45", "name": "[dpdk-dev,v3,3/6] net/enic: flow API for NICs with advanced filters disabled", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "b9f49eb45c58bdeae3e8323fed00ada5c93c9b26", "submitter": { "id": 359, "url": "http://patches.dpdk.org/api/people/359/?format=api", "name": "John Daley (johndale)", "email": "johndale@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/20170517030348.2663-4-johndale@cisco.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/24330/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/24330/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 2BB0B3245;\n\tWed, 17 May 2017 05:04:09 +0200 (CEST)", "from alln-iport-7.cisco.com (alln-iport-7.cisco.com\n\t[173.37.142.94]) by dpdk.org (Postfix) with ESMTP id 5BD6E2A5D\n\tfor <dev@dpdk.org>; Wed, 17 May 2017 05:04:00 +0200 (CEST)", "from rcdn-core-6.cisco.com ([173.37.93.157])\n\tby alln-iport-7.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t17 May 2017 03:03:59 +0000", "from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48])\n\tby rcdn-core-6.cisco.com (8.14.5/8.14.5) with ESMTP id v4H33x12001490;\n\tWed, 17 May 2017 03:03:59 GMT", "by cisco.com (Postfix, from userid 392789)\n\tid 088933FAAF21; Tue, 16 May 2017 20:03:59 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=7113; q=dns/txt; s=iport;\n\tt=1494990240; x=1496199840;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=yt0/rFmmWAJOBvdn6o2XiM5UK/j4n8p/RVOLllMrBxQ=;\n\tb=iVuWUCZxRKfMz7BJ6gvz7wyJho9egT45bMdX67MFG9kZkXnYAGx9JryQ\n\txxR4sP70kSp+KfpkqxDN7cxfjXg99/mt2DN1SC3Y4gh3ecvxSBGzsP0Ft\n\tRM615iJs1mVi7q28+cl44doaku6DctBoVk/M8SpRwPvZKkuE/XJe9pGDR A=;", "X-IronPort-AV": "E=Sophos;i=\"5.38,352,1491264000\"; d=\"scan'208\";a=\"427536750\"", "From": "John Daley <johndale@cisco.com>", "To": "ferruh.yigit@intel.com", "Cc": "dev@dpdk.org, John Daley <johndale@cisco.com>", "Date": "Tue, 16 May 2017 20:03:45 -0700", "Message-Id": "<20170517030348.2663-4-johndale@cisco.com>", "X-Mailer": "git-send-email 2.12.0", "In-Reply-To": "<20170517030348.2663-1-johndale@cisco.com>", "References": "<20170331020622.25498-8-johndale@cisco.com>\n\t<20170517030348.2663-1-johndale@cisco.com>", "Subject": "[dpdk-dev] [PATCH v3 3/6] net/enic: flow API for NICs with advanced\n\tfilters disabled", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Flow support for 1300 series adapters with the 'Advanced Filter'\nmode disabled via the UCS management interface. This allows:\nAttributes: ingress\nItems: Outer eth, ipv4, ipv6, udp, sctp, tcp, vxlan. Inner eth, ipv4,\n ipv6, udp, tcp.\nActions: queue and void\nSelectors: 'is', 'spec' and 'mask'. 'last' is not supported\n\nWith advanced filters disabled, an IPv4 or IPv6 item must be specified\nin the pattern.\n\nSigned-off-by: John Daley <johndale@cisco.com>\nReviewed-by: Nelson Escobar <neescoba@cisco.com>\n---\n drivers/net/enic/enic_flow.c | 135 ++++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 133 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c\nindex 2ea8c9370..edbde98e6 100644\n--- a/drivers/net/enic/enic_flow.c\n+++ b/drivers/net/enic/enic_flow.c\n@@ -101,8 +101,85 @@ static enic_copy_item_fn enic_copy_item_tcp_v2;\n static enic_copy_item_fn enic_copy_item_sctp_v2;\n static enic_copy_item_fn enic_copy_item_sctp_v2;\n static enic_copy_item_fn enic_copy_item_vxlan_v2;\n+static copy_action_fn enic_copy_action_v1;\n static copy_action_fn enic_copy_action_v2;\n \n+/**\n+ * NICs have Advanced Filters capability but they are disabled. This means\n+ * that layer 3 must be specified.\n+ */\n+static const struct enic_items enic_items_v2[] = {\n+\t[RTE_FLOW_ITEM_TYPE_ETH] = {\n+\t\t.copy_item = enic_copy_item_eth_v2,\n+\t\t.valid_start_item = 1,\n+\t\t.prev_items = (const enum rte_flow_item_type[]) {\n+\t\t\t RTE_FLOW_ITEM_TYPE_VXLAN,\n+\t\t\t RTE_FLOW_ITEM_TYPE_END,\n+\t\t},\n+\t},\n+\t[RTE_FLOW_ITEM_TYPE_VLAN] = {\n+\t\t.copy_item = enic_copy_item_vlan_v2,\n+\t\t.valid_start_item = 1,\n+\t\t.prev_items = (const enum rte_flow_item_type[]) {\n+\t\t\t RTE_FLOW_ITEM_TYPE_ETH,\n+\t\t\t RTE_FLOW_ITEM_TYPE_END,\n+\t\t},\n+\t},\n+\t[RTE_FLOW_ITEM_TYPE_IPV4] = {\n+\t\t.copy_item = enic_copy_item_ipv4_v2,\n+\t\t.valid_start_item = 1,\n+\t\t.prev_items = (const enum rte_flow_item_type[]) {\n+\t\t\t RTE_FLOW_ITEM_TYPE_ETH,\n+\t\t\t RTE_FLOW_ITEM_TYPE_VLAN,\n+\t\t\t RTE_FLOW_ITEM_TYPE_END,\n+\t\t},\n+\t},\n+\t[RTE_FLOW_ITEM_TYPE_IPV6] = {\n+\t\t.copy_item = enic_copy_item_ipv6_v2,\n+\t\t.valid_start_item = 1,\n+\t\t.prev_items = (const enum rte_flow_item_type[]) {\n+\t\t\t RTE_FLOW_ITEM_TYPE_ETH,\n+\t\t\t RTE_FLOW_ITEM_TYPE_VLAN,\n+\t\t\t RTE_FLOW_ITEM_TYPE_END,\n+\t\t},\n+\t},\n+\t[RTE_FLOW_ITEM_TYPE_UDP] = {\n+\t\t.copy_item = enic_copy_item_udp_v2,\n+\t\t.valid_start_item = 0,\n+\t\t.prev_items = (const enum rte_flow_item_type[]) {\n+\t\t\t RTE_FLOW_ITEM_TYPE_IPV4,\n+\t\t\t RTE_FLOW_ITEM_TYPE_IPV6,\n+\t\t\t RTE_FLOW_ITEM_TYPE_END,\n+\t\t},\n+\t},\n+\t[RTE_FLOW_ITEM_TYPE_TCP] = {\n+\t\t.copy_item = enic_copy_item_tcp_v2,\n+\t\t.valid_start_item = 0,\n+\t\t.prev_items = (const enum rte_flow_item_type[]) {\n+\t\t\t RTE_FLOW_ITEM_TYPE_IPV4,\n+\t\t\t RTE_FLOW_ITEM_TYPE_IPV6,\n+\t\t\t RTE_FLOW_ITEM_TYPE_END,\n+\t\t},\n+\t},\n+\t[RTE_FLOW_ITEM_TYPE_SCTP] = {\n+\t\t.copy_item = enic_copy_item_sctp_v2,\n+\t\t.valid_start_item = 0,\n+\t\t.prev_items = (const enum rte_flow_item_type[]) {\n+\t\t\t RTE_FLOW_ITEM_TYPE_IPV4,\n+\t\t\t RTE_FLOW_ITEM_TYPE_IPV6,\n+\t\t\t RTE_FLOW_ITEM_TYPE_END,\n+\t\t},\n+\t},\n+\t[RTE_FLOW_ITEM_TYPE_VXLAN] = {\n+\t\t.copy_item = enic_copy_item_vxlan_v2,\n+\t\t.valid_start_item = 0,\n+\t\t.prev_items = (const enum rte_flow_item_type[]) {\n+\t\t\t RTE_FLOW_ITEM_TYPE_UDP,\n+\t\t\t RTE_FLOW_ITEM_TYPE_END,\n+\t\t},\n+\t},\n+};\n+\n /** NICs with Advanced filters enabled */\n static const struct enic_items enic_items_v3[] = {\n \t[RTE_FLOW_ITEM_TYPE_ETH] = {\n@@ -178,11 +255,20 @@ static const struct enic_items enic_items_v3[] = {\n \n /** Filtering capabilites indexed this NICs supported filter type. */\n static const struct enic_filter_cap enic_filter_cap[] = {\n+\t[FILTER_USNIC_IP] = {\n+\t\t.item_info = enic_items_v2,\n+\t},\n \t[FILTER_DPDK_1] = {\n \t\t.item_info = enic_items_v3,\n \t},\n };\n \n+/** Supported actions for older NICs */\n+static const enum rte_flow_action_type enic_supported_actions_v1[] = {\n+\tRTE_FLOW_ACTION_TYPE_QUEUE,\n+\tRTE_FLOW_ACTION_TYPE_END,\n+};\n+\n /** Supported actions for newer NICs */\n static const enum rte_flow_action_type enic_supported_actions_v2[] = {\n \tRTE_FLOW_ACTION_TYPE_QUEUE,\n@@ -193,6 +279,10 @@ static const enum rte_flow_action_type enic_supported_actions_v2[] = {\n \n /** Action capabilites indexed by NIC version information */\n static const struct enic_action_cap enic_action_cap[] = {\n+\t[FILTER_ACTION_RQ_STEERING_FLAG] = {\n+\t\t.actions = enic_supported_actions_v1,\n+\t\t.copy_fn = enic_copy_action_v1,\n+\t},\n \t[FILTER_ACTION_V2_ALL] = {\n \t\t.actions = enic_supported_actions_v2,\n \t\t.copy_fn = enic_copy_action_v2,\n@@ -643,7 +733,6 @@ enic_copy_filter(const struct rte_flow_item pattern[],\n \tenum rte_flow_item_type prev_item;\n \tconst struct enic_items *item_info;\n \n-\tenic_filter->type = FILTER_DPDK_1;\n \tu8 is_first_item = 1;\n \n \tFLOW_TRACE();\n@@ -681,6 +770,44 @@ enic_copy_filter(const struct rte_flow_item pattern[],\n \t\t\t item, \"stacking error\");\n \treturn -rte_errno;\n }\n+\n+/**\n+ * Build the intenal version 1 NIC action structure from the provided pattern.\n+ * The pattern is validated as the items are copied.\n+ *\n+ * @param actions[in]\n+ * @param enic_action[out]\n+ * NIC specfilc actions derived from the actions.\n+ * @param error[out]\n+ */\n+static int\n+enic_copy_action_v1(const struct rte_flow_action actions[],\n+\t\t struct filter_action_v2 *enic_action)\n+{\n+\tFLOW_TRACE();\n+\n+\tfor (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {\n+\t\tif (actions->type == RTE_FLOW_ACTION_TYPE_VOID)\n+\t\t\tcontinue;\n+\n+\t\tswitch (actions->type) {\n+\t\tcase RTE_FLOW_ACTION_TYPE_QUEUE: {\n+\t\t\tconst struct rte_flow_action_queue *queue =\n+\t\t\t\t(const struct rte_flow_action_queue *)\n+\t\t\t\tactions->conf;\n+\t\t\tenic_action->rq_idx =\n+\t\t\t\tenic_rte_rq_idx_to_sop_idx(queue->index);\n+\t\t\tbreak;\n+\t\t}\n+\t\tdefault:\n+\t\t\tRTE_ASSERT(0);\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\tenic_action->type = FILTER_ACTION_RQ_STEERING;\n+\treturn 0;\n+}\n+\n /**\n * Build the intenal version 2 NIC action structure from the provided pattern.\n * The pattern is validated as the items are copied.\n@@ -755,7 +882,8 @@ static const struct enic_filter_cap *\n enic_get_filter_cap(struct enic *enic)\n {\n \t/* FIXME: only support advanced filters for now */\n-\tif (enic->flow_filter_mode != FILTER_DPDK_1)\n+\tif ((enic->flow_filter_mode != FILTER_DPDK_1) &&\n+\t (enic->flow_filter_mode != FILTER_USNIC_IP))\n \t\treturn (const struct enic_filter_cap *)NULL;\n \n \tif (enic->flow_filter_mode)\n@@ -772,6 +900,8 @@ enic_get_action_cap(struct enic *enic)\n \n \tif (enic->filter_tags)\n \t\tea = &enic_action_cap[FILTER_ACTION_V2_ALL];\n+\telse\n+\t\tea = &enic_action_cap[FILTER_ACTION_RQ_STEERING_FLAG];\n \treturn ea;\n }\n /**\n@@ -884,6 +1014,7 @@ enic_flow_parse(struct rte_eth_dev *dev,\n \t\t\t NULL, \"Flow API not available\");\n \t\treturn -rte_errno;\n \t}\n+\tenic_filter->type = enic->flow_filter_mode;\n \tret = enic_copy_filter(pattern, enic_filter_cap->item_info,\n \t\t\t\t enic_filter, error);\n \treturn ret;\n", "prefixes": [ "dpdk-dev", "v3", "3/6" ] }{ "id": 24330, "url": "