Skip to content

Commit 1a1f4a2

Browse files
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 40GbE Intel Wired LAN Driver Updates 2018-04-30 This series contains updates to i40e and i40evf only. Jia-Ju Bai replaces an instance of GFP_ATOMIC to GFP_KERNEL, since i40evf is not in atomic context when i40evf_add_vlan() is called. Jake cleans up function header comments to ensure that the function parameter comments actually match the function parameters. Fixed a possible overflow error in the PTP clock code. Fixed warnings regarding restricted __be32 type usage. Mariusz fixes the reading of the LLDP configuration, which moves from using relative values to calculating the absolute address. Jakub adds a check for 10G LR mode for i40e. Paweł fixes an issue, where changing the MTU would turn on TSO, GSO and GRO. Alex fixes a couple of issues with the UDP tunnel filter configuration. First being that the tunnels did not have mutual exclusion in place to prevent a race condition between a user request to add/remove a port and an update. The second issue was we were deleting filters that were not associated with the actual filter we wanted to delete. Harshitha ensures that the queue map sent by the VF is taken into account when enabling/disabling queues in the VF VSI. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 8231bee + bf1099b commit 1a1f4a2

21 files changed

+401
-129
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,12 @@ struct i40e_tc_configuration {
310310
struct i40e_tc_info tc_info[I40E_MAX_TRAFFIC_CLASS];
311311
};
312312

313+
#define I40E_UDP_PORT_INDEX_UNUSED 255
313314
struct i40e_udp_port_config {
314315
/* AdminQ command interface expects port number in Host byte order */
315316
u16 port;
316317
u8 type;
318+
u8 filter_index;
317319
};
318320

319321
/* macros related to FLX_PIT */
@@ -584,7 +586,7 @@ struct i40e_pf {
584586
unsigned long ptp_tx_start;
585587
struct hwtstamp_config tstamp_config;
586588
struct mutex tmreg_lock; /* Used to protect the SYSTIME registers. */
587-
u64 ptp_base_adj;
589+
u32 ptp_adj_mult;
588590
u32 tx_hwtstamp_timeouts;
589591
u32 tx_hwtstamp_skipped;
590592
u32 rx_hwtstamp_cleared;
@@ -985,6 +987,9 @@ void i40e_service_event_schedule(struct i40e_pf *pf);
985987
void i40e_notify_client_of_vf_msg(struct i40e_vsi *vsi, u32 vf_id,
986988
u8 *msg, u16 len);
987989

990+
int i40e_control_wait_tx_q(int seid, struct i40e_pf *pf, int pf_q, bool is_xdp,
991+
bool enable);
992+
int i40e_control_wait_rx_q(struct i40e_pf *pf, int pf_q, bool enable);
988993
int i40e_vsi_start_rings(struct i40e_vsi *vsi);
989994
void i40e_vsi_stop_rings(struct i40e_vsi *vsi);
990995
void i40e_vsi_stop_rings_no_wait(struct i40e_vsi *vsi);

drivers/net/ethernet/intel/i40e/i40e_client.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static struct i40e_ops i40e_lan_ops = {
4040
/**
4141
* i40e_client_get_params - Get the params that can change at runtime
4242
* @vsi: the VSI with the message
43-
* @param: clinet param struct
43+
* @params: client param struct
4444
*
4545
**/
4646
static
@@ -566,7 +566,7 @@ static int i40e_client_virtchnl_send(struct i40e_info *ldev,
566566
* i40e_client_setup_qvlist
567567
* @ldev: pointer to L2 context.
568568
* @client: Client pointer.
569-
* @qv_info: queue and vector list
569+
* @qvlist_info: queue and vector list
570570
*
571571
* Return 0 on success or < 0 on error
572572
**/
@@ -641,7 +641,7 @@ static int i40e_client_setup_qvlist(struct i40e_info *ldev,
641641
* i40e_client_request_reset
642642
* @ldev: pointer to L2 context.
643643
* @client: Client pointer.
644-
* @level: reset level
644+
* @reset_level: reset level
645645
**/
646646
static void i40e_client_request_reset(struct i40e_info *ldev,
647647
struct i40e_client *client,

drivers/net/ethernet/intel/i40e/i40e_common.c

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,8 @@ enum i40e_status_code i40e_aq_set_phy_config(struct i40e_hw *hw,
16711671
/**
16721672
* i40e_set_fc
16731673
* @hw: pointer to the hw struct
1674+
* @aq_failures: buffer to return AdminQ failure information
1675+
* @atomic_restart: whether to enable atomic link restart
16741676
*
16751677
* Set the requested flow control mode using set_phy_config.
16761678
**/
@@ -2807,8 +2809,8 @@ i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 seid,
28072809
* @mr_list: list of mirrored VSI SEIDs or VLAN IDs
28082810
* @cmd_details: pointer to command details structure or NULL
28092811
* @rule_id: Rule ID returned from FW
2810-
* @rule_used: Number of rules used in internal switch
2811-
* @rule_free: Number of rules free in internal switch
2812+
* @rules_used: Number of rules used in internal switch
2813+
* @rules_free: Number of rules free in internal switch
28122814
*
28132815
* Add/Delete a mirror rule to a specific switch. Mirror rules are supported for
28142816
* VEBs/VEPA elements only
@@ -2868,8 +2870,8 @@ static i40e_status i40e_mirrorrule_op(struct i40e_hw *hw,
28682870
* @mr_list: list of mirrored VSI SEIDs or VLAN IDs
28692871
* @cmd_details: pointer to command details structure or NULL
28702872
* @rule_id: Rule ID returned from FW
2871-
* @rule_used: Number of rules used in internal switch
2872-
* @rule_free: Number of rules free in internal switch
2873+
* @rules_used: Number of rules used in internal switch
2874+
* @rules_free: Number of rules free in internal switch
28732875
*
28742876
* Add mirror rule. Mirror rules are supported for VEBs or VEPA elements only
28752877
**/
@@ -2899,8 +2901,8 @@ i40e_status i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
28992901
* add_mirrorrule.
29002902
* @mr_list: list of mirrored VLAN IDs to be removed
29012903
* @cmd_details: pointer to command details structure or NULL
2902-
* @rule_used: Number of rules used in internal switch
2903-
* @rule_free: Number of rules free in internal switch
2904+
* @rules_used: Number of rules used in internal switch
2905+
* @rules_free: Number of rules free in internal switch
29042906
*
29052907
* Delete a mirror rule. Mirror rules are supported for VEBs/VEPA elements only
29062908
**/
@@ -3648,6 +3650,8 @@ i40e_status i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent,
36483650
/**
36493651
* i40e_aq_start_lldp
36503652
* @hw: pointer to the hw struct
3653+
* @buff: buffer for result
3654+
* @buff_size: buffer size
36513655
* @cmd_details: pointer to command details structure or NULL
36523656
*
36533657
* Start the embedded LLDP Agent on all ports.
@@ -3728,7 +3732,6 @@ i40e_status i40e_aq_get_cee_dcb_config(struct i40e_hw *hw,
37283732
* i40e_aq_add_udp_tunnel
37293733
* @hw: pointer to the hw struct
37303734
* @udp_port: the UDP port to add in Host byte order
3731-
* @header_len: length of the tunneling header length in DWords
37323735
* @protocol_index: protocol index type
37333736
* @filter_index: pointer to filter index
37343737
* @cmd_details: pointer to command details structure or NULL
@@ -3947,6 +3950,7 @@ i40e_status i40e_aq_config_vsi_tc_bw(struct i40e_hw *hw,
39473950
* @hw: pointer to the hw struct
39483951
* @seid: seid of the switching component connected to Physical Port
39493952
* @ets_data: Buffer holding ETS parameters
3953+
* @opcode: Tx scheduler AQ command opcode
39503954
* @cmd_details: pointer to command details structure or NULL
39513955
**/
39523956
i40e_status i40e_aq_config_switch_comp_ets(struct i40e_hw *hw,
@@ -4290,10 +4294,10 @@ i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,
42904294
* @hw: pointer to the hw struct
42914295
* @seid: VSI seid to add ethertype filter from
42924296
**/
4293-
#define I40E_FLOW_CONTROL_ETHTYPE 0x8808
42944297
void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw,
42954298
u16 seid)
42964299
{
4300+
#define I40E_FLOW_CONTROL_ETHTYPE 0x8808
42974301
u16 flag = I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC |
42984302
I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP |
42994303
I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX;
@@ -4424,6 +4428,7 @@ void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status)
44244428
* @ret_buff_size: actual buffer size returned
44254429
* @ret_next_table: next block to read
44264430
* @ret_next_index: next index to read
4431+
* @cmd_details: pointer to command details structure or NULL
44274432
*
44284433
* Dump internal FW/HW data for debug purposes.
44294434
*
@@ -4550,7 +4555,7 @@ i40e_status i40e_aq_configure_partition_bw(struct i40e_hw *hw,
45504555
* i40e_read_phy_register_clause22
45514556
* @hw: pointer to the HW structure
45524557
* @reg: register address in the page
4553-
* @phy_adr: PHY address on MDIO interface
4558+
* @phy_addr: PHY address on MDIO interface
45544559
* @value: PHY register value
45554560
*
45564561
* Reads specified PHY register value
@@ -4595,7 +4600,7 @@ i40e_status i40e_read_phy_register_clause22(struct i40e_hw *hw,
45954600
* i40e_write_phy_register_clause22
45964601
* @hw: pointer to the HW structure
45974602
* @reg: register address in the page
4598-
* @phy_adr: PHY address on MDIO interface
4603+
* @phy_addr: PHY address on MDIO interface
45994604
* @value: PHY register value
46004605
*
46014606
* Writes specified PHY register value
@@ -4636,7 +4641,7 @@ i40e_status i40e_write_phy_register_clause22(struct i40e_hw *hw,
46364641
* @hw: pointer to the HW structure
46374642
* @page: registers page number
46384643
* @reg: register address in the page
4639-
* @phy_adr: PHY address on MDIO interface
4644+
* @phy_addr: PHY address on MDIO interface
46404645
* @value: PHY register value
46414646
*
46424647
* Reads specified PHY register value
@@ -4710,7 +4715,7 @@ i40e_status i40e_read_phy_register_clause45(struct i40e_hw *hw,
47104715
* @hw: pointer to the HW structure
47114716
* @page: registers page number
47124717
* @reg: register address in the page
4713-
* @phy_adr: PHY address on MDIO interface
4718+
* @phy_addr: PHY address on MDIO interface
47144719
* @value: PHY register value
47154720
*
47164721
* Writes value to specified PHY register
@@ -4777,7 +4782,7 @@ i40e_status i40e_write_phy_register_clause45(struct i40e_hw *hw,
47774782
* @hw: pointer to the HW structure
47784783
* @page: registers page number
47794784
* @reg: register address in the page
4780-
* @phy_adr: PHY address on MDIO interface
4785+
* @phy_addr: PHY address on MDIO interface
47814786
* @value: PHY register value
47824787
*
47834788
* Writes value to specified PHY register
@@ -4813,7 +4818,7 @@ i40e_status i40e_write_phy_register(struct i40e_hw *hw,
48134818
* @hw: pointer to the HW structure
48144819
* @page: registers page number
48154820
* @reg: register address in the page
4816-
* @phy_adr: PHY address on MDIO interface
4821+
* @phy_addr: PHY address on MDIO interface
48174822
* @value: PHY register value
48184823
*
48194824
* Reads specified PHY register value
@@ -4848,7 +4853,6 @@ i40e_status i40e_read_phy_register(struct i40e_hw *hw,
48484853
* i40e_get_phy_address
48494854
* @hw: pointer to the HW structure
48504855
* @dev_num: PHY port num that address we want
4851-
* @phy_addr: Returned PHY address
48524856
*
48534857
* Gets PHY address for current port
48544858
**/
@@ -5058,7 +5062,9 @@ i40e_status i40e_led_get_phy(struct i40e_hw *hw, u16 *led_addr,
50585062
* i40e_led_set_phy
50595063
* @hw: pointer to the HW structure
50605064
* @on: true or false
5065+
* @led_addr: address of led register to use
50615066
* @mode: original val plus bit for set or ignore
5067+
*
50625068
* Set led's on or off when controlled by the PHY
50635069
*
50645070
**/
@@ -5347,6 +5353,7 @@ i40e_status_code i40e_aq_write_ddp(struct i40e_hw *hw, void *buff,
53475353
* @hw: pointer to the hw struct
53485354
* @buff: command buffer (size in bytes = buff_size)
53495355
* @buff_size: buffer size in bytes
5356+
* @flags: AdminQ command flags
53505357
* @cmd_details: pointer to command details structure or NULL
53515358
**/
53525359
enum

drivers/net/ethernet/intel/i40e/i40e_dcb.c

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,70 @@ i40e_status i40e_init_dcb(struct i40e_hw *hw)
920920
return ret;
921921
}
922922

923+
/**
924+
* _i40e_read_lldp_cfg - generic read of LLDP Configuration data from NVM
925+
* @hw: pointer to the HW structure
926+
* @lldp_cfg: pointer to hold lldp configuration variables
927+
* @module: address of the module pointer
928+
* @word_offset: offset of LLDP configuration
929+
*
930+
* Reads the LLDP configuration data from NVM using passed addresses
931+
**/
932+
static i40e_status _i40e_read_lldp_cfg(struct i40e_hw *hw,
933+
struct i40e_lldp_variables *lldp_cfg,
934+
u8 module, u32 word_offset)
935+
{
936+
u32 address, offset = (2 * word_offset);
937+
i40e_status ret;
938+
__le16 raw_mem;
939+
u16 mem;
940+
941+
ret = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
942+
if (ret)
943+
return ret;
944+
945+
ret = i40e_aq_read_nvm(hw, 0x0, module * 2, sizeof(raw_mem), &raw_mem,
946+
true, NULL);
947+
i40e_release_nvm(hw);
948+
if (ret)
949+
return ret;
950+
951+
mem = le16_to_cpu(raw_mem);
952+
/* Check if this pointer needs to be read in word size or 4K sector
953+
* units.
954+
*/
955+
if (mem & I40E_PTR_TYPE)
956+
address = (0x7FFF & mem) * 4096;
957+
else
958+
address = (0x7FFF & mem) * 2;
959+
960+
ret = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
961+
if (ret)
962+
goto err_lldp_cfg;
963+
964+
ret = i40e_aq_read_nvm(hw, module, offset, sizeof(raw_mem), &raw_mem,
965+
true, NULL);
966+
i40e_release_nvm(hw);
967+
if (ret)
968+
return ret;
969+
970+
mem = le16_to_cpu(raw_mem);
971+
offset = mem + word_offset;
972+
offset *= 2;
973+
974+
ret = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
975+
if (ret)
976+
goto err_lldp_cfg;
977+
978+
ret = i40e_aq_read_nvm(hw, 0, address + offset,
979+
sizeof(struct i40e_lldp_variables), lldp_cfg,
980+
true, NULL);
981+
i40e_release_nvm(hw);
982+
983+
err_lldp_cfg:
984+
return ret;
985+
}
986+
923987
/**
924988
* i40e_read_lldp_cfg - read LLDP Configuration data from NVM
925989
* @hw: pointer to the HW structure
@@ -931,21 +995,34 @@ i40e_status i40e_read_lldp_cfg(struct i40e_hw *hw,
931995
struct i40e_lldp_variables *lldp_cfg)
932996
{
933997
i40e_status ret = 0;
934-
u32 offset = (2 * I40E_NVM_LLDP_CFG_PTR);
998+
u32 mem;
935999

9361000
if (!lldp_cfg)
9371001
return I40E_ERR_PARAM;
9381002

9391003
ret = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
9401004
if (ret)
941-
goto err_lldp_cfg;
1005+
return ret;
9421006

943-
ret = i40e_aq_read_nvm(hw, I40E_SR_EMP_MODULE_PTR, offset,
944-
sizeof(struct i40e_lldp_variables),
945-
(u8 *)lldp_cfg,
946-
true, NULL);
1007+
ret = i40e_aq_read_nvm(hw, I40E_SR_NVM_CONTROL_WORD, 0, sizeof(mem),
1008+
&mem, true, NULL);
9471009
i40e_release_nvm(hw);
1010+
if (ret)
1011+
return ret;
1012+
1013+
/* Read a bit that holds information whether we are running flat or
1014+
* structured NVM image. Flat image has LLDP configuration in shadow
1015+
* ram, so there is a need to pass different addresses for both cases.
1016+
*/
1017+
if (mem & I40E_SR_NVM_MAP_STRUCTURE_TYPE) {
1018+
/* Flat NVM case */
1019+
ret = _i40e_read_lldp_cfg(hw, lldp_cfg, I40E_SR_EMP_MODULE_PTR,
1020+
I40E_SR_LLDP_CFG_PTR);
1021+
} else {
1022+
/* Good old structured NVM image */
1023+
ret = _i40e_read_lldp_cfg(hw, lldp_cfg, I40E_EMP_MODULE_PTR,
1024+
I40E_NVM_LLDP_CFG_PTR);
1025+
}
9481026

949-
err_lldp_cfg:
9501027
return ret;
9511028
}

drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static void i40e_get_pfc_delay(struct i40e_hw *hw, u16 *delay)
2323

2424
/**
2525
* i40e_dcbnl_ieee_getets - retrieve local IEEE ETS configuration
26-
* @netdev: the corresponding netdev
26+
* @dev: the corresponding netdev
2727
* @ets: structure to hold the ETS information
2828
*
2929
* Returns local IEEE ETS configuration
@@ -62,8 +62,8 @@ static int i40e_dcbnl_ieee_getets(struct net_device *dev,
6262

6363
/**
6464
* i40e_dcbnl_ieee_getpfc - retrieve local IEEE PFC configuration
65-
* @netdev: the corresponding netdev
66-
* @ets: structure to hold the PFC information
65+
* @dev: the corresponding netdev
66+
* @pfc: structure to hold the PFC information
6767
*
6868
* Returns local IEEE PFC configuration
6969
**/
@@ -95,7 +95,7 @@ static int i40e_dcbnl_ieee_getpfc(struct net_device *dev,
9595

9696
/**
9797
* i40e_dcbnl_getdcbx - retrieve current DCBx capability
98-
* @netdev: the corresponding netdev
98+
* @dev: the corresponding netdev
9999
*
100100
* Returns DCBx capability features
101101
**/
@@ -108,7 +108,8 @@ static u8 i40e_dcbnl_getdcbx(struct net_device *dev)
108108

109109
/**
110110
* i40e_dcbnl_get_perm_hw_addr - MAC address used by DCBx
111-
* @netdev: the corresponding netdev
111+
* @dev: the corresponding netdev
112+
* @perm_addr: buffer to store the MAC address
112113
*
113114
* Returns the SAN MAC address used for LLDP exchange
114115
**/

drivers/net/ethernet/intel/i40e/i40e_debugfs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ static struct dentry *i40e_dbg_root;
1212

1313
/**
1414
* i40e_dbg_find_vsi - searches for the vsi with the given seid
15-
* @pf - the PF structure to search for the vsi
16-
* @seid - seid of the vsi it is searching for
15+
* @pf: the PF structure to search for the vsi
16+
* @seid: seid of the vsi it is searching for
1717
**/
1818
static struct i40e_vsi *i40e_dbg_find_vsi(struct i40e_pf *pf, int seid)
1919
{
@@ -31,8 +31,8 @@ static struct i40e_vsi *i40e_dbg_find_vsi(struct i40e_pf *pf, int seid)
3131

3232
/**
3333
* i40e_dbg_find_veb - searches for the veb with the given seid
34-
* @pf - the PF structure to search for the veb
35-
* @seid - seid of the veb it is searching for
34+
* @pf: the PF structure to search for the veb
35+
* @seid: seid of the veb it is searching for
3636
**/
3737
static struct i40e_veb *i40e_dbg_find_veb(struct i40e_pf *pf, int seid)
3838
{

0 commit comments

Comments
 (0)