Skip to contentSkip to conversation

i40e: display correct udp tunnel type

PATCH Superseded Keller 1 participant 7 messages Mar 27, 2017 7 messages not in the archive

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Keller

#2 lore raw

PATCH 3/13 i40e: display correct udp tunnel type

In reply to a message not in the archive

This patch is incorrect. It doesn't contain most of the meat of the code. I think the error messages are fixed in a different way in the current upstream. I can create a separate patch to bring them in line or you can fix this one.

We need to change the code in i40e_sync_udp_filters_subtask so that it doesn't do a hard check against "non-zero udp_ports[i].type" means VXLAN and zero means Geneve.

Thanks,
Jake

Quoted 42 lines

-----Original Message-----
From: Michael, Alice
Sent: Monday, March 27, 2017 2:48 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Keller, Jacob E <[email protected]>
Subject: [next PATCH S65 03/13] i40e: display correct udp tunnel type

From: Jacob Keller <[email protected]>

Do not hardcode vxlan into the error message, and instead check to determine whether this is a geneve or a vxlan tunnel.

Change-ID I1a8fcdbdb57f7cb9f3723aba2fff5036165f6dc3

---
Testing-hints:
Partially upstream. The exact way of parsing the tunnel type to a string was changed.

 drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +5 -0
index 9ce06e8..9e665fa 100644
@@ -7231,6 +7231,11 @@ static void i40e_handle_mdd_event(struct i40e_pf
 *pf)
 	i40e_flush(hw);
 }
 
+static const char * const tunnel_types[] = {
+	[UDP_TUNNEL_TYPE_VXLAN] = "vxlan",
+	[UDP_TUNNEL_TYPE_GENEVE] = "geneve",
+};
+
 /**
  * i40e_sync_udp_filters_subtask - Sync the VSI filter list with HW

* @pf: board private structure
--
2.9.3

#5 lore raw

PATCH 1/13 i40e: update error message when trying to add invalid filters

In reply to a message not in the archive

ACK

Quoted 48 lines

-----Original Message-----
From: Michael, Alice
Sent: Monday, March 27, 2017 2:48 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Keller, Jacob E <[email protected]>
Subject: [next PATCH S65 01/13] i40e: update error message when trying to add invalid filters

From: Jacob Keller <[email protected]>

Re-word the error message displayed when adding a filter with an invalid flow type. Additionally, report a distinct error message when the IPv4 protocol is at fault.

Change-ID Iba3d85b87f8d383c97c8bdd180df34a6adf3ee67
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +5 -4
index ebffca0..d45f48c 100644
@@ -533,14 +533,15 @@ int i40e_add_del_fdir(struct i40e_vsi *vsi,
 			break;
 		default:
 			/* We cannot support masking based on protocol */
-			goto unsupported_flow;
+			dev_info(&pf->pdev->dev, "Unsupported IPv4 protocol
 0x%02x\n",
+				 input->ip4_proto);
+			return -EINVAL;
 		}
 		break;
 	default:
-unsupported_flow:
-		dev_info(&pf->pdev->dev, "Could not specify spec type %d\n",
+		dev_info(&pf->pdev->dev, "Unsupported flow type 0x%02x\n",
 			 input->flow_type);
-		ret = -EINVAL;
+		return -EINVAL;
 	}
 

/* The buffer allocated here will be normally be freed by
--
2.9.3

#7 lore raw

PATCH 7/13 i40e: remove extraneous loop in i40e_vsi_wait_queues_disabled

In reply to a message not in the archive

ACK

Quoted 60 lines

-----Original Message-----
From: Michael, Alice
Sent: Monday, March 27, 2017 2:48 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Keller, Jacob E <[email protected]>
Subject: [next PATCH S65 07/13] i40e: remove extraneous loop in i40e_vsi_wait_queues_disabled

From: Jacob Keller <[email protected]>

We can simply check both Tx and Rx queues in a single loop, rather than repeating the loop twice.

Change-ID Ic06f26b0e3c2620e0e33c1a2999edda488e647ad
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
index 992dec1..cecbb5d 100644
@@ -4431,7 +4431,7 @@ static void i40e_pf_unquiesce_all_vsi(struct i40e_pf
 *pf)
  * i40e_vsi_wait_queues_disabled - Wait for VSI's queues to be disabled
  * @vsi: the VSI being configured
  *
- * This function waits for the given VSI's queues to be disabled.
+ * Wait until all queues on a given VSI have been disabled.
  **/
 static int i40e_vsi_wait_queues_disabled(struct i40e_vsi *vsi)

{

drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -4440,7 +4440,7 @@ static int i40e_vsi_wait_queues_disabled(struct
 i40e_vsi *vsi)
 
 	pf_q = vsi->base_queue;
 	for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) {
-		/* Check and wait for the disable status of the queue */
+		/* Check and wait for the Tx queue */
 		ret = i40e_pf_txq_wait(pf, pf_q, false);
 		if (ret) {
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -5
 			dev_info(&pf->pdev->dev,
@@ -4448,11 +4448,7 @@ static int i40e_vsi_wait_queues_disabled(struct
 i40e_vsi *vsi)
 				 vsi->seid, pf_q);
 			return ret;
 		}
-	}
-
-	pf_q = vsi->base_queue;
-	for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) {
-		/* Check and wait for the disable status of the queue */
+		/* Check and wait for the Tx queue */
 		ret = i40e_pf_rxq_wait(pf, pf_q, false);
 		if (ret) {

dev_info(&pf->pdev->dev,
--
2.9.3

#9 lore raw

PATCH 6/13 i40e: allow look-up of MAC address from Open Firmware or IDPROM

In reply to a message not in the archive

One minor whitespace nit, otherwise this looks good.

Quoted 53 lines

-----Original Message-----
From: Michael, Alice
Sent: Monday, March 27, 2017 2:48 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Keller, Jacob E <[email protected]>
Subject: [next PATCH S65 06/13] i40e: allow look-up of MAC address from Open Firmware or IDPROM

From: Jacob Keller <[email protected]>

Look up the MAC address from the eth_get_platform_mac_address() function first before checking what the firmware provides. We already handle the case of re-writing the MAC-VLAN filter, so there is no need to add extra code for this. However, update the comment where we do this to indicate that it does impact the Open Firmware MAC address case. This patch was backported from upstream, but behavior changed due to review feedback.

Change-ID I73e59fbe0b0e7e6f3ee9f5170d0bd3a4d5faf4db

---
Testing-hints: You would need a platform that has Open Firmware with a MAC address setup.

 drivers/net/ethernet/intel/i40e/i40e_main.c | 31 ++++++++++++++++------------
(quoted diff) +0 -1
-
 1 file changed, 17 insertions(+), 14 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +9 -4
index 45274fc..992dec1 100644
@@ -9352,10 +9352,15 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
 	if (vsi->type == I40E_VSI_MAIN) {
 		SET_NETDEV_DEV(netdev, &pf->pdev->dev);
 		ether_addr_copy(mac_addr, hw->mac.perm_addr);
-		/* The following steps are necessary to properly keep track of
-		 * MAC-VLAN filters loaded into firmware - first we remove
-		 * filter that is automatically generated by firmware and then
-		 * add new filter both to the driver hash table and firmware.
+		/* The following steps are necessary for two reasons. First,
+		 * some older NVM configurations load a default MAC-VLAN
+		 * filter that will accept any tagged packet, and we want to
+		 * replace this with a normal filter. Additionally, it is
+		 * possible our MAC address was provided by the platform using
+		 * Open Firmware or similar.
+		 *
+		 * Thus, we need to remove the default filter and install one
+		 * specific to the MAC address.
 		 */
 		i40e_rm_default_mac_filter(vsi, mac_addr);
 		spin_lock_bh(&vsi->mac_filter_hash_lock);

drivers/net/ethernet/intel/i40e/i40e_main.c static void i40e_print_features(struct i40e_pf *pf) · line 10869

Quoted 5 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -10861,22 +10866,20 @@ static void i40e_print_features(struct i40e_pf *pf)
 	WARN_ON(i > INFO_STRING_LEN);
 }
 
-/**
+ /**

Looks like a stray space got inserted here.

Quoted 40 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +6 -8
  * i40e_get_platform_mac_addr - get platform-specific MAC address
- *
  * @pdev: PCI device information struct
  * @pf: board private structure
  *
- * Look up the MAC address in Open Firmware  on systems that support it,
- * and use IDPROM on SPARC if no OF address is found. On return, the
- * I40E_FLAG_PF_MAC will be wset in pf->flags if a platform-specific value
- * has been selected.
+ * Look up the MAC address for the device. First we'll try
+ * eth_platform_get_mac_address, which will check Open Firmware, or arch
+ * specific fallback. Otherwise, we'll default to the stored value in
+ * firmware.
  **/
 static void i40e_get_platform_mac_addr(struct pci_dev *pdev, struct i40e_pf
 *pf)
 {
-	pf->flags &= ~I40E_FLAG_PF_MAC;
-	if (!eth_platform_get_mac_address(&pdev->dev, pf->hw.mac.addr))
-		pf->flags |= I40E_FLAG_PF_MAC;
+	if (eth_platform_get_mac_address(&pdev->dev, pf->hw.mac.addr))
+		i40e_get_mac_addr(&pf->hw, pf->hw.mac.addr);
 }
 

/**

drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -11095,9 +11098,9 @@ static int i40e_probe(struct pci_dev *pdev, const
 struct pci_device_id *ent)
 		i40e_aq_stop_lldp(hw, true, NULL);
 	}
 
-	i40e_get_mac_addr(hw, hw->mac.addr);
 	/* allow a platform config to override the HW addr */
 	i40e_get_platform_mac_addr(pdev, pf);
+
 	if (!is_valid_ether_addr(hw->mac.addr)) {
 		dev_info(&pdev->dev, "invalid MAC address %pM\n", hw-
Quoted 1 line

mac.addr);

err = -EIO;
--
2.9.3

#11 lore raw

PATCH 9/13 i40e: clean up historic deprecated flag definitions

In reply to a message not in the archive

ACK

Quoted 67 lines

-----Original Message-----
From: Michael, Alice
Sent: Monday, March 27, 2017 2:48 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Keller, Jacob E <[email protected]>
Subject: [next PATCH S65 09/13] i40e: clean up historic deprecated flag definitions

From: Jacob Keller <[email protected]>

Since an early commit a few flags have no longer been used. Remove these definitions to reduce code clutter.

Change-ID I3589be4622574e747013cd4dc403e18b039f4965
---
 drivers/net/ethernet/intel/i40e/i40e.h          | 3 ---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 2 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
 3 files changed, 2 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +0 -3
index fc91ffd..2c12900 100644
@@ -390,11 +390,8 @@ struct i40e_pf {
 #define I40E_FLAG_RSS_ENABLED			BIT_ULL(6)
 #define I40E_FLAG_VMDQ_ENABLED			BIT_ULL(7)
 #define I40E_FLAG_IWARP_ENABLED			BIT_ULL(10)
-#define I40E_FLAG_CLEAN_ADMINQ			BIT_ULL(14)
 #define I40E_FLAG_FILTER_SYNC			BIT_ULL(15)
 #define I40E_FLAG_SERVICE_CLIENT_REQUESTED	BIT_ULL(16)
-#define I40E_FLAG_PROCESS_MDD_EVENT		BIT_ULL(17)
-#define I40E_FLAG_PROCESS_VFLR_EVENT		BIT_ULL(18)
 #define I40E_FLAG_SRIOV_ENABLED			BIT_ULL(19)
 #define I40E_FLAG_DCB_ENABLED			BIT_ULL(20)
 #define I40E_FLAG_FD_SB_ENABLED			BIT_ULL(21)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
index f5f5bbe..b5ce68f 100644
@@ -41,7 +41,7 @@ static const char i40e_driver_string[] =
 
 #define DRV_VERSION_MAJOR 2
 #define DRV_VERSION_MINOR 1
-#define DRV_VERSION_BUILD 10
+#define DRV_VERSION_BUILD 11
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD)    DRV_KERN
drivers/net/ethernet/intel/i40evf/i40evf_main.c +1 -2
index 8c029c7..3b2f91a 100644
@@ -39,7 +39,7 @@ static const char i40evf_driver_string[] =
 
 #define DRV_VERSION_MAJOR 2
 #define DRV_VERSION_MINOR 1
-#define DRV_VERSION_BUILD 10
+#define DRV_VERSION_BUILD 11
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD) \
--

2.9.3

#13 lore raw

PATCH 8/13 i40e: remove I40E_FLAG_NEED_LINK_UPDATE

In reply to a message not in the archive

Reword description to be more accurate with upstream:

The I40E_FLAG_NEED_LINK_UPDATE definition was never used. Remove it.

Quoted 63 lines

-----Original Message-----
From: Michael, Alice
Sent: Monday, March 27, 2017 2:48 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Keller, Jacob E <[email protected]>
Subject: [next PATCH S65 08/13] i40e: remove I40E_FLAG_NEED_LINK_UPDATE

From: Jacob Keller <[email protected]>

In a previous commit the last use of I40E_FLAG_NEED_LINK_UPDATE was removed, but the flag definitions stayed around. Remove them.

Change-ID If59d0c6b4af85ca27281f3183c54b055adb439a4
---
 drivers/net/ethernet/intel/i40e/i40e.h      | 1 -
 drivers/net/ethernet/intel/i40e/i40e_main.c | 1 -
 drivers/net/ethernet/intel/i40evf/i40evf.h  | 1 -
 3 files changed, 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +0 -1
index 686327c..fc91ffd 100644
@@ -389,7 +389,6 @@ struct i40e_pf {
 #define I40E_FLAG_MSIX_ENABLED			BIT_ULL(3)
 #define I40E_FLAG_RSS_ENABLED			BIT_ULL(6)
 #define I40E_FLAG_VMDQ_ENABLED			BIT_ULL(7)
-#define I40E_FLAG_NEED_LINK_UPDATE		BIT_ULL(9)
 #define I40E_FLAG_IWARP_ENABLED			BIT_ULL(10)
 #define I40E_FLAG_CLEAN_ADMINQ			BIT_ULL(14)
 #define I40E_FLAG_FILTER_SYNC			BIT_ULL(15)
drivers/net/ethernet/intel/i40e/i40e_main.c +0 -1
index cecbb5d..f5f5bbe 100644
@@ -11125,7 +11125,6 @@ static int i40e_probe(struct pci_dev *pdev, const
 struct pci_device_id *ent)
 
 	INIT_WORK(&pf->service_task, i40e_service_task);
 	clear_bit(__I40E_SERVICE_SCHED, &pf->state);
-	pf->flags |= I40E_FLAG_NEED_LINK_UPDATE;
 
 	/* NVM bit on means WoL disabled for the port */

i40e_read_nvm_word(hw, I40E_SR_NVM_WAKE_ON_LAN,
&wol_nvm_bits);

drivers/net/ethernet/intel/i40evf/i40evf.h +0 -2
index d61ecf6..35ded19 100644
@@ -205,7 +205,6 @@ struct i40evf_adapter {
 #define I40EVF_FLAG_IN_NETPOLL			BIT(4)
 #define I40EVF_FLAG_IMIR_ENABLED		BIT(5)
 #define I40EVF_FLAG_MQ_CAPABLE			BIT(6)
-#define I40EVF_FLAG_NEED_LINK_UPDATE		BIT(7)
 #define I40EVF_FLAG_PF_COMMS_FAILED		BIT(8)
 #define I40EVF_FLAG_RESET_PENDING		BIT(9)
 #define I40EVF_FLAG_RESET_NEEDED		BIT(10)
--

2.9.3

#3 lore raw

PATCH 3/13 i40e: display correct udp tunnel type

In reply to Keller

This series should be removed from intel-wired-lan .

Thanks
Bimmy

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Keller, Jacob E
Sent: Monday, March 27, 2017 4:42 PM
To: Michael, Alice <[email protected]>; intel-wired-lan at lists.osuosl.org
Subject: Re: [Intel-wired-lan] [next PATCH S65 03/13] i40e: display correct udp tunnel type

This patch is incorrect. It doesn't contain most of the meat of the code. I think the error messages are fixed in a different way in the current upstream. I can create a separate patch to bring them in line or you can fix this one.

We need to change the code in i40e_sync_udp_filters_subtask so that it doesn't do a hard check against "non-zero udp_ports[i].type" means VXLAN and zero means Geneve.

Thanks,
Jake

Quoted 41 lines

-----Original Message-----
From: Michael, Alice
Sent: Monday, March 27, 2017 2:48 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Keller, Jacob E <[email protected]>
Subject: [next PATCH S65 03/13] i40e: display correct udp tunnel type

From: Jacob Keller <[email protected]>

Do not hardcode vxlan into the error message, and instead check to determine whether this is a geneve or a vxlan tunnel.

Change-ID I1a8fcdbdb57f7cb9f3723aba2fff5036165f6dc3

---
Testing-hints:
Partially upstream. The exact way of parsing the tunnel type to a string was changed.

 drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +0 -0
index 9ce06e8..9e665fa 100644
@@ -7231,6 +7231,11 @@ static void i40e_handle_mdd_event(struct 

i40e_pf
*pf)

drivers/net/ethernet/intel/i40e/i40e_main.c +4 -1
 	i40e_flush(hw);
 }
 
+static const char * const tunnel_types[] = {
+	[UDP_TUNNEL_TYPE_VXLAN] = "vxlan",
+	[UDP_TUNNEL_TYPE_GENEVE] = "geneve", };
+
 /**
  * i40e_sync_udp_filters_subtask - Sync the VSI filter list with HW
  * @pf: board private structure
--
Quoted 1 line

2.9.3

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan at lists.osuosl.org
http://lists.osuosl.org/mailman/listinfo/intel-wired-lan