From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 56EE71B35B for ; Fri, 26 Jan 2018 18:33:57 +0100 (CET) Received: from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net [10.75.144.136]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 1048230C032; Fri, 26 Jan 2018 09:33:56 -0800 (PST) Received: from C02VPB22HTD6.vpn.broadcom.net (unknown [10.10.117.193]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id 6F1FFAC0782; Fri, 26 Jan 2018 09:33:55 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 26 Jan 2018 09:31:56 -0800 Message-Id: <20180126173200.14458-4-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.14.3 (Apple Git-98) In-Reply-To: <20180126173200.14458-1-ajit.khaparde@broadcom.com> References: <20180126173200.14458-1-ajit.khaparde@broadcom.com> Subject: [dpdk-dev] [PATCH v3 3/7] net/bnxt: register for more async events X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jan 2018 17:33:57 -0000 Register for async events from the FW. New events we are registering for include Link speed config changes, PF driver unload and VF config change. Also log a message when the async event arrives on the completion ring. Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_cpr.c | 11 ++++++++++- drivers/net/bnxt/bnxt_hwrm.c | 9 +++++++-- drivers/net/bnxt/bnxt_hwrm.h | 11 +++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index 663a5223d..737bb060a 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -57,8 +57,17 @@ void bnxt_handle_async_event(struct bnxt *bp, case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE: bnxt_link_update_op(bp->eth_dev, 1); break; + case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD: + PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n"); + break; + case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE: + PMD_DRV_LOG(INFO, "Async event: VF config changed\n"); + break; + case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED: + PMD_DRV_LOG(INFO, "Port conn async event\n"); + break; default: - PMD_DRV_LOG(DEBUG, "handle_async_event id = 0x%x\n", event_id); + PMD_DRV_LOG(INFO, "handle_async_event id = 0x%x\n", event_id); break; } } diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index fdca424a9..75e03ad5d 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -637,8 +637,13 @@ int bnxt_hwrm_func_driver_register(struct bnxt *bp) sizeof(bp->pf.vf_req_fwd))); } - req.async_event_fwd[0] |= rte_cpu_to_le_32(0x1); /* TODO: Use MACRO */ - //memset(req.async_event_fwd, 0xff, sizeof(req.async_event_fwd)); + req.async_event_fwd[0] |= + rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_LINK_STATUS_CHANGE | + ASYNC_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED | + ASYNC_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE); + req.async_event_fwd[1] |= + rte_cpu_to_le_32(ASYNC_CMPL_EVENT_ID_PF_DRVR_UNLOAD | + ASYNC_CMPL_EVENT_ID_VF_CFG_CHANGE); rc = bnxt_hwrm_send_message(bp, &req, sizeof(req)); diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h index 46f6f3208..108f8e81d 100644 --- a/drivers/net/bnxt/bnxt_hwrm.h +++ b/drivers/net/bnxt/bnxt_hwrm.h @@ -42,6 +42,17 @@ struct bnxt_filter_info; struct bnxt_cp_ring_info; #define HWRM_SEQ_ID_INVALID -1U +/* Convert Bit field location to value */ +#define ASYNC_CMPL_EVENT_ID_LINK_STATUS_CHANGE \ + (1 << HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE) +#define ASYNC_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED \ + (1 << HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED) +#define ASYNC_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE \ + (1 << HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE) +#define ASYNC_CMPL_EVENT_ID_PF_DRVR_UNLOAD \ + (1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD - 32)) +#define ASYNC_CMPL_EVENT_ID_VF_CFG_CHANGE \ + (1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE - 32)) int bnxt_hwrm_cfa_l2_clear_rx_mask(struct bnxt *bp, struct bnxt_vnic_info *vnic); -- 2.14.3 (Apple Git-98)