All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates
@ 2016-09-14 23:24 Bimmy Pujari
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 1/9] i40e: Fix client interaction Bimmy Pujari
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: Bimmy Pujari @ 2016-09-14 23:24 UTC (permalink / raw)
  To: intel-wired-lan

Alan Brady adds code to fix interrupt affinity bug.

Alexander Duyck rewrites Flow Director busy wait loop, removes unused 
function i40e_vsi_lookup and drops code for unsupported flow types.

Bimmy Pujari changes version from 1.6.16 to 1.6.19

Carolyn Wyborny adds code to fix client interaction.

Filip Sadowski adds code for bit test mask correction.

Mitch Williams adds code to reopen client after reset.

Preethi Banala adds code for group based mode VF offload flags.

 drivers/net/ethernet/intel/i40e/i40e.h            |  4 +-
 drivers/net/ethernet/intel/i40e/i40e_client.c     | 85 +++++------------------
 drivers/net/ethernet/intel/i40e/i40e_client.h     |  2 -
 drivers/net/ethernet/intel/i40e/i40e_common.c     |  2 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c       | 66 ++++++++++++++----
 drivers/net/ethernet/intel/i40e/i40e_txrx.c       | 80 ++++++++++-----------
 drivers/net/ethernet/intel/i40e/i40e_virtchnl.h   |  4 ++
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c     | 31 +++++++--
 drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h |  4 ++
 drivers/net/ethernet/intel/i40evf/i40evf.h        |  3 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c   | 73 +++++++++++++------
 11 files changed, 198 insertions(+), 156 deletions(-)

-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S47 1/9] i40e: Fix client interaction
  2016-09-14 23:24 [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates Bimmy Pujari
@ 2016-09-14 23:24 ` Bimmy Pujari
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 2/9] i40e: Rewrite Flow Director busy wait loop Bimmy Pujari
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 18+ messages in thread
From: Bimmy Pujari @ 2016-09-14 23:24 UTC (permalink / raw)
  To: intel-wired-lan

From: Carolyn Wyborny <carolyn.wyborny@intel.com>

This patch fixes a problem in the client interface that
was causing random stack traces in RDMA driver load and
unload tests.  This patch fixes the problem by checking
for an existing client before trying to open it.  Without
this patch, there is a timing related null pointer deref.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Change-ID: Ib73d30671a27f6f9770dd53b3e5292b88d6b62da
---
Testing Hints:  See HSD for repro script

 drivers/net/ethernet/intel/i40e/i40e_client.c | 29 ++++++++++++---------------
 1 file changed, 13 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c
index 250db0b..6ffac03 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
@@ -565,7 +565,7 @@ void i40e_client_subtask(struct i40e_pf *pf)
 			if (test_bit(__I40E_DOWN, &pf->vsi[pf->lan_vsi]->state))
 				continue;
 		} else {
-			dev_warn(&pf->pdev->dev, "This client %s is being instanciated at probe\n",
+			dev_warn(&pf->pdev->dev, "This client %s is being instantiated at probe\n",
 				 client->name);
 		}
 
@@ -582,24 +582,21 @@ void i40e_client_subtask(struct i40e_pf *pf)
 			dev_info(&pf->pdev->dev, "Added instance of Client %s to PF%d bus=0x%02x func=0x%02x\n",
 				 client->name, pf->hw.pf_id,
 				 pf->hw.bus.device, pf->hw.bus.func);
-		}
-
-		mutex_lock(&i40e_client_instance_mutex);
-		/* Send an Open request to the client */
-		atomic_inc(&cdev->ref_cnt);
-		if (client->ops && client->ops->open)
-			ret = client->ops->open(&cdev->lan_info, client);
-		atomic_dec(&cdev->ref_cnt);
-		if (!ret) {
+			mutex_lock(&i40e_client_instance_mutex);
+			atomic_inc(&cdev->ref_cnt);
+			if (client->ops && client->ops->open)
+				ret = client->ops->open(&cdev->lan_info,
+							client);
+			atomic_dec(&cdev->ref_cnt);
+			if (ret < 0) {
+				mutex_unlock(&i40e_client_instance_mutex);
+				i40e_client_del_instance(pf, client);
+				atomic_dec(&client->ref_cnt);
+				continue;
+			}
 			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;
 		}
-		mutex_unlock(&i40e_client_instance_mutex);
 	}
 	mutex_unlock(&i40e_client_mutex);
 }
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S47 2/9] i40e: Rewrite Flow Director busy wait loop
  2016-09-14 23:24 [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates Bimmy Pujari
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 1/9] i40e: Fix client interaction Bimmy Pujari
@ 2016-09-14 23:24 ` Bimmy Pujari
  2016-09-22 17:25   ` Bowers, AndrewX
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 3/9] i40e: Bit test mask correction Bimmy Pujari
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Bimmy Pujari @ 2016-09-14 23:24 UTC (permalink / raw)
  To: intel-wired-lan

From: Alexander Duyck <alexander.h.duyck@intel.com>

We can reorder the busy wait loop at the start of the Flow Director
transmit function to reduce the overall code size while still retaining the
same functionality.  As such I am taking advantage of the opportunity to do
so.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Change-ID: I34c403ca001953c6ac9816e65d5305e73d869026
---
Testing Hints:
        Verify Flow Director still functional for adding/deleting rules.

 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 9b82240..d1c3a3a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -122,7 +122,6 @@ static int i40e_program_fdir_filter(struct i40e_fdir_filter *fdir_data,
 	struct device *dev;
 	dma_addr_t dma;
 	u32 td_cmd = 0;
-	u16 delay = 0;
 	u16 i;
 
 	/* find existing FDIR VSI */
@@ -137,15 +136,11 @@ static int i40e_program_fdir_filter(struct i40e_fdir_filter *fdir_data,
 	dev = tx_ring->dev;
 
 	/* we need two descriptors to add/del a filter and we can wait */
-	do {
-		if (I40E_DESC_UNUSED(tx_ring) > 1)
-			break;
+	for (i = I40E_FD_CLEAN_DELAY; I40E_DESC_UNUSED(tx_ring) < 2; i--) {
+		if (!i)
+			return -EAGAIN;
 		msleep_interruptible(1);
-		delay++;
-	} while (delay < I40E_FD_CLEAN_DELAY);
-
-	if (!(I40E_DESC_UNUSED(tx_ring) > 1))
-		return -EAGAIN;
+	}
 
 	dma = dma_map_single(dev, raw_packet,
 			     I40E_FDIR_MAX_RAW_PACKET_SIZE, DMA_TO_DEVICE);
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S47 3/9] i40e: Bit test mask correction
  2016-09-14 23:24 [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates Bimmy Pujari
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 1/9] i40e: Fix client interaction Bimmy Pujari
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 2/9] i40e: Rewrite Flow Director busy wait loop Bimmy Pujari
@ 2016-09-14 23:24 ` Bimmy Pujari
  2016-09-21 17:15   ` Bowers, AndrewX
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 4/9] i40e: Remove unused function i40e_vsi_lookup Bimmy Pujari
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Bimmy Pujari @ 2016-09-14 23:24 UTC (permalink / raw)
  To: intel-wired-lan

From: Filip Sadowski <filip.sadowski@intel.com>

Incorrect bit mask was used for testing "get link status" response.
Instead of I40E_AQ_LSE_ENABLE (which is actually 0x03) it most probably
should be I40E_AQ_LSE_IS_ENABLED (which is defined as 0x01).

Signed-off-by: Filip Sadowski <filip.sadowski@intel.com>
Change-ID: Ia199142906720507f847de3a33a25c61a9781b2f
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 2154a34..fe8100b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -1849,7 +1849,7 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
 	else
 		hw_link_info->crc_enable = false;
 
-	if (resp->command_flags & cpu_to_le16(I40E_AQ_LSE_ENABLE))
+	if (resp->command_flags & cpu_to_le16(I40E_AQ_LSE_IS_ENABLED))
 		hw_link_info->lse_enable = true;
 	else
 		hw_link_info->lse_enable = false;
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S47 4/9] i40e: Remove unused function i40e_vsi_lookup
  2016-09-14 23:24 [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates Bimmy Pujari
                   ` (2 preceding siblings ...)
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 3/9] i40e: Bit test mask correction Bimmy Pujari
@ 2016-09-14 23:24 ` Bimmy Pujari
  2016-09-21 17:22   ` Bowers, AndrewX
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 5/9] i40e: Drop code for unsupported flow types Bimmy Pujari
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Bimmy Pujari @ 2016-09-14 23:24 UTC (permalink / raw)
  To: intel-wired-lan

From: Alexander Duyck <alexander.h.duyck@intel.com>

The function is not used so there is no need to carry it forward.  I have
plans to add a slightly different function that can be inlined to handle
the same kind of functionality.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Change-ID: Ie2dfcb189dc75e5fbc156bac23003e3b4210ae0f
---
Testing Hints:
        Verify driver builds without issues under various configurations.

 drivers/net/ethernet/intel/i40e/i40e.h        |  2 --
 drivers/net/ethernet/intel/i40e/i40e_client.c | 31 ---------------------------
 2 files changed, 33 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index dfc52a9..29bc649 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -732,8 +732,6 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi);
 struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
 				u16 uplink, u32 param1);
 int i40e_vsi_release(struct i40e_vsi *vsi);
-struct i40e_vsi *i40e_vsi_lookup(struct i40e_pf *pf, enum i40e_vsi_type type,
-				 struct i40e_vsi *start_vsi);
 #ifdef I40E_FCOE
 void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
 			      struct i40e_vsi_context *ctxt,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c
index 6ffac03..417ac16 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
@@ -406,37 +406,6 @@ int i40e_vf_client_capable(struct i40e_pf *pf, u32 vf_id,
 }
 
 /**
- * i40e_vsi_lookup - finds a matching VSI from the PF list starting at start_vsi
- * @pf: board private structure
- * @type: vsi type
- * @start_vsi: a VSI pointer from where to start the search
- *
- * Returns non NULL on success or NULL for failure
- **/
-struct i40e_vsi *i40e_vsi_lookup(struct i40e_pf *pf,
-				 enum i40e_vsi_type type,
-				 struct i40e_vsi *start_vsi)
-{
-	struct i40e_vsi *vsi;
-	int i = 0;
-
-	if (start_vsi) {
-		for (i = 0; i < pf->num_alloc_vsi; i++) {
-			vsi = pf->vsi[i];
-			if (vsi == start_vsi)
-				break;
-		}
-	}
-	for (; i < pf->num_alloc_vsi; i++) {
-		vsi = pf->vsi[i];
-		if (vsi && vsi->type == type)
-			return vsi;
-	}
-
-	return NULL;
-}
-
-/**
  * i40e_client_add_instance - add a client instance struct to the instance list
  * @pf: pointer to the board struct
  * @client: pointer to a client struct in the client list.
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S47 5/9] i40e: Drop code for unsupported flow types
  2016-09-14 23:24 [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates Bimmy Pujari
                   ` (3 preceding siblings ...)
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 4/9] i40e: Remove unused function i40e_vsi_lookup Bimmy Pujari
@ 2016-09-14 23:24 ` Bimmy Pujari
  2016-09-22 17:26   ` Bowers, AndrewX
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 6/9] i40e: reopen client after reset Bimmy Pujari
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Bimmy Pujari @ 2016-09-14 23:24 UTC (permalink / raw)
  To: intel-wired-lan

From: Alexander Duyck <alexander.h.duyck@intel.com>

We cannot currently support SCTP in the hardware, and IPV4_FLOW is not used
anywhere by the software so we can go through and drop the functionality
related to these two flow types.

In addition we cannot support masking based on the protocol value so if the
user is expecting a value other than TCP or UDP we should simply return an
error rather then trying to allocate a filter for a rule that will only
partially match what the user requested.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Change-ID: I10d52bb97d8104d76255fe244551814ff9531a63
---
Testing Hints:
        This change should have no impact on actual functionality.  All it
        should be doing is removing dead code.  As such we should see no
        actual change in how ethtool Flow Director filters are handled.

 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 31 +++++------------------------
 1 file changed, 5 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index d1c3a3a..eba16a1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -330,22 +330,6 @@ static int i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi,
 	return err ? -EOPNOTSUPP : 0;
 }
 
-/**
- * i40e_add_del_fdir_sctpv4 - Add/Remove SCTPv4 Flow Director filters for
- * a specific flow spec
- * @vsi: pointer to the targeted VSI
- * @fd_data: the flow director data required for the FDir descriptor
- * @add: true adds a filter, false removes it
- *
- * Returns 0 if the filters were successfully added or removed
- **/
-static int i40e_add_del_fdir_sctpv4(struct i40e_vsi *vsi,
-				    struct i40e_fdir_filter *fd_data,
-				    bool add)
-{
-	return -EOPNOTSUPP;
-}
-
 #define I40E_IP_DUMMY_PACKET_LEN 34
 /**
  * i40e_add_del_fdir_ipv4 - Add/Remove IPv4 Flow Director filters for
@@ -428,12 +412,6 @@ int i40e_add_del_fdir(struct i40e_vsi *vsi,
 	case UDP_V4_FLOW:
 		ret = i40e_add_del_fdir_udpv4(vsi, input, add);
 		break;
-	case SCTP_V4_FLOW:
-		ret = i40e_add_del_fdir_sctpv4(vsi, input, add);
-		break;
-	case IPV4_FLOW:
-		ret = i40e_add_del_fdir_ipv4(vsi, input, add);
-		break;
 	case IP_USER_FLOW:
 		switch (input->ip4_proto) {
 		case IPPROTO_TCP:
@@ -442,15 +420,16 @@ int i40e_add_del_fdir(struct i40e_vsi *vsi,
 		case IPPROTO_UDP:
 			ret = i40e_add_del_fdir_udpv4(vsi, input, add);
 			break;
-		case IPPROTO_SCTP:
-			ret = i40e_add_del_fdir_sctpv4(vsi, input, add);
-			break;
-		default:
+		case IPPROTO_IP:
 			ret = i40e_add_del_fdir_ipv4(vsi, input, add);
 			break;
+		default:
+			/* We cannot support masking based on protocol */
+			goto unsupported_flow;
 		}
 		break;
 	default:
+unsupported_flow:
 		dev_info(&pf->pdev->dev, "Could not specify spec type %d\n",
 			 input->flow_type);
 		ret = -EINVAL;
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S47 6/9] i40e: reopen client after reset
  2016-09-14 23:24 [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates Bimmy Pujari
                   ` (4 preceding siblings ...)
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 5/9] i40e: Drop code for unsupported flow types Bimmy Pujari
@ 2016-09-14 23:24 ` Bimmy Pujari
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 7/9] i40e: group base mode VF offload flags Bimmy Pujari
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 18+ messages in thread
From: Bimmy Pujari @ 2016-09-14 23:24 UTC (permalink / raw)
  To: intel-wired-lan

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

Allow the client interface to reopen existing clients if they were
closed. This allows clients to recover from reset, which is essential
for supporting VF RDMA. In one instance, the driver was not clearing the
open bit when the client was closed. Add the code to clear this bit so
that the state is accurate and the driver will not attempt to reopen
already-open clients. Remove the ref_cnt variable; it was just getting
in the way and was not being used consistently.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Change-ID: Ic71af4553b096963ac0c56a997f887c9a4ed162d
---
Testing Hints : enable VF RDMA

 drivers/net/ethernet/intel/i40e/i40e_client.c | 47 ++++++++++-----------------
 drivers/net/ethernet/intel/i40e/i40e_client.h |  2 --
 2 files changed, 17 insertions(+), 32 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c
index 417ac16..7fe72ab 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
@@ -287,6 +287,7 @@ void i40e_notify_client_of_netdev_close(struct i40e_vsi *vsi, bool reset)
 			}
 			cdev->client->ops->close(&cdev->lan_info, cdev->client,
 						 reset);
+			clear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);
 			i40e_client_release_qvlist(&cdev->lan_info);
 		}
 	}
@@ -544,28 +545,27 @@ void i40e_client_subtask(struct i40e_pf *pf)
 			continue;
 
 		if (!existing) {
-			/* Also up the ref_cnt for no. of instances of this
-			 * client.
-			 */
-			atomic_inc(&client->ref_cnt);
 			dev_info(&pf->pdev->dev, "Added instance of Client %s to PF%d bus=0x%02x func=0x%02x\n",
 				 client->name, pf->hw.pf_id,
 				 pf->hw.bus.device, pf->hw.bus.func);
-			mutex_lock(&i40e_client_instance_mutex);
-			atomic_inc(&cdev->ref_cnt);
+		}
+
+		mutex_lock(&i40e_client_instance_mutex);
+		if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,
+			      &cdev->state)) {
+			/* Send an Open request to the client */
 			if (client->ops && client->ops->open)
 				ret = client->ops->open(&cdev->lan_info,
 							client);
-			atomic_dec(&cdev->ref_cnt);
-			if (ret < 0) {
-				mutex_unlock(&i40e_client_instance_mutex);
+			if (!ret) {
+				set_bit(__I40E_CLIENT_INSTANCE_OPENED,
+					&cdev->state);
+			} else {
+				/* remove client instance */
 				i40e_client_del_instance(pf, client);
-				atomic_dec(&client->ref_cnt);
-				continue;
 			}
-			set_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);
-			mutex_unlock(&i40e_client_instance_mutex);
 		}
+		mutex_unlock(&i40e_client_instance_mutex);
 	}
 	mutex_unlock(&i40e_client_mutex);
 }
@@ -660,10 +660,6 @@ static int i40e_client_release(struct i40e_client *client)
 			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;
-			}
 			if (client->ops && client->ops->close)
 				client->ops->close(&cdev->lan_info, client,
 						   false);
@@ -676,11 +672,9 @@ static int i40e_client_release(struct i40e_client *client)
 		}
 		/* delete the client instance from the list */
 		list_move(&cdev->list, &cdevs_tmp);
-		atomic_dec(&client->ref_cnt);
 		dev_info(&pf->pdev->dev, "Deleted client instance of Client %s\n",
 			 client->name);
 	}
-out:
 	mutex_unlock(&i40e_client_instance_mutex);
 
 	/* free the client device and release its vsi */
@@ -1006,17 +1000,10 @@ int i40e_unregister_client(struct i40e_client *client)
 		ret = -ENODEV;
 		goto out;
 	}
-	if (atomic_read(&client->ref_cnt) == 0) {
-		clear_bit(__I40E_CLIENT_REGISTERED, &client->state);
-		list_del(&client->list);
-		pr_info("i40e: Unregistered client %s with return code %d\n",
-			client->name, ret);
-	} else {
-		ret = I40E_ERR_NOT_READY;
-		pr_err("i40e: Client %s failed unregister - client has open instances\n",
-		       client->name);
-	}
-
+	clear_bit(__I40E_CLIENT_REGISTERED, &client->state);
+	list_del(&client->list);
+	pr_info("i40e: Unregistered client %s with return code %d\n",
+		client->name, ret);
 out:
 	mutex_unlock(&i40e_client_mutex);
 	return ret;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.h b/drivers/net/ethernet/intel/i40e/i40e_client.h
index 38a6c36..528bd79 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.h
@@ -203,8 +203,6 @@ struct i40e_client_instance {
 	struct i40e_info lan_info;
 	struct i40e_client *client;
 	unsigned long  state;
-	/* A count of all the in-progress calls to the client */
-	atomic_t ref_cnt;
 };
 
 struct i40e_client {
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S47 7/9] i40e: group base mode VF offload flags
  2016-09-14 23:24 [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates Bimmy Pujari
                   ` (5 preceding siblings ...)
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 6/9] i40e: reopen client after reset Bimmy Pujari
@ 2016-09-14 23:24 ` Bimmy Pujari
  2016-09-21 17:24   ` Bowers, AndrewX
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 8/9] i40e/i40evf: fix interrupt affinity bug Bimmy Pujari
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 9/9] i40e/i40evf: Changed version from 1.6.16 to 1.6.19 Bimmy Pujari
  8 siblings, 1 reply; 18+ messages in thread
From: Bimmy Pujari @ 2016-09-14 23:24 UTC (permalink / raw)
  To: intel-wired-lan

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

Group together the minimum set of offload capabilities that are always
supported by VF in base mode. This define would be used by PF to make
sure VF in base mode gets minimum of base capabilities .

Signed-off-by: Preethi Banala <preethi.banala@intel.com>
Change-ID: Id5e8f22ba169c8f0a38d22fc36b2cb531c02582c
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl.h   | 4 ++++
 drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl.h
index f861d31..974ba2b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl.h
@@ -165,6 +165,10 @@ struct i40e_virtchnl_vsi_resource {
 #define I40E_VIRTCHNL_VF_OFFLOAD_RSS_PF		0X00080000
 #define I40E_VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM	0X00100000
 
+#define I40E_VF_BASE_MODE_OFFLOADS (I40E_VIRTCHNL_VF_OFFLOAD_L2 | \
+				    I40E_VIRTCHNL_VF_OFFLOAD_VLAN | \
+				    I40E_VIRTCHNL_VF_OFFLOAD_RSS_PF)
+
 struct i40e_virtchnl_vf_resource {
 	u16 num_vsis;
 	u16 num_queue_pairs;
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h b/drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h
index bd691ad..fc374f8 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h
@@ -162,6 +162,10 @@ struct i40e_virtchnl_vsi_resource {
 #define I40E_VIRTCHNL_VF_OFFLOAD_RSS_PF		0X00080000
 #define I40E_VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM	0X00100000
 
+#define I40E_VF_BASE_MODE_OFFLOADS (I40E_VIRTCHNL_VF_OFFLOAD_L2 | \
+				    I40E_VIRTCHNL_VF_OFFLOAD_VLAN | \
+				    I40E_VIRTCHNL_VF_OFFLOAD_RSS_PF)
+
 struct i40e_virtchnl_vf_resource {
 	u16 num_vsis;
 	u16 num_queue_pairs;
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S47 8/9] i40e/i40evf: fix interrupt affinity bug
  2016-09-14 23:24 [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates Bimmy Pujari
                   ` (6 preceding siblings ...)
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 7/9] i40e: group base mode VF offload flags Bimmy Pujari
@ 2016-09-14 23:24 ` Bimmy Pujari
  2016-09-21 16:17   ` Bowers, AndrewX
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 9/9] i40e/i40evf: Changed version from 1.6.16 to 1.6.19 Bimmy Pujari
  8 siblings, 1 reply; 18+ messages in thread
From: Bimmy Pujari @ 2016-09-14 23:24 UTC (permalink / raw)
  To: intel-wired-lan

From: Alan Brady <alan.brady@intel.com>

There exists a bug in which a 'perfect storm' can occur and cause
interrupts to fail to be correctly affinitized. This causes unexpected
behavior and has a substantial impact on performance when it happens.

The bug occurs if there is heavy traffic, any number of CPUs that have
an i40e interrupt are pegged at 100%, and the interrupt afffinity for
those CPUs is changed.  Instead of moving to the new CPU, the interrupt
continues to be polled while there is heavy traffic.

The bug is most readily realized as the driver is first brought up and
all interrupts start on CPU0. If there is heavy traffic and the
interrupt starts polling before the interrupt is affinitized, the
interrupt will be stuck on CPU0 until traffic stops. The bug, however,
can also be wrought out more simply by affinitizing all the interrupts
to a single CPU and then attempting to move any of those interrupts off
while there is heavy traffic.

This patch fixes the bug by registering for update notifications from
the kernel when the interrupt affinity changes. When that fires, we
cache the intended affinity mask. Then, while polling, if the cpu is
pegged at 100% and we failed to clean the rings, we check to make sure
we have the correct affinity and stop polling if we're firing on the
wrong CPU.  When the kernel successfully moves the interrupt, it will
start polling on the correct CPU. The performance impact is minimal
since the only time this section gets executed is when performance is
already compromised by the CPU.

Signed-off-by: Alan Brady <alan.brady@intel.com>
Change-ID: I4410a880159b9dba1f8297aa72bef36dca34e830
---
Testing-hints:
    1.  Bring up ethx.
    2.  Set affinity for all traffic interrupts to CPU0
    3.  Start heavy traffic.
    4.  Attempt to change affinity for any/all interrupts.
        Expected:  IRQ correctly moves to the new cpu
        Actual:  IRQ continues to poll on CPU0 and performance is
                 severely impacted.

 drivers/net/ethernet/intel/i40e/i40e.h          |  2 +
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 64 +++++++++++++++++-----
 drivers/net/ethernet/intel/i40e/i40e_txrx.c     | 36 ++++++++++---
 drivers/net/ethernet/intel/i40evf/i40e_txrx.c   | 31 +++++++++--
 drivers/net/ethernet/intel/i40evf/i40evf.h      |  3 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 71 +++++++++++++++++--------
 6 files changed, 159 insertions(+), 48 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 29bc649..69c0466 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -611,6 +611,8 @@ struct i40e_q_vector {
 	unsigned long hung_detected; /* Set/Reset for hung_detection logic */
 
 	cpumask_t affinity_mask;
+	struct irq_affinity_notify affinity_notify;
+
 	struct rcu_head rcu;	/* to avoid race with update stats on free */
 	char name[I40E_INT_NAME_STR_LEN];
 	bool arm_wb_state;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index e18fc4a..d7169d0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3310,6 +3310,33 @@ static irqreturn_t i40e_msix_clean_rings(int irq, void *data)
 }
 
 /**
+ * i40e_irq_affinity_notify - Callback for affinity changes
+ * @notify: context as to what irq was changed
+ * @mask: the new affinity mask
+ *
+ * This is a callback function used by the irq_set_affinity_notifier function
+ * so that we may register to receive changes to the irq affinity masks.
+ **/
+static void i40e_irq_affinity_notify(struct irq_affinity_notify *notify,
+				     const cpumask_t *mask)
+{
+	struct i40e_q_vector *q_vector =
+		container_of(notify, struct i40e_q_vector, affinity_notify);
+
+	q_vector->affinity_mask = *mask;
+}
+
+/**
+ * i40e_irq_affinity_release - Callback for affinity notifier release
+ * @ref: internal core kernel usage
+ *
+ * This is a callback function used by the irq_set_affinity_notifier function
+ * to inform the current notification subscriber that they will no longer
+ * receive notifications.
+ **/
+static void i40e_irq_affinity_release(struct kref *ref) {}
+
+/**
  * i40e_vsi_request_irq_msix - Initialize MSI-X interrupts
  * @vsi: the VSI being configured
  * @basename: name for the vector
@@ -3324,10 +3351,13 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
 	int rx_int_idx = 0;
 	int tx_int_idx = 0;
 	int vector, err;
+	int irq_num;
 
 	for (vector = 0; vector < q_vectors; vector++) {
 		struct i40e_q_vector *q_vector = vsi->q_vectors[vector];
 
+		irq_num = pf->msix_entries[base + vector].vector;
+
 		if (q_vector->tx.ring && q_vector->rx.ring) {
 			snprintf(q_vector->name, sizeof(q_vector->name) - 1,
 				 "%s-%s-%d", basename, "TxRx", rx_int_idx++);
@@ -3342,7 +3372,7 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
 			/* skip this unused q_vector */
 			continue;
 		}
-		err = request_irq(pf->msix_entries[base + vector].vector,
+		err = request_irq(irq_num,
 				  vsi->irq_handler,
 				  0,
 				  q_vector->name,
@@ -3352,9 +3382,13 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
 				 "MSIX request_irq failed, error: %d\n", err);
 			goto free_queue_irqs;
 		}
+
+		/* register for affinity change notifications */
+		q_vector->affinity_notify.notify = i40e_irq_affinity_notify;
+		q_vector->affinity_notify.release = i40e_irq_affinity_release;
+		irq_set_affinity_notifier(irq_num, &q_vector->affinity_notify);
 		/* assign the mask for this irq */
-		irq_set_affinity_hint(pf->msix_entries[base + vector].vector,
-				      &q_vector->affinity_mask);
+		irq_set_affinity_hint(irq_num, &q_vector->affinity_mask);
 	}
 
 	vsi->irqs_ready = true;
@@ -3363,10 +3397,10 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
 free_queue_irqs:
 	while (vector) {
 		vector--;
-		irq_set_affinity_hint(pf->msix_entries[base + vector].vector,
-				      NULL);
-		free_irq(pf->msix_entries[base + vector].vector,
-			 &(vsi->q_vectors[vector]));
+		irq_num = pf->msix_entries[base + vector].vector;
+		irq_set_affinity_notifier(irq_num, NULL);
+		irq_set_affinity_hint(irq_num, NULL);
+		free_irq(irq_num, &vsi->q_vectors[vector]);
 	}
 	return err;
 }
@@ -4005,19 +4039,23 @@ static void i40e_vsi_free_irq(struct i40e_vsi *vsi)
 
 		vsi->irqs_ready = false;
 		for (i = 0; i < vsi->num_q_vectors; i++) {
-			u16 vector = i + base;
+			int irq_num;
+			u16 vector;
+
+			vector = i + base;
+			irq_num = pf->msix_entries[vector].vector;
 
 			/* free only the irqs that were actually requested */
 			if (!vsi->q_vectors[i] ||
 			    !vsi->q_vectors[i]->num_ringpairs)
 				continue;
 
+			/* clear the affinity notifier in the IRQ descriptor */
+			irq_set_affinity_notifier(irq_num, NULL);
 			/* clear the affinity_mask in the IRQ descriptor */
-			irq_set_affinity_hint(pf->msix_entries[vector].vector,
-					      NULL);
-			synchronize_irq(pf->msix_entries[vector].vector);
-			free_irq(pf->msix_entries[vector].vector,
-				 vsi->q_vectors[i]);
+			irq_set_affinity_hint(irq_num, NULL);
+			synchronize_irq(irq_num);
+			free_irq(irq_num, vsi->q_vectors[i]);
 
 			/* Tear down the interrupt queue link list
 			 *
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index eba16a1..587f596 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1999,12 +1999,25 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
 
 	/* If work not completed, return budget and polling will return */
 	if (!clean_complete) {
+		const cpumask_t *aff_mask = &q_vector->affinity_mask;
+		int cpu_id = smp_processor_id();
+
+		/* It is possible that the interrupt affinity has changed but,
+		 * if the cpu is pegged at 100%, polling will never exit while
+		 * traffic continues and the interrupt will be stuck on this
+		 * cpu.  We check to make sure affinity is correct before we
+		 * continue to poll, otherwise we must stop polling so the
+		 * interrupt can move to the correct cpu.
+		 */
+		if (likely(cpumask_test_cpu(cpu_id, aff_mask) ||
+			   !(vsi->back->flags & I40E_FLAG_MSIX_ENABLED))) {
 tx_only:
-		if (arm_wb) {
-			q_vector->tx.ring[0].tx_stats.tx_force_wb++;
-			i40e_enable_wb_on_itr(vsi, q_vector);
+			if (arm_wb) {
+				q_vector->tx.ring[0].tx_stats.tx_force_wb++;
+				i40e_enable_wb_on_itr(vsi, q_vector);
+			}
+			return budget;
 		}
-		return budget;
 	}
 
 	if (vsi->back->flags & I40E_TXR_FLAGS_WB_ON_ITR)
@@ -2012,11 +2025,18 @@ tx_only:
 
 	/* Work is done so exit the polling mode and re-enable the interrupt */
 	napi_complete_done(napi, work_done);
-	if (vsi->back->flags & I40E_FLAG_MSIX_ENABLED) {
-		i40e_update_enable_itr(vsi, q_vector);
-	} else { /* Legacy mode */
+
+	/* If we're prematurely stopping polling to fix the interrupt
+	 * affinity we want to make sure polling starts back up so we
+	 * issue a call to i40e_force_wb which triggers a SW interrupt.
+	 */
+	if (!clean_complete)
+		i40e_force_wb(vsi, q_vector);
+	else if (!(vsi->back->flags & I40E_FLAG_MSIX_ENABLED))
 		i40e_irq_dynamic_enable_icr0(vsi->back, false);
-	}
+	else
+		i40e_update_enable_itr(vsi, q_vector);
+
 	return 0;
 }
 
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index 75f2a2c..dd8ad6b 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -1461,12 +1461,24 @@ int i40evf_napi_poll(struct napi_struct *napi, int budget)
 
 	/* If work not completed, return budget and polling will return */
 	if (!clean_complete) {
+		const cpumask_t *aff_mask = &q_vector->affinity_mask;
+		int cpu_id = smp_processor_id();
+
+		/* It is possible that the interrupt affinity has changed but,
+		 * if the cpu is pegged at 100%, polling will never exit while
+		 * traffic continues and the interrupt will be stuck on this
+		 * cpu.  We check to make sure affinity is correct before we
+		 * continue to poll, otherwise we must stop polling so the
+		 * interrupt can move to the correct cpu.
+		 */
+		if (likely(cpumask_test_cpu(cpu_id, aff_mask))) {
 tx_only:
-		if (arm_wb) {
-			q_vector->tx.ring[0].tx_stats.tx_force_wb++;
-			i40e_enable_wb_on_itr(vsi, q_vector);
+			if (arm_wb) {
+				q_vector->tx.ring[0].tx_stats.tx_force_wb++;
+				i40e_enable_wb_on_itr(vsi, q_vector);
+			}
+			return budget;
 		}
-		return budget;
 	}
 
 	if (vsi->back->flags & I40E_TXR_FLAGS_WB_ON_ITR)
@@ -1474,7 +1486,16 @@ tx_only:
 
 	/* Work is done so exit the polling mode and re-enable the interrupt */
 	napi_complete_done(napi, work_done);
-	i40e_update_enable_itr(vsi, q_vector);
+
+	/* If we're prematurely stopping polling to fix the interrupt
+	 * affinity we want to make sure polling starts back up so we
+	 * issue a call to i40evf_force_wb which triggers a SW interrupt.
+	 */
+	if (!clean_complete)
+		i40evf_force_wb(vsi, q_vector);
+	else
+		i40e_update_enable_itr(vsi, q_vector);
+
 	return 0;
 }
 
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h
index c5fd724..fffe4cf 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf.h
+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h
@@ -107,7 +107,8 @@ struct i40e_q_vector {
 	int v_idx;	/* vector index in list */
 	char name[IFNAMSIZ + 9];
 	bool arm_wb_state;
-	cpumask_var_t affinity_mask;
+	cpumask_t affinity_mask;
+	struct irq_affinity_notify affinity_notify;
 };
 
 /* Helper macros to switch between ints/sec and what the register uses.
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 1437281..0881b4e 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -496,6 +496,33 @@ static void i40evf_netpoll(struct net_device *netdev)
 
 #endif
 /**
+ * i40evf_irq_affinity_notify - Callback for affinity changes
+ * @notify: context as to what irq was changed
+ * @mask: the new affinity mask
+ *
+ * This is a callback function used by the irq_set_affinity_notifier function
+ * so that we may register to receive changes to the irq affinity masks.
+ **/
+static void i40evf_irq_affinity_notify(struct irq_affinity_notify *notify,
+				       const cpumask_t *mask)
+{
+	struct i40e_q_vector *q_vector =
+		container_of(notify, struct i40e_q_vector, affinity_notify);
+
+	q_vector->affinity_mask = *mask;
+}
+
+/**
+ * i40evf_irq_affinity_release - Callback for affinity notifier release
+ * @ref: internal core kernel usage
+ *
+ * This is a callback function used by the irq_set_affinity_notifier function
+ * to inform the current notification subscriber that they will no longer
+ * receive notifications.
+ **/
+static void i40evf_irq_affinity_release(struct kref *ref) {}
+
+/**
  * i40evf_request_traffic_irqs - Initialize MSI-X interrupts
  * @adapter: board private structure
  *
@@ -507,6 +534,7 @@ i40evf_request_traffic_irqs(struct i40evf_adapter *adapter, char *basename)
 {
 	int vector, err, q_vectors;
 	int rx_int_idx = 0, tx_int_idx = 0;
+	int irq_num;
 
 	i40evf_irq_disable(adapter);
 	/* Decrement for Other and TCP Timer vectors */
@@ -514,6 +542,7 @@ i40evf_request_traffic_irqs(struct i40evf_adapter *adapter, char *basename)
 
 	for (vector = 0; vector < q_vectors; vector++) {
 		struct i40e_q_vector *q_vector = &adapter->q_vectors[vector];
+		irq_num = adapter->msix_entries[vector + NONQ_VECS].vector;
 
 		if (q_vector->tx.ring && q_vector->rx.ring) {
 			snprintf(q_vector->name, sizeof(q_vector->name) - 1,
@@ -532,21 +561,23 @@ i40evf_request_traffic_irqs(struct i40evf_adapter *adapter, char *basename)
 			/* skip this unused q_vector */
 			continue;
 		}
-		err = request_irq(
-			adapter->msix_entries[vector + NONQ_VECS].vector,
-			i40evf_msix_clean_rings,
-			0,
-			q_vector->name,
-			q_vector);
+		err = request_irq(irq_num,
+				  i40evf_msix_clean_rings,
+				  0,
+				  q_vector->name,
+				  q_vector);
 		if (err) {
 			dev_info(&adapter->pdev->dev,
 				 "Request_irq failed, error: %d\n", err);
 			goto free_queue_irqs;
 		}
+		/* register for affinity change notifications */
+		q_vector->affinity_notify.notify = i40evf_irq_affinity_notify;
+		q_vector->affinity_notify.release =
+						   i40evf_irq_affinity_release;
+		irq_set_affinity_notifier(irq_num, &q_vector->affinity_notify);
 		/* assign the mask for this irq */
-		irq_set_affinity_hint(
-			adapter->msix_entries[vector + NONQ_VECS].vector,
-			q_vector->affinity_mask);
+		irq_set_affinity_hint(irq_num, &q_vector->affinity_mask);
 	}
 
 	return 0;
@@ -554,11 +585,10 @@ i40evf_request_traffic_irqs(struct i40evf_adapter *adapter, char *basename)
 free_queue_irqs:
 	while (vector) {
 		vector--;
-		irq_set_affinity_hint(
-			adapter->msix_entries[vector + NONQ_VECS].vector,
-			NULL);
-		free_irq(adapter->msix_entries[vector + NONQ_VECS].vector,
-			 &adapter->q_vectors[vector]);
+		irq_num = adapter->msix_entries[vector + NONQ_VECS].vector;
+		irq_set_affinity_notifier(irq_num, NULL);
+		irq_set_affinity_hint(irq_num, NULL);
+		free_irq(irq_num, &adapter->q_vectors[vector]);
 	}
 	return err;
 }
@@ -599,16 +629,15 @@ static int i40evf_request_misc_irq(struct i40evf_adapter *adapter)
  **/
 static void i40evf_free_traffic_irqs(struct i40evf_adapter *adapter)
 {
-	int i;
-	int q_vectors;
+	int vector, irq_num, q_vectors;
 
 	q_vectors = adapter->num_msix_vectors - NONQ_VECS;
 
-	for (i = 0; i < q_vectors; i++) {
-		irq_set_affinity_hint(adapter->msix_entries[i+1].vector,
-				      NULL);
-		free_irq(adapter->msix_entries[i+1].vector,
-			 &adapter->q_vectors[i]);
+	for (vector = 0; vector < q_vectors; vector++) {
+		irq_num = adapter->msix_entries[vector + NONQ_VECS].vector;
+		irq_set_affinity_notifier(irq_num, NULL);
+		irq_set_affinity_hint(irq_num, NULL);
+		free_irq(irq_num, &adapter->q_vectors[vector]);
 	}
 }
 
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S47 9/9] i40e/i40evf: Changed version from 1.6.16 to 1.6.19
  2016-09-14 23:24 [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates Bimmy Pujari
                   ` (7 preceding siblings ...)
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 8/9] i40e/i40evf: fix interrupt affinity bug Bimmy Pujari
@ 2016-09-14 23:24 ` Bimmy Pujari
  2016-09-21 17:49   ` Bowers, AndrewX
  8 siblings, 1 reply; 18+ messages in thread
From: Bimmy Pujari @ 2016-09-14 23:24 UTC (permalink / raw)
  To: intel-wired-lan

Signed-off-by: Bimmy Pujari <bimmy.pujari@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 2 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index d7169d0..fe7a76d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -41,7 +41,7 @@ static const char i40e_driver_string[] =
 
 #define DRV_VERSION_MAJOR 1
 #define DRV_VERSION_MINOR 6
-#define DRV_VERSION_BUILD 16
+#define DRV_VERSION_BUILD 19
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD)    DRV_KERN
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 0881b4e..45b7cd9 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -38,7 +38,7 @@ static const char i40evf_driver_string[] =
 
 #define DRV_VERSION_MAJOR 1
 #define DRV_VERSION_MINOR 6
-#define DRV_VERSION_BUILD 16
+#define DRV_VERSION_BUILD 19
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD) \
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S47 8/9] i40e/i40evf: fix interrupt affinity bug
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 8/9] i40e/i40evf: fix interrupt affinity bug Bimmy Pujari
@ 2016-09-21 16:17   ` Bowers, AndrewX
  0 siblings, 0 replies; 18+ messages in thread
From: Bowers, AndrewX @ 2016-09-21 16:17 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Wednesday, September 14, 2016 4:25 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Brady, Alan <alan.brady@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S47 8/9] i40e/i40evf: fix interrupt
> affinity bug
> 
> From: Alan Brady <alan.brady@intel.com>
> 
> There exists a bug in which a 'perfect storm' can occur and cause interrupts to
> fail to be correctly affinitized. This causes unexpected behavior and has a
> substantial impact on performance when it happens.
> 
> The bug occurs if there is heavy traffic, any number of CPUs that have an i40e
> interrupt are pegged at 100%, and the interrupt afffinity for those CPUs is
> changed.  Instead of moving to the new CPU, the interrupt continues to be
> polled while there is heavy traffic.
> 
> The bug is most readily realized as the driver is first brought up and all
> interrupts start on CPU0. If there is heavy traffic and the interrupt starts
> polling before the interrupt is affinitized, the interrupt will be stuck on CPU0
> until traffic stops. The bug, however, can also be wrought out more simply by
> affinitizing all the interrupts to a single CPU and then attempting to move any
> of those interrupts off while there is heavy traffic.
> 
> This patch fixes the bug by registering for update notifications from the
> kernel when the interrupt affinity changes. When that fires, we cache the
> intended affinity mask. Then, while polling, if the cpu is pegged at 100% and
> we failed to clean the rings, we check to make sure we have the correct
> affinity and stop polling if we're firing on the wrong CPU.  When the kernel
> successfully moves the interrupt, it will start polling on the correct CPU. The
> performance impact is minimal since the only time this section gets executed
> is when performance is already compromised by the CPU.
> 
> Signed-off-by: Alan Brady <alan.brady@intel.com>
> Change-ID: I4410a880159b9dba1f8297aa72bef36dca34e830
> ---
> Testing-hints:
>     1.  Bring up ethx.
>     2.  Set affinity for all traffic interrupts to CPU0
>     3.  Start heavy traffic.
>     4.  Attempt to change affinity for any/all interrupts.
>         Expected:  IRQ correctly moves to the new cpu
>         Actual:  IRQ continues to poll on CPU0 and performance is
>                  severely impacted.
> 
>  drivers/net/ethernet/intel/i40e/i40e.h          |  2 +
>  drivers/net/ethernet/intel/i40e/i40e_main.c     | 64 +++++++++++++++++---
> --
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c     | 36 ++++++++++---
>  drivers/net/ethernet/intel/i40evf/i40e_txrx.c   | 31 +++++++++--
>  drivers/net/ethernet/intel/i40evf/i40evf.h      |  3 +-
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c | 71
> +++++++++++++++++--------
>  6 files changed, 159 insertions(+), 48 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Bug behavior no longer present



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

* [Intel-wired-lan] [next PATCH S47 3/9] i40e: Bit test mask correction
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 3/9] i40e: Bit test mask correction Bimmy Pujari
@ 2016-09-21 17:15   ` Bowers, AndrewX
  0 siblings, 0 replies; 18+ messages in thread
From: Bowers, AndrewX @ 2016-09-21 17:15 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Wednesday, September 14, 2016 4:25 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Sadowski, Filip <filip.sadowski@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S47 3/9] i40e: Bit test mask correction
> 
> From: Filip Sadowski <filip.sadowski@intel.com>
> 
> Incorrect bit mask was used for testing "get link status" response.
> Instead of I40E_AQ_LSE_ENABLE (which is actually 0x03) it most probably
> should be I40E_AQ_LSE_IS_ENABLED (which is defined as 0x01).
> 
> Signed-off-by: Filip Sadowski <filip.sadowski@intel.com>
> Change-ID: Ia199142906720507f847de3a33a25c61a9781b2f
> ---
>  drivers/net/ethernet/intel/i40e/i40e_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>


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

* [Intel-wired-lan] [next PATCH S47 4/9] i40e: Remove unused function i40e_vsi_lookup
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 4/9] i40e: Remove unused function i40e_vsi_lookup Bimmy Pujari
@ 2016-09-21 17:22   ` Bowers, AndrewX
  0 siblings, 0 replies; 18+ messages in thread
From: Bowers, AndrewX @ 2016-09-21 17:22 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Wednesday, September 14, 2016 4:25 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S47 4/9] i40e: Remove unused
> function i40e_vsi_lookup
> 
> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> The function is not used so there is no need to carry it forward.  I have plans
> to add a slightly different function that can be inlined to handle the same
> kind of functionality.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Change-ID: Ie2dfcb189dc75e5fbc156bac23003e3b4210ae0f
> ---
> Testing Hints:
>         Verify driver builds without issues under various configurations.
> 
>  drivers/net/ethernet/intel/i40e/i40e.h        |  2 --
>  drivers/net/ethernet/intel/i40e/i40e_client.c | 31 ---------------------------
>  2 files changed, 33 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S47 7/9] i40e: group base mode VF offload flags
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 7/9] i40e: group base mode VF offload flags Bimmy Pujari
@ 2016-09-21 17:24   ` Bowers, AndrewX
  0 siblings, 0 replies; 18+ messages in thread
From: Bowers, AndrewX @ 2016-09-21 17:24 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Wednesday, September 14, 2016 4:25 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S47 7/9] i40e: group base mode VF
> offload flags
> 
> From: Preethi Banala <preethi.banala@intel.com>
> 
> Group together the minimum set of offload capabilities that are always
> supported by VF in base mode. This define would be used by PF to make
> sure VF in base mode gets minimum of base capabilities .
> 
> Signed-off-by: Preethi Banala <preethi.banala@intel.com>
> Change-ID: Id5e8f22ba169c8f0a38d22fc36b2cb531c02582c
> ---
>  drivers/net/ethernet/intel/i40e/i40e_virtchnl.h   | 4 ++++
>  drivers/net/ethernet/intel/i40evf/i40e_virtchnl.h | 4 ++++
>  2 files changed, 8 insertions(+)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S47 9/9] i40e/i40evf: Changed version from 1.6.16 to 1.6.19
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 9/9] i40e/i40evf: Changed version from 1.6.16 to 1.6.19 Bimmy Pujari
@ 2016-09-21 17:49   ` Bowers, AndrewX
  0 siblings, 0 replies; 18+ messages in thread
From: Bowers, AndrewX @ 2016-09-21 17:49 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Wednesday, September 14, 2016 4:25 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S47 9/9] i40e/i40evf: Changed version
> from 1.6.16 to 1.6.19
> 
> Signed-off-by: Bimmy Pujari <bimmy.pujari@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c     | 2 +-
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S47 2/9] i40e: Rewrite Flow Director busy wait loop
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 2/9] i40e: Rewrite Flow Director busy wait loop Bimmy Pujari
@ 2016-09-22 17:25   ` Bowers, AndrewX
  0 siblings, 0 replies; 18+ messages in thread
From: Bowers, AndrewX @ 2016-09-22 17:25 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Wednesday, September 14, 2016 4:25 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S47 2/9] i40e: Rewrite Flow Director
> busy wait loop
> 
> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> We can reorder the busy wait loop at the start of the Flow Director transmit
> function to reduce the overall code size while still retaining the same
> functionality.  As such I am taking advantage of the opportunity to do so.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Change-ID: I34c403ca001953c6ac9816e65d5305e73d869026
> ---
> Testing Hints:
>         Verify Flow Director still functional for adding/deleting rules.
> 
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S47 5/9] i40e: Drop code for unsupported flow types
  2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 5/9] i40e: Drop code for unsupported flow types Bimmy Pujari
@ 2016-09-22 17:26   ` Bowers, AndrewX
  0 siblings, 0 replies; 18+ messages in thread
From: Bowers, AndrewX @ 2016-09-22 17:26 UTC (permalink / raw)
  To: intel-wired-lan

------Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On
> Behalf Of Bimmy Pujari
> Sent: Wednesday, September 14, 2016 4:25 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S47 5/9] i40e: Drop code for
> unsupported flow types
> 
> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> We cannot currently support SCTP in the hardware, and IPV4_FLOW is not
> used anywhere by the software so we can go through and drop the
> functionality related to these two flow types.
> 
> In addition we cannot support masking based on the protocol value so if the
> user is expecting a value other than TCP or UDP we should simply return an
> error rather then trying to allocate a filter for a rule that will only partially
> match what the user requested.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Change-ID: I10d52bb97d8104d76255fe244551814ff9531a63
> ---
> Testing Hints:
>         This change should have no impact on actual functionality.  All it
>         should be doing is removing dead code.  As such we should see no
>         actual change in how ethtool Flow Director filters are handled.
> 
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c | 31 +++++------------------------
>  1 file changed, 5 insertions(+), 26 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



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

* [Intel-wired-lan] [next PATCH S47 3/9] i40e: Bit test mask correction
  2016-09-27 18:26 [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates Bimmy Pujari
@ 2016-09-27 18:26 ` Bimmy Pujari
  0 siblings, 0 replies; 18+ messages in thread
From: Bimmy Pujari @ 2016-09-27 18:26 UTC (permalink / raw)
  To: intel-wired-lan

From: Filip Sadowski <filip.sadowski@intel.com>

Incorrect bit mask was used for testing "get link status" response.
Instead of I40E_AQ_LSE_ENABLE (which is actually 0x03) it most probably
should be I40E_AQ_LSE_IS_ENABLED (which is defined as 0x01).

Signed-off-by: Filip Sadowski <filip.sadowski@intel.com>
Change-ID: Ia199142906720507f847de3a33a25c61a9781b2f
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 2154a34..fe8100b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -1849,7 +1849,7 @@ i40e_status i40e_aq_get_link_info(struct i40e_hw *hw,
 	else
 		hw_link_info->crc_enable = false;
 
-	if (resp->command_flags & cpu_to_le16(I40E_AQ_LSE_ENABLE))
+	if (resp->command_flags & cpu_to_le16(I40E_AQ_LSE_IS_ENABLED))
 		hw_link_info->lse_enable = true;
 	else
 		hw_link_info->lse_enable = false;
-- 
2.4.11


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

end of thread, other threads:[~2016-09-27 18:26 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-14 23:24 [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates Bimmy Pujari
2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 1/9] i40e: Fix client interaction Bimmy Pujari
2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 2/9] i40e: Rewrite Flow Director busy wait loop Bimmy Pujari
2016-09-22 17:25   ` Bowers, AndrewX
2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 3/9] i40e: Bit test mask correction Bimmy Pujari
2016-09-21 17:15   ` Bowers, AndrewX
2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 4/9] i40e: Remove unused function i40e_vsi_lookup Bimmy Pujari
2016-09-21 17:22   ` Bowers, AndrewX
2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 5/9] i40e: Drop code for unsupported flow types Bimmy Pujari
2016-09-22 17:26   ` Bowers, AndrewX
2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 6/9] i40e: reopen client after reset Bimmy Pujari
2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 7/9] i40e: group base mode VF offload flags Bimmy Pujari
2016-09-21 17:24   ` Bowers, AndrewX
2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 8/9] i40e/i40evf: fix interrupt affinity bug Bimmy Pujari
2016-09-21 16:17   ` Bowers, AndrewX
2016-09-14 23:24 ` [Intel-wired-lan] [next PATCH S47 9/9] i40e/i40evf: Changed version from 1.6.16 to 1.6.19 Bimmy Pujari
2016-09-21 17:49   ` Bowers, AndrewX
2016-09-27 18:26 [Intel-wired-lan] [next PATCH S47 0/9] i40e/i40evf updates Bimmy Pujari
2016-09-27 18:26 ` [Intel-wired-lan] [next PATCH S47 3/9] i40e: Bit test mask correction Bimmy Pujari

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.