* [dpdk-dev] [PATCH 0/2] bnxt bug fixes @ 2020-02-20 4:12 Kalesh A P 2020-02-20 4:12 ` [dpdk-dev] [PATCH 1/2] net/bnxt: fix segmentation fault handling async events on port stop Kalesh A P ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Kalesh A P @ 2020-02-20 4:12 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, ajit.khaparde From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> These are couple of bnxt PMD bug fixes. Please apply. Kalesh AP (2): net/bnxt: fix segmentation fault handling async events on port stop net/bnxt: fix race when port is stopped and async events are received drivers/net/bnxt/bnxt_cpr.c | 6 ++++++ drivers/net/bnxt/bnxt_hwrm.c | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) -- 2.10.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 1/2] net/bnxt: fix segmentation fault handling async events on port stop 2020-02-20 4:12 [dpdk-dev] [PATCH 0/2] bnxt bug fixes Kalesh A P @ 2020-02-20 4:12 ` Kalesh A P 2020-02-20 4:12 ` [dpdk-dev] [PATCH 2/2] net/bnxt: fix race when port is stopped and async events are received Kalesh A P 2020-02-20 6:23 ` [dpdk-dev] [PATCH 0/2] bnxt bug fixes Ajit Khaparde 2 siblings, 0 replies; 4+ messages in thread From: Kalesh A P @ 2020-02-20 4:12 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, ajit.khaparde From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Check for bp->hwrm_cmd_resp_addr before using it in HWRM_PREP to avoid segmentation fault when stop port and meanwhile receive events from FW. Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW") Cc: stable@dpdk.org Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com> --- drivers/net/bnxt/bnxt_hwrm.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index acecf27..a9c9c72 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -184,6 +184,10 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, */ #define HWRM_PREP(req, type, kong) do { \ rte_spinlock_lock(&bp->hwrm_lock); \ + if (bp->hwrm_cmd_resp_addr == NULL) { \ + rte_spinlock_unlock(&bp->hwrm_lock); \ + return -EACCES; \ + } \ memset(bp->hwrm_cmd_resp_addr, 0, bp->max_resp_len); \ req.req_type = rte_cpu_to_le_16(HWRM_##type); \ req.cmpl_ring = rte_cpu_to_le_16(-1); \ @@ -3096,9 +3100,9 @@ static void add_random_mac_if_needed(struct bnxt *bp, } } -static void reserve_resources_from_vf(struct bnxt *bp, - struct hwrm_func_cfg_input *cfg_req, - int vf) +static int reserve_resources_from_vf(struct bnxt *bp, + struct hwrm_func_cfg_input *cfg_req, + int vf) { struct hwrm_func_qcaps_input req = {0}; struct hwrm_func_qcaps_output *resp = bp->hwrm_cmd_resp_addr; @@ -3132,6 +3136,8 @@ static void reserve_resources_from_vf(struct bnxt *bp, bp->max_ring_grps -= rte_le_to_cpu_16(resp->max_hw_ring_grps); HWRM_UNLOCK(); + + return 0; } int bnxt_hwrm_func_qcfg_current_vf_vlan(struct bnxt *bp, int vf) -- 2.10.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 2/2] net/bnxt: fix race when port is stopped and async events are received 2020-02-20 4:12 [dpdk-dev] [PATCH 0/2] bnxt bug fixes Kalesh A P 2020-02-20 4:12 ` [dpdk-dev] [PATCH 1/2] net/bnxt: fix segmentation fault handling async events on port stop Kalesh A P @ 2020-02-20 4:12 ` Kalesh A P 2020-02-20 6:23 ` [dpdk-dev] [PATCH 0/2] bnxt bug fixes Ajit Khaparde 2 siblings, 0 replies; 4+ messages in thread From: Kalesh A P @ 2020-02-20 4:12 UTC (permalink / raw) To: dev; +Cc: ferruh.yigit, ajit.khaparde From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Fix a race condition between port stop and error recovery task. When io forwarding is not started on Stingray devices, driver will not receive the async event from FW when there is a FW reset. While exiting testpmd, as part of port stop driver sees this event and this in turn causes a race between port stop and error recovery task. Fixed this by ignoring the fatal/non-fatal async event from FW while stopping port. Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW") Cc: stable@dpdk.org Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com> Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com> --- drivers/net/bnxt/bnxt_cpr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index 0f7b5e9..21565b1 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -76,6 +76,12 @@ void bnxt_handle_async_event(struct bnxt *bp, PMD_DRV_LOG(INFO, "Port conn async event\n"); break; case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY: + /* Ignore reset notify async events when stopping the port */ + if (!bp->eth_dev->data->dev_started) { + bp->flags |= BNXT_FLAG_FATAL_ERROR; + return; + } + event_data = rte_le_to_cpu_32(async_cmp->event_data1); /* timestamp_lo/hi values are in units of 100ms */ bp->fw_reset_max_msecs = async_cmp->timestamp_hi ? -- 2.10.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] bnxt bug fixes 2020-02-20 4:12 [dpdk-dev] [PATCH 0/2] bnxt bug fixes Kalesh A P 2020-02-20 4:12 ` [dpdk-dev] [PATCH 1/2] net/bnxt: fix segmentation fault handling async events on port stop Kalesh A P 2020-02-20 4:12 ` [dpdk-dev] [PATCH 2/2] net/bnxt: fix race when port is stopped and async events are received Kalesh A P @ 2020-02-20 6:23 ` Ajit Khaparde 2 siblings, 0 replies; 4+ messages in thread From: Ajit Khaparde @ 2020-02-20 6:23 UTC (permalink / raw) To: Kalesh A P; +Cc: dpdk-dev, Ferruh Yigit On Wed, Feb 19, 2020 at 7:55 PM Kalesh A P < kalesh-anakkur.purayil@broadcom.com> wrote: > From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> > > These are couple of bnxt PMD bug fixes. Please apply. > Patches applied to dpdk-next-net-brcm. > > Kalesh AP (2): > net/bnxt: fix segmentation fault handling async events on port stop > net/bnxt: fix race when port is stopped and async events are received > > drivers/net/bnxt/bnxt_cpr.c | 6 ++++++ > drivers/net/bnxt/bnxt_hwrm.c | 12 +++++++++--- > 2 files changed, 15 insertions(+), 3 deletions(-) > > -- > 2.10.1 > > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-20 6:23 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-02-20 4:12 [dpdk-dev] [PATCH 0/2] bnxt bug fixes Kalesh A P 2020-02-20 4:12 ` [dpdk-dev] [PATCH 1/2] net/bnxt: fix segmentation fault handling async events on port stop Kalesh A P 2020-02-20 4:12 ` [dpdk-dev] [PATCH 2/2] net/bnxt: fix race when port is stopped and async events are received Kalesh A P 2020-02-20 6:23 ` [dpdk-dev] [PATCH 0/2] bnxt bug fixes Ajit Khaparde
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).