Skip to content

Commit d96112b

Browse files
committed
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 2018-10-01 This series contains updates to ice driver only. Anirudh provides several changes to "prep" the driver for upcoming features. Specifically, the functions that are used for PF VSI/netdev setup will also be used in SR-IOV support and to allow the reuse of these functions, code needs to move. Dave provides the only other change in the series, updates the driver to protect the reset patch in its entirety. This is done by adding the various bit checks to determine if a reset is scheduled/initiated and whether it came from the software or firmware. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 804fe10 + 5df7e45 commit d96112b

File tree

7 files changed

+2773
-2649
lines changed

7 files changed

+2773
-2649
lines changed

drivers/net/ethernet/intel/ice/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ ice-y := ice_main.o \
1313
ice_nvm.o \
1414
ice_switch.o \
1515
ice_sched.o \
16+
ice_lib.o \
1617
ice_txrx.o \
1718
ice_ethtool.o

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ enum ice_state {
124124
__ICE_DOWN,
125125
__ICE_NEEDS_RESTART,
126126
__ICE_PREPARED_FOR_RESET, /* set by driver when prepared */
127-
__ICE_RESET_RECOVERY_PENDING, /* set by driver when reset starts */
127+
__ICE_RESET_OICR_RECV, /* set by driver after rcv reset OICR */
128128
__ICE_PFR_REQ, /* set by driver and peers */
129129
__ICE_CORER_REQ, /* set by driver and peers */
130130
__ICE_GLOBR_REQ, /* set by driver and peers */

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2652,3 +2652,64 @@ ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_id, u8 tc_bitmap,
26522652
return ice_cfg_vsi_qs(pi, vsi_id, tc_bitmap, max_lanqs,
26532653
ICE_SCHED_NODE_OWNER_LAN);
26542654
}
2655+
2656+
/**
2657+
* ice_stat_update40 - read 40 bit stat from the chip and update stat values
2658+
* @hw: ptr to the hardware info
2659+
* @hireg: high 32 bit HW register to read from
2660+
* @loreg: low 32 bit HW register to read from
2661+
* @prev_stat_loaded: bool to specify if previous stats are loaded
2662+
* @prev_stat: ptr to previous loaded stat value
2663+
* @cur_stat: ptr to current stat value
2664+
*/
2665+
void ice_stat_update40(struct ice_hw *hw, u32 hireg, u32 loreg,
2666+
bool prev_stat_loaded, u64 *prev_stat, u64 *cur_stat)
2667+
{
2668+
u64 new_data;
2669+
2670+
new_data = rd32(hw, loreg);
2671+
new_data |= ((u64)(rd32(hw, hireg) & 0xFFFF)) << 32;
2672+
2673+
/* device stats are not reset at PFR, they likely will not be zeroed
2674+
* when the driver starts. So save the first values read and use them as
2675+
* offsets to be subtracted from the raw values in order to report stats
2676+
* that count from zero.
2677+
*/
2678+
if (!prev_stat_loaded)
2679+
*prev_stat = new_data;
2680+
if (new_data >= *prev_stat)
2681+
*cur_stat = new_data - *prev_stat;
2682+
else
2683+
/* to manage the potential roll-over */
2684+
*cur_stat = (new_data + BIT_ULL(40)) - *prev_stat;
2685+
*cur_stat &= 0xFFFFFFFFFFULL;
2686+
}
2687+
2688+
/**
2689+
* ice_stat_update32 - read 32 bit stat from the chip and update stat values
2690+
* @hw: ptr to the hardware info
2691+
* @reg: HW register to read from
2692+
* @prev_stat_loaded: bool to specify if previous stats are loaded
2693+
* @prev_stat: ptr to previous loaded stat value
2694+
* @cur_stat: ptr to current stat value
2695+
*/
2696+
void ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
2697+
u64 *prev_stat, u64 *cur_stat)
2698+
{
2699+
u32 new_data;
2700+
2701+
new_data = rd32(hw, reg);
2702+
2703+
/* device stats are not reset at PFR, they likely will not be zeroed
2704+
* when the driver starts. So save the first values read and use them as
2705+
* offsets to be subtracted from the raw values in order to report stats
2706+
* that count from zero.
2707+
*/
2708+
if (!prev_stat_loaded)
2709+
*prev_stat = new_data;
2710+
if (new_data >= *prev_stat)
2711+
*cur_stat = new_data - *prev_stat;
2712+
else
2713+
/* to manage the potential roll-over */
2714+
*cur_stat = (new_data + BIT_ULL(32)) - *prev_stat;
2715+
}

drivers/net/ethernet/intel/ice/ice_common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,8 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_id, u8 tc, u8 num_qgrps,
9696
struct ice_aqc_add_tx_qgrp *buf, u16 buf_size,
9797
struct ice_sq_cd *cd);
9898
void ice_output_fw_log(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf);
99+
void ice_stat_update40(struct ice_hw *hw, u32 hireg, u32 loreg,
100+
bool prev_stat_loaded, u64 *prev_stat, u64 *cur_stat);
101+
void ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
102+
u64 *prev_stat, u64 *cur_stat);
99103
#endif /* _ICE_COMMON_H_ */

0 commit comments

Comments
 (0)