net/bnxt: register for more async events
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Fri, 26 Jan 2018 17:31:56 +0000 (09:31 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 29 Jan 2018 09:04:28 +0000 (10:04 +0100)
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 <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_cpr.c
drivers/net/bnxt/bnxt_hwrm.c
drivers/net/bnxt/bnxt_hwrm.h

index 663a522..737bb06 100644 (file)
@@ -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;
        }
 }
index fdca424..75e03ad 100644 (file)
@@ -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));
 
index 46f6f32..108f8e8 100644 (file)
@@ -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);