Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/45663/?format=api
https://patches.dpdk.org/api/patches/45663/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180929084454.93718-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": "<20180929084454.93718-1-xiaoyun.li@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20180929084454.93718-1-xiaoyun.li@intel.com", "date": "2018-09-29T08:44:54", "name": "[v3] net/i40e: select fdir config automatically", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "2ca01a581d4223494b08d237859dfd022803372a", "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/20180929084454.93718-1-xiaoyun.li@intel.com/mbox/", "series": [ { "id": 1597, "url": "https://patches.dpdk.org/api/series/1597/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1597", "date": "2018-09-29T08:44:54", "name": "[v3] net/i40e: select fdir config automatically", "version": 3, "mbox": "https://patches.dpdk.org/series/1597/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/45663/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/45663/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 208101B101;\n\tSat, 29 Sep 2018 11:01:24 +0200 (CEST)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id 17DC01B100\n\tfor <dev@dpdk.org>; Sat, 29 Sep 2018 11:01:21 +0200 (CEST)", "from fmsmga007.fm.intel.com ([10.253.24.52])\n\tby orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t29 Sep 2018 02:01:20 -0700", "from dpdk-xiaoyun3.sh.intel.com ([10.67.119.56])\n\tby fmsmga007.fm.intel.com with ESMTP; 29 Sep 2018 01:53:10 -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,319,1534834800\"; d=\"scan'208\";a=\"74047203\"", "From": "Xiaoyun Li <xiaoyun.li@intel.com>", "To": "ferruh.yigit@intel.com, qi.z.zhang@intel.com, beilei.xing@intel.com,\n\tdev@dpdk.org", "Cc": "Xiaoyun Li <xiaoyun.li@intel.com>", "Date": "Sat, 29 Sep 2018 16:44:54 +0800", "Message-Id": "<20180929084454.93718-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 v3] 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---\nv3:\n * Fixed fdir config doesn't automatically remove when last flow is\n * destroyed.\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 6487596da..d811b3891 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": [ "v3" ] }{ "id": 45663, "url": "