Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/105340/?format=api
http://patches.dpdk.org/api/patches/105340/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/c9396110f5bdba31d4b572f608f0f854f7bf87cf.1640242368.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": "<c9396110f5bdba31d4b572f608f0f854f7bf87cf.1640242368.git.songyl@ramaxel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/c9396110f5bdba31d4b572f608f0f854f7bf87cf.1640242368.git.songyl@ramaxel.com", "date": "2021-12-23T08:23:57", "name": "[v2,14/25] net/spnic: add port/vport enable", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "e10aceed0a93f7922a15e1a1544a67390fd1ebea", "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/c9396110f5bdba31d4b572f608f0f854f7bf87cf.1640242368.git.songyl@ramaxel.com/mbox/", "series": [ { "id": 21012, "url": "http://patches.dpdk.org/api/series/21012/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=21012", "date": "2021-12-23T08:23:44", "name": "Net/SPNIC: support SPNIC into DPDK 22.03", "version": 2, "mbox": "http://patches.dpdk.org/series/21012/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/105340/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/105340/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 DC8D0A0350;\n\tThu, 23 Dec 2021 09:25:49 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7795F41176;\n\tThu, 23 Dec 2021 09:24:46 +0100 (CET)", "from VLXDG1SPAM1.ramaxel.com (email.ramaxel.com [221.4.138.186])\n by mails.dpdk.org (Postfix) with ESMTP id 643F9411E1\n for <dev@dpdk.org>; Thu, 23 Dec 2021 09:24:44 +0100 (CET)", "from V12DG1MBS01.ramaxel.local (v12dg1mbs01.ramaxel.local\n [172.26.18.31])\n by VLXDG1SPAM1.ramaxel.com with ESMTPS id 1BN8OEYp037293\n (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);\n Thu, 23 Dec 2021 16:24:14 +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; Thu, 23\n Dec 2021 16:24:14 +0800" ], "From": "Yanling Song <songyl@ramaxel.com>", "To": "<dev@dpdk.org>", "CC": "<songyl@ramaxel.com>, <yanling.song@linux.dev>, <yanggan@ramaxel.com>,\n <xuyun@ramaxel.com>, <ferruh.yigit@intel.com>", "Subject": "[PATCH v2 14/25] net/spnic: add port/vport enable", "Date": "Thu, 23 Dec 2021 16:23:57 +0800", "Message-ID": "\n <c9396110f5bdba31d4b572f608f0f854f7bf87cf.1640242368.git.songyl@ramaxel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<cover.1640242368.git.songyl@ramaxel.com>", "References": "<cover.1640242368.git.songyl@ramaxel.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.64.9.47]", "X-ClientProxiedBy": "V12DG1MBS03.ramaxel.local (172.26.18.33) To\n V12DG1MBS01.ramaxel.local (172.26.18.31)", "X-DNSRBL": "", "X-MAIL": "VLXDG1SPAM1.ramaxel.com 1BN8OEYp037293", "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 patch adds interface to enable port/vport so that the hardware\nwould receive packets to host.\n\nSigned-off-by: Yanling Song <songyl@ramaxel.com>\n---\n drivers/net/spnic/spnic_ethdev.c | 46 ++++++++++++++++++++++++++++++++\n 1 file changed, 46 insertions(+)", "diff": "diff --git a/drivers/net/spnic/spnic_ethdev.c b/drivers/net/spnic/spnic_ethdev.c\nindex 74d09bafac..0459959ca5 100644\n--- a/drivers/net/spnic/spnic_ethdev.c\n+++ b/drivers/net/spnic/spnic_ethdev.c\n@@ -855,8 +855,10 @@ static void spnic_deinit_sw_rxtxqs(struct spnic_nic_dev *nic_dev)\n static int spnic_dev_start(struct rte_eth_dev *eth_dev)\n {\n \tstruct spnic_nic_dev *nic_dev;\n+\tstruct spnic_rxq *rxq = NULL;\n \tu64 nic_features;\n \tint err;\n+\tu16 i;\n \n \tnic_dev = SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(eth_dev);\n \n@@ -916,6 +918,22 @@ static int spnic_dev_start(struct rte_eth_dev *eth_dev)\n \n \tspnic_start_all_sqs(eth_dev);\n \n+\t/* Open virtual port and ready to start packet receiving */\n+\terr = spnic_set_vport_enable(nic_dev->hwdev, true);\n+\tif (err) {\n+\t\tPMD_DRV_LOG(ERR, \"Enable vport failed, dev_name: %s\",\n+\t\t\t eth_dev->data->name);\n+\t\tgoto en_vport_fail;\n+\t}\n+\n+\t/* Open physical port and start packet receiving */\n+\terr = spnic_set_port_enable(nic_dev->hwdev, true);\n+\tif (err) {\n+\t\tPMD_DRV_LOG(ERR, \"Enable physical port failed, dev_name: %s\",\n+\t\t\t eth_dev->data->name);\n+\t\tgoto en_port_fail;\n+\t}\n+\n \t/* Update eth_dev link status */\n \tif (eth_dev->data->dev_conf.intr_conf.lsc != 0)\n \t\t(void)spnic_link_update(eth_dev, 0);\n@@ -924,6 +942,20 @@ static int spnic_dev_start(struct rte_eth_dev *eth_dev)\n \n \treturn 0;\n \n+en_port_fail:\n+\t(void)spnic_set_vport_enable(nic_dev->hwdev, false);\n+\n+en_vport_fail:\n+\t/* Flush tx && rx chip resources in case of setting vport fake fail */\n+\t(void)spnic_flush_qps_res(nic_dev->hwdev);\n+\trte_delay_ms(100);\n+\tfor (i = 0; i < nic_dev->num_rqs; i++) {\n+\t\trxq = nic_dev->rxqs[i];\n+\t\tspnic_remove_rq_from_rx_queue_list(nic_dev, rxq->q_id);\n+\t\tspnic_free_rxq_mbufs(rxq);\n+\t\teth_dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;\n+\t\teth_dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;\n+\t}\n start_rqs_fail:\n \tspnic_remove_rxtx_configure(eth_dev);\n \n@@ -951,6 +983,7 @@ static int spnic_dev_stop(struct rte_eth_dev *dev)\n {\n \tstruct spnic_nic_dev *nic_dev;\n \tstruct rte_eth_link link;\n+\tint err;\n \n \tnic_dev = SPNIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);\n \tif (!rte_bit_relaxed_test_and_clear32(SPNIC_DEV_START, &nic_dev->dev_status)) {\n@@ -959,6 +992,19 @@ static int spnic_dev_stop(struct rte_eth_dev *dev)\n \t\treturn 0;\n \t}\n \n+\t/* Stop phy port and vport */\n+\terr = spnic_set_port_enable(nic_dev->hwdev, false);\n+\tif (err)\n+\t\tPMD_DRV_LOG(WARNING, \"Disable phy port failed, error: %d, \"\n+\t\t\t \"dev_name: %s, port_id: %d\", err, dev->data->name,\n+\t\t\t dev->data->port_id);\n+\n+\terr = spnic_set_vport_enable(nic_dev->hwdev, false);\n+\tif (err)\n+\t\tPMD_DRV_LOG(WARNING, \"Disable vport failed, error: %d, \"\n+\t\t\t \"dev_name: %s, port_id: %d\", err, dev->data->name,\n+\t\t\t dev->data->port_id);\n+\n \t/* Clear recorded link status */\n \tmemset(&link, 0, sizeof(link));\n \t(void)rte_eth_linkstatus_set(dev, &link);\n", "prefixes": [ "v2", "14/25" ] }{ "id": 105340, "url": "