Commit 16111991 authored by David S. Miller's avatar David S. Miller

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-04-18

This series contains updates to the ice driver only.

Anirudh fixes up code comments which had typos.  Added support for DCB
into the ice driver, which required a bit of refactoring of the existing
code.  Also fixed a potential race condition between closing and opening
the VSI for a MIB change event, so resolved this by grabbing the
rtnl_lock prior to closing.  Added support to process LLDP MIB change
notifications.  Added support for reporting DCB stats via ethtool.

Brett updates the calculation to increment ITR to use a direct
calculation instead of using estimations.  This provides a more accurate
value.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents f9a904ef 711987bb
...@@ -17,3 +17,4 @@ ice-y := ice_main.o \ ...@@ -17,3 +17,4 @@ ice-y := ice_main.o \
ice_txrx.o \ ice_txrx.o \
ice_ethtool.o ice_ethtool.o
ice-$(CONFIG_PCI_IOV) += ice_virtchnl_pf.o ice_sriov.o ice-$(CONFIG_PCI_IOV) += ice_virtchnl_pf.o ice_sriov.o
ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_lib.o
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "ice_devids.h" #include "ice_devids.h"
#include "ice_type.h" #include "ice_type.h"
#include "ice_txrx.h" #include "ice_txrx.h"
#include "ice_dcb.h"
#include "ice_switch.h" #include "ice_switch.h"
#include "ice_common.h" #include "ice_common.h"
#include "ice_sched.h" #include "ice_sched.h"
...@@ -151,7 +152,7 @@ struct ice_tc_info { ...@@ -151,7 +152,7 @@ struct ice_tc_info {
struct ice_tc_cfg { struct ice_tc_cfg {
u8 numtc; /* Total number of enabled TCs */ u8 numtc; /* Total number of enabled TCs */
u8 ena_tc; /* TX map */ u8 ena_tc; /* Tx map */
struct ice_tc_info tc_info[ICE_MAX_TRAFFIC_CLASS]; struct ice_tc_info tc_info[ICE_MAX_TRAFFIC_CLASS];
}; };
...@@ -162,7 +163,7 @@ struct ice_res_tracker { ...@@ -162,7 +163,7 @@ struct ice_res_tracker {
}; };
struct ice_qs_cfg { struct ice_qs_cfg {
struct mutex *qs_mutex; /* will be assgined to &pf->avail_q_mutex */ struct mutex *qs_mutex; /* will be assigned to &pf->avail_q_mutex */
unsigned long *pf_map; unsigned long *pf_map;
unsigned long pf_map_size; unsigned long pf_map_size;
unsigned int q_count; unsigned int q_count;
...@@ -321,7 +322,11 @@ enum ice_pf_flags { ...@@ -321,7 +322,11 @@ enum ice_pf_flags {
ICE_FLAG_RSS_ENA, ICE_FLAG_RSS_ENA,
ICE_FLAG_SRIOV_ENA, ICE_FLAG_SRIOV_ENA,
ICE_FLAG_SRIOV_CAPABLE, ICE_FLAG_SRIOV_CAPABLE,
ICE_FLAG_DCB_CAPABLE,
ICE_FLAG_DCB_ENA,
ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA, ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA,
ICE_FLAG_DISABLE_FW_LLDP,
ICE_FLAG_ETHTOOL_CTXT, /* set when ethtool holds RTNL lock */
ICE_PF_FLAGS_NBITS /* must be last */ ICE_PF_FLAGS_NBITS /* must be last */
}; };
...@@ -360,8 +365,8 @@ struct ice_pf { ...@@ -360,8 +365,8 @@ struct ice_pf {
u32 hw_oicr_idx; /* Other interrupt cause vector HW index */ u32 hw_oicr_idx; /* Other interrupt cause vector HW index */
u32 num_avail_hw_msix; /* remaining HW MSIX vectors left unclaimed */ u32 num_avail_hw_msix; /* remaining HW MSIX vectors left unclaimed */
u32 num_lan_msix; /* Total MSIX vectors for base driver */ u32 num_lan_msix; /* Total MSIX vectors for base driver */
u16 num_lan_tx; /* num lan Tx queues setup */ u16 num_lan_tx; /* num LAN Tx queues setup */
u16 num_lan_rx; /* num lan Rx queues setup */ u16 num_lan_rx; /* num LAN Rx queues setup */
u16 q_left_tx; /* remaining num Tx queues left unclaimed */ u16 q_left_tx; /* remaining num Tx queues left unclaimed */
u16 q_left_rx; /* remaining num Rx 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 next_vsi; /* Next free slot in pf->vsi[] - 0-based! */
...@@ -375,6 +380,9 @@ struct ice_pf { ...@@ -375,6 +380,9 @@ struct ice_pf {
struct ice_hw_port_stats stats_prev; struct ice_hw_port_stats stats_prev;
struct ice_hw hw; struct ice_hw hw;
u8 stat_prev_loaded; /* has previous stats been loaded */ u8 stat_prev_loaded; /* has previous stats been loaded */
#ifdef CONFIG_DCB
u16 dcbx_cap;
#endif /* CONFIG_DCB */
u32 tx_timeout_count; u32 tx_timeout_count;
unsigned long tx_timeout_last_recovery; unsigned long tx_timeout_last_recovery;
u32 tx_timeout_recovery_level; u32 tx_timeout_recovery_level;
...@@ -387,8 +395,8 @@ struct ice_netdev_priv { ...@@ -387,8 +395,8 @@ struct ice_netdev_priv {
/** /**
* ice_irq_dynamic_ena - Enable default interrupt generation settings * ice_irq_dynamic_ena - Enable default interrupt generation settings
* @hw: pointer to hw struct * @hw: pointer to HW struct
* @vsi: pointer to vsi struct, can be NULL * @vsi: pointer to VSI struct, can be NULL
* @q_vector: pointer to q_vector, can be NULL * @q_vector: pointer to q_vector, can be NULL
*/ */
static inline void static inline void
...@@ -411,12 +419,6 @@ ice_irq_dynamic_ena(struct ice_hw *hw, struct ice_vsi *vsi, ...@@ -411,12 +419,6 @@ ice_irq_dynamic_ena(struct ice_hw *hw, struct ice_vsi *vsi,
wr32(hw, GLINT_DYN_CTL(vector), val); wr32(hw, GLINT_DYN_CTL(vector), val);
} }
static inline void ice_vsi_set_tc_cfg(struct ice_vsi *vsi)
{
vsi->tc_cfg.ena_tc = ICE_DFLT_TRAFFIC_CLASS;
vsi->tc_cfg.numtc = 1;
}
void ice_set_ethtool_ops(struct net_device *netdev); void ice_set_ethtool_ops(struct net_device *netdev);
int ice_up(struct ice_vsi *vsi); int ice_up(struct ice_vsi *vsi);
int ice_down(struct ice_vsi *vsi); int ice_down(struct ice_vsi *vsi);
...@@ -425,5 +427,9 @@ int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size); ...@@ -425,5 +427,9 @@ int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);
void ice_fill_rss_lut(u8 *lut, u16 rss_table_size, u16 rss_size); void ice_fill_rss_lut(u8 *lut, u16 rss_table_size, u16 rss_size);
void ice_print_link_msg(struct ice_vsi *vsi, bool isup); void ice_print_link_msg(struct ice_vsi *vsi, bool isup);
void ice_napi_del(struct ice_vsi *vsi); void ice_napi_del(struct ice_vsi *vsi);
#ifdef CONFIG_DCB
int ice_pf_ena_all_vsi(struct ice_pf *pf, bool locked);
void ice_pf_dis_all_vsi(struct ice_pf *pf, bool locked);
#endif /* CONFIG_DCB */
#endif /* _ICE_H_ */ #endif /* _ICE_H_ */
...@@ -62,7 +62,7 @@ struct ice_aqc_req_res { ...@@ -62,7 +62,7 @@ struct ice_aqc_req_res {
#define ICE_AQ_RES_NVM_WRITE_DFLT_TIMEOUT_MS 180000 #define ICE_AQ_RES_NVM_WRITE_DFLT_TIMEOUT_MS 180000
#define ICE_AQ_RES_CHNG_LOCK_DFLT_TIMEOUT_MS 1000 #define ICE_AQ_RES_CHNG_LOCK_DFLT_TIMEOUT_MS 1000
#define ICE_AQ_RES_GLBL_LOCK_DFLT_TIMEOUT_MS 3000 #define ICE_AQ_RES_GLBL_LOCK_DFLT_TIMEOUT_MS 3000
/* For SDP: pin id of the SDP */ /* For SDP: pin ID of the SDP */
__le32 res_number; __le32 res_number;
/* Status is only used for ICE_AQC_RES_ID_GLBL_LOCK */ /* Status is only used for ICE_AQC_RES_ID_GLBL_LOCK */
__le16 status; __le16 status;
...@@ -747,6 +747,32 @@ struct ice_aqc_delete_elem { ...@@ -747,6 +747,32 @@ struct ice_aqc_delete_elem {
__le32 teid[1]; __le32 teid[1];
}; };
/* Query Port ETS (indirect 0x040E)
*
* This indirect command is used to query port TC node configuration.
*/
struct ice_aqc_query_port_ets {
__le32 port_teid;
__le32 reserved;
__le32 addr_high;
__le32 addr_low;
};
struct ice_aqc_port_ets_elem {
u8 tc_valid_bits;
u8 reserved[3];
/* 3 bits for UP per TC 0-7, 4th byte reserved */
__le32 up2tc;
u8 tc_bw_share[8];
__le32 port_eir_prof_id;
__le32 port_cir_prof_id;
/* 3 bits per Node priority to TC 0-7, 4th byte reserved */
__le32 tc_node_prio;
#define ICE_TC_NODE_PRIO_S 0x4
u8 reserved1[4];
__le32 tc_node_teid[8]; /* Used for response, reserved in command */
};
/* Query Scheduler Resource Allocation (indirect 0x0412) /* Query Scheduler Resource Allocation (indirect 0x0412)
* This indirect command retrieves the scheduler resources allocated by * This indirect command retrieves the scheduler resources allocated by
* EMP Firmware to the given PF. * EMP Firmware to the given PF.
...@@ -1024,7 +1050,7 @@ struct ice_aqc_get_link_status_data { ...@@ -1024,7 +1050,7 @@ struct ice_aqc_get_link_status_data {
u8 ext_info; u8 ext_info;
#define ICE_AQ_LINK_PHY_TEMP_ALARM BIT(0) #define ICE_AQ_LINK_PHY_TEMP_ALARM BIT(0)
#define ICE_AQ_LINK_EXCESSIVE_ERRORS BIT(1) /* Excessive Link Errors */ #define ICE_AQ_LINK_EXCESSIVE_ERRORS BIT(1) /* Excessive Link Errors */
/* Port TX Suspended */ /* Port Tx Suspended */
#define ICE_AQ_LINK_TX_S 2 #define ICE_AQ_LINK_TX_S 2
#define ICE_AQ_LINK_TX_M (0x03 << ICE_AQ_LINK_TX_S) #define ICE_AQ_LINK_TX_M (0x03 << ICE_AQ_LINK_TX_S)
#define ICE_AQ_LINK_TX_ACTIVE 0 #define ICE_AQ_LINK_TX_ACTIVE 0
...@@ -1120,9 +1146,9 @@ struct ice_aqc_nvm { ...@@ -1120,9 +1146,9 @@ struct ice_aqc_nvm {
}; };
/** /**
* Send to PF command (indirect 0x0801) id is only used by PF * Send to PF command (indirect 0x0801) ID is only used by PF
* *
* Send to VF command (indirect 0x0802) id is only used by PF * Send to VF command (indirect 0x0802) ID is only used by PF
* *
*/ */
struct ice_aqc_pf_vf_msg { struct ice_aqc_pf_vf_msg {
...@@ -1132,6 +1158,126 @@ struct ice_aqc_pf_vf_msg { ...@@ -1132,6 +1158,126 @@ struct ice_aqc_pf_vf_msg {
__le32 addr_low; __le32 addr_low;
}; };
/* Get LLDP MIB (indirect 0x0A00)
* Note: This is also used by the LLDP MIB Change Event (0x0A01)
* as the format is the same.
*/
struct ice_aqc_lldp_get_mib {
u8 type;
#define ICE_AQ_LLDP_MIB_TYPE_S 0
#define ICE_AQ_LLDP_MIB_TYPE_M (0x3 << ICE_AQ_LLDP_MIB_TYPE_S)
#define ICE_AQ_LLDP_MIB_LOCAL 0
#define ICE_AQ_LLDP_MIB_REMOTE 1
#define ICE_AQ_LLDP_MIB_LOCAL_AND_REMOTE 2
#define ICE_AQ_LLDP_BRID_TYPE_S 2
#define ICE_AQ_LLDP_BRID_TYPE_M (0x3 << ICE_AQ_LLDP_BRID_TYPE_S)
#define ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID 0
#define ICE_AQ_LLDP_BRID_TYPE_NON_TPMR 1
/* Tx pause flags in the 0xA01 event use ICE_AQ_LLDP_TX_* */
#define ICE_AQ_LLDP_TX_S 0x4
#define ICE_AQ_LLDP_TX_M (0x03 << ICE_AQ_LLDP_TX_S)
#define ICE_AQ_LLDP_TX_ACTIVE 0
#define ICE_AQ_LLDP_TX_SUSPENDED 1
#define ICE_AQ_LLDP_TX_FLUSHED 3
/* The following bytes are reserved for the Get LLDP MIB command (0x0A00)
* and in the LLDP MIB Change Event (0x0A01). They are valid for the
* Get LLDP MIB (0x0A00) response only.
*/
u8 reserved1;
__le16 local_len;
__le16 remote_len;
u8 reserved2[2];
__le32 addr_high;
__le32 addr_low;
};
/* Configure LLDP MIB Change Event (direct 0x0A01) */
/* For MIB Change Event use ice_aqc_lldp_get_mib structure above */
struct ice_aqc_lldp_set_mib_change {
u8 command;
#define ICE_AQ_LLDP_MIB_UPDATE_ENABLE 0x0
#define ICE_AQ_LLDP_MIB_UPDATE_DIS 0x1
u8 reserved[15];
};
/* Stop LLDP (direct 0x0A05) */
struct ice_aqc_lldp_stop {
u8 command;
#define ICE_AQ_LLDP_AGENT_STATE_MASK BIT(0)
#define ICE_AQ_LLDP_AGENT_STOP 0x0
#define ICE_AQ_LLDP_AGENT_SHUTDOWN ICE_AQ_LLDP_AGENT_STATE_MASK
#define ICE_AQ_LLDP_AGENT_PERSIST_DIS BIT(1)
u8 reserved[15];
};
/* Start LLDP (direct 0x0A06) */
struct ice_aqc_lldp_start {
u8 command;
#define ICE_AQ_LLDP_AGENT_START BIT(0)
#define ICE_AQ_LLDP_AGENT_PERSIST_ENA BIT(1)
u8 reserved[15];
};
/* Get CEE DCBX Oper Config (0x0A07)
* The command uses the generic descriptor struct and
* returns the struct below as an indirect response.
*/
struct ice_aqc_get_cee_dcb_cfg_resp {
u8 oper_num_tc;
u8 oper_prio_tc[4];
u8 oper_tc_bw[8];
u8 oper_pfc_en;
__le16 oper_app_prio;
#define ICE_AQC_CEE_APP_FCOE_S 0
#define ICE_AQC_CEE_APP_FCOE_M (0x7 << ICE_AQC_CEE_APP_FCOE_S)
#define ICE_AQC_CEE_APP_ISCSI_S 3
#define ICE_AQC_CEE_APP_ISCSI_M (0x7 << ICE_AQC_CEE_APP_ISCSI_S)
#define ICE_AQC_CEE_APP_FIP_S 8
#define ICE_AQC_CEE_APP_FIP_M (0x7 << ICE_AQC_CEE_APP_FIP_S)
__le32 tlv_status;
#define ICE_AQC_CEE_PG_STATUS_S 0
#define ICE_AQC_CEE_PG_STATUS_M (0x7 << ICE_AQC_CEE_PG_STATUS_S)
#define ICE_AQC_CEE_PFC_STATUS_S 3
#define ICE_AQC_CEE_PFC_STATUS_M (0x7 << ICE_AQC_CEE_PFC_STATUS_S)
#define ICE_AQC_CEE_FCOE_STATUS_S 8
#define ICE_AQC_CEE_FCOE_STATUS_M (0x7 << ICE_AQC_CEE_FCOE_STATUS_S)
#define ICE_AQC_CEE_ISCSI_STATUS_S 11
#define ICE_AQC_CEE_ISCSI_STATUS_M (0x7 << ICE_AQC_CEE_ISCSI_STATUS_S)
#define ICE_AQC_CEE_FIP_STATUS_S 16
#define ICE_AQC_CEE_FIP_STATUS_M (0x7 << ICE_AQC_CEE_FIP_STATUS_S)
u8 reserved[12];
};
/* Set Local LLDP MIB (indirect 0x0A08)
* Used to replace the local MIB of a given LLDP agent. e.g. DCBx
*/
struct ice_aqc_lldp_set_local_mib {
u8 type;
#define SET_LOCAL_MIB_TYPE_DCBX_M BIT(0)
#define SET_LOCAL_MIB_TYPE_LOCAL_MIB 0
#define SET_LOCAL_MIB_TYPE_CEE_M BIT(1)
#define SET_LOCAL_MIB_TYPE_CEE_WILLING 0
#define SET_LOCAL_MIB_TYPE_CEE_NON_WILLING SET_LOCAL_MIB_TYPE_CEE_M
u8 reserved0;
__le16 length;
u8 reserved1[4];
__le32 addr_high;
__le32 addr_low;
};
/* Stop/Start LLDP Agent (direct 0x0A09)
* Used for stopping/starting specific LLDP agent. e.g. DCBx.
* The same structure is used for the response, with the command field
* being used as the status field.
*/
struct ice_aqc_lldp_stop_start_specific_agent {
u8 command;
#define ICE_AQC_START_STOP_AGENT_M BIT(0)
#define ICE_AQC_START_STOP_AGENT_STOP_DCBX 0
#define ICE_AQC_START_STOP_AGENT_START_DCBX ICE_AQC_START_STOP_AGENT_M
u8 reserved[15];
};
/* Get/Set RSS key (indirect 0x0B04/0x0B02) */ /* Get/Set RSS key (indirect 0x0B04/0x0B02) */
struct ice_aqc_get_set_rss_key { struct ice_aqc_get_set_rss_key {
#define ICE_AQC_GSET_RSS_KEY_VSI_VALID BIT(15) #define ICE_AQC_GSET_RSS_KEY_VSI_VALID BIT(15)
...@@ -1186,7 +1332,7 @@ struct ice_aqc_get_set_rss_lut { ...@@ -1186,7 +1332,7 @@ struct ice_aqc_get_set_rss_lut {
__le32 addr_low; __le32 addr_low;
}; };
/* Add TX LAN Queues (indirect 0x0C30) */ /* Add Tx LAN Queues (indirect 0x0C30) */
struct ice_aqc_add_txqs { struct ice_aqc_add_txqs {
u8 num_qgrps; u8 num_qgrps;
u8 reserved[3]; u8 reserved[3];
...@@ -1195,7 +1341,7 @@ struct ice_aqc_add_txqs { ...@@ -1195,7 +1341,7 @@ struct ice_aqc_add_txqs {
__le32 addr_low; __le32 addr_low;
}; };
/* This is the descriptor of each queue entry for the Add TX LAN Queues /* This is the descriptor of each queue entry for the Add Tx LAN Queues
* command (0x0C30). Only used within struct ice_aqc_add_tx_qgrp. * command (0x0C30). Only used within struct ice_aqc_add_tx_qgrp.
*/ */
struct ice_aqc_add_txqs_perq { struct ice_aqc_add_txqs_perq {
...@@ -1207,7 +1353,7 @@ struct ice_aqc_add_txqs_perq { ...@@ -1207,7 +1353,7 @@ struct ice_aqc_add_txqs_perq {
struct ice_aqc_txsched_elem info; struct ice_aqc_txsched_elem info;
}; };
/* The format of the command buffer for Add TX LAN Queues (0x0C30) /* The format of the command buffer for Add Tx LAN Queues (0x0C30)
* is an array of the following structs. Please note that the length of * is an array of the following structs. Please note that the length of
* each struct ice_aqc_add_tx_qgrp is variable due * each struct ice_aqc_add_tx_qgrp is variable due
* to the variable number of queues in each group! * to the variable number of queues in each group!
...@@ -1219,7 +1365,7 @@ struct ice_aqc_add_tx_qgrp { ...@@ -1219,7 +1365,7 @@ struct ice_aqc_add_tx_qgrp {
struct ice_aqc_add_txqs_perq txqs[1]; struct ice_aqc_add_txqs_perq txqs[1];
}; };
/* Disable TX LAN Queues (indirect 0x0C31) */ /* Disable Tx LAN Queues (indirect 0x0C31) */
struct ice_aqc_dis_txqs { struct ice_aqc_dis_txqs {
u8 cmd_type; u8 cmd_type;
#define ICE_AQC_Q_DIS_CMD_S 0 #define ICE_AQC_Q_DIS_CMD_S 0
...@@ -1241,7 +1387,7 @@ struct ice_aqc_dis_txqs { ...@@ -1241,7 +1387,7 @@ struct ice_aqc_dis_txqs {
__le32 addr_low; __le32 addr_low;
}; };
/* The buffer for Disable TX LAN Queues (indirect 0x0C31) /* The buffer for Disable Tx LAN Queues (indirect 0x0C31)
* contains the following structures, arrayed one after the * contains the following structures, arrayed one after the
* other. * other.
* Note: Since the q_id is 16 bits wide, if the * Note: Since the q_id is 16 bits wide, if the
...@@ -1388,8 +1534,15 @@ struct ice_aq_desc { ...@@ -1388,8 +1534,15 @@ struct ice_aq_desc {
struct ice_aqc_get_topo get_topo; struct ice_aqc_get_topo get_topo;
struct ice_aqc_sched_elem_cmd sched_elem_cmd; struct ice_aqc_sched_elem_cmd sched_elem_cmd;
struct ice_aqc_query_txsched_res query_sched_res; struct ice_aqc_query_txsched_res query_sched_res;
struct ice_aqc_query_port_ets port_ets;
struct ice_aqc_nvm nvm; struct ice_aqc_nvm nvm;
struct ice_aqc_pf_vf_msg virt; struct ice_aqc_pf_vf_msg virt;
struct ice_aqc_lldp_get_mib lldp_get_mib;
struct ice_aqc_lldp_set_mib_change lldp_set_event;
struct ice_aqc_lldp_stop lldp_stop;
struct ice_aqc_lldp_start lldp_start;
struct ice_aqc_lldp_set_local_mib lldp_set_mib;
struct ice_aqc_lldp_stop_start_specific_agent lldp_agent_ctrl;
struct ice_aqc_get_set_rss_lut get_set_rss_lut; struct ice_aqc_get_set_rss_lut get_set_rss_lut;
struct ice_aqc_get_set_rss_key get_set_rss_key; struct ice_aqc_get_set_rss_key get_set_rss_key;
struct ice_aqc_add_txqs add_txqs; struct ice_aqc_add_txqs add_txqs;
...@@ -1422,6 +1575,8 @@ struct ice_aq_desc { ...@@ -1422,6 +1575,8 @@ struct ice_aq_desc {
/* error codes */ /* error codes */
enum ice_aq_err { enum ice_aq_err {
ICE_AQ_RC_OK = 0, /* Success */ ICE_AQ_RC_OK = 0, /* Success */
ICE_AQ_RC_EPERM = 1, /* Operation not permitted */
ICE_AQ_RC_ENOENT = 2, /* No such element */
ICE_AQ_RC_ENOMEM = 9, /* Out of memory */ ICE_AQ_RC_ENOMEM = 9, /* Out of memory */
ICE_AQ_RC_EBUSY = 12, /* Device or resource busy */ ICE_AQ_RC_EBUSY = 12, /* Device or resource busy */
ICE_AQ_RC_EEXIST = 13, /* Object already exists */ ICE_AQ_RC_EEXIST = 13, /* Object already exists */
...@@ -1474,6 +1629,7 @@ enum ice_adminq_opc { ...@@ -1474,6 +1629,7 @@ enum ice_adminq_opc {
ice_aqc_opc_get_sched_elems = 0x0404, ice_aqc_opc_get_sched_elems = 0x0404,
ice_aqc_opc_suspend_sched_elems = 0x0409, ice_aqc_opc_suspend_sched_elems = 0x0409,
ice_aqc_opc_resume_sched_elems = 0x040A, ice_aqc_opc_resume_sched_elems = 0x040A,
ice_aqc_opc_query_port_ets = 0x040E,
ice_aqc_opc_delete_sched_elems = 0x040F, ice_aqc_opc_delete_sched_elems = 0x040F,
ice_aqc_opc_query_sched_res = 0x0412, ice_aqc_opc_query_sched_res = 0x0412,
...@@ -1491,6 +1647,14 @@ enum ice_adminq_opc { ...@@ -1491,6 +1647,14 @@ enum ice_adminq_opc {
/* PF/VF mailbox commands */ /* PF/VF mailbox commands */
ice_mbx_opc_send_msg_to_pf = 0x0801, ice_mbx_opc_send_msg_to_pf = 0x0801,
ice_mbx_opc_send_msg_to_vf = 0x0802, ice_mbx_opc_send_msg_to_vf = 0x0802,
/* LLDP commands */
ice_aqc_opc_lldp_get_mib = 0x0A00,
ice_aqc_opc_lldp_set_mib_change = 0x0A01,
ice_aqc_opc_lldp_stop = 0x0A05,
ice_aqc_opc_lldp_start = 0x0A06,
ice_aqc_opc_get_cee_dcb_cfg = 0x0A07,
ice_aqc_opc_lldp_set_local_mib = 0x0A08,
ice_aqc_opc_lldp_stop_start_specific_agent = 0x0A09,
/* RSS commands */ /* RSS commands */
ice_aqc_opc_set_rss_key = 0x0B02, ice_aqc_opc_set_rss_key = 0x0B02,
...@@ -1498,7 +1662,7 @@ enum ice_adminq_opc { ...@@ -1498,7 +1662,7 @@ enum ice_adminq_opc {
ice_aqc_opc_get_rss_key = 0x0B04, ice_aqc_opc_get_rss_key = 0x0B04,
ice_aqc_opc_get_rss_lut = 0x0B05, ice_aqc_opc_get_rss_lut = 0x0B05,
/* TX queue handling commands/events */ /* Tx queue handling commands/events */
ice_aqc_opc_add_txqs = 0x0C30, ice_aqc_opc_add_txqs = 0x0C30,
ice_aqc_opc_dis_txqs = 0x0C31, ice_aqc_opc_dis_txqs = 0x0C31,
......
This diff is collapsed.
...@@ -118,4 +118,7 @@ ice_stat_update40(struct ice_hw *hw, u32 hireg, u32 loreg, ...@@ -118,4 +118,7 @@ ice_stat_update40(struct ice_hw *hw, u32 hireg, u32 loreg,
void void
ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded, ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
u64 *prev_stat, u64 *cur_stat); u64 *prev_stat, u64 *cur_stat);
enum ice_status
ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,
struct ice_aqc_get_elem *buf);
#endif /* _ICE_COMMON_H_ */ #endif /* _ICE_COMMON_H_ */
...@@ -51,7 +51,7 @@ static void ice_mailbox_init_regs(struct ice_hw *hw) ...@@ -51,7 +51,7 @@ static void ice_mailbox_init_regs(struct ice_hw *hw)
/** /**
* ice_check_sq_alive * ice_check_sq_alive
* @hw: pointer to the hw struct * @hw: pointer to the HW struct
* @cq: pointer to the specific Control queue * @cq: pointer to the specific Control queue
* *
* Returns true if Queue is enabled else false. * Returns true if Queue is enabled else false.
...@@ -287,7 +287,7 @@ ice_cfg_sq_regs(struct ice_hw *hw, struct ice_ctl_q_info *cq) ...@@ -287,7 +287,7 @@ ice_cfg_sq_regs(struct ice_hw *hw, struct ice_ctl_q_info *cq)
* @hw: pointer to the hardware structure * @hw: pointer to the hardware structure
* @cq: pointer to the specific Control queue * @cq: pointer to the specific Control queue
* *
* Configure base address and length registers for the receive (event q) * Configure base address and length registers for the receive (event queue)
*/ */
static enum ice_status static enum ice_status
ice_cfg_rq_regs(struct ice_hw *hw, struct ice_ctl_q_info *cq) ice_cfg_rq_regs(struct ice_hw *hw, struct ice_ctl_q_info *cq)
...@@ -751,7 +751,7 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq) ...@@ -751,7 +751,7 @@ static u16 ice_clean_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
/** /**
* ice_sq_done - check if FW has processed the Admin Send Queue (ATQ) * ice_sq_done - check if FW has processed the Admin Send Queue (ATQ)
* @hw: pointer to the hw struct * @hw: pointer to the HW struct
* @cq: pointer to the specific Control queue * @cq: pointer to the specific Control queue
* *
* Returns true if the firmware has processed all descriptors on the * Returns true if the firmware has processed all descriptors on the
...@@ -767,7 +767,7 @@ static bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq) ...@@ -767,7 +767,7 @@ static bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq)
/** /**
* ice_sq_send_cmd - send command to Control Queue (ATQ) * ice_sq_send_cmd - send command to Control Queue (ATQ)
* @hw: pointer to the hw struct * @hw: pointer to the HW struct
* @cq: pointer to the specific Control queue * @cq: pointer to the specific Control queue
* @desc: prefilled descriptor describing the command (non DMA mem) * @desc: prefilled descriptor describing the command (non DMA mem)
* @buf: buffer to use for indirect commands (or NULL for direct commands) * @buf: buffer to use for indirect commands (or NULL for direct commands)
...@@ -962,7 +962,7 @@ void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode) ...@@ -962,7 +962,7 @@ void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode)
/** /**
* ice_clean_rq_elem * ice_clean_rq_elem
* @hw: pointer to the hw struct * @hw: pointer to the HW struct
* @cq: pointer to the specific Control queue * @cq: pointer to the specific Control queue
* @e: event info from the receive descriptor, includes any buffers * @e: event info from the receive descriptor, includes any buffers
* @pending: number of events that could be left to process * @pending: number of events that could be left to process
......
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2019, Intel Corporation. */
#ifndef _ICE_DCB_H_
#define _ICE_DCB_H_
#include "ice_type.h"
#define ICE_DCBX_STATUS_NOT_STARTED 0
#define ICE_DCBX_STATUS_IN_PROGRESS 1
#define ICE_DCBX_STATUS_DONE 2
#define ICE_DCBX_STATUS_DIS 7
#define ICE_TLV_TYPE_END 0
#define ICE_TLV_TYPE_ORG 127
#define ICE_IEEE_8021QAZ_OUI 0x0080C2
#define ICE_IEEE_SUBTYPE_ETS_CFG 9
#define ICE_IEEE_SUBTYPE_ETS_REC 10
#define ICE_IEEE_SUBTYPE_PFC_CFG 11
#define ICE_IEEE_SUBTYPE_APP_PRI 12
#define ICE_CEE_DCBX_OUI 0x001B21
#define ICE_CEE_DCBX_TYPE 2
#define ICE_CEE_SUBTYPE_PG_CFG 2
#define ICE_CEE_SUBTYPE_PFC_CFG 3
#define ICE_CEE_SUBTYPE_APP_PRI 4
#define ICE_CEE_MAX_FEAT_TYPE 3
/* Defines for LLDP TLV header */
#define ICE_LLDP_TLV_LEN_S 0
#define ICE_LLDP_TLV_LEN_M (0x01FF << ICE_LLDP_TLV_LEN_S)
#define ICE_LLDP_TLV_TYPE_S 9
#define ICE_LLDP_TLV_TYPE_M (0x7F << ICE_LLDP_TLV_TYPE_S)
#define ICE_LLDP_TLV_SUBTYPE_S 0
#define ICE_LLDP_TLV_SUBTYPE_M (0xFF << ICE_LLDP_TLV_SUBTYPE_S)
#define ICE_LLDP_TLV_OUI_S 8
#define ICE_LLDP_TLV_OUI_M (0xFFFFFFUL << ICE_LLDP_TLV_OUI_S)
/* Defines for IEEE ETS TLV */
#define ICE_IEEE_ETS_MAXTC_S 0
#define ICE_IEEE_ETS_MAXTC_M (0x7 << ICE_IEEE_ETS_MAXTC_S)
#define ICE_IEEE_ETS_CBS_S 6
#define ICE_IEEE_ETS_CBS_M BIT(ICE_IEEE_ETS_CBS_S)
#define ICE_IEEE_ETS_WILLING_S 7
#define ICE_IEEE_ETS_WILLING_M BIT(ICE_IEEE_ETS_WILLING_S)
#define ICE_IEEE_ETS_PRIO_0_S 0
#define ICE_IEEE_ETS_PRIO_0_M (0x7 << ICE_IEEE_ETS_PRIO_0_S)
#define ICE_IEEE_ETS_PRIO_1_S 4
#define ICE_IEEE_ETS_PRIO_1_M (0x7 << ICE_IEEE_ETS_PRIO_1_S)
#define ICE_CEE_PGID_PRIO_0_S 0
#define ICE_CEE_PGID_PRIO_0_M (0xF << ICE_CEE_PGID_PRIO_0_S)
#define ICE_CEE_PGID_PRIO_1_S 4
#define ICE_CEE_PGID_PRIO_1_M (0xF << ICE_CEE_PGID_PRIO_1_S)
#define ICE_CEE_PGID_STRICT 15
/* Defines for IEEE TSA types */
#define ICE_IEEE_TSA_STRICT 0
#define ICE_IEEE_TSA_ETS 2
/* Defines for IEEE PFC TLV */
#define ICE_IEEE_PFC_CAP_S 0
#define ICE_IEEE_PFC_CAP_M (0xF << ICE_IEEE_PFC_CAP_S)
#define ICE_IEEE_PFC_MBC_S 6
#define ICE_IEEE_PFC_MBC_M BIT(ICE_IEEE_PFC_MBC_S)
#define ICE_IEEE_PFC_WILLING_S 7
#define ICE_IEEE_PFC_WILLING_M BIT(ICE_IEEE_PFC_WILLING_S)
/* Defines for IEEE APP TLV */
#define ICE_IEEE_APP_SEL_S 0
#define ICE_IEEE_APP_SEL_M (0x7 << ICE_IEEE_APP_SEL_S)
#define ICE_IEEE_APP_PRIO_S 5
#define ICE_IEEE_APP_PRIO_M (0x7 << ICE_IEEE_APP_PRIO_S)
/* TLV definitions for preparing MIB */
#define ICE_IEEE_TLV_ID_ETS_CFG 3
#define ICE_IEEE_TLV_ID_ETS_REC 4
#define ICE_IEEE_TLV_ID_PFC_CFG 5
#define ICE_IEEE_TLV_ID_APP_PRI 6
#define ICE_TLV_ID_END_OF_LLDPPDU 7
#define ICE_TLV_ID_START ICE_IEEE_TLV_ID_ETS_CFG
#define ICE_IEEE_ETS_TLV_LEN 25
#define ICE_IEEE_PFC_TLV_LEN 6
#define ICE_IEEE_APP_TLV_LEN 11
/* IEEE 802.1AB LLDP Organization specific TLV */
struct ice_lldp_org_tlv {
__be16 typelen;
__be32 ouisubtype;
u8 tlvinfo[1];
} __packed;
struct ice_cee_tlv_hdr {
__be16 typelen;
u8 operver;
u8 maxver;
};
struct ice_cee_ctrl_tlv {
struct ice_cee_tlv_hdr hdr;
__be32 seqno;
__be32 ackno;
};
struct ice_cee_feat_tlv {
struct ice_cee_tlv_hdr hdr;
u8 en_will_err; /* Bits: |En|Will|Err|Reserved(5)| */
#define ICE_CEE_FEAT_TLV_ENA_M 0x80
#define ICE_CEE_FEAT_TLV_WILLING_M 0x40
#define ICE_CEE_FEAT_TLV_ERR_M 0x20
u8 subtype;
u8 tlvinfo[1];
};
struct ice_cee_app_prio {
__be16 protocol;
u8 upper_oui_sel; /* Bits: |Upper OUI(6)|Selector(2)| */
#define ICE_CEE_APP_SELECTOR_M 0x03
__be16 lower_oui;
u8 prio_map;
} __packed;
u8 ice_get_dcbx_status(struct ice_hw *hw);
enum ice_status ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg);
enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi);
enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi);
enum ice_status ice_init_dcb(struct ice_hw *hw);
enum ice_status
ice_query_port_ets(struct ice_port_info *pi,
struct ice_aqc_port_ets_elem *buf, u16 buf_size,
struct ice_sq_cd *cmd_details);
#ifdef CONFIG_DCB
enum ice_status
ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent,
struct ice_sq_cd *cd);
enum ice_status ice_aq_start_lldp(struct ice_hw *hw, struct ice_sq_cd *cd);
enum ice_status
ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent,
bool *dcbx_agent_status, struct ice_sq_cd *cd);
enum ice_status
ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,
struct ice_sq_cd *cd);
#else /* CONFIG_DCB */
static inline enum ice_status
ice_aq_stop_lldp(struct ice_hw __always_unused *hw,
bool __always_unused shutdown_lldp_agent,
struct ice_sq_cd __always_unused *cd)
{
return 0;
}
static inline enum ice_status
ice_aq_start_lldp(struct ice_hw __always_unused *hw,
struct ice_sq_cd __always_unused *cd)
{
return 0;
}
static inline enum ice_status
ice_aq_start_stop_dcbx(struct ice_hw __always_unused *hw,
bool __always_unused start_dcbx_agent,
bool *dcbx_agent_status,
struct ice_sq_cd __always_unused *cd)
{
*dcbx_agent_status = false;
return 0;
}
static inline enum ice_status
ice_aq_cfg_lldp_mib_change(struct ice_hw __always_unused *hw,
bool __always_unused ena_update,
struct ice_sq_cd __always_unused *cd)
{
return 0;
}
#endif /* CONFIG_DCB */
#endif /* _ICE_DCB_H_ */
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2019, Intel Corporation. */
#ifndef _ICE_DCB_LIB_H_
#define _ICE_DCB_LIB_H_
#include "ice.h"
#include "ice_lib.h"
#ifdef CONFIG_DCB
#define ICE_TC_MAX_BW 100 /* Default Max BW percentage */
void ice_dcb_rebuild(struct ice_pf *pf);
u8 ice_dcb_get_ena_tc(struct ice_dcbx_cfg *dcbcfg);
u8 ice_dcb_get_num_tc(struct ice_dcbx_cfg *dcbcfg);
void ice_vsi_cfg_dcb_rings(struct ice_vsi *vsi);
int ice_init_pf_dcb(struct ice_pf *pf);
void ice_update_dcb_stats(struct ice_pf *pf);
int
ice_tx_prepare_vlan_flags_dcb(struct ice_ring *tx_ring,
struct ice_tx_buf *first);
void
ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,
struct ice_rq_event_info *event);
static inline void
ice_set_cgd_num(struct ice_tlan_ctx *tlan_ctx, struct ice_ring *ring)
{
tlan_ctx->cgd_num = ring->dcb_tc;
}
#else
#define ice_dcb_rebuild(pf) do {} while (0)
static inline u8 ice_dcb_get_ena_tc(struct ice_dcbx_cfg __always_unused *dcbcfg)
{
return ICE_DFLT_TRAFFIC_CLASS;
}
static inline u8 ice_dcb_get_num_tc(struct ice_dcbx_cfg __always_unused *dcbcfg)
{
return 1;
}
static inline int ice_init_pf_dcb(struct ice_pf *pf)
{
dev_dbg(&pf->pdev->dev, "DCB not supported\n");
return -EOPNOTSUPP;
}
static inline int
ice_tx_prepare_vlan_flags_dcb(struct ice_ring __always_unused *tx_ring,
struct ice_tx_buf __always_unused *first)
{
return 0;
}
#define ice_update_dcb_stats(pf) do {} while (0)
#define ice_vsi_cfg_dcb_rings(vsi) do {} while (0)
#define ice_dcb_process_lldp_set_mib_change(pf, event) do {} while (0)
#define ice_set_cgd_num(tlan_ctx, ring) do {} while (0)
#endif /* CONFIG_DCB */
#endif /* _ICE_DCB_LIB_H_ */
...@@ -49,6 +49,9 @@ ...@@ -49,6 +49,9 @@
#define PF_MBX_ATQLEN_ATQLEN_M ICE_M(0x3FF, 0) #define PF_MBX_ATQLEN_ATQLEN_M ICE_M(0x3FF, 0)
#define PF_MBX_ATQLEN_ATQENABLE_M BIT(31) #define PF_MBX_ATQLEN_ATQENABLE_M BIT(31)
#define PF_MBX_ATQT 0x0022E300 #define PF_MBX_ATQT 0x0022E300
#define PRTDCB_GENS 0x00083020
#define PRTDCB_GENS_DCBX_STATUS_S 0
#define PRTDCB_GENS_DCBX_STATUS_M ICE_M(0x7, 0)
#define GLFLXP_RXDID_FLAGS(_i, _j) (0x0045D000 + ((_i) * 4 + (_j) * 256)) #define GLFLXP_RXDID_FLAGS(_i, _j) (0x0045D000 + ((_i) * 4 + (_j) * 256))
#define GLFLXP_RXDID_FLAGS_FLEXIFLAG_4N_S 0 #define GLFLXP_RXDID_FLAGS_FLEXIFLAG_4N_S 0
#define GLFLXP_RXDID_FLAGS_FLEXIFLAG_4N_M ICE_M(0x3F, 0) #define GLFLXP_RXDID_FLAGS_FLEXIFLAG_4N_M ICE_M(0x3F, 0)
...@@ -318,11 +321,16 @@ ...@@ -318,11 +321,16 @@
#define GLPRT_PTC64L(_i) (0x00380B80 + ((_i) * 8)) #define GLPRT_PTC64L(_i) (0x00380B80 + ((_i) * 8))
#define GLPRT_PTC9522H(_i) (0x00380D04 + ((_i) * 8)) #define GLPRT_PTC9522H(_i) (0x00380D04 + ((_i) * 8))
#define GLPRT_PTC9522L(_i) (0x00380D00 + ((_i) * 8)) #define GLPRT_PTC9522L(_i) (0x00380D00 + ((_i) * 8))
#define GLPRT_PXOFFRXC(_i, _j) (0x00380500 + ((_i) * 8 + (_j) * 64))
#define GLPRT_PXOFFTXC(_i, _j) (0x00380F40 + ((_i) * 8 + (_j) * 64))
#define GLPRT_PXONRXC(_i, _j) (0x00380300 + ((_i) * 8 + (_j) * 64))
#define GLPRT_PXONTXC(_i, _j) (0x00380D40 + ((_i) * 8 + (_j) * 64))
#define GLPRT_RFC(_i) (0x00380AC0 + ((_i) * 8)) #define GLPRT_RFC(_i) (0x00380AC0 + ((_i) * 8))
#define GLPRT_RJC(_i) (0x00380B00 + ((_i) * 8)) #define GLPRT_RJC(_i) (0x00380B00 + ((_i) * 8))
#define GLPRT_RLEC(_i) (0x00380140 + ((_i) * 8)) #define GLPRT_RLEC(_i) (0x00380140 + ((_i) * 8))
#define GLPRT_ROC(_i) (0x00380240 + ((_i) * 8)) #define GLPRT_ROC(_i) (0x00380240 + ((_i) * 8))
#define GLPRT_RUC(_i) (0x00380200 + ((_i) * 8)) #define GLPRT_RUC(_i) (0x00380200 + ((_i) * 8))
#define GLPRT_RXON2OFFCNT(_i, _j) (0x00380700 + ((_i) * 8 + (_j) * 64))
#define GLPRT_TDOLD(_i) (0x00381280 + ((_i) * 8)) #define GLPRT_TDOLD(_i) (0x00381280 + ((_i) * 8))
#define GLPRT_UPRCH(_i) (0x00381304 + ((_i) * 8)) #define GLPRT_UPRCH(_i) (0x00381304 + ((_i) * 8))
#define GLPRT_UPRCL(_i) (0x00381300 + ((_i) * 8)) #define GLPRT_UPRCL(_i) (0x00381300 + ((_i) * 8))
......
...@@ -20,7 +20,7 @@ union ice_32byte_rx_desc { ...@@ -20,7 +20,7 @@ union ice_32byte_rx_desc {
} lo_dword; } lo_dword;
union { union {
__le32 rss; /* RSS Hash */ __le32 rss; /* RSS Hash */
__le32 fd_id; /* Flow Director filter id */ __le32 fd_id; /* Flow Director filter ID */
} hi_dword; } hi_dword;
} qword0; } qword0;
struct { struct {
...@@ -99,7 +99,7 @@ enum ice_rx_ptype_payload_layer { ...@@ -99,7 +99,7 @@ enum ice_rx_ptype_payload_layer {
ICE_RX_PTYPE_PAYLOAD_LAYER_PAY4 = 3, ICE_RX_PTYPE_PAYLOAD_LAYER_PAY4 = 3,
}; };
/* RX Flex Descriptor /* Rx Flex Descriptor
* This descriptor is used instead of the legacy version descriptor when * This descriptor is used instead of the legacy version descriptor when
* ice_rlan_ctx.adv_desc is set * ice_rlan_ctx.adv_desc is set
*/ */
...@@ -113,7 +113,7 @@ union ice_32b_rx_flex_desc { ...@@ -113,7 +113,7 @@ union ice_32b_rx_flex_desc {
} read; } read;
struct { struct {
/* Qword 0 */ /* Qword 0 */
u8 rxdid; /* descriptor builder profile id */ u8 rxdid; /* descriptor builder profile ID */
u8 mir_id_umb_cast; /* mirror=[5:0], umb=[7:6] */ u8 mir_id_umb_cast; /* mirror=[5:0], umb=[7:6] */
__le16 ptype_flex_flags0; /* ptype=[9:0], ff0=[15:10] */ __le16 ptype_flex_flags0; /* ptype=[9:0], ff0=[15:10] */
__le16 pkt_len; /* [15:14] are reserved */ __le16 pkt_len; /* [15:14] are reserved */
...@@ -149,7 +149,7 @@ union ice_32b_rx_flex_desc { ...@@ -149,7 +149,7 @@ union ice_32b_rx_flex_desc {
/* Rx Flex Descriptor NIC Profile /* Rx Flex Descriptor NIC Profile
* This descriptor corresponds to RxDID 2 which contains * This descriptor corresponds to RxDID 2 which contains
* metadata fields for RSS, flow id and timestamp info * metadata fields for RSS, flow ID and timestamp info
*/ */
struct ice_32b_rx_flex_desc_nic { struct ice_32b_rx_flex_desc_nic {
/* Qword 0 */ /* Qword 0 */
...@@ -208,7 +208,7 @@ enum ice_flex_rx_mdid { ...@@ -208,7 +208,7 @@ enum ice_flex_rx_mdid {
ICE_RX_MDID_HASH_HIGH, ICE_RX_MDID_HASH_HIGH,
}; };
/* RX/TX Flag64 packet flag bits */ /* Rx/Tx Flag64 packet flag bits */
enum ice_flg64_bits { enum ice_flg64_bits {
ICE_FLG_PKT_DSI = 0, ICE_FLG_PKT_DSI = 0,
ICE_FLG_EVLAN_x8100 = 15, ICE_FLG_EVLAN_x8100 = 15,
...@@ -322,7 +322,7 @@ enum ice_rlan_ctx_rx_hsplit_1 { ...@@ -322,7 +322,7 @@ enum ice_rlan_ctx_rx_hsplit_1 {
ICE_RLAN_RX_HSPLIT_1_SPLIT_ALWAYS = 2, ICE_RLAN_RX_HSPLIT_1_SPLIT_ALWAYS = 2,
}; };
/* TX Descriptor */ /* Tx Descriptor */
struct ice_tx_desc { struct ice_tx_desc {
__le64 buf_addr; /* Address of descriptor's data buf */ __le64 buf_addr; /* Address of descriptor's data buf */
__le64 cmd_type_offset_bsz; __le64 cmd_type_offset_bsz;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "ice.h" #include "ice.h"
#include "ice_lib.h" #include "ice_lib.h"
#include "ice_dcb_lib.h"
/** /**
* ice_setup_rx_ctx - Configure a receive ring context * ice_setup_rx_ctx - Configure a receive ring context
...@@ -73,7 +74,7 @@ static int ice_setup_rx_ctx(struct ice_ring *ring) ...@@ -73,7 +74,7 @@ static int ice_setup_rx_ctx(struct ice_ring *ring)
regval |= (rxdid << QRXFLXP_CNTXT_RXDID_IDX_S) & regval |= (rxdid << QRXFLXP_CNTXT_RXDID_IDX_S) &
QRXFLXP_CNTXT_RXDID_IDX_M; QRXFLXP_CNTXT_RXDID_IDX_M;
/* increasing context priority to pick up profile id; /* increasing context priority to pick up profile ID;
* default is 0x01; setting to 0x03 to ensure profile * default is 0x01; setting to 0x03 to ensure profile
* is programming if prev context is of same priority * is programming if prev context is of same priority
*/ */
...@@ -124,6 +125,8 @@ ice_setup_tx_ctx(struct ice_ring *ring, struct ice_tlan_ctx *tlan_ctx, u16 pf_q) ...@@ -124,6 +125,8 @@ ice_setup_tx_ctx(struct ice_ring *ring, struct ice_tlan_ctx *tlan_ctx, u16 pf_q)
/* Transmit Queue Length */ /* Transmit Queue Length */
tlan_ctx->qlen = ring->count; tlan_ctx->qlen = ring->count;
ice_set_cgd_num(tlan_ctx, ring);
/* PF number */ /* PF number */
tlan_ctx->pf_num = hw->pf_id; tlan_ctx->pf_num = hw->pf_id;
...@@ -138,7 +141,7 @@ ice_setup_tx_ctx(struct ice_ring *ring, struct ice_tlan_ctx *tlan_ctx, u16 pf_q) ...@@ -138,7 +141,7 @@ ice_setup_tx_ctx(struct ice_ring *ring, struct ice_tlan_ctx *tlan_ctx, u16 pf_q)
tlan_ctx->vmvf_type = ICE_TLAN_CTX_VMVF_TYPE_PF; tlan_ctx->vmvf_type = ICE_TLAN_CTX_VMVF_TYPE_PF;
break; break;
case ICE_VSI_VF: case ICE_VSI_VF:
/* Firmware expects vmvf_num to be absolute VF id */ /* Firmware expects vmvf_num to be absolute VF ID */
tlan_ctx->vmvf_num = hw->func_caps.vf_base_id + vsi->vf_id; tlan_ctx->vmvf_num = hw->func_caps.vf_base_id + vsi->vf_id;
tlan_ctx->vmvf_type = ICE_TLAN_CTX_VMVF_TYPE_VF; tlan_ctx->vmvf_type = ICE_TLAN_CTX_VMVF_TYPE_VF;
break; break;
...@@ -297,7 +300,7 @@ static void ice_vsi_set_num_desc(struct ice_vsi *vsi) ...@@ -297,7 +300,7 @@ static void ice_vsi_set_num_desc(struct ice_vsi *vsi)
/** /**
* ice_vsi_set_num_qs - Set number of queues, descriptors and vectors for a VSI * ice_vsi_set_num_qs - Set number of queues, descriptors and vectors for a VSI
* @vsi: the VSI being configured * @vsi: the VSI being configured
* @vf_id: Id of the VF being configured * @vf_id: ID of the VF being configured
* *
* Return 0 on success and a negative value on error * Return 0 on success and a negative value on error
*/ */
...@@ -479,7 +482,7 @@ static irqreturn_t ice_msix_clean_rings(int __always_unused irq, void *data) ...@@ -479,7 +482,7 @@ static irqreturn_t ice_msix_clean_rings(int __always_unused irq, void *data)
* ice_vsi_alloc - Allocates the next available struct VSI in the PF * ice_vsi_alloc - Allocates the next available struct VSI in the PF
* @pf: board private structure * @pf: board private structure
* @type: type of VSI * @type: type of VSI
* @vf_id: Id of the VF being configured * @vf_id: ID of the VF being configured
* *
* returns a pointer to a VSI on success, NULL on failure. * returns a pointer to a VSI on success, NULL on failure.
*/ */
...@@ -1301,7 +1304,11 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi) ...@@ -1301,7 +1304,11 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi)
* through the MSI-X enabling code. On a constrained vector budget, we map Tx * through the MSI-X enabling code. On a constrained vector budget, we map Tx
* and Rx rings to the vector as "efficiently" as possible. * and Rx rings to the vector as "efficiently" as possible.
*/ */
#ifdef CONFIG_DCB
void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi)
#else
static void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi) static void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi)
#endif /* CONFIG_DCB */
{ {
int q_vectors = vsi->num_q_vectors; int q_vectors = vsi->num_q_vectors;
int tx_rings_rem, rx_rings_rem; int tx_rings_rem, rx_rings_rem;
...@@ -1445,12 +1452,12 @@ static int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi) ...@@ -1445,12 +1452,12 @@ static int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi)
} }
/** /**
* ice_add_mac_to_list - Add a mac address filter entry to the list * ice_add_mac_to_list - Add a MAC address filter entry to the list
* @vsi: the VSI to be forwarded to * @vsi: the VSI to be forwarded to
* @add_list: pointer to the list which contains MAC filter entries * @add_list: pointer to the list which contains MAC filter entries
* @macaddr: the MAC address to be added. * @macaddr: the MAC address to be added.
* *
* Adds mac address filter entry to the temp list * Adds MAC address filter entry to the temp list
* *
* Returns 0 on success or ENOMEM on failure. * Returns 0 on success or ENOMEM on failure.
*/ */
...@@ -1552,7 +1559,7 @@ void ice_free_fltr_list(struct device *dev, struct list_head *h) ...@@ -1552,7 +1559,7 @@ void ice_free_fltr_list(struct device *dev, struct list_head *h)
/** /**
* ice_vsi_add_vlan - Add VSI membership for given VLAN * ice_vsi_add_vlan - Add VSI membership for given VLAN
* @vsi: the VSI being configured * @vsi: the VSI being configured
* @vid: VLAN id to be added * @vid: VLAN ID to be added
*/ */
int ice_vsi_add_vlan(struct ice_vsi *vsi, u16 vid) int ice_vsi_add_vlan(struct ice_vsi *vsi, u16 vid)
{ {
...@@ -1590,7 +1597,7 @@ int ice_vsi_add_vlan(struct ice_vsi *vsi, u16 vid) ...@@ -1590,7 +1597,7 @@ int ice_vsi_add_vlan(struct ice_vsi *vsi, u16 vid)
/** /**
* ice_vsi_kill_vlan - Remove VSI membership for a given VLAN * ice_vsi_kill_vlan - Remove VSI membership for a given VLAN
* @vsi: the VSI being configured * @vsi: the VSI being configured
* @vid: VLAN id to be removed * @vid: VLAN ID to be removed
* *
* Returns 0 on success and negative on failure * Returns 0 on success and negative on failure
*/ */
...@@ -2016,7 +2023,7 @@ int ice_vsi_stop_rx_rings(struct ice_vsi *vsi) ...@@ -2016,7 +2023,7 @@ int ice_vsi_stop_rx_rings(struct ice_vsi *vsi)
* ice_vsi_stop_tx_rings - Disable Tx rings * ice_vsi_stop_tx_rings - Disable Tx rings
* @vsi: the VSI being configured * @vsi: the VSI being configured
* @rst_src: reset source * @rst_src: reset source
* @rel_vmvf_num: Relative id of VF/VM * @rel_vmvf_num: Relative ID of VF/VM
* @rings: Tx ring array to be stopped * @rings: Tx ring array to be stopped
* @offset: offset within vsi->txq_map * @offset: offset within vsi->txq_map
*/ */
...@@ -2102,7 +2109,7 @@ ice_vsi_stop_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, ...@@ -2102,7 +2109,7 @@ ice_vsi_stop_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,
* ice_vsi_stop_lan_tx_rings - Disable LAN Tx rings * ice_vsi_stop_lan_tx_rings - Disable LAN Tx rings
* @vsi: the VSI being configured * @vsi: the VSI being configured
* @rst_src: reset source * @rst_src: reset source
* @rel_vmvf_num: Relative id of VF/VM * @rel_vmvf_num: Relative ID of VF/VM
*/ */
int int
ice_vsi_stop_lan_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, ice_vsi_stop_lan_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,
...@@ -2172,12 +2179,20 @@ int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc) ...@@ -2172,12 +2179,20 @@ int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc)
return -EIO; return -EIO;
} }
static void ice_vsi_set_tc_cfg(struct ice_vsi *vsi)
{
struct ice_dcbx_cfg *cfg = &vsi->port_info->local_dcbx_cfg;
vsi->tc_cfg.ena_tc = ice_dcb_get_ena_tc(cfg);
vsi->tc_cfg.numtc = ice_dcb_get_num_tc(cfg);
}
/** /**
* ice_vsi_setup - Set up a VSI by a given type * ice_vsi_setup - Set up a VSI by a given type
* @pf: board private structure * @pf: board private structure
* @pi: pointer to the port_info instance * @pi: pointer to the port_info instance
* @type: VSI type * @type: VSI type
* @vf_id: defines VF id to which this VSI connects. This field is meant to be * @vf_id: defines VF ID to which this VSI connects. This field is meant to be
* used only for ICE_VSI_VF VSI type. For other VSI types, should * used only for ICE_VSI_VF VSI type. For other VSI types, should
* fill-in ICE_INVAL_VFID as input. * fill-in ICE_INVAL_VFID as input.
* *
...@@ -2219,7 +2234,7 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi, ...@@ -2219,7 +2234,7 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,
/* set RSS capabilities */ /* set RSS capabilities */
ice_vsi_set_rss_params(vsi); ice_vsi_set_rss_params(vsi);
/* set tc configuration */ /* set TC configuration */
ice_vsi_set_tc_cfg(vsi); ice_vsi_set_tc_cfg(vsi);
/* create the VSI */ /* create the VSI */
...@@ -2815,3 +2830,125 @@ bool ice_is_reset_in_progress(unsigned long *state) ...@@ -2815,3 +2830,125 @@ bool ice_is_reset_in_progress(unsigned long *state)
test_bit(__ICE_CORER_REQ, state) || test_bit(__ICE_CORER_REQ, state) ||
test_bit(__ICE_GLOBR_REQ, state); test_bit(__ICE_GLOBR_REQ, state);
} }
#ifdef CONFIG_DCB
/**
* ice_vsi_update_q_map - update our copy of the VSI info with new queue map
* @vsi: VSI being configured
* @ctx: the context buffer returned from AQ VSI update command
*/
static void ice_vsi_update_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctx)
{
vsi->info.mapping_flags = ctx->info.mapping_flags;
memcpy(&vsi->info.q_mapping, &ctx->info.q_mapping,
sizeof(vsi->info.q_mapping));
memcpy(&vsi->info.tc_mapping, ctx->info.tc_mapping,
sizeof(vsi->info.tc_mapping));
}
/**
* ice_vsi_cfg_netdev_tc - Setup the netdev TC configuration
* @vsi: the VSI being configured
* @ena_tc: TC map to be enabled
*/
static void ice_vsi_cfg_netdev_tc(struct ice_vsi *vsi, u8 ena_tc)
{
struct net_device *netdev = vsi->netdev;
struct ice_pf *pf = vsi->back;
struct ice_dcbx_cfg *dcbcfg;
u8 netdev_tc;
int i;
if (!netdev)
return;
if (!ena_tc) {
netdev_reset_tc(netdev);
return;
}
if (netdev_set_num_tc(netdev, vsi->tc_cfg.numtc))
return;
dcbcfg = &pf->hw.port_info->local_dcbx_cfg;
ice_for_each_traffic_class(i)
if (vsi->tc_cfg.ena_tc & BIT(i))
netdev_set_tc_queue(netdev,
vsi->tc_cfg.tc_info[i].netdev_tc,
vsi->tc_cfg.tc_info[i].qcount_tx,
vsi->tc_cfg.tc_info[i].qoffset);
for (i = 0; i < ICE_MAX_USER_PRIORITY; i++) {
u8 ets_tc = dcbcfg->etscfg.prio_table[i];
/* Get the mapped netdev TC# for the UP */
netdev_tc = vsi->tc_cfg.tc_info[ets_tc].netdev_tc;
netdev_set_prio_tc_map(netdev, i, netdev_tc);
}
}
/**
* ice_vsi_cfg_tc - Configure VSI Tx Sched for given TC map
* @vsi: VSI to be configured
* @ena_tc: TC bitmap
*
* VSI queues expected to be quiesced before calling this function
*/
int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)
{
u16 max_txqs[ICE_MAX_TRAFFIC_CLASS] = { 0 };
struct ice_vsi_ctx *ctx;
struct ice_pf *pf = vsi->back;
enum ice_status status;
int i, ret = 0;
u8 num_tc = 0;
ice_for_each_traffic_class(i) {
/* build bitmap of enabled TCs */
if (ena_tc & BIT(i))
num_tc++;
/* populate max_txqs per TC */
max_txqs[i] = pf->num_lan_tx;
}
vsi->tc_cfg.ena_tc = ena_tc;
vsi->tc_cfg.numtc = num_tc;
ctx = devm_kzalloc(&pf->pdev->dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;
ctx->vf_num = 0;
ctx->info = vsi->info;
ice_vsi_setup_q_map(vsi, ctx);
/* must to indicate which section of VSI context are being modified */
ctx->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_RXQ_MAP_VALID);
status = ice_update_vsi(&pf->hw, vsi->idx, ctx, NULL);
if (status) {
dev_info(&pf->pdev->dev, "Failed VSI Update\n");
ret = -EIO;
goto out;
}
status = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, vsi->tc_cfg.ena_tc,
max_txqs);
if (status) {
dev_err(&pf->pdev->dev,
"VSI %d failed TC config, error %d\n",
vsi->vsi_num, status);
ret = -EIO;
goto out;
}
ice_vsi_update_q_map(vsi, ctx);
vsi->info.valid_sections = 0;
ice_vsi_cfg_netdev_tc(vsi, ena_tc);
out:
devm_kfree(&pf->pdev->dev, ctx);
return ret;
}
#endif /* CONFIG_DCB */
...@@ -41,6 +41,10 @@ void ice_vsi_delete(struct ice_vsi *vsi); ...@@ -41,6 +41,10 @@ void ice_vsi_delete(struct ice_vsi *vsi);
int ice_vsi_clear(struct ice_vsi *vsi); int ice_vsi_clear(struct ice_vsi *vsi);
#ifdef CONFIG_DCB
int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc);
#endif /* CONFIG_DCB */
struct ice_vsi * struct ice_vsi *
ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi, ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,
enum ice_vsi_type type, u16 vf_id); enum ice_vsi_type type, u16 vf_id);
...@@ -62,6 +66,10 @@ void ice_vsi_free_q_vectors(struct ice_vsi *vsi); ...@@ -62,6 +66,10 @@ void ice_vsi_free_q_vectors(struct ice_vsi *vsi);
void ice_vsi_put_qs(struct ice_vsi *vsi); void ice_vsi_put_qs(struct ice_vsi *vsi);
#ifdef CONFIG_DCB
void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi);
#endif /* CONFIG_DCB */
void ice_vsi_dis_irq(struct ice_vsi *vsi); void ice_vsi_dis_irq(struct ice_vsi *vsi);
void ice_vsi_free_irq(struct ice_vsi *vsi); void ice_vsi_free_irq(struct ice_vsi *vsi);
......
This diff is collapsed.
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
/** /**
* ice_aq_read_nvm * ice_aq_read_nvm
* @hw: pointer to the hw struct * @hw: pointer to the HW struct
* @module_typeid: module pointer location in words from the NVM beginning * @module_typeid: module pointer location in words from the NVM beginning
* @offset: byte offset from the module beginning * @offset: byte offset from the module beginning
* @length: length of the section to be read (in bytes from the offset) * @length: length of the section to be read (in bytes from the offset)
...@@ -235,7 +235,7 @@ ice_read_sr_word(struct ice_hw *hw, u16 offset, u16 *data) ...@@ -235,7 +235,7 @@ ice_read_sr_word(struct ice_hw *hw, u16 offset, u16 *data)
/** /**
* ice_init_nvm - initializes NVM setting * ice_init_nvm - initializes NVM setting
* @hw: pointer to the hw struct * @hw: pointer to the HW struct
* *
* This function reads and populates NVM settings such as Shadow RAM size, * This function reads and populates NVM settings such as Shadow RAM size,
* max_timeout, and blank_nvm_mode * max_timeout, and blank_nvm_mode
...@@ -248,7 +248,7 @@ enum ice_status ice_init_nvm(struct ice_hw *hw) ...@@ -248,7 +248,7 @@ enum ice_status ice_init_nvm(struct ice_hw *hw)
u32 fla, gens_stat; u32 fla, gens_stat;
u8 sr_size; u8 sr_size;
/* The SR size is stored regardless of the nvm programming mode /* The SR size is stored regardless of the NVM programming mode
* as the blank mode may be used in the factory line. * as the blank mode may be used in the factory line.
*/ */
gens_stat = rd32(hw, GLNVM_GENS); gens_stat = rd32(hw, GLNVM_GENS);
......
This diff is collapsed.
...@@ -24,6 +24,10 @@ struct ice_sched_agg_info { ...@@ -24,6 +24,10 @@ struct ice_sched_agg_info {
}; };
/* FW AQ command calls */ /* FW AQ command calls */
enum ice_status
ice_aq_query_sched_elems(struct ice_hw *hw, u16 elems_req,
struct ice_aqc_get_elem *buf, u16 buf_size,
u16 *elems_ret, struct ice_sq_cd *cd);
enum ice_status ice_sched_init_port(struct ice_port_info *pi); enum ice_status ice_sched_init_port(struct ice_port_info *pi);
enum ice_status ice_sched_query_res_alloc(struct ice_hw *hw); enum ice_status ice_sched_query_res_alloc(struct ice_hw *hw);
void ice_sched_clear_port(struct ice_port_info *pi); void ice_sched_clear_port(struct ice_port_info *pi);
......
...@@ -12,6 +12,7 @@ enum ice_status { ...@@ -12,6 +12,7 @@ enum ice_status {
ICE_ERR_PARAM = -1, ICE_ERR_PARAM = -1,
ICE_ERR_NOT_IMPL = -2, ICE_ERR_NOT_IMPL = -2,
ICE_ERR_NOT_READY = -3, ICE_ERR_NOT_READY = -3,
ICE_ERR_NOT_SUPPORTED = -4,
ICE_ERR_BAD_PTR = -5, ICE_ERR_BAD_PTR = -5,
ICE_ERR_INVAL_SIZE = -6, ICE_ERR_INVAL_SIZE = -6,
ICE_ERR_DEVICE_NOT_SUPPORTED = -8, ICE_ERR_DEVICE_NOT_SUPPORTED = -8,
......
This diff is collapsed.
...@@ -44,7 +44,7 @@ enum ice_sw_lkup_type { ...@@ -44,7 +44,7 @@ enum ice_sw_lkup_type {
ICE_SW_LKUP_LAST ICE_SW_LKUP_LAST
}; };
/* type of filter src id */ /* type of filter src ID */
enum ice_src_id { enum ice_src_id {
ICE_SRC_ID_UNKNOWN = 0, ICE_SRC_ID_UNKNOWN = 0,
ICE_SRC_ID_VSI, ICE_SRC_ID_VSI,
...@@ -95,8 +95,8 @@ struct ice_fltr_info { ...@@ -95,8 +95,8 @@ struct ice_fltr_info {
/* Depending on filter action */ /* Depending on filter action */
union { union {
/* queue id in case of ICE_FWD_TO_Q and starting /* queue ID in case of ICE_FWD_TO_Q and starting
* queue id in case of ICE_FWD_TO_QGRP. * queue ID in case of ICE_FWD_TO_QGRP.
*/ */
u16 q_id:11; u16 q_id:11;
u16 hw_vsi_id:10; u16 hw_vsi_id:10;
...@@ -143,7 +143,7 @@ struct ice_sw_recipe { ...@@ -143,7 +143,7 @@ struct ice_sw_recipe {
DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES); DECLARE_BITMAP(r_bitmap, ICE_MAX_NUM_RECIPES);
}; };
/* Bookkeeping structure to hold bitmap of VSIs corresponding to VSI list id */ /* Bookkeeping structure to hold bitmap of VSIs corresponding to VSI list ID */
struct ice_vsi_list_map_info { struct ice_vsi_list_map_info {
struct list_head list_entry; struct list_head list_entry;
DECLARE_BITMAP(vsi_map, ICE_MAX_VSI); DECLARE_BITMAP(vsi_map, ICE_MAX_VSI);
...@@ -165,7 +165,7 @@ struct ice_fltr_list_entry { ...@@ -165,7 +165,7 @@ struct ice_fltr_list_entry {
* used for VLAN membership. * used for VLAN membership.
*/ */
struct ice_fltr_mgmt_list_entry { struct ice_fltr_mgmt_list_entry {
/* back pointer to VSI list id to VSI list mapping */ /* back pointer to VSI list ID to VSI list mapping */
struct ice_vsi_list_map_info *vsi_list_info; struct ice_vsi_list_map_info *vsi_list_info;
u16 vsi_count; u16 vsi_count;
#define ICE_INVAL_LG_ACT_INDEX 0xffff #define ICE_INVAL_LG_ACT_INDEX 0xffff
......
This diff is collapsed.
...@@ -45,6 +45,8 @@ ...@@ -45,6 +45,8 @@
#define ICE_TX_FLAGS_HW_VLAN BIT(1) #define ICE_TX_FLAGS_HW_VLAN BIT(1)
#define ICE_TX_FLAGS_SW_VLAN BIT(2) #define ICE_TX_FLAGS_SW_VLAN BIT(2)
#define ICE_TX_FLAGS_VLAN_M 0xffff0000 #define ICE_TX_FLAGS_VLAN_M 0xffff0000
#define ICE_TX_FLAGS_VLAN_PR_M 0xe0000000
#define ICE_TX_FLAGS_VLAN_PR_S 29
#define ICE_TX_FLAGS_VLAN_S 16 #define ICE_TX_FLAGS_VLAN_S 16
#define ICE_RX_DMA_ATTR \ #define ICE_RX_DMA_ATTR \
...@@ -160,6 +162,9 @@ struct ice_ring { ...@@ -160,6 +162,9 @@ struct ice_ring {
}; };
u16 q_index; /* Queue number of ring */ u16 q_index; /* Queue number of ring */
u32 txq_teid; /* Added Tx queue TEID */ u32 txq_teid; /* Added Tx queue TEID */
#ifdef CONFIG_DCB
u8 dcb_tc; /* Traffic class of ring */
#endif /* CONFIG_DCB */
u16 count; /* Number of descriptors */ u16 count; /* Number of descriptors */
u16 reg_idx; /* HW register index of the ring */ u16 reg_idx; /* HW register index of the ring */
......
This diff is collapsed.
...@@ -48,10 +48,10 @@ enum ice_virtchnl_cap { ...@@ -48,10 +48,10 @@ enum ice_virtchnl_cap {
struct ice_vf { struct ice_vf {
struct ice_pf *pf; struct ice_pf *pf;
s16 vf_id; /* VF id in the PF space */ s16 vf_id; /* VF ID in the PF space */
u32 driver_caps; /* reported by VF driver */ u32 driver_caps; /* reported by VF driver */
int first_vector_idx; /* first vector index of this VF */ int first_vector_idx; /* first vector index of this VF */
struct ice_sw *vf_sw_id; /* switch id the VF VSIs connect to */ struct ice_sw *vf_sw_id; /* switch ID the VF VSIs connect to */
struct virtchnl_version_info vf_ver; struct virtchnl_version_info vf_ver;
struct virtchnl_ether_addr dflt_lan_addr; struct virtchnl_ether_addr dflt_lan_addr;
u16 port_vlan_id; u16 port_vlan_id;
...@@ -59,10 +59,10 @@ struct ice_vf { ...@@ -59,10 +59,10 @@ struct ice_vf {
u8 trusted; u8 trusted;
u16 lan_vsi_idx; /* index into PF struct */ u16 lan_vsi_idx; /* index into PF struct */
u16 lan_vsi_num; /* ID as used by firmware */ u16 lan_vsi_num; /* ID as used by firmware */
u64 num_mdd_events; /* number of mdd events detected */ u64 num_mdd_events; /* number of MDD events detected */
u64 num_inval_msgs; /* number of continuous invalid msgs */ u64 num_inval_msgs; /* number of continuous invalid msgs */
u64 num_valid_msgs; /* number of valid msgs detected */ u64 num_valid_msgs; /* number of valid msgs detected */
unsigned long vf_caps; /* vf's adv. capabilities */ unsigned long vf_caps; /* VF's adv. capabilities */
DECLARE_BITMAP(vf_states, ICE_VF_STATES_NBITS); /* VF runtime states */ DECLARE_BITMAP(vf_states, ICE_VF_STATES_NBITS); /* VF runtime states */
unsigned int tx_rate; /* Tx bandwidth limit in Mbps */ unsigned int tx_rate; /* Tx bandwidth limit in Mbps */
u8 link_forced; u8 link_forced;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment