Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/45571/?format=api
https://patches.dpdk.org/api/patches/45571/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180928110303.90561-1-xiaoyun.li@intel.com/", "project": { "id": 1, "url": "https://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": "<20180928110303.90561-1-xiaoyun.li@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180928110303.90561-1-xiaoyun.li@intel.com", "date": "2018-09-28T11:03:03", "name": "[v2] net/i40e: select fdir config automatically", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "93fd8c5459a924dc8b8f9048cf7d5e661370cbb5", "submitter": { "id": 798, "url": "https://patches.dpdk.org/api/people/798/?format=api", "name": "Li, Xiaoyun", "email": "xiaoyun.li@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180928110303.90561-1-xiaoyun.li@intel.com/mbox/", "series": [ { "id": 1569, "url": "https://patches.dpdk.org/api/series/1569/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1569", "date": "2018-09-28T11:03:03", "name": "[v2] net/i40e: select fdir config automatically", "version": 2, "mbox": "https://patches.dpdk.org/series/1569/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/45571/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/45571/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 4CC541B272;\n\tFri, 28 Sep 2018 13:11:37 +0200 (CEST)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 102A11B20A\n\tfor <dev@dpdk.org>; Fri, 28 Sep 2018 13:11:35 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t28 Sep 2018 04:11:34 -0700", "from dpdk-xiaoyun3.sh.intel.com ([10.67.119.56])\n\tby fmsmga005.fm.intel.com with ESMTP; 28 Sep 2018 04:11:15 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.54,314,1534834800\"; d=\"scan'208\";a=\"266735862\"", "From": "Xiaoyun Li <xiaoyun.li@intel.com>", "To": "beilei.xing@intel.com,\n\tqi.z.zhang@intel.com,\n\tferruh.yigit@intel.com", "Cc": "dev@dpdk.org,\n\tXiaoyun Li <xiaoyun.li@intel.com>", "Date": "Fri, 28 Sep 2018 19:03:03 +0800", "Message-Id": "<20180928110303.90561-1-xiaoyun.li@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20180928072453.6348-1-xiaoyun.li@intel.com>", "References": "<20180928072453.6348-1-xiaoyun.li@intel.com>", "Subject": "[dpdk-dev] [PATCH v2] net/i40e: select fdir config automatically", "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": "I40e driver needed users to config exact fdir mode to create rte_flow\nrules but it shouldn't. This patch allows users to create rte_flow rules\nwithout configuring fdir mode and let the driver select the config\nautomatically. And remove the workaround in flow_filtering example.\n\nSigned-off-by: Xiaoyun Li <xiaoyun.li@intel.com>\n---\nv2:\n * Added fdir teardown in i40e_flow_flush_fdir_filter.\n * Replace TAILQ_FIRST with TAILQ_EMPTY which is more intuitive.\n * Remove the workaround in flow_filtering example since the driver will\n * set the fdir config automatically.\n---\n drivers/net/i40e/i40e_flow.c | 35 +++++++++++++++++++++++++++++-----\n examples/flow_filtering/main.c | 16 ----------------\n 2 files changed, 30 insertions(+), 21 deletions(-)", "diff": "diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c\nindex c67b264de..68ae00a27 100644\n--- a/drivers/net/i40e/i40e_flow.c\n+++ b/drivers/net/i40e/i40e_flow.c\n@@ -3127,6 +3127,7 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev,\n \t\t\t struct rte_flow_error *error,\n \t\t\t union i40e_filter_t *filter)\n {\n+\tstruct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n \tstruct i40e_fdir_filter_conf *fdir_filter =\n \t\t&filter->fdir_filter;\n \tint ret;\n@@ -3148,14 +3149,29 @@ i40e_flow_parse_fdir_filter(struct rte_eth_dev *dev,\n \n \tif (dev->data->dev_conf.fdir_conf.mode !=\n \t RTE_FDIR_MODE_PERFECT) {\n-\t\trte_flow_error_set(error, ENOTSUP,\n-\t\t\t\t RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n-\t\t\t\t NULL,\n-\t\t\t\t \"Check the mode in fdir_conf.\");\n-\t\treturn -rte_errno;\n+\t\t/* Enable fdir when fdir flow is added at first time. */\n+\t\tret = i40e_fdir_setup(pf);\n+\t\tif (ret != I40E_SUCCESS) {\n+\t\t\trte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t RTE_FLOW_ERROR_TYPE_HANDLE,\n+\t\t\t\t\t NULL, \"Failed to setup fdir.\");\n+\t\t\treturn -rte_errno;\n+\t\t}\n+\t\tret = i40e_fdir_configure(dev);\n+\t\tif (ret < 0) {\n+\t\t\trte_flow_error_set(error, ENOTSUP,\n+\t\t\t\t\t RTE_FLOW_ERROR_TYPE_HANDLE,\n+\t\t\t\t\t NULL, \"Failed to configure fdir.\");\n+\t\t\tgoto err;\n+\t\t}\n+\n+\t\tdev->data->dev_conf.fdir_conf.mode = RTE_FDIR_MODE_PERFECT;\n \t}\n \n \treturn 0;\n+err:\n+\ti40e_fdir_teardown(pf);\n+\treturn -rte_errno;\n }\n \n /* Parse to get the action info of a tunnel filter\n@@ -4708,6 +4724,13 @@ i40e_flow_destroy(struct rte_eth_dev *dev,\n \tcase RTE_ETH_FILTER_FDIR:\n \t\tret = i40e_flow_add_del_fdir_filter(dev,\n \t\t &((struct i40e_fdir_filter *)flow->rule)->fdir, 0);\n+\n+\t\t/* If the last flow is destroyed, disable fdir. */\n+\t\tif (!ret && !TAILQ_EMPTY(&pf->fdir.fdir_list)) {\n+\t\t\ti40e_fdir_teardown(pf);\n+\t\t\tdev->data->dev_conf.fdir_conf.mode =\n+\t\t\t\t RTE_FDIR_MODE_NONE;\n+\t\t}\n \t\tbreak;\n \tcase RTE_ETH_FILTER_HASH:\n \t\tret = i40e_config_rss_filter_del(dev,\n@@ -4900,6 +4923,8 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)\n \t\t\tpf->fdir.inset_flag[pctype] = 0;\n \t}\n \n+\ti40e_fdir_teardown(pf);\n+\n \treturn ret;\n }\n \ndiff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c\nindex b3f85b563..a73d120e3 100644\n--- a/examples/flow_filtering/main.c\n+++ b/examples/flow_filtering/main.c\n@@ -131,22 +131,6 @@ init_port(void)\n \t\t\t\tDEV_TX_OFFLOAD_SCTP_CKSUM |\n \t\t\t\tDEV_TX_OFFLOAD_TCP_TSO,\n \t\t},\n-\t\t/*\n-\t\t * Initialize fdir_conf of rte_eth_conf.\n-\t\t * Fdir is used in flow filtering for I40e,\n-\t\t * so rte_flow rules involve some fdir\n-\t\t * configurations. In long term it's better\n-\t\t * that drivers don't require any fdir\n-\t\t * configuration for rte_flow, but we need to\n-\t\t * get this workaround so that sample app can\n-\t\t * run on I40e.\n-\t\t */\n-\t\t.fdir_conf = {\n-\t\t\t.mode = RTE_FDIR_MODE_PERFECT,\n-\t\t\t.pballoc = RTE_FDIR_PBALLOC_64K,\n-\t\t\t.status = RTE_FDIR_REPORT_STATUS,\n-\t\t\t.drop_queue = 127,\n-\t\t},\n \t};\n \tstruct rte_eth_txconf txq_conf;\n \tstruct rte_eth_rxconf rxq_conf;\n", "prefixes": [ "v2" ] }{ "id": 45571, "url": "