Skip to content

Commit 2b1a7f7

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 2020-05-22 This series contains updates to virtchnl and the ice driver. Geert Uytterhoeven fixes a data structure alignment issue in the virtchnl structures. Henry adds Flow Director support which allows for the redirection on ntuple rules over six patches. Initially Henry adds the initial infrastructure for Flow Director, and then later adds IPv4 and IPv6 support, as well as being able to display the ntuple rules. Bret add Accelerated Receive Flow Steering (aRFS) support which is used to steer receive flows to a specific queue. Fixes a transmit timeout when the VF link transitions from up/down/up because the transmit and receive queue interrupts are not enabled as part of VF's link up. Fixed an issue when the default VF LAN address is changed and after reset the PF will attempt to add the new MAC, which fails because it already exists. This causes the VF to be disabled completely until it is removed and enabled via sysfs. Anirudh (Ani) makes a fix where the ice driver needs to call set_mac_cfg to enable jumbo frames, so ensure it gets called during initialization and after reset. Fix bad register reads during a register dump in ethtool by removing the bad registers. Paul fixes an issue where the receive Malicious Driver Detection (MDD) auto reset message was not being logged because it occurred after the VF reset. Victor adds a check for compatibility between the Dynamic Device Personalization (DDP) package and the NIC firmware to ensure that everything aligns. Jesse fixes a administrative queue string call with the appropriate error reporting variable. Also fixed the loop variables that are comparing or assigning signed against unsigned values. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 098205f + c1e0883 commit 2b1a7f7

33 files changed

Lines changed: 5407 additions & 113 deletions

‎drivers/net/ethernet/intel/ice/Makefile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ ice-y := ice_main.o \
1818
ice_txrx_lib.o \
1919
ice_txrx.o \
2020
ice_fltr.o \
21+
ice_fdir.o \
22+
ice_ethtool_fdir.o \
2123
ice_flex_pipe.o \
2224
ice_flow.o \
2325
ice_devlink.o \
2426
ice_ethtool.o
2527
ice-$(CONFIG_PCI_IOV) += ice_virtchnl_pf.o ice_sriov.o
2628
ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o
29+
ice-$(CONFIG_RFS_ACCEL) += ice_arfs.o
2730
ice-$(CONFIG_XDP_SOCKETS) += ice_xsk.o

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

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <linux/ctype.h>
3535
#include <linux/bpf.h>
3636
#include <linux/avf/virtchnl.h>
37+
#include <linux/cpu_rmap.h>
3738
#include <net/devlink.h>
3839
#include <net/ipv6.h>
3940
#include <net/xdp_sock.h>
@@ -50,7 +51,9 @@
5051
#include "ice_sched.h"
5152
#include "ice_virtchnl_pf.h"
5253
#include "ice_sriov.h"
54+
#include "ice_fdir.h"
5355
#include "ice_xsk.h"
56+
#include "ice_arfs.h"
5457

5558
extern const char ice_drv_ver[];
5659
#define ICE_BAR0 0
@@ -66,6 +69,7 @@ extern const char ice_drv_ver[];
6669
#define ICE_AQ_LEN 64
6770
#define ICE_MBXSQ_LEN 64
6871
#define ICE_MIN_MSIX 2
72+
#define ICE_FDIR_MSIX 1
6973
#define ICE_NO_VSI 0xffff
7074
#define ICE_VSI_MAP_CONTIG 0
7175
#define ICE_VSI_MAP_SCATTER 1
@@ -94,6 +98,7 @@ extern const char ice_drv_ver[];
9498
#define ICE_TX_DESC(R, i) (&(((struct ice_tx_desc *)((R)->desc))[i]))
9599
#define ICE_RX_DESC(R, i) (&(((union ice_32b_rx_flex_desc *)((R)->desc))[i]))
96100
#define ICE_TX_CTX_DESC(R, i) (&(((struct ice_tx_ctx_desc *)((R)->desc))[i]))
101+
#define ICE_TX_FDIRDESC(R, i) (&(((struct ice_fltr_desc *)((R)->desc))[i]))
97102

98103
/* Macro for each VSI in a PF */
99104
#define ice_for_each_vsi(pf, i) \
@@ -214,6 +219,7 @@ enum ice_state {
214219
__ICE_CFG_BUSY,
215220
__ICE_SERVICE_SCHED,
216221
__ICE_SERVICE_DIS,
222+
__ICE_FD_FLUSH_REQ,
217223
__ICE_OICR_INTR_DIS, /* Global OICR interrupt disabled */
218224
__ICE_MDD_VF_PRINT_PENDING, /* set when MDD event handle */
219225
__ICE_VF_RESETS_DISABLED, /* disable resets during ice_remove */
@@ -257,6 +263,8 @@ struct ice_vsi {
257263
s16 vf_id; /* VF ID for SR-IOV VSIs */
258264

259265
u16 ethtype; /* Ethernet protocol for pause frame */
266+
u16 num_gfltr;
267+
u16 num_bfltr;
260268

261269
/* RSS config */
262270
u16 rss_table_size; /* HW RSS table size */
@@ -265,6 +273,14 @@ struct ice_vsi {
265273
u8 *rss_lut_user; /* User configured lookup table entries */
266274
u8 rss_lut_type; /* used to configure Get/Set RSS LUT AQ call */
267275

276+
/* aRFS members only allocated for the PF VSI */
277+
#define ICE_MAX_ARFS_LIST 1024
278+
#define ICE_ARFS_LST_MASK (ICE_MAX_ARFS_LIST - 1)
279+
struct hlist_head *arfs_fltr_list;
280+
struct ice_arfs_active_fltr_cntrs *arfs_fltr_cntrs;
281+
spinlock_t arfs_lock; /* protects aRFS hash table and filter state */
282+
atomic_t *arfs_last_fltr_id;
283+
268284
u16 max_frame;
269285
u16 rx_buf_len;
270286

@@ -339,6 +355,7 @@ enum ice_pf_flags {
339355
ICE_FLAG_SRIOV_CAPABLE,
340356
ICE_FLAG_DCB_CAPABLE,
341357
ICE_FLAG_DCB_ENA,
358+
ICE_FLAG_FD_ENA,
342359
ICE_FLAG_ADV_FEATURES,
343360
ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA,
344361
ICE_FLAG_NO_MEDIA,
@@ -367,6 +384,8 @@ struct ice_pf {
367384
*/
368385
u16 sriov_base_vector;
369386

387+
u16 ctrl_vsi_idx; /* control VSI index in pf->vsi array */
388+
370389
struct ice_vsi **vsi; /* VSIs created by the driver */
371390
struct ice_sw *first_sw; /* first switch created by firmware */
372391
/* Virtchnl/SR-IOV config info */
@@ -505,8 +524,27 @@ static inline struct ice_vsi *ice_get_main_vsi(struct ice_pf *pf)
505524
return NULL;
506525
}
507526

527+
/**
528+
* ice_get_ctrl_vsi - Get the control VSI
529+
* @pf: PF instance
530+
*/
531+
static inline struct ice_vsi *ice_get_ctrl_vsi(struct ice_pf *pf)
532+
{
533+
/* if pf->ctrl_vsi_idx is ICE_NO_VSI, control VSI was not set up */
534+
if (!pf->vsi || pf->ctrl_vsi_idx == ICE_NO_VSI)
535+
return NULL;
536+
537+
return pf->vsi[pf->ctrl_vsi_idx];
538+
}
539+
540+
#define ICE_FD_STAT_CTR_BLOCK_COUNT 256
541+
#define ICE_FD_STAT_PF_IDX(base_idx) \
542+
((base_idx) * ICE_FD_STAT_CTR_BLOCK_COUNT)
543+
#define ICE_FD_SB_STAT_IDX(base_idx) ICE_FD_STAT_PF_IDX(base_idx)
544+
508545
int ice_vsi_setup_tx_rings(struct ice_vsi *vsi);
509546
int ice_vsi_setup_rx_rings(struct ice_vsi *vsi);
547+
int ice_vsi_open_ctrl(struct ice_vsi *vsi);
510548
void ice_set_ethtool_ops(struct net_device *netdev);
511549
void ice_set_ethtool_safe_mode_ops(struct net_device *netdev);
512550
u16 ice_get_avail_txq_count(struct ice_pf *pf);
@@ -530,7 +568,22 @@ int ice_schedule_reset(struct ice_pf *pf, enum ice_reset_req reset);
530568
void ice_print_link_msg(struct ice_vsi *vsi, bool isup);
531569
const char *ice_stat_str(enum ice_status stat_err);
532570
const char *ice_aq_str(enum ice_aq_err aq_err);
571+
int
572+
ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add,
573+
bool is_tun);
574+
void ice_vsi_manage_fdir(struct ice_vsi *vsi, bool ena);
575+
int ice_add_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd);
576+
int ice_del_fdir_ethtool(struct ice_vsi *vsi, struct ethtool_rxnfc *cmd);
577+
int ice_get_ethtool_fdir_entry(struct ice_hw *hw, struct ethtool_rxnfc *cmd);
578+
int
579+
ice_get_fdir_fltr_ids(struct ice_hw *hw, struct ethtool_rxnfc *cmd,
580+
u32 *rule_locs);
581+
void ice_fdir_release_flows(struct ice_hw *hw);
582+
void ice_fdir_replay_flows(struct ice_hw *hw);
583+
void ice_fdir_replay_fltrs(struct ice_pf *pf);
584+
int ice_fdir_create_dflt_rules(struct ice_pf *pf);
533585
int ice_open(struct net_device *netdev);
534586
int ice_stop(struct net_device *netdev);
587+
void ice_service_task_schedule(struct ice_pf *pf);
535588

536589
#endif /* _ICE_H_ */

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

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ struct ice_aqc_list_caps_elem {
107107
#define ICE_AQC_CAPS_RXQS 0x0041
108108
#define ICE_AQC_CAPS_TXQS 0x0042
109109
#define ICE_AQC_CAPS_MSIX 0x0043
110+
#define ICE_AQC_CAPS_FD 0x0045
110111
#define ICE_AQC_CAPS_MAX_MTU 0x0047
111112

112113
u8 major_ver;
@@ -232,6 +233,11 @@ struct ice_aqc_get_sw_cfg_resp {
232233
*/
233234
#define ICE_AQC_RES_TYPE_VSI_LIST_REP 0x03
234235
#define ICE_AQC_RES_TYPE_VSI_LIST_PRUNE 0x04
236+
#define ICE_AQC_RES_TYPE_FDIR_COUNTER_BLOCK 0x21
237+
#define ICE_AQC_RES_TYPE_FDIR_GUARANTEED_ENTRIES 0x22
238+
#define ICE_AQC_RES_TYPE_FDIR_SHARED_ENTRIES 0x23
239+
#define ICE_AQC_RES_TYPE_FD_PROF_BLDR_PROFID 0x58
240+
#define ICE_AQC_RES_TYPE_FD_PROF_BLDR_TCAM 0x59
235241
#define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_PROFID 0x60
236242
#define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_TCAM 0x61
237243

@@ -240,6 +246,9 @@ struct ice_aqc_get_sw_cfg_resp {
240246

241247
#define ICE_AQC_RES_TYPE_FLAG_DEDICATED 0x00
242248

249+
#define ICE_AQC_RES_TYPE_S 0
250+
#define ICE_AQC_RES_TYPE_M (0x07F << ICE_AQC_RES_TYPE_S)
251+
243252
/* Allocate Resources command (indirect 0x0208)
244253
* Free Resources command (indirect 0x0209)
245254
*/
@@ -1059,6 +1068,25 @@ struct ice_aqc_set_phy_cfg_data {
10591068
u8 rsvd1;
10601069
};
10611070

1071+
/* Set MAC Config command data structure (direct 0x0603) */
1072+
struct ice_aqc_set_mac_cfg {
1073+
__le16 max_frame_size;
1074+
u8 params;
1075+
#define ICE_AQ_SET_MAC_PACE_S 3
1076+
#define ICE_AQ_SET_MAC_PACE_M (0xF << ICE_AQ_SET_MAC_PACE_S)
1077+
#define ICE_AQ_SET_MAC_PACE_TYPE_M BIT(7)
1078+
#define ICE_AQ_SET_MAC_PACE_TYPE_RATE 0
1079+
#define ICE_AQ_SET_MAC_PACE_TYPE_FIXED ICE_AQ_SET_MAC_PACE_TYPE_M
1080+
u8 tx_tmr_priority;
1081+
__le16 tx_tmr_value;
1082+
__le16 fc_refresh_threshold;
1083+
u8 drop_opts;
1084+
#define ICE_AQ_SET_MAC_AUTO_DROP_MASK BIT(0)
1085+
#define ICE_AQ_SET_MAC_AUTO_DROP_NONE 0
1086+
#define ICE_AQ_SET_MAC_AUTO_DROP_BLOCKING_PKTS BIT(0)
1087+
u8 reserved[7];
1088+
};
1089+
10621090
/* Restart AN command data structure (direct 0x0605)
10631091
* Also used for response, with only the lport_num field present.
10641092
*/
@@ -1675,10 +1703,12 @@ struct ice_pkg_ver {
16751703
};
16761704

16771705
#define ICE_PKG_NAME_SIZE 32
1706+
#define ICE_SEG_NAME_SIZE 28
16781707

16791708
struct ice_aqc_get_pkg_info {
16801709
struct ice_pkg_ver ver;
1681-
char name[ICE_PKG_NAME_SIZE];
1710+
char name[ICE_SEG_NAME_SIZE];
1711+
__le32 track_id;
16821712
u8 is_in_nvm;
16831713
u8 is_active;
16841714
u8 is_active_at_boot;
@@ -1765,6 +1795,7 @@ struct ice_aq_desc {
17651795
struct ice_aqc_download_pkg download_pkg;
17661796
struct ice_aqc_set_mac_lb set_mac_lb;
17671797
struct ice_aqc_alloc_free_res_cmd sw_res_ctrl;
1798+
struct ice_aqc_set_mac_cfg set_mac_cfg;
17681799
struct ice_aqc_set_event_mask set_event_mask;
17691800
struct ice_aqc_get_link_status get_link_status;
17701801
struct ice_aqc_event_lan_overflow lan_overflow;
@@ -1861,6 +1892,7 @@ enum ice_adminq_opc {
18611892
/* PHY commands */
18621893
ice_aqc_opc_get_phy_caps = 0x0600,
18631894
ice_aqc_opc_set_phy_cfg = 0x0601,
1895+
ice_aqc_opc_set_mac_cfg = 0x0603,
18641896
ice_aqc_opc_restart_an = 0x0605,
18651897
ice_aqc_opc_get_link_status = 0x0607,
18661898
ice_aqc_opc_set_event_mask = 0x0613,

0 commit comments

Comments
 (0)