net/bnxt: configure RSS
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Wed, 15 Jun 2016 21:23:21 +0000 (14:23 -0700)
committerBruce Richardson <bruce.richardson@intel.com>
Mon, 20 Jun 2016 15:21:52 +0000 (17:21 +0200)
New HWRM call:
bnxt_hwrm_vnic_rss_cfg:
Used to enable RSS configuration of the VNIC.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Reviewed-by: David Christensen <david.christensen@broadcom.com>
drivers/net/bnxt/bnxt_hwrm.c
drivers/net/bnxt/bnxt_hwrm.h
drivers/net/bnxt/hsi_struct_def_dpdk.h

index 5a5063f..29b0729 100644 (file)
@@ -646,6 +646,30 @@ int bnxt_hwrm_vnic_free(struct bnxt *bp, struct bnxt_vnic_info *vnic)
        return rc;
 }
 
+int bnxt_hwrm_vnic_rss_cfg(struct bnxt *bp,
+                          struct bnxt_vnic_info *vnic)
+{
+       int rc = 0;
+       struct hwrm_vnic_rss_cfg_input req = {.req_type = 0 };
+       struct hwrm_vnic_rss_cfg_output *resp = bp->hwrm_cmd_resp_addr;
+
+       HWRM_PREP(req, VNIC_RSS_CFG, -1, resp);
+
+       req.hash_type = rte_cpu_to_le_32(vnic->hash_type);
+
+       req.ring_grp_tbl_addr =
+           rte_cpu_to_le_64(vnic->rss_table_dma_addr);
+       req.hash_key_tbl_addr =
+           rte_cpu_to_le_64(vnic->rss_hash_key_dma_addr);
+       req.rss_ctx_idx = rte_cpu_to_le_16(vnic->fw_rss_cos_lb_ctx);
+
+       rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
+
+       HWRM_CHECK_RESULT;
+
+       return rc;
+}
+
 /*
  * HWRM utility functions
  */
index fbb8aba..8c7b939 100644 (file)
@@ -68,6 +68,8 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic);
 int bnxt_hwrm_vnic_ctx_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic);
 int bnxt_hwrm_vnic_ctx_free(struct bnxt *bp, struct bnxt_vnic_info *vnic);
 int bnxt_hwrm_vnic_free(struct bnxt *bp, struct bnxt_vnic_info *vnic);
+int bnxt_hwrm_vnic_rss_cfg(struct bnxt *bp,
+                          struct bnxt_vnic_info *vnic);
 
 int bnxt_clear_all_hwrm_stat_ctxs(struct bnxt *bp);
 void bnxt_free_hwrm_resources(struct bnxt *bp);
index 6412df2..72d4984 100644 (file)
@@ -92,6 +92,7 @@ struct ctx_hw_stats64 {
 #define HWRM_VNIC_ALLOC                        (UINT32_C(0x40))
 #define HWRM_VNIC_FREE                 (UINT32_C(0x41))
 #define HWRM_VNIC_CFG                  (UINT32_C(0x42))
+#define HWRM_VNIC_RSS_CFG              (UINT32_C(0x46))
 #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC (UINT32_C(0x70))
 #define HWRM_VNIC_RSS_COS_LB_CTX_FREE  (UINT32_C(0x71))
 #define HWRM_CFA_L2_FILTER_ALLOC       (UINT32_C(0x90))