Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4825a4e4 authored by David S. Miller's avatar David S. Miller
Browse files


Jeff Kirsher says:

====================
40GbE Intel Wired LAN Driver Updates 2016-08-19

This series contains updates to i40e and i40evf only.

Jake provides several patches, first just moves a function to co-locate
the two functions related to configuring RSS via the admin queue, which
should help in spotting bugs when comparing the two functions.  Fixed
an issue where commit e69ff813 ("i40e: rework the functions to
configure RSS with similar parameters") missed checking whether the seed
is NULL before using it and did not use the passed in *lut parameter.
Fixed an issue where a previous refactor missed i40e_vsi_config_rss()
and the values were being ignored, so checked for the fields and used
them instead of default values.  Lastly replaced calls to
create_singlethread_workqueue() with alloc_workqueue() to provide more
control over workqueue creation and allows explicit setting of the
desired mode of operation.

Mitch adds link speed to log messages and reports speed through ethtool.

Carolyn refactors tail bump check and fixes byte ordering problems found
when enabling this feature support.  Adds support for HMC resources and
profile commands for x722 firmware.

Heinrich Schuchardt fixes format identifiers from %u to %d since the
variable is defined as an integer.

Catherine fixes an issue where there was a race condition between the
completion of the client open and calls to the client ops, so ensured
that client ops are not called until we are sure client is open.

Harshitha makes sure that i40e_client_release() does not try to use
an adapter pointer which may not be initialized, so make sure it is.

Joe Perches fixes the use of the local macro XSTRINGIFY() to use
__stringify() instead.

Avinash corrects the mutex usage in client_subtask().  Fixed the RDMA
client to open again after reset since it is closed during a PF reset.

Jeff (me) clean up whitespace issues, where indentation was done
inconsistently and with spaces versus tabs.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 6afb1e28 bf3a178c
Loading
Loading
Loading
Loading
+66 −69
Original line number Diff line number Diff line
@@ -120,10 +120,6 @@
#define I40E_CURRENT_NVM_VERSION_HI	0x2
#define I40E_CURRENT_NVM_VERSION_LO	0x40

/* magic for getting defines into strings */
#define STRINGIFY(foo)  #foo
#define XSTRINGIFY(bar) STRINGIFY(bar)

#define I40E_RX_DESC(R, i)	\
	(&(((union i40e_32byte_rx_desc *)((R)->desc))[i]))
#define I40E_TX_DESC(R, i)	\
@@ -541,6 +537,7 @@ struct i40e_vsi {
	u8  *rss_hkey_user;	/* User configured hash keys */
	u8  *rss_lut_user;	/* User configured lookup table entries */


	u16 max_frame;
	u16 rx_buf_len;

+42 −17
Original line number Diff line number Diff line
@@ -204,6 +204,9 @@ enum i40e_admin_queue_opc {
	i40e_aqc_opc_suspend_port_tx				= 0x041B,
	i40e_aqc_opc_resume_port_tx				= 0x041C,
	i40e_aqc_opc_configure_partition_bw			= 0x041D,
	/* hmc */
	i40e_aqc_opc_query_hmc_resource_profile	= 0x0500,
	i40e_aqc_opc_set_hmc_resource_profile	= 0x0501,

	/* phy commands*/
	i40e_aqc_opc_get_phy_abilities		= 0x0600,
@@ -450,13 +453,15 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration);
/* Set ARP Proxy command / response (indirect 0x0104) */
struct i40e_aqc_arp_proxy_data {
	__le16	command_flags;
#define I40E_AQ_ARP_INIT_IPV4	0x0008
#define I40E_AQ_ARP_UNSUP_CTL	0x0010
#define I40E_AQ_ARP_ENA		0x0020
#define I40E_AQ_ARP_ADD_IPV4	0x0040
#define I40E_AQ_ARP_DEL_IPV4	0x0080
#define I40E_AQ_ARP_INIT_IPV4	0x0800
#define I40E_AQ_ARP_UNSUP_CTL	0x1000
#define I40E_AQ_ARP_ENA		0x2000
#define I40E_AQ_ARP_ADD_IPV4	0x4000
#define I40E_AQ_ARP_DEL_IPV4	0x8000
	__le16	table_id;
	__le32	pfpm_proxyfc;
	__le32	enabled_offloads;
#define I40E_AQ_ARP_DIRECTED_OFFLOAD_ENABLE	0x00000020
#define I40E_AQ_ARP_OFFLOAD_ENABLE		0x00000800
	__le32	ip_addr;
	u8	mac_addr[6];
	u8	reserved[2];
@@ -471,17 +476,19 @@ struct i40e_aqc_ns_proxy_data {
	__le16	table_idx_ipv6_0;
	__le16	table_idx_ipv6_1;
	__le16	control;
#define I40E_AQ_NS_PROXY_ADD_0		0x0100
#define I40E_AQ_NS_PROXY_DEL_0		0x0200
#define I40E_AQ_NS_PROXY_ADD_1		0x0400
#define I40E_AQ_NS_PROXY_DEL_1		0x0800
#define I40E_AQ_NS_PROXY_ADD_IPV6_0	0x1000
#define I40E_AQ_NS_PROXY_DEL_IPV6_0	0x2000
#define I40E_AQ_NS_PROXY_ADD_IPV6_1	0x4000
#define I40E_AQ_NS_PROXY_DEL_IPV6_1	0x8000
#define I40E_AQ_NS_PROXY_COMMAND_SEQ	0x0001
#define I40E_AQ_NS_PROXY_INIT_IPV6_TBL	0x0002
#define I40E_AQ_NS_PROXY_INIT_MAC_TBL	0x0004
#define I40E_AQ_NS_PROXY_ADD_0		0x0001
#define I40E_AQ_NS_PROXY_DEL_0		0x0002
#define I40E_AQ_NS_PROXY_ADD_1		0x0004
#define I40E_AQ_NS_PROXY_DEL_1		0x0008
#define I40E_AQ_NS_PROXY_ADD_IPV6_0	0x0010
#define I40E_AQ_NS_PROXY_DEL_IPV6_0	0x0020
#define I40E_AQ_NS_PROXY_ADD_IPV6_1	0x0040
#define I40E_AQ_NS_PROXY_DEL_IPV6_1	0x0080
#define I40E_AQ_NS_PROXY_COMMAND_SEQ	0x0100
#define I40E_AQ_NS_PROXY_INIT_IPV6_TBL	0x0200
#define I40E_AQ_NS_PROXY_INIT_MAC_TBL	0x0400
#define I40E_AQ_NS_PROXY_OFFLOAD_ENABLE	0x0800
#define I40E_AQ_NS_PROXY_DIRECTED_OFFLOAD_ENABLE	0x1000
	u8	mac_addr_0[6];
	u8	mac_addr_1[6];
	u8	local_mac_addr[6];
@@ -1582,6 +1589,24 @@ struct i40e_aqc_configure_partition_bw_data {

I40E_CHECK_STRUCT_LEN(0x22, i40e_aqc_configure_partition_bw_data);

/* Get and set the active HMC resource profile and status.
 * (direct 0x0500) and (direct 0x0501)
 */
struct i40e_aq_get_set_hmc_resource_profile {
	u8	pm_profile;
	u8	pe_vf_enabled;
	u8	reserved[14];
};

I40E_CHECK_CMD_LENGTH(i40e_aq_get_set_hmc_resource_profile);

enum i40e_aq_hmc_profile {
	/* I40E_HMC_PROFILE_NO_CHANGE	= 0, reserved */
	I40E_HMC_PROFILE_DEFAULT	= 1,
	I40E_HMC_PROFILE_FAVOR_VF	= 2,
	I40E_HMC_PROFILE_EQUAL		= 3,
};

/* Get PHY Abilities (indirect 0x0600) uses the generic indirect struct */

/* set in param0 for get phy abilities to report qualified modules */
+28 −2
Original line number Diff line number Diff line
@@ -148,6 +148,11 @@ i40e_notify_client_of_vf_msg(struct i40e_vsi *vsi, u32 vf_id, u8 *msg, u16 len)
					"Cannot locate client instance virtual channel receive routine\n");
				continue;
			}
			if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,
				      &cdev->state)) {
				dev_dbg(&vsi->back->pdev->dev, "Client is not open, abort virtchnl_receive\n");
				continue;
			}
			cdev->client->ops->virtchnl_receive(&cdev->lan_info,
							    cdev->client,
							    vf_id, msg, len);
@@ -181,6 +186,11 @@ void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi)
					"Cannot locate client instance l2_param_change routine\n");
				continue;
			}
			if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,
				      &cdev->state)) {
				dev_dbg(&vsi->back->pdev->dev, "Client is not open, abort l2 param change\n");
				continue;
			}
			cdev->lan_info.params = params;
			cdev->client->ops->l2_param_change(&cdev->lan_info,
							   cdev->client,
@@ -298,6 +308,11 @@ void i40e_notify_client_of_vf_reset(struct i40e_pf *pf, u32 vf_id)
					"Cannot locate client instance VF reset routine\n");
				continue;
			}
			if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,
				      &cdev->state)) {
				dev_dbg(&pf->pdev->dev, "Client is not open, abort vf-reset\n");
				continue;
			}
			cdev->client->ops->vf_reset(&cdev->lan_info,
						    cdev->client, vf_id);
		}
@@ -328,6 +343,11 @@ void i40e_notify_client_of_vf_enable(struct i40e_pf *pf, u32 num_vfs)
					"Cannot locate client instance VF enable routine\n");
				continue;
			}
			if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,
				      &cdev->state)) {
				dev_dbg(&pf->pdev->dev, "Client is not open, abort vf-enable\n");
				continue;
			}
			cdev->client->ops->vf_enable(&cdev->lan_info,
						     cdev->client, num_vfs);
		}
@@ -362,6 +382,11 @@ int i40e_vf_client_capable(struct i40e_pf *pf, u32 vf_id,
					"Cannot locate client instance VF capability routine\n");
				continue;
			}
			if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,
				      &cdev->state)) {
				dev_dbg(&pf->pdev->dev, "Client is not open, abort vf-capable\n");
				continue;
			}
			capable = cdev->client->ops->vf_capable(&cdev->lan_info,
								cdev->client,
								vf_id);
@@ -551,6 +576,7 @@ void i40e_client_subtask(struct i40e_pf *pf)
			set_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);
		} else {
			/* remove client instance */
			mutex_unlock(&i40e_client_instance_mutex);
			i40e_client_del_instance(pf, client);
			atomic_dec(&client->ref_cnt);
			continue;
@@ -637,7 +663,7 @@ int i40e_lan_del_device(struct i40e_pf *pf)
static int i40e_client_release(struct i40e_client *client)
{
	struct i40e_client_instance *cdev, *tmp;
	struct i40e_pf *pf = NULL;
	struct i40e_pf *pf;
	int ret = 0;

	LIST_HEAD(cdevs_tmp);
@@ -647,12 +673,12 @@ static int i40e_client_release(struct i40e_client *client)
		if (strncmp(cdev->client->name, client->name,
			    I40E_CLIENT_STR_LENGTH))
			continue;
		pf = (struct i40e_pf *)cdev->lan_info.pf;
		if (test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) {
			if (atomic_read(&cdev->ref_cnt) > 0) {
				ret = I40E_ERR_NOT_READY;
				goto out;
			}
			pf = (struct i40e_pf *)cdev->lan_info.pf;
			if (client->ops && client->ops->close)
				client->ops->close(&cdev->lan_info, client,
						   false);
+3 −3
Original line number Diff line number Diff line
@@ -36,9 +36,9 @@
#define I40E_CLIENT_VERSION_MINOR 01
#define I40E_CLIENT_VERSION_BUILD 00
#define I40E_CLIENT_VERSION_STR     \
	XSTRINGIFY(I40E_CLIENT_VERSION_MAJOR) "." \
	XSTRINGIFY(I40E_CLIENT_VERSION_MINOR) "." \
	XSTRINGIFY(I40E_CLIENT_VERSION_BUILD)
	__stringify(I40E_CLIENT_VERSION_MAJOR) "." \
	__stringify(I40E_CLIENT_VERSION_MINOR) "." \
	__stringify(I40E_CLIENT_VERSION_BUILD)

struct i40e_client_version {
	u8 major;
+13 −13
Original line number Diff line number Diff line
@@ -1560,13 +1560,13 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
		}
#endif
		for (i = 0; i < vsi->num_queue_pairs; i++) {
			snprintf(p, ETH_GSTRING_LEN, "tx-%u.tx_packets", i);
			snprintf(p, ETH_GSTRING_LEN, "tx-%d.tx_packets", i);
			p += ETH_GSTRING_LEN;
			snprintf(p, ETH_GSTRING_LEN, "tx-%u.tx_bytes", i);
			snprintf(p, ETH_GSTRING_LEN, "tx-%d.tx_bytes", i);
			p += ETH_GSTRING_LEN;
			snprintf(p, ETH_GSTRING_LEN, "rx-%u.rx_packets", i);
			snprintf(p, ETH_GSTRING_LEN, "rx-%d.rx_packets", i);
			p += ETH_GSTRING_LEN;
			snprintf(p, ETH_GSTRING_LEN, "rx-%u.rx_bytes", i);
			snprintf(p, ETH_GSTRING_LEN, "rx-%d.rx_bytes", i);
			p += ETH_GSTRING_LEN;
		}
		if (vsi != pf->vsi[pf->lan_vsi] || pf->hw.partition_id != 1)
@@ -1581,16 +1581,16 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
			}
			for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
				snprintf(p, ETH_GSTRING_LEN,
					 "veb.tc_%u_tx_packets", i);
					 "veb.tc_%d_tx_packets", i);
				p += ETH_GSTRING_LEN;
				snprintf(p, ETH_GSTRING_LEN,
					 "veb.tc_%u_tx_bytes", i);
					 "veb.tc_%d_tx_bytes", i);
				p += ETH_GSTRING_LEN;
				snprintf(p, ETH_GSTRING_LEN,
					 "veb.tc_%u_rx_packets", i);
					 "veb.tc_%d_rx_packets", i);
				p += ETH_GSTRING_LEN;
				snprintf(p, ETH_GSTRING_LEN,
					 "veb.tc_%u_rx_bytes", i);
					 "veb.tc_%d_rx_bytes", i);
				p += ETH_GSTRING_LEN;
			}
		}
@@ -1601,23 +1601,23 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
		}
		for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
			snprintf(p, ETH_GSTRING_LEN,
				 "port.tx_priority_%u_xon", i);
				 "port.tx_priority_%d_xon", i);
			p += ETH_GSTRING_LEN;
			snprintf(p, ETH_GSTRING_LEN,
				 "port.tx_priority_%u_xoff", i);
				 "port.tx_priority_%d_xoff", i);
			p += ETH_GSTRING_LEN;
		}
		for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
			snprintf(p, ETH_GSTRING_LEN,
				 "port.rx_priority_%u_xon", i);
				 "port.rx_priority_%d_xon", i);
			p += ETH_GSTRING_LEN;
			snprintf(p, ETH_GSTRING_LEN,
				 "port.rx_priority_%u_xoff", i);
				 "port.rx_priority_%d_xoff", i);
			p += ETH_GSTRING_LEN;
		}
		for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
			snprintf(p, ETH_GSTRING_LEN,
				 "port.rx_priority_%u_xon_2_xoff", i);
				 "port.rx_priority_%d_xon_2_xoff", i);
			p += ETH_GSTRING_LEN;
		}
		/* BUG_ON(p - data != I40E_STATS_LEN * ETH_GSTRING_LEN); */
Loading