bnxt_en: Add helper function bnxt_hwrm_vnic_rss_cfg_p5()
authorPavan Chebbi <pavan.chebbi@broadcom.com>
Mon, 25 Mar 2024 22:28:53 +0000 (15:28 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Mar 2024 05:34:40 +0000 (22:34 -0700)
This is a pure refactoring patch.  The new function
bnxt_hwrm_vnic_set_rss_p5() will set up the P5_PLUS specific RSS ring
table and then call bnxt_hwrm_vnic_cfg() to setup the vnic for proper
RSS operations.  This new function will be used later for additional
RSS contexts.

Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20240325222902.220712-4-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h

index 493b724848c8f44122abd1b1fb340e97abc30a09..dd2c5033af0273d79d64662341785d6432b6671b 100644 (file)
@@ -9825,6 +9825,23 @@ vnic_setup_err:
        return rc;
 }
 
+int bnxt_hwrm_vnic_rss_cfg_p5(struct bnxt *bp, u16 vnic_id)
+{
+       int rc;
+
+       rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic_id, true);
+       if (rc) {
+               netdev_err(bp->dev, "hwrm vnic %d set rss failure rc: %d\n",
+                          vnic_id, rc);
+               return rc;
+       }
+       rc = bnxt_hwrm_vnic_cfg(bp, vnic_id);
+       if (rc)
+               netdev_err(bp->dev, "hwrm vnic %d cfg failure rc: %x\n",
+                          vnic_id, rc);
+       return rc;
+}
+
 static int __bnxt_setup_vnic_p5(struct bnxt *bp, u16 vnic_id)
 {
        int rc, i, nr_ctxs;
@@ -9842,18 +9859,10 @@ static int __bnxt_setup_vnic_p5(struct bnxt *bp, u16 vnic_id)
        if (i < nr_ctxs)
                return -ENOMEM;
 
-       rc = bnxt_hwrm_vnic_set_rss_p5(bp, vnic_id, true);
-       if (rc) {
-               netdev_err(bp->dev, "hwrm vnic %d set rss failure rc: %d\n",
-                          vnic_id, rc);
-               return rc;
-       }
-       rc = bnxt_hwrm_vnic_cfg(bp, vnic_id);
-       if (rc) {
-               netdev_err(bp->dev, "hwrm vnic %d cfg failure rc: %x\n",
-                          vnic_id, rc);
+       rc = bnxt_hwrm_vnic_rss_cfg_p5(bp, vnic_id);
+       if (rc)
                return rc;
-       }
+
        if (bp->flags & BNXT_FLAG_AGG_RINGS) {
                rc = bnxt_hwrm_vnic_set_hds(bp, vnic_id);
                if (rc) {
index dd849e715c9ba6d7fe611db24dabcba033313f92..fbb53308cb81559ce42b24c0bbee4c64e47a1989 100644 (file)
@@ -2721,6 +2721,7 @@ int bnxt_hwrm_free_wol_fltr(struct bnxt *bp);
 int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp, bool all);
 int bnxt_hwrm_func_qcaps(struct bnxt *bp);
 int bnxt_hwrm_fw_set_time(struct bnxt *);
+int bnxt_hwrm_vnic_rss_cfg_p5(struct bnxt *bp, u16 vnic_id);
 int bnxt_open_nic(struct bnxt *, bool, bool);
 int bnxt_half_open_nic(struct bnxt *bp);
 void bnxt_half_close_nic(struct bnxt *bp);