Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/62836/?format=api
http://patches.dpdk.org/api/patches/62836/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191111131914.16559-4-pbhagavatula@marvell.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": "<20191111131914.16559-4-pbhagavatula@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20191111131914.16559-4-pbhagavatula@marvell.com", "date": "2019-11-11T13:19:07", "name": "[v17,03/10] ethdev: add validation to offloads set by PMD", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "833b37472136c2dfc789c51c27c014705dbf0700", "submitter": { "id": 1183, "url": "http://patches.dpdk.org/api/people/1183/?format=api", "name": "Pavan Nikhilesh Bhagavatula", "email": "pbhagavatula@marvell.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/20191111131914.16559-4-pbhagavatula@marvell.com/mbox/", "series": [ { "id": 7386, "url": "http://patches.dpdk.org/api/series/7386/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7386", "date": "2019-11-11T13:19:04", "name": "ethdev: add new Rx offload flags", "version": 17, "mbox": "http://patches.dpdk.org/series/7386/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/62836/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/62836/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 D6639A04B9;\n\tMon, 11 Nov 2019 14:19:50 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B76FE2B84;\n\tMon, 11 Nov 2019 14:19:33 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 287C82B84\n for <dev@dpdk.org>; Mon, 11 Nov 2019 14:19:32 +0100 (CET)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n xABDHf05026281; Mon, 11 Nov 2019 05:19:31 -0800", "from sc-exch04.marvell.com ([199.233.58.184])\n by mx0b-0016f401.pphosted.com with ESMTP id 2w5wurp8xa-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 11 Nov 2019 05:19:31 -0800", "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com\n (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 11 Nov\n 2019 05:19:29 -0800", "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n Transport; Mon, 11 Nov 2019 05:19:29 -0800", "from BG-LT7430.marvell.com (unknown [10.28.17.38])\n by maili.marvell.com (Postfix) with ESMTP id 670533F703F;\n Mon, 11 Nov 2019 05:19:27 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0818;\n bh=M/Ev94kliFJ9BHhVcHADFYB0S45fUMvFyEHF8nSDiUc=;\n b=VW8pBDpdRIngeOnFrwjHXKUztVg6bg+TsIVRsqGd9XfnRA8Ru85aZXgTG9SG5sNXwOyA\n zfg5hTSdXXYMu+bRiSaYosdp1mFGDrf8SnF7d9NiLsXNqtJU/VpHCQPnoAJZiCNrl4nO\n 3g3UjDRLIXtYqEtoeSevE9O77VlyiVmvmOWHCG/yQH0N0913f7K6bECqoCXzQsokk3jk\n f0exaAn0X5W/rBiv+IKzJD9WmEomqVspRHj9Lw/ad7dcBij9xdMcYm6Of7TqgWd89rGp\n J9SeaZQplzhO9gIYzvNGjnlpcSH3AYLlo/aMlM2DU8p+v+W4kCUM/zL3jK6r2ZGVSVms Bw==", "From": "<pbhagavatula@marvell.com>", "To": "<ferruh.yigit@intel.com>, <arybchenko@solarflare.com>,\n <jerinj@marvell.com>, <thomas@monjalon.net>", "CC": "<dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>", "Date": "Mon, 11 Nov 2019 18:49:07 +0530", "Message-ID": "<20191111131914.16559-4-pbhagavatula@marvell.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20191111131914.16559-1-pbhagavatula@marvell.com>", "References": "<20191106191803.15098-1-pbhagavatula@marvell.com>\n <20191111131914.16559-1-pbhagavatula@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.95,18.0.572\n definitions=2019-11-11_04:2019-11-11,2019-11-11 signatures=0", "Subject": "[dpdk-dev] [PATCH v17 03/10] ethdev: add validation to offloads set\n\tby PMD", "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": "From: Pavan Nikhilesh <pbhagavatula@marvell.com>\n\nSome PMDs cannot work when certain offloads are enable/disabled, as a\nworkaround PMDs auto enable/disable offloads internally and expose it\nthrough dev->data->dev_conf.rxmode.offloads.\n\nAfter device specific dev_configure is called compare the requested\noffloads to the offloads exposed by the PMD and, if the PMD failed\nto enable a given offload then log it and return -EINVAL from\nrte_eth_dev_configure, else if the PMD failed to disable a given offload\nlog and continue with rte_eth_dev_configure.\n\nSuggested-by: Andrew Rybchenko <arybchenko@solarflare.com>\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\nReviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n lib/librte_ethdev/rte_ethdev.c | 83 +++++++++++++++++++++++++++++++---\n 1 file changed, 76 insertions(+), 7 deletions(-)", "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 153d50e9a..bebd52231 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -1137,6 +1137,57 @@ rte_eth_dev_tx_offload_name(uint64_t offload)\n \treturn name;\n }\n \n+/*\n+ * Validate offloads that are requested through rte_eth_dev_configure against\n+ * the offloads successfuly set by the ethernet device.\n+ *\n+ * @param port_id\n+ * The port identifier of the Ethernet device.\n+ * @param req_offloads\n+ * The offloads that have been requested through `rte_eth_dev_configure`.\n+ * @param set_offloads\n+ * The offloads successfuly set by the ethernet device.\n+ * @param offload_type\n+ * The offload type i.e. Rx/Tx string.\n+ * @param offload_name\n+ * The function that prints the offload name.\n+ * @return\n+ * - (0) if validation successful.\n+ * - (-EINVAL) if requested offload has been silently disabled.\n+ *\n+ */\n+static int\n+validate_offloads(uint16_t port_id, uint64_t req_offloads,\n+\t\t uint64_t set_offloads, const char *offload_type,\n+\t\t const char *(*offload_name)(uint64_t))\n+{\n+\tuint64_t offloads_diff = req_offloads ^ set_offloads;\n+\tuint64_t offload;\n+\tint ret = 0;\n+\n+\twhile (offloads_diff != 0) {\n+\t\t/* Check if any offload is requested but not enabled. */\n+\t\toffload = 1ULL << __builtin_ctzll(offloads_diff);\n+\t\tif (offload & req_offloads) {\n+\t\t\tRTE_ETHDEV_LOG(ERR,\n+\t\t\t\t\"Port %u failed to enable %s offload %s\\n\",\n+\t\t\t\tport_id, offload_type, offload_name(offload));\n+\t\t\tret = -EINVAL;\n+\t\t}\n+\n+\t\t/* Chech if offload couldn't be disabled. */\n+\t\tif (offload & set_offloads) {\n+\t\t\tRTE_ETHDEV_LOG(INFO,\n+\t\t\t\t\"Port %u failed to disable %s offload %s\\n\",\n+\t\t\t\tport_id, offload_type, offload_name(offload));\n+\t\t}\n+\n+\t\toffloads_diff &= ~offload;\n+\t}\n+\n+\treturn ret;\n+}\n+\n int\n rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,\n \t\t const struct rte_eth_conf *dev_conf)\n@@ -1343,10 +1394,8 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,\n \tif (diag != 0) {\n \t\tRTE_ETHDEV_LOG(ERR, \"Port%u dev_configure = %d\\n\",\n \t\t\tport_id, diag);\n-\t\trte_eth_dev_rx_queue_config(dev, 0);\n-\t\trte_eth_dev_tx_queue_config(dev, 0);\n \t\tret = eth_err(port_id, diag);\n-\t\tgoto rollback;\n+\t\tgoto reset_queues;\n \t}\n \n \t/* Initialize Rx profiling if enabled at compilation time. */\n@@ -1354,14 +1403,34 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,\n \tif (diag != 0) {\n \t\tRTE_ETHDEV_LOG(ERR, \"Port%u __rte_eth_dev_profile_init = %d\\n\",\n \t\t\tport_id, diag);\n-\t\trte_eth_dev_rx_queue_config(dev, 0);\n-\t\trte_eth_dev_tx_queue_config(dev, 0);\n \t\tret = eth_err(port_id, diag);\n-\t\tgoto rollback;\n+\t\tgoto reset_queues;\n \t}\n \n-\treturn 0;\n+\t/* Validate Rx offloads. */\n+\tdiag = validate_offloads(port_id,\n+\t\t\tdev_conf->rxmode.offloads,\n+\t\t\tdev->data->dev_conf.rxmode.offloads, \"Rx\",\n+\t\t\trte_eth_dev_rx_offload_name);\n+\tif (diag != 0) {\n+\t\tret = diag;\n+\t\tgoto reset_queues;\n+\t}\n+\n+\t/* Validate Tx offloads. */\n+\tdiag = validate_offloads(port_id,\n+\t\t\tdev_conf->txmode.offloads,\n+\t\t\tdev->data->dev_conf.txmode.offloads, \"Tx\",\n+\t\t\trte_eth_dev_tx_offload_name);\n+\tif (diag != 0) {\n+\t\tret = diag;\n+\t\tgoto reset_queues;\n+\t}\n \n+\treturn 0;\n+reset_queues:\n+\trte_eth_dev_rx_queue_config(dev, 0);\n+\trte_eth_dev_tx_queue_config(dev, 0);\n rollback:\n \tmemcpy(&dev->data->dev_conf, &orig_conf, sizeof(dev->data->dev_conf));\n \n", "prefixes": [ "v17", "03/10" ] }{ "id": 62836, "url": "