summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/ice/ice.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-09-07 15:24:50 +0200
committerDavid S. Miller <davem@davemloft.net>2019-09-07 15:24:50 +0200
commit6938843dd8bba53147c12b625a567e2ea7e4e263 (patch)
tree0897384fe9baf3959a008536d44e358d9e9cc2c8 /drivers/net/ethernet/intel/ice/ice.h
parent742ca7812bcc96db59c9bf01ed64ff3f0f293189 (diff)
parent5c875c1af8dc69e64e0e457956b4271eac792733 (diff)
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 100GbE Intel Wired LAN Driver Updates 2019-09-05 This series contains updates to ice driver. Brett fixes the setting of num_q_vectors by using the maximum number between the allocated transmit and receive queues. Anirudh simplifies the code to use a helper function to return the main VSI, which is the first element in the pf->vsi array. Adds a pointer check to prevent a NULL pointer dereference. Adds a check to ensure we do not initialize DCB on devices that are not DCB capable. Does some housekeeping on the code to remove unnecessary indirection and reduce the PF structure by removing elements that are not needed since the values they were storing can be readily gotten from ice_get_avail_*_count()'s. Updates the printed strings to make it easier to search the logs for driver capabilities. Jesse cleans up unnecessary function arguments. Updated the code to use prefetch() to add some efficiency to the driver to avoid a cache miss. Did some housekeeping on the code to remove the configurable transmit work limit via ethtool which ended up creating performance overhead. Made additional performance enhancements by updating the driver to start out with a reasonable number of descriptors by changing the default to 2048. Mitch fixes the reset logic for VFs by clearing VF_MBX_ARQLEN register when the source of the reset is not PFR. Lukasz updates the driver to include a similar fix for the i40e driver by reporting link down for VF's when the PF queues are not enabled. Akeem updates the driver to report the VF link status once we get VF resources so that we can reflect the link status similarly to how the PF reports link speed. Ashish updates the transmit context structure based on recent changes to the hardware specification. Dave updates the DCB logic to allow a delayed registration for MIB change events so that the driver is not accepting events before it is ready for them. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice.h')
-rw-r--r--drivers/net/ethernet/intel/ice/ice.h46
1 files changed, 11 insertions, 35 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
index fb2bc836b20a..b36e1cf0e461 100644
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -47,23 +47,8 @@ extern const char ice_drv_ver[];
#define ICE_MIN_NUM_DESC 64
#define ICE_MAX_NUM_DESC 8160
#define ICE_DFLT_MIN_RX_DESC 512
-/* if the default number of Rx descriptors between ICE_MAX_NUM_DESC and the
- * number of descriptors to fill up an entire page is greater than or equal to
- * ICE_DFLT_MIN_RX_DESC set it based on page size, otherwise set it to
- * ICE_DFLT_MIN_RX_DESC
- */
-#define ICE_DFLT_NUM_RX_DESC \
- min_t(u16, ICE_MAX_NUM_DESC, \
- max_t(u16, ALIGN(PAGE_SIZE / sizeof(union ice_32byte_rx_desc), \
- ICE_REQ_DESC_MULTIPLE), \
- ICE_DFLT_MIN_RX_DESC))
-/* set default number of Tx descriptors to the minimum between ICE_MAX_NUM_DESC
- * and the number of descriptors to fill up an entire page
- */
-#define ICE_DFLT_NUM_TX_DESC min_t(u16, ICE_MAX_NUM_DESC, \
- ALIGN(PAGE_SIZE / \
- sizeof(struct ice_tx_desc), \
- ICE_REQ_DESC_MULTIPLE))
+#define ICE_DFLT_NUM_TX_DESC 256
+#define ICE_DFLT_NUM_RX_DESC 2048
#define ICE_DFLT_TRAFFIC_CLASS BIT(0)
#define ICE_INT_NAME_STR_LEN (IFNAMSIZ + 16)
@@ -247,9 +232,6 @@ struct ice_vsi {
u16 vsi_num; /* HW (absolute) index of this VSI */
u16 idx; /* software index in pf->vsi[] */
- /* Interrupt thresholds */
- u16 work_lmt;
-
s16 vf_id; /* VF ID for SR-IOV VSIs */
u16 ethtype; /* Ethernet protocol for pause frame */
@@ -371,8 +353,6 @@ struct ice_pf {
u32 num_lan_msix; /* Total MSIX vectors for base driver */
u16 num_lan_tx; /* num LAN Tx queues setup */
u16 num_lan_rx; /* num LAN Rx queues setup */
- u16 q_left_tx; /* remaining num Tx queues left unclaimed */
- u16 q_left_rx; /* remaining num Rx queues left unclaimed */
u16 next_vsi; /* Next free slot in pf->vsi[] - 0-based! */
u16 num_alloc_vsi;
u16 corer_count; /* Core reset count */
@@ -425,21 +405,15 @@ ice_irq_dynamic_ena(struct ice_hw *hw, struct ice_vsi *vsi,
}
/**
- * ice_find_vsi_by_type - Find and return VSI of a given type
- * @pf: PF to search for VSI
- * @type: Value indicating type of VSI we are looking for
+ * ice_get_main_vsi - Get the PF VSI
+ * @pf: PF instance
+ *
+ * returns pf->vsi[0], which by definition is the PF VSI
*/
-static inline struct ice_vsi *
-ice_find_vsi_by_type(struct ice_pf *pf, enum ice_vsi_type type)
+static inline struct ice_vsi *ice_get_main_vsi(struct ice_pf *pf)
{
- int i;
-
- for (i = 0; i < pf->num_alloc_vsi; i++) {
- struct ice_vsi *vsi = pf->vsi[i];
-
- if (vsi && vsi->type == type)
- return vsi;
- }
+ if (pf->vsi)
+ return pf->vsi[0];
return NULL;
}
@@ -447,6 +421,8 @@ ice_find_vsi_by_type(struct ice_pf *pf, enum ice_vsi_type type)
int ice_vsi_setup_tx_rings(struct ice_vsi *vsi);
int ice_vsi_setup_rx_rings(struct ice_vsi *vsi);
void ice_set_ethtool_ops(struct net_device *netdev);
+u16 ice_get_avail_txq_count(struct ice_pf *pf);
+u16 ice_get_avail_rxq_count(struct ice_pf *pf);
void ice_update_vsi_stats(struct ice_vsi *vsi);
void ice_update_pf_stats(struct ice_pf *pf);
int ice_up(struct ice_vsi *vsi);