All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next 0/4][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-06
@ 2017-04-07  3:23 Jeff Kirsher
  2017-04-07  3:23 ` [net-next 1/4] i40e/i40evf: Add capability exchange for outer checksum Jeff Kirsher
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Jeff Kirsher @ 2017-04-07  3:23 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene

This series contains updates to i40e and i40evf.

Preethi adds support for the outer checksum and TSO offloads for
encapsulated packets for the VF.

Mitch fixes a possible memory leak, where we need to remove the client
instance when the driver unloads.  Also we need to check to see if the
client (i40iw) is already present during probe, and add a client instance
if necessary.  Lastly, make sure we close any attached clients when the
driver is removed or shut down to prevent a kernel panic.

The following are changes since commit dc423b6be10c56d0dd957caf307f12d16f728f07:
  Merge branch 'ftgmac-rework-batch2-rx-path'
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 40GbE

Mitch Williams (3):
  i40e: remove client instance on driver unload
  i40e: register existing client on probe
  i40e: close client on remove and shutdown

Preethi Banala (1):
  i40e/i40evf: Add capability exchange for outer checksum

 drivers/net/ethernet/intel/i40e/i40e_client.c      |  9 ++++
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 62 +++++++++++++---------
 drivers/net/ethernet/intel/i40e/i40e_virtchnl.h    |  3 +-
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |  7 +++
 drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h  |  3 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 61 +++++++++++----------
 .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    |  4 +-
 7 files changed, 93 insertions(+), 56 deletions(-)

-- 
2.12.2

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [net-next 1/4] i40e/i40evf: Add capability exchange for outer checksum
  2017-04-07  3:23 [net-next 0/4][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-06 Jeff Kirsher
@ 2017-04-07  3:23 ` Jeff Kirsher
  2017-04-07  6:38   ` Or Gerlitz
  2017-04-07  3:23 ` [net-next 2/4] i40e: remove client instance on driver unload Jeff Kirsher
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Jeff Kirsher @ 2017-04-07  3:23 UTC (permalink / raw)
  To: davem
  Cc: Preethi Banala, netdev, nhorman, sassmann, jogreene, Alan Brady,
	Jesse Brandeburg, Jacob Keller, Jeff Kirsher

From: Preethi Banala <preethi.banala@intel.com>

This patch adds a capability negotiation between VF and PF using ENCAP/
ENCAP_CSUM offload flags in order for the VF to support outer checksum
and TSO offloads for encapsulated packets. These capabilities were assumed
by default and enabled in current hardware. Going forward, these features
needs to be negotiated with PF before advertising to the stack.
Additionally, strip out the mac.type checks for X722 since outer checksums
are enabled based on the ENCAP_CSUM offload negotiation flag and maintain
consistency between drivers in how the features are configured.

Change-ID: Ie380a6f57eca557a2bb575b66b12fae36d308920
Signed-off-by: Preethi Banala <preethi.banala@intel.com>
Signed-off-by: Alan Brady <alan.brady@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 52 +++++++++---------
 drivers/net/ethernet/intel/i40e/i40e_virtchnl.h    |  3 +-
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |  7 +++
 drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h  |  3 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 61 ++++++++++++----------
 .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    |  4 +-
 6 files changed, 74 insertions(+), 56 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 703444e92964..7147c67a939d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -9253,6 +9253,8 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
 	u8 broadcast[ETH_ALEN];
 	u8 mac_addr[ETH_ALEN];
 	int etherdev_size;
+	netdev_features_t hw_enc_features;
+	netdev_features_t hw_features;
 
 	etherdev_size = sizeof(struct i40e_netdev_priv);
 	netdev = alloc_etherdev_mq(etherdev_size, vsi->alloc_queue_pairs);
@@ -9263,43 +9265,43 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
 	np = netdev_priv(netdev);
 	np->vsi = vsi;
 
-	netdev->hw_enc_features |= NETIF_F_SG			|
-				   NETIF_F_IP_CSUM		|
-				   NETIF_F_IPV6_CSUM		|
-				   NETIF_F_HIGHDMA		|
-				   NETIF_F_SOFT_FEATURES	|
-				   NETIF_F_TSO			|
-				   NETIF_F_TSO_ECN		|
-				   NETIF_F_TSO6			|
-				   NETIF_F_GSO_GRE		|
-				   NETIF_F_GSO_GRE_CSUM		|
-				   NETIF_F_GSO_IPXIP4		|
-				   NETIF_F_GSO_IPXIP6		|
-				   NETIF_F_GSO_UDP_TUNNEL	|
-				   NETIF_F_GSO_UDP_TUNNEL_CSUM	|
-				   NETIF_F_GSO_PARTIAL		|
-				   NETIF_F_SCTP_CRC		|
-				   NETIF_F_RXHASH		|
-				   NETIF_F_RXCSUM		|
-				   0;
+	hw_enc_features = NETIF_F_SG			|
+			  NETIF_F_IP_CSUM		|
+			  NETIF_F_IPV6_CSUM		|
+			  NETIF_F_HIGHDMA		|
+			  NETIF_F_SOFT_FEATURES		|
+			  NETIF_F_TSO			|
+			  NETIF_F_TSO_ECN		|
+			  NETIF_F_TSO6			|
+			  NETIF_F_GSO_GRE		|
+			  NETIF_F_GSO_GRE_CSUM		|
+			  NETIF_F_GSO_PARTIAL		|
+			  NETIF_F_GSO_UDP_TUNNEL	|
+			  NETIF_F_GSO_UDP_TUNNEL_CSUM	|
+			  NETIF_F_SCTP_CRC		|
+			  NETIF_F_RXHASH		|
+			  NETIF_F_RXCSUM		|
+			  0;
 
 	if (!(pf->flags & I40E_FLAG_OUTER_UDP_CSUM_CAPABLE))
 		netdev->gso_partial_features |= NETIF_F_GSO_UDP_TUNNEL_CSUM;
 
 	netdev->gso_partial_features |= NETIF_F_GSO_GRE_CSUM;
 
+	netdev->hw_enc_features |= hw_enc_features;
+
 	/* record features VLANs can make use of */
-	netdev->vlan_features |= netdev->hw_enc_features |
-				 NETIF_F_TSO_MANGLEID;
+	netdev->vlan_features |= hw_enc_features | NETIF_F_TSO_MANGLEID;
 
 	if (!(pf->flags & I40E_FLAG_MFP_ENABLED))
 		netdev->hw_features |= NETIF_F_NTUPLE;
+	hw_features = hw_enc_features		|
+		      NETIF_F_HW_VLAN_CTAG_TX	|
+		      NETIF_F_HW_VLAN_CTAG_RX;
 
-	netdev->hw_features |= netdev->hw_enc_features	|
-			       NETIF_F_HW_VLAN_CTAG_TX	|
-			       NETIF_F_HW_VLAN_CTAG_RX;
+	netdev->hw_features |= hw_features;
 
-	netdev->features |= netdev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER;
+	netdev->features |= hw_features | NETIF_F_HW_VLAN_CTAG_FILTER;
 	netdev->hw_enc_features |= NETIF_F_TSO_MANGLEID;
 
 	if (vsi->type == I40E_VSI_MAIN) {
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl.h
index 974ba2baf6ea..8552192a5bde 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl.h
@@ -163,7 +163,8 @@ struct i40e_virtchnl_vsi_resource {
 #define I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING	0x00020000
 #define I40E_VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2	0x00040000
 #define I40E_VIRTCHNL_VF_OFFLOAD_RSS_PF		0X00080000
-#define I40E_VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM	0X00100000
+#define I40E_VIRTCHNL_VF_OFFLOAD_ENCAP		0X00100000
+#define I40E_VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM	0X00200000
 
 #define I40E_VF_BASE_MODE_OFFLOADS (I40E_VIRTCHNL_VF_OFFLOAD_L2 | \
 				    I40E_VIRTCHNL_VF_OFFLOAD_VLAN | \
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index d526940ff951..65c95ffc15ec 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1408,6 +1408,13 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)
 				I40E_VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2;
 	}
 
+	if (vf->driver_caps & I40E_VIRTCHNL_VF_OFFLOAD_ENCAP)
+		vfres->vf_offload_flags |= I40E_VIRTCHNL_VF_OFFLOAD_ENCAP;
+
+	if ((pf->flags & I40E_FLAG_OUTER_UDP_CSUM_CAPABLE) &&
+	    (vf->driver_caps & I40E_VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM))
+		vfres->vf_offload_flags |= I40E_VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM;
+
 	if (vf->driver_caps & I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING) {
 		if (pf->flags & I40E_FLAG_MFP_ENABLED) {
 			dev_err(&pf->pdev->dev,
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h b/drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h
index f431fbc4a3e7..c5ad0388c3d5 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h
@@ -163,7 +163,8 @@ struct i40e_virtchnl_vsi_resource {
 #define I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING	0x00020000
 #define I40E_VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2	0x00040000
 #define I40E_VIRTCHNL_VF_OFFLOAD_RSS_PF		0X00080000
-#define I40E_VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM	0X00100000
+#define I40E_VIRTCHNL_VF_OFFLOAD_ENCAP		0X00100000
+#define I40E_VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM	0X00200000
 
 #define I40E_VF_BASE_MODE_OFFLOADS (I40E_VIRTCHNL_VF_OFFLOAD_L2 | \
 				    I40E_VIRTCHNL_VF_OFFLOAD_VLAN | \
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index fb2811c23024..c690aba8e8d1 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2401,6 +2401,8 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
 	struct net_device *netdev = adapter->netdev;
 	struct i40e_vsi *vsi = &adapter->vsi;
 	int i;
+	netdev_features_t hw_enc_features;
+	netdev_features_t hw_features;
 
 	/* got VF config message back from PF, now we can parse it */
 	for (i = 0; i < vfres->num_vsis; i++) {
@@ -2412,46 +2414,52 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
 		return -ENODEV;
 	}
 
-	netdev->hw_enc_features |= NETIF_F_SG			|
-				   NETIF_F_IP_CSUM		|
-				   NETIF_F_IPV6_CSUM		|
-				   NETIF_F_HIGHDMA		|
-				   NETIF_F_SOFT_FEATURES	|
-				   NETIF_F_TSO			|
-				   NETIF_F_TSO_ECN		|
-				   NETIF_F_TSO6			|
+	hw_enc_features = NETIF_F_SG			|
+			  NETIF_F_IP_CSUM		|
+			  NETIF_F_IPV6_CSUM		|
+			  NETIF_F_HIGHDMA		|
+			  NETIF_F_SOFT_FEATURES	|
+			  NETIF_F_TSO			|
+			  NETIF_F_TSO_ECN		|
+			  NETIF_F_TSO6			|
+			  NETIF_F_SCTP_CRC		|
+			  NETIF_F_RXHASH		|
+			  NETIF_F_RXCSUM		|
+			  0;
+
+	/* advertise to stack only if offloads for encapsulated packets is
+	 * supported
+	 */
+	if (vfres->vf_offload_flags & I40E_VIRTCHNL_VF_OFFLOAD_ENCAP) {
+		hw_enc_features |= NETIF_F_GSO_UDP_TUNNEL	|
 				   NETIF_F_GSO_GRE		|
 				   NETIF_F_GSO_GRE_CSUM		|
 				   NETIF_F_GSO_IPXIP4		|
 				   NETIF_F_GSO_IPXIP6		|
-				   NETIF_F_GSO_UDP_TUNNEL	|
 				   NETIF_F_GSO_UDP_TUNNEL_CSUM	|
 				   NETIF_F_GSO_PARTIAL		|
-				   NETIF_F_SCTP_CRC		|
-				   NETIF_F_RXHASH		|
-				   NETIF_F_RXCSUM		|
 				   0;
 
-	if (!(adapter->flags & I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE))
-		netdev->gso_partial_features |= NETIF_F_GSO_UDP_TUNNEL_CSUM;
-
-	netdev->gso_partial_features |= NETIF_F_GSO_GRE_CSUM;
+		if (!(vfres->vf_offload_flags &
+		      I40E_VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM))
+			netdev->gso_partial_features |=
+				NETIF_F_GSO_UDP_TUNNEL_CSUM;
 
+		netdev->gso_partial_features |= NETIF_F_GSO_GRE_CSUM;
+		netdev->hw_enc_features |= NETIF_F_TSO_MANGLEID;
+		netdev->hw_enc_features |= hw_enc_features;
+	}
 	/* record features VLANs can make use of */
-	netdev->vlan_features |= netdev->hw_enc_features |
-				 NETIF_F_TSO_MANGLEID;
+	netdev->vlan_features |= hw_enc_features | NETIF_F_TSO_MANGLEID;
 
 	/* Write features and hw_features separately to avoid polluting
-	 * with, or dropping, features that are set when we registgered.
+	 * with, or dropping, features that are set when we registered.
 	 */
-	netdev->hw_features |= netdev->hw_enc_features;
+	hw_features = hw_enc_features;
 
-	netdev->features |= netdev->hw_enc_features | I40EVF_VLAN_FEATURES;
-	netdev->hw_enc_features |= NETIF_F_TSO_MANGLEID;
+	netdev->hw_features |= hw_features;
 
-	/* disable VLAN features if not supported */
-	if (!(vfres->vf_offload_flags & I40E_VIRTCHNL_VF_OFFLOAD_VLAN))
-		netdev->features ^= I40EVF_VLAN_FEATURES;
+	netdev->features |= hw_features | I40EVF_VLAN_FEATURES;
 
 	adapter->vsi.id = adapter->vsi_res->vsi_id;
 
@@ -2592,9 +2600,6 @@ static void i40evf_init_task(struct work_struct *work)
 		goto err_alloc;
 	}
 
-	if (hw->mac.type == I40E_MAC_X722_VF)
-		adapter->flags |= I40EVF_FLAG_OUTER_UDP_CSUM_CAPABLE;
-
 	if (i40evf_process_config(adapter))
 		goto err_alloc;
 	adapter->current_op = I40E_VIRTCHNL_OP_UNKNOWN;
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
index 032be8d3928a..3bccfbb1db14 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c
@@ -159,7 +159,9 @@ int i40evf_send_vf_config_msg(struct i40evf_adapter *adapter)
 	       I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG |
 	       I40E_VIRTCHNL_VF_OFFLOAD_VLAN |
 	       I40E_VIRTCHNL_VF_OFFLOAD_WB_ON_ITR |
-	       I40E_VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2;
+	       I40E_VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2 |
+	       I40E_VIRTCHNL_VF_OFFLOAD_ENCAP |
+	       I40E_VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM;
 
 	adapter->current_op = I40E_VIRTCHNL_OP_GET_VF_RESOURCES;
 	adapter->aq_required &= ~I40EVF_FLAG_AQ_GET_CONFIG;
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [net-next 2/4] i40e: remove client instance on driver unload
  2017-04-07  3:23 [net-next 0/4][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-06 Jeff Kirsher
  2017-04-07  3:23 ` [net-next 1/4] i40e/i40evf: Add capability exchange for outer checksum Jeff Kirsher
@ 2017-04-07  3:23 ` Jeff Kirsher
  2017-04-07  3:23 ` [net-next 3/4] i40e: register existing client on probe Jeff Kirsher
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Jeff Kirsher @ 2017-04-07  3:23 UTC (permalink / raw)
  To: davem; +Cc: Mitch Williams, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Mitch Williams <mitch.a.williams@intel.com>

When the driver is unloaded, we need to remove the client instance,
otherwise we leak memory.

Change-ID: If1e7882ac1f6ce15d004722fafbe31afbe0adc9a
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_client.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c
index 191028b1489b..d05296a7078e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
@@ -459,6 +459,9 @@ int i40e_lan_del_device(struct i40e_pf *pf)
 	struct i40e_device *ldev, *tmp;
 	int ret = -ENODEV;
 
+	/* First, remove any client instance. */
+	i40e_client_del_instance(pf);
+
 	mutex_lock(&i40e_device_mutex);
 	list_for_each_entry_safe(ldev, tmp, &i40e_devices, list) {
 		if (ldev->pf == pf) {
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [net-next 3/4] i40e: register existing client on probe
  2017-04-07  3:23 [net-next 0/4][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-06 Jeff Kirsher
  2017-04-07  3:23 ` [net-next 1/4] i40e/i40evf: Add capability exchange for outer checksum Jeff Kirsher
  2017-04-07  3:23 ` [net-next 2/4] i40e: remove client instance on driver unload Jeff Kirsher
@ 2017-04-07  3:23 ` Jeff Kirsher
  2017-04-07  3:23 ` [net-next 4/4] i40e: close client on remove and shutdown Jeff Kirsher
  2017-04-07 12:43 ` [net-next 0/4][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-06 David Miller
  4 siblings, 0 replies; 8+ messages in thread
From: Jeff Kirsher @ 2017-04-07  3:23 UTC (permalink / raw)
  To: davem; +Cc: Mitch Williams, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Mitch Williams <mitch.a.williams@intel.com>

In some cases, a client (i40iw) may already be present when probe is
called. Check for this, and add a client instance if necessary.

Change-ID: I2009312694b7ad81f1023919e4c6c86181f21689
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_client.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c
index d05296a7078e..eb2896fd52a6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
@@ -436,6 +436,12 @@ int i40e_lan_add_device(struct i40e_pf *pf)
 		 pf->hw.pf_id, pf->hw.bus.bus_id,
 		 pf->hw.bus.device, pf->hw.bus.func);
 
+	/* If a client has already been registered, we need to add an instance
+	 * of it to our new LAN device.
+	 */
+	if (registered_client)
+		i40e_client_add_instance(pf);
+
 	/* Since in some cases register may have happened before a device gets
 	 * added, we can schedule a subtask to go initiate the clients if
 	 * they can be launched at probe time.
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [net-next 4/4] i40e: close client on remove and shutdown
  2017-04-07  3:23 [net-next 0/4][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-06 Jeff Kirsher
                   ` (2 preceding siblings ...)
  2017-04-07  3:23 ` [net-next 3/4] i40e: register existing client on probe Jeff Kirsher
@ 2017-04-07  3:23 ` Jeff Kirsher
  2017-04-07 12:43 ` [net-next 0/4][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-06 David Miller
  4 siblings, 0 replies; 8+ messages in thread
From: Jeff Kirsher @ 2017-04-07  3:23 UTC (permalink / raw)
  To: davem; +Cc: Mitch Williams, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Mitch Williams <mitch.a.williams@intel.com>

When the driver is removed or shut down, close any attached clients
(i.e. i40iw). This prevents a panic seen sometimes on forced driver
removal or system shutdown when iWarp is running.

Change-ID: I4f6161e5a73ffbb2fd5883567b007310302bfcb5
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 7147c67a939d..d83430faaa41 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -11395,6 +11395,11 @@ static void i40e_remove(struct pci_dev *pdev)
 	if (pf->service_task.func)
 		cancel_work_sync(&pf->service_task);
 
+	/* Client close must be called explicitly here because the timer
+	 * has been stopped.
+	 */
+	i40e_notify_client_of_netdev_close(pf->vsi[pf->lan_vsi], false);
+
 	if (pf->flags & I40E_FLAG_SRIOV_ENABLED) {
 		i40e_free_vfs(pf);
 		pf->flags &= ~I40E_FLAG_SRIOV_ENABLED;
@@ -11635,6 +11640,11 @@ static void i40e_shutdown(struct pci_dev *pdev)
 	cancel_work_sync(&pf->service_task);
 	i40e_fdir_teardown(pf);
 
+	/* Client close must be called explicitly here because the timer
+	 * has been stopped.
+	 */
+	i40e_notify_client_of_netdev_close(pf->vsi[pf->lan_vsi], false);
+
 	if (pf->wol_en && (pf->flags & I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE))
 		i40e_enable_mc_magic_wake(pf);
 
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [net-next 1/4] i40e/i40evf: Add capability exchange for outer checksum
  2017-04-07  3:23 ` [net-next 1/4] i40e/i40evf: Add capability exchange for outer checksum Jeff Kirsher
@ 2017-04-07  6:38   ` Or Gerlitz
  2017-04-07 13:27     ` Alexander Duyck
  0 siblings, 1 reply; 8+ messages in thread
From: Or Gerlitz @ 2017-04-07  6:38 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: David Miller, Preethi Banala, Linux Netdev List, nhorman,
	sassmann, jogreene, Alan Brady, Jesse Brandeburg, Jacob Keller

On Fri, Apr 7, 2017 at 6:23 AM, Jeff Kirsher
<jeffrey.t.kirsher@intel.com> wrote:
> From: Preethi Banala <preethi.banala@intel.com>
>
> This patch adds a capability negotiation between VF and PF using ENCAP/
> ENCAP_CSUM offload flags in order for the VF to support outer checksum
> and TSO offloads for encapsulated packets.

[...]
-#define I40E_VIRTCHNL_VF_OFFLOAD_    0X00100000
+#define I40E_VIRTCHNL_VF_OFFLOAD_ENCAP         0X00100000
+#define I40E_VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM    0X00200000

what happens when one of the PF or VF doesn't have this hunk, e.g one
assumes value X and one assumes value Y for ENCAP_CSUM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [net-next 0/4][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-06
  2017-04-07  3:23 [net-next 0/4][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-06 Jeff Kirsher
                   ` (3 preceding siblings ...)
  2017-04-07  3:23 ` [net-next 4/4] i40e: close client on remove and shutdown Jeff Kirsher
@ 2017-04-07 12:43 ` David Miller
  4 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2017-04-07 12:43 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu,  6 Apr 2017 20:23:21 -0700

> This series contains updates to i40e and i40evf.

Pulled, thanks Jeff.

Please have someone address Or's feedback about the csum capability
bits.  Thank you.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [net-next 1/4] i40e/i40evf: Add capability exchange for outer checksum
  2017-04-07  6:38   ` Or Gerlitz
@ 2017-04-07 13:27     ` Alexander Duyck
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Duyck @ 2017-04-07 13:27 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: Jeff Kirsher, David Miller, Preethi Banala, Linux Netdev List,
	nhorman, sassmann, jogreene, Alan Brady, Jesse Brandeburg,
	Jacob Keller

On Thu, Apr 6, 2017 at 11:38 PM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
> On Fri, Apr 7, 2017 at 6:23 AM, Jeff Kirsher
> <jeffrey.t.kirsher@intel.com> wrote:
>> From: Preethi Banala <preethi.banala@intel.com>
>>
>> This patch adds a capability negotiation between VF and PF using ENCAP/
>> ENCAP_CSUM offload flags in order for the VF to support outer checksum
>> and TSO offloads for encapsulated packets.
>
> [...]
> -#define I40E_VIRTCHNL_VF_OFFLOAD_    0X00100000
> +#define I40E_VIRTCHNL_VF_OFFLOAD_ENCAP         0X00100000
> +#define I40E_VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM    0X00200000
>
> what happens when one of the PF or VF doesn't have this hunk, e.g one
> assumes value X and one assumes value Y for ENCAP_CSUM

The way the capability exchange works is that the VF advertises what
it wants and the PF does an AND of that value and a bitmask of what
the PF supports. The VF then receives the result and has to work with
that. So a legacy PF driver will cause the VF to drop support for
something like this because these bits are not supported.

That way both the PF and VF should know what to expect from each other
in terms of what is supported without it being implied based on the VF
device IDs.

- Alex

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-04-07 13:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-07  3:23 [net-next 0/4][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-06 Jeff Kirsher
2017-04-07  3:23 ` [net-next 1/4] i40e/i40evf: Add capability exchange for outer checksum Jeff Kirsher
2017-04-07  6:38   ` Or Gerlitz
2017-04-07 13:27     ` Alexander Duyck
2017-04-07  3:23 ` [net-next 2/4] i40e: remove client instance on driver unload Jeff Kirsher
2017-04-07  3:23 ` [net-next 3/4] i40e: register existing client on probe Jeff Kirsher
2017-04-07  3:23 ` [net-next 4/4] i40e: close client on remove and shutdown Jeff Kirsher
2017-04-07 12:43 ` [net-next 0/4][pull request] 40GbE Intel Wired LAN Driver Updates 2017-04-06 David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.