net/qede/base: improve Tx-switching performance
[dpdk.git] / drivers / net / qede / base / ecore_sriov.c
index 38c2db3..0e2b324 100644 (file)
@@ -1707,9 +1707,10 @@ ecore_iov_reconfigure_unicast_shadow(struct ecore_hwfn *p_hwfn,
        return rc;
 }
 
-static int ecore_iov_configure_vport_forced(struct ecore_hwfn *p_hwfn,
-                                           struct ecore_vf_info *p_vf,
-                                           u64 events)
+static  enum _ecore_status_t
+ecore_iov_configure_vport_forced(struct ecore_hwfn *p_hwfn,
+                                struct ecore_vf_info *p_vf,
+                                u64 events)
 {
        enum _ecore_status_t rc = ECORE_SUCCESS;
        struct ecore_filter_ucast filter;
@@ -2098,26 +2099,27 @@ static void ecore_iov_vf_mbx_start_txq(struct ecore_hwfn *p_hwfn,
        pq_params.eth.is_vf = 1;
        pq_params.eth.vf_id = vf->relative_vf_id;
 
-       req = &mbx->req_virt->start_txq;
        OSAL_MEMSET(&p_params, 0, sizeof(p_params));
+       req = &mbx->req_virt->start_txq;
+
+       if (!ecore_iov_validate_txq(p_hwfn, vf, req->tx_qid) ||
+           !ecore_iov_validate_sb(p_hwfn, vf, req->hw_sb))
+               goto out;
+
        p_params.queue_id = (u8)vf->vf_queues[req->tx_qid].fw_tx_qid;
+       p_params.qzone_id = (u8)vf->vf_queues[req->tx_qid].fw_tx_qid;
        p_params.vport_id = vf->vport_id;
        p_params.stats_id = vf->abs_vf_id + 0x10,
        p_params.sb = req->hw_sb;
        p_params.sb_idx = req->sb_index;
 
-       if (!ecore_iov_validate_txq(p_hwfn, vf, req->tx_qid) ||
-           !ecore_iov_validate_sb(p_hwfn, vf, req->hw_sb))
-               goto out;
-
-       rc = ecore_sp_eth_txq_start_ramrod(
-               p_hwfn,
-               vf->opaque_fid,
-               vf->vf_queues[req->tx_qid].fw_cid,
-               &p_params,
-               req->pbl_addr,
-               req->pbl_size,
-               &pq_params);
+       rc = ecore_sp_eth_txq_start_ramrod(p_hwfn,
+                                          vf->opaque_fid,
+                                          vf->vf_queues[req->tx_qid].fw_cid,
+                                          &p_params,
+                                          req->pbl_addr,
+                                          req->pbl_size,
+                                          &pq_params);
 
        if (rc)
                status = PFVF_STATUS_FAILURE;
@@ -3141,9 +3143,10 @@ ecore_iov_single_vf_flr_cleanup(struct ecore_hwfn *p_hwfn,
        return rc;
 }
 
-int ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *p_disabled_vfs)
+bool ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *p_disabled_vfs)
 {
-       u16 i, found = 0;
+       bool found;
+       u16 i;
 
        DP_VERBOSE(p_hwfn, ECORE_MSG_IOV, "Marking FLR-ed VFs\n");
        for (i = 0; i < (VF_MAX_STATIC / 32); i++)
@@ -3153,7 +3156,7 @@ int ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *p_disabled_vfs)
 
        if (!p_hwfn->p_dev->p_iov_info) {
                DP_NOTICE(p_hwfn, true, "VF flr but no IOV\n");
-               return 0;
+               return false;
        }
 
        /* Mark VFs */
@@ -3182,7 +3185,7 @@ int ecore_iov_mark_vf_flr(struct ecore_hwfn *p_hwfn, u32 *p_disabled_vfs)
                         * VF flr until ACKs, we're safe.
                         */
                        p_flr[rel_vf_id / 64] |= 1ULL << (rel_vf_id % 64);
-                       found = 1;
+                       found = true;
                }
        }
 
@@ -3961,7 +3964,8 @@ bool ecore_iov_is_vf_initialized(struct ecore_hwfn *p_hwfn, u16 rel_vf_id)
        return (p_vf->state == VF_ENABLED);
 }
 
-int ecore_iov_get_vf_min_rate(struct ecore_hwfn *p_hwfn, int vfid)
+enum _ecore_status_t
+ecore_iov_get_vf_min_rate(struct ecore_hwfn *p_hwfn, int vfid)
 {
        struct ecore_wfq_data *vf_vp_wfq;
        struct ecore_vf_info *vf_info;