net/sfc/base: define max desc number for every EF10 NIC
[dpdk.git] / drivers / net / sfc / base / hunt_nic.c
index 70c042f..6605cfc 100644 (file)
@@ -20,7 +20,6 @@ hunt_nic_get_required_pcie_bandwidth(
        __out           uint32_t *bandwidth_mbpsp)
 {
        uint32_t port_modes;
-       uint32_t max_port_mode;
        uint32_t bandwidth;
        efx_rc_t rc;
 
@@ -47,17 +46,13 @@ hunt_nic_get_required_pcie_bandwidth(
                        goto fail1;
        } else {
                if (port_modes & (1U << TLV_PORT_MODE_40G)) {
-                       max_port_mode = TLV_PORT_MODE_40G;
+                       bandwidth = 40000;
                } else if (port_modes & (1U << TLV_PORT_MODE_10G_10G_10G_10G)) {
-                       max_port_mode = TLV_PORT_MODE_10G_10G_10G_10G;
+                       bandwidth = 4 * 10000;
                } else {
                        /* Assume two 10G ports */
-                       max_port_mode = TLV_PORT_MODE_10G_10G;
+                       bandwidth = 2 * 10000;
                }
-
-               if ((rc = ef10_nic_get_port_mode_bandwidth(max_port_mode,
-                                                           &bandwidth)) != 0)
-                       goto fail2;
        }
 
 out:
@@ -65,8 +60,6 @@ out:
 
        return (0);
 
-fail2:
-       EFSYS_PROBE(fail2);
 fail1:
        EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
@@ -201,7 +194,10 @@ hunt_board_cfg(
         * The workaround for bug35388 uses the top bit of transmit queue
         * descriptor writes, preventing the use of 4096 descriptor TXQs.
         */
-       encp->enc_txq_max_ndescs = encp->enc_bug35388_workaround ? 2048 : 4096;
+       encp->enc_txq_max_ndescs = encp->enc_bug35388_workaround ?
+           HUNT_TXQ_MAXNDESCS_BUG35388_WORKAROUND :
+           HUNT_TXQ_MAXNDESCS;
+       encp->enc_txq_min_ndescs = EF10_TXQ_MINNDESCS;
 
        EFX_STATIC_ASSERT(HUNT_PIOBUF_NBUFS <= EF10_MAX_PIOBUF_NBUFS);
        encp->enc_piobuf_limit = HUNT_PIOBUF_NBUFS;