Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/60428/?format=api
http://patches.dpdk.org/api/patches/60428/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191002171745.4504-6-ajit.khaparde@broadcom.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": "<20191002171745.4504-6-ajit.khaparde@broadcom.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20191002171745.4504-6-ajit.khaparde@broadcom.com", "date": "2019-10-02T17:17:34", "name": "[v3,05/16] net/bnxt: fix async link handling and update", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "2ac373f6f01f6b4b38ecc1b4e62b6d797b8ffffc", "submitter": { "id": 501, "url": "http://patches.dpdk.org/api/people/501/?format=api", "name": "Ajit Khaparde", "email": "ajit.khaparde@broadcom.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/20191002171745.4504-6-ajit.khaparde@broadcom.com/mbox/", "series": [ { "id": 6669, "url": "http://patches.dpdk.org/api/series/6669/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6669", "date": "2019-10-02T17:17:29", "name": "bnxt patchset", "version": 3, "mbox": "http://patches.dpdk.org/series/6669/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/60428/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/60428/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 C80A61BF5E;\n\tWed, 2 Oct 2019 19:18:09 +0200 (CEST)", "from rnd-relay.smtp.broadcom.com (unknown [192.19.229.170])\n\tby dpdk.org (Postfix) with ESMTP id 6A8F31BF1D;\n\tWed, 2 Oct 2019 19:17:54 +0200 (CEST)", "from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net\n\t[10.75.242.48])\n\tby rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 5EE5F30D367;\n\tWed, 2 Oct 2019 10:16:36 -0700 (PDT)", "from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net\n\t[10.69.74.102])\n\tby mail-irv-17.broadcom.com (Postfix) with ESMTP id 3A8C7140091;\n\tWed, 2 Oct 2019 10:17:48 -0700 (PDT)" ], "DKIM-Filter": "OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 5EE5F30D367", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com;\n\ts=dkimrelay; t=1570036596;\n\tbh=9lO9LLu1wSXahuTFCCTU0e+PSy9spx4MiY7958pjSaA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=hEsPa8ij/5GVNZdX4+wO4N3YaHHgDAU6cVX/w8FidzeetG1eW0Sf4yp8TRawjtPGR\n\tDjRw+Bj9N/0fIRSR0FyfZfhT5atSak9+KXpbm7UoyeihI3N4pTHgyjfOKyuczs1Mv/\n\tCrQqPb2dQVrjc6ZRynCaAWI6bG6ulI7c1P9lyQaE=", "From": "Ajit Khaparde <ajit.khaparde@broadcom.com>", "To": "dev@dpdk.org", "Cc": "ferruh.yigit@intel.com, stable@dpdk.org,\n\tKalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>,\n\tLance Richardson <lance.richardson@broadcom.com>", "Date": "Wed, 2 Oct 2019 10:17:34 -0700", "Message-Id": "<20191002171745.4504-6-ajit.khaparde@broadcom.com>", "X-Mailer": "git-send-email 2.20.1 (Apple Git-117)", "In-Reply-To": "<20191002171745.4504-1-ajit.khaparde@broadcom.com>", "References": "<20191002055423.99659-1-ajit.khaparde@broadcom.com>\n\t<20191002171745.4504-1-ajit.khaparde@broadcom.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v3 05/16] net/bnxt: fix async link handling and\n\tupdate", "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": "When updating the link because of an async link notification\nthere is no need to set wait_for_completion. At this point\nthe link related information should be available without need to poll.\nUse rte_eth_linkstatus_set instead of memcpy to ensure atomicity\nwhile updating the link status.\nWe force the physical link down as a part of device stop.\nBut we are not waiting there enough and handling the async notification\nbefore exiting. It just sits in the default CQ till we do a device start.\nFix it by calling the CQ handler in device stop.\n\nFixes: 7bc8e9a227cc (\"net/bnxt: support async link notification\")\nCc: stable@dpdk.org\nReviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>\nReviewed-by: Lance Richardson <lance.richardson@broadcom.com>\nSigned-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>\n---\n drivers/net/bnxt/bnxt_cpr.c | 2 +-\n drivers/net/bnxt/bnxt_ethdev.c | 11 +++++++----\n drivers/net/bnxt/bnxt_irq.c | 2 +-\n drivers/net/bnxt/bnxt_irq.h | 1 +\n 4 files changed, 10 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c\nindex 4817672ef0..f58372516a 100644\n--- a/drivers/net/bnxt/bnxt_cpr.c\n+++ b/drivers/net/bnxt/bnxt_cpr.c\n@@ -66,7 +66,7 @@ void bnxt_handle_async_event(struct bnxt *bp,\n \tcase HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE:\n \tcase HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE:\n \t\t/* FALLTHROUGH */\n-\t\tbnxt_link_update_op(bp->eth_dev, 1);\n+\t\tbnxt_link_update_op(bp->eth_dev, 0);\n \t\tbreak;\n \tcase HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD:\n \t\tPMD_DRV_LOG(INFO, \"Async event: PF driver unloaded\\n\");\ndiff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c\nindex d1c5acb3e2..4d15ba5ceb 100644\n--- a/drivers/net/bnxt/bnxt_ethdev.c\n+++ b/drivers/net/bnxt/bnxt_ethdev.c\n@@ -834,6 +834,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)\n \t\t\tbp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS);\n \t}\n \n+\tbnxt_enable_int(bp);\n \trc = bnxt_hwrm_if_change(bp, 1);\n \tif (!rc) {\n \t\tif (bp->flags & BNXT_FLAG_IF_CHANGE_HOT_FW_RESET_DONE) {\n@@ -862,7 +863,6 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)\n \teth_dev->rx_pkt_burst = bnxt_receive_function(eth_dev);\n \teth_dev->tx_pkt_burst = bnxt_transmit_function(eth_dev);\n \n-\tbnxt_enable_int(bp);\n \tbp->flags |= BNXT_FLAG_INIT_DONE;\n \teth_dev->data->dev_started = 1;\n \tbp->dev_stopped = 0;\n@@ -926,7 +926,9 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)\n \t\t/* TBD: STOP HW queues DMA */\n \t\teth_dev->data->dev_link.link_status = 0;\n \t}\n-\tbnxt_set_hwrm_link_config(bp, false);\n+\tbnxt_dev_set_link_down_op(eth_dev);\n+\t/* Wait for link to be reset and the async notification to process. */\n+\trte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2);\n \n \t/* Clean queue intr-vector mapping */\n \trte_intr_efd_disable(intr_handle);\n@@ -938,6 +940,8 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)\n \tbnxt_hwrm_port_clr_stats(bp);\n \tbnxt_free_tx_mbufs(bp);\n \tbnxt_free_rx_mbufs(bp);\n+\t/* Process any remaining notifications in default completion queue */\n+\tbnxt_int_handler(eth_dev);\n \tbnxt_shutdown_nic(bp);\n \tbnxt_hwrm_if_change(bp, 0);\n \tbp->dev_stopped = 1;\n@@ -1084,8 +1088,7 @@ int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete)\n \t/* Timed out or success */\n \tif (new.link_status != eth_dev->data->dev_link.link_status ||\n \tnew.link_speed != eth_dev->data->dev_link.link_speed) {\n-\t\tmemcpy(ð_dev->data->dev_link, &new,\n-\t\t\tsizeof(struct rte_eth_link));\n+\t\trte_eth_linkstatus_set(eth_dev, &new);\n \n \t\t_rte_eth_dev_callback_process(eth_dev,\n \t\t\t\t\t RTE_ETH_EVENT_INTR_LSC,\ndiff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c\nindex a22700a0da..729d68d704 100644\n--- a/drivers/net/bnxt/bnxt_irq.c\n+++ b/drivers/net/bnxt/bnxt_irq.c\n@@ -18,7 +18,7 @@\n * Interrupts\n */\n \n-static void bnxt_int_handler(void *param)\n+void bnxt_int_handler(void *param)\n {\n \tstruct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param;\n \tstruct bnxt *bp = eth_dev->data->dev_private;\ndiff --git a/drivers/net/bnxt/bnxt_irq.h b/drivers/net/bnxt/bnxt_irq.h\nindex 460a97a09c..1b56e08068 100644\n--- a/drivers/net/bnxt/bnxt_irq.h\n+++ b/drivers/net/bnxt/bnxt_irq.h\n@@ -22,5 +22,6 @@ void bnxt_disable_int(struct bnxt *bp);\n void bnxt_enable_int(struct bnxt *bp);\n int bnxt_setup_int(struct bnxt *bp);\n int bnxt_request_int(struct bnxt *bp);\n+void bnxt_int_handler(void *param);\n \n #endif\n", "prefixes": [ "v3", "05/16" ] }{ "id": 60428, "url": "