Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/105257/?format=api
http://patches.dpdk.org/api/patches/105257/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/056dc0cd7dbafa37d68a2887d5602f860fe44b7b.1639636621.git.songyl@ramaxel.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": "<056dc0cd7dbafa37d68a2887d5602f860fe44b7b.1639636621.git.songyl@ramaxel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/056dc0cd7dbafa37d68a2887d5602f860fe44b7b.1639636621.git.songyl@ramaxel.com", "date": "2021-12-18T02:51:46", "name": "[v1,19/25] net/spnic: support promiscuous and allmulticast Rx modes", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "9815587e148a1dd19fa3080586bcc404afbf6b31", "submitter": { "id": 2455, "url": "http://patches.dpdk.org/api/people/2455/?format=api", "name": "Yanling Song", "email": "songyl@ramaxel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/056dc0cd7dbafa37d68a2887d5602f860fe44b7b.1639636621.git.songyl@ramaxel.com/mbox/", "series": [ { "id": 20973, "url": "http://patches.dpdk.org/api/series/20973/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=20973", "date": "2021-12-18T02:51:28", "name": "Net/SPNIC: support SPNIC into DPDK 22.03", "version": 1, "mbox": "http://patches.dpdk.org/series/20973/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/105257/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/105257/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C65EAA04A4;\n\tSat, 18 Dec 2021 03:54:45 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 29FB0426E5;\n\tSat, 18 Dec 2021 03:52:45 +0100 (CET)", "from VLXDG1SPAM1.ramaxel.com (email.ramaxel.com [221.4.138.186])\n by mails.dpdk.org (Postfix) with ESMTP id C76A1426E7\n for <dev@dpdk.org>; Sat, 18 Dec 2021 03:52:43 +0100 (CET)", "from V12DG1MBS01.ramaxel.local (v12dg1mbs01.ramaxel.local\n [172.26.18.31])\n by VLXDG1SPAM1.ramaxel.com with ESMTPS id 1BI2q27Q010347\n (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);\n Sat, 18 Dec 2021 10:52:02 +0800 (GMT-8)\n (envelope-from songyl@ramaxel.com)", "from localhost.localdomain (10.64.9.47) by V12DG1MBS01.ramaxel.local\n (172.26.18.31) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Sat, 18\n Dec 2021 10:52:02 +0800" ], "From": "Yanling Song <songyl@ramaxel.com>", "To": "<dev@dpdk.org>", "CC": "<songyl@ramaxel.com>, <yanling.song@linux.dev>, <yanggan@ramaxel.com>,\n <ferruh.yigit@intel.com>", "Subject": "[PATCH v1 19/25] net/spnic: support promiscuous and allmulticast Rx\n modes", "Date": "Sat, 18 Dec 2021 10:51:46 +0800", "Message-ID": "\n <056dc0cd7dbafa37d68a2887d5602f860fe44b7b.1639636621.git.songyl@ramaxel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<cover.1639636621.git.songyl@ramaxel.com>", "References": "<cover.1639636621.git.songyl@ramaxel.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.64.9.47]", "X-ClientProxiedBy": "V12DG1MBS01.ramaxel.local (172.26.18.31) To\n V12DG1MBS01.ramaxel.local (172.26.18.31)", "X-DNSRBL": "", "X-MAIL": "VLXDG1SPAM1.ramaxel.com 1BI2q27Q010347", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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" }, "content": "This commit implements promiscuous_enable/disable() and\nallmulticast_enable/disable() to configure promiscuous or\nallmulticast Rx modes. Note: promiscuous rx mode is only supported\nby PF.\n\nSigned-off-by: Yanling Song <songyl@ramaxel.com>\n---\n drivers/net/spnic/spnic_ethdev.c | 156 +++++++++++++++++++++++++++++++\n 1 file changed, 156 insertions(+)", "diff": "diff --git a/drivers/net/spnic/spnic_ethdev.c b/drivers/net/spnic/spnic_ethdev.c\nindex 7f6bd41c55..0b5ef15373 100644\n--- a/drivers/net/spnic/spnic_ethdev.c\n+++ b/drivers/net/spnic/spnic_ethdev.c\n@@ -1394,6 +1394,156 @@ static int spnic_vlan_offload_set(struct rte_eth_dev *dev, int mask)\n \treturn 0;\n }\n \n+/**\n+ * Enable allmulticast mode.\n+ *\n+ * @param[in] dev\n+ * Pointer to ethernet device structure.\n+ *\n+ * @retval zero: Success\n+ * @retval non-zero: Failure\n+ */\n+static int spnic_dev_allmulticast_enable(struct rte_eth_dev *dev)\n+{\n+\tstruct spnic_nic_dev *nic_dev = SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\tu32 rx_mode;\n+\tint err;\n+\n+\terr = spnic_mutex_lock(&nic_dev->rx_mode_mutex);\n+\tif (err)\n+\t\treturn err;\n+\n+\trx_mode = nic_dev->rx_mode | SPNIC_RX_MODE_MC_ALL;\n+\n+\terr = spnic_set_rx_mode(nic_dev->hwdev, rx_mode);\n+\tif (err) {\n+\t\t(void)spnic_mutex_unlock(&nic_dev->rx_mode_mutex);\n+\t\tPMD_DRV_LOG(ERR, \"Enable allmulticast failed, error: %d\", err);\n+\t\treturn err;\n+\t}\n+\n+\tnic_dev->rx_mode = rx_mode;\n+\n+\t(void)spnic_mutex_unlock(&nic_dev->rx_mode_mutex);\n+\n+\tPMD_DRV_LOG(INFO, \"Enable allmulticast succeed, nic_dev: %s, port_id: %d\",\n+\t\t nic_dev->dev_name, dev->data->port_id);\n+\treturn 0;\n+}\n+\n+/**\n+ * Disable allmulticast mode.\n+ *\n+ * @param[in] dev\n+ * Pointer to ethernet device structure.\n+ *\n+ * @retval zero: Success\n+ * @retval non-zero: Failure\n+ */\n+static int spnic_dev_allmulticast_disable(struct rte_eth_dev *dev)\n+{\n+\tstruct spnic_nic_dev *nic_dev = SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\tu32 rx_mode;\n+\tint err;\n+\n+\terr = spnic_mutex_lock(&nic_dev->rx_mode_mutex);\n+\tif (err)\n+\t\treturn err;\n+\n+\trx_mode = nic_dev->rx_mode & (~SPNIC_RX_MODE_MC_ALL);\n+\n+\terr = spnic_set_rx_mode(nic_dev->hwdev, rx_mode);\n+\tif (err) {\n+\t\t(void)spnic_mutex_unlock(&nic_dev->rx_mode_mutex);\n+\t\tPMD_DRV_LOG(ERR, \"Disable allmulticast failed, error: %d\", err);\n+\t\treturn err;\n+\t}\n+\n+\tnic_dev->rx_mode = rx_mode;\n+\n+\t(void)spnic_mutex_unlock(&nic_dev->rx_mode_mutex);\n+\n+\tPMD_DRV_LOG(INFO, \"Disable allmulticast succeed, nic_dev: %s, port_id: %d\",\n+\t\t nic_dev->dev_name, dev->data->port_id);\n+\treturn 0;\n+}\n+\n+/**\n+ * Enable promiscuous mode.\n+ *\n+ * @param[in] dev\n+ * Pointer to ethernet device structure.\n+ *\n+ * @retval zero: Success\n+ * @retval non-zero: Failure\n+ */\n+static int spnic_dev_promiscuous_enable(struct rte_eth_dev *dev)\n+{\n+\tstruct spnic_nic_dev *nic_dev = SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\tu32 rx_mode;\n+\tint err;\n+\n+\terr = spnic_mutex_lock(&nic_dev->rx_mode_mutex);\n+\tif (err)\n+\t\treturn err;\n+\n+\trx_mode = nic_dev->rx_mode | SPNIC_RX_MODE_PROMISC;\n+\n+\terr = spnic_set_rx_mode(nic_dev->hwdev, rx_mode);\n+\tif (err) {\n+\t\t(void)spnic_mutex_unlock(&nic_dev->rx_mode_mutex);\n+\t\tPMD_DRV_LOG(ERR, \"Enable promiscuous failed\");\n+\t\treturn err;\n+\t}\n+\n+\tnic_dev->rx_mode = rx_mode;\n+\n+\t(void)spnic_mutex_unlock(&nic_dev->rx_mode_mutex);\n+\n+\tPMD_DRV_LOG(INFO, \"Enable promiscuous, nic_dev: %s, port_id: %d, promisc: %d\",\n+\t\t nic_dev->dev_name, dev->data->port_id,\n+\t\t dev->data->promiscuous);\n+\treturn 0;\n+}\n+\n+/**\n+ * Disable promiscuous mode.\n+ *\n+ * @param[in] dev\n+ * Pointer to ethernet device structure.\n+ *\n+ * @retval zero: Success\n+ * @retval non-zero: Failure\n+ */\n+static int spnic_dev_promiscuous_disable(struct rte_eth_dev *dev)\n+{\n+\tstruct spnic_nic_dev *nic_dev = SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n+\tu32 rx_mode;\n+\tint err;\n+\n+\terr = spnic_mutex_lock(&nic_dev->rx_mode_mutex);\n+\tif (err)\n+\t\treturn err;\n+\n+\trx_mode = nic_dev->rx_mode & (~SPNIC_RX_MODE_PROMISC);\n+\n+\terr = spnic_set_rx_mode(nic_dev->hwdev, rx_mode);\n+\tif (err) {\n+\t\t(void)spnic_mutex_unlock(&nic_dev->rx_mode_mutex);\n+\t\tPMD_DRV_LOG(ERR, \"Disable promiscuous failed\");\n+\t\treturn err;\n+\t}\n+\n+\tnic_dev->rx_mode = rx_mode;\n+\n+\t(void)spnic_mutex_unlock(&nic_dev->rx_mode_mutex);\n+\n+\tPMD_DRV_LOG(INFO, \"Disable promiscuous, nic_dev: %s, port_id: %d, promisc: %d\",\n+\t\t nic_dev->dev_name, dev->data->port_id,\n+\t\t dev->data->promiscuous);\n+\treturn 0;\n+}\n+\n \n /**\n * Update the RSS hash key and RSS hash type.\n@@ -1830,6 +1980,10 @@ static const struct eth_dev_ops spnic_pmd_ops = {\n \t.mtu_set = spnic_dev_set_mtu,\n \t.vlan_filter_set = spnic_vlan_filter_set,\n \t.vlan_offload_set = spnic_vlan_offload_set,\n+\t.allmulticast_enable = spnic_dev_allmulticast_enable,\n+\t.allmulticast_disable = spnic_dev_allmulticast_disable,\n+\t.promiscuous_enable = spnic_dev_promiscuous_enable,\n+\t.promiscuous_disable = spnic_dev_promiscuous_disable,\n \t.rss_hash_update = spnic_rss_hash_update,\n \t.rss_hash_conf_get = spnic_rss_conf_get,\n \t.reta_update = spnic_rss_reta_update,\n@@ -1855,6 +2009,8 @@ static const struct eth_dev_ops spnic_pmd_vf_ops = {\n \t.mtu_set = spnic_dev_set_mtu,\n \t.vlan_filter_set = spnic_vlan_filter_set,\n \t.vlan_offload_set = spnic_vlan_offload_set,\n+\t.allmulticast_enable = spnic_dev_allmulticast_enable,\n+\t.allmulticast_disable = spnic_dev_allmulticast_disable,\n \t.rss_hash_update = spnic_rss_hash_update,\n \t.rss_hash_conf_get = spnic_rss_conf_get,\n \t.reta_update = spnic_rss_reta_update,\n", "prefixes": [ "v1", "19/25" ] }{ "id": 105257, "url": "