All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [next PATCH S51-V2 0/8] i40e/i40evf updates
@ 2016-10-25 23:08 Bimmy Pujari
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 1/8] i40e: Be much more verbose about what we can and cannot offload Bimmy Pujari
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Bimmy Pujari @ 2016-10-25 23:08 UTC (permalink / raw)
  To: intel-wired-lan

Alexander Duyck adds code to be much more verbose about what we can and 
cannot offload.

Jacob Keller removes unnecessary label from
i40e_vc_config_promiscuous_mode_msg, removes second check of VLAN_N_VID
in i40e_vlan_rx_add_vid, adds code to avoid duplicate private flags
definitions & fixes trivial typo in naming of i40e_sync_filters_subtask.

Michal Kosiarz adds code for Clause22 implementation.

Piotr Raczynski adds code to add protocols over MCTP to 
i40e_aq_discover_capabilities.

 drivers/net/ethernet/intel/i40e/i40e_common.c      | 188 ++++++++++++++++-----
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |  42 ++---
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  60 +++++--
 drivers/net/ethernet/intel/i40e/i40e_prototype.h   |  12 +-
 drivers/net/ethernet/intel/i40e/i40e_type.h        |  23 ++-
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |   7 +-
 drivers/net/ethernet/intel/i40evf/i40e_type.h      |   4 +
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |  59 +++++++
 8 files changed, 303 insertions(+), 92 deletions(-)

-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S51-V2 1/8] i40e: Be much more verbose about what we can and cannot offload
  2016-10-25 23:08 [Intel-wired-lan] [next PATCH S51-V2 0/8] i40e/i40evf updates Bimmy Pujari
@ 2016-10-25 23:08 ` Bimmy Pujari
  2016-10-26 21:17   ` Bowers, AndrewX
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 2/8] i40evf: " Bimmy Pujari
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Bimmy Pujari @ 2016-10-25 23:08 UTC (permalink / raw)
  To: intel-wired-lan

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

This change makes it so that we are much more robust about defining what we
can and cannot offload.  Previously we were just checking for the L4 tunnel
header length, however there are other fields we should be verifying as
there are multiple scenarios in which we cannot perform hardware offloads.

In addition the device only supports GSO as long as the MSS is 64 or
greater.  We were not checking this so an MSS less than that was resulting
in Tx hangs.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Change-ID: I5e2fd5f3075c73601b4b36327b771c64fcb6c31b
---
Testing Hints:
        This is half of the fix needed to address MSS less than 64.  This
        is the fix for upstream and kernels after 3.18.4, but we will need
        to come up with a separate fix for out-of-tree that can be stripped
        on kernels prior to 3.18.4.

        An easy test for this patch is to just set the MTU for an interface
        to a value 102.  Without this patch we should see Tx hangs with
        netperf and with we should be able to pass traffic without
        triggering Tx hangs.

 drivers/net/ethernet/intel/i40e/i40e_main.c | 52 ++++++++++++++++++++++++-----
 1 file changed, 44 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 82805fe..d572f1d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -9057,10 +9057,6 @@ static int i40e_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				       nlflags, 0, 0, filter_mask, NULL);
 }
 
-/* Hardware supports L4 tunnel length of 128B (=2^7) which includes
- * inner mac plus all inner ethertypes.
- */
-#define I40E_MAX_TUNNEL_HDR_LEN 128
 /**
  * i40e_features_check - Validate encapsulated packet conforms to limits
  * @skb: skb buff
@@ -9071,12 +9067,52 @@ static netdev_features_t i40e_features_check(struct sk_buff *skb,
 					     struct net_device *dev,
 					     netdev_features_t features)
 {
-	if (skb->encapsulation &&
-	    ((skb_inner_network_header(skb) - skb_transport_header(skb)) >
-	     I40E_MAX_TUNNEL_HDR_LEN))
-		return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
+	size_t len;
+
+	/* No point in doing any of this if neither checksum nor GSO are
+	 * being requested for this frame.  We can rule out both by just
+	 * checking for CHECKSUM_PARTIAL
+	 */
+	if (skb->ip_summed != CHECKSUM_PARTIAL)
+		return features;
+
+	/* We cannot support GSO if the MSS is going to be less than
+	 * 64 bytes.  If it is then we need to drop support for GSO.
+	 */
+	if (skb_is_gso(skb) && (skb_shinfo(skb)->gso_size < 64))
+		features &= ~NETIF_F_GSO_MASK;
+
+	/* MACLEN can support@most 63 words */
+	len = skb_network_header(skb) - skb->data;
+	if (len & ~(63 * 2))
+		goto out_err;
+
+	/* IPLEN and EIPLEN can support at most 127 dwords */
+	len = skb_transport_header(skb) - skb_network_header(skb);
+	if (len & ~(127 * 4))
+		goto out_err;
+
+	if (skb->encapsulation) {
+		/* L4TUNLEN can support 127 words */
+		len = skb_inner_network_header(skb) - skb_transport_header(skb);
+		if (len & ~(127 * 2))
+			goto out_err;
+
+		/* IPLEN can support at most 127 dwords */
+		len = skb_inner_transport_header(skb) -
+		      skb_inner_network_header(skb);
+		if (len & ~(127 * 4))
+			goto out_err;
+	}
+
+	/* No need to validate L4LEN as TCP is the only protocol with a
+	 * a flexible value and we support all possible values supported
+	 * by TCP, which is at most 15 dwords
+	 */
 
 	return features;
+out_err:
+	return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
 }
 
 static const struct net_device_ops i40e_netdev_ops = {
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S51-V2 2/8] i40evf: Be much more verbose about what we can and cannot offload
  2016-10-25 23:08 [Intel-wired-lan] [next PATCH S51-V2 0/8] i40e/i40evf updates Bimmy Pujari
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 1/8] i40e: Be much more verbose about what we can and cannot offload Bimmy Pujari
@ 2016-10-25 23:08 ` Bimmy Pujari
  2016-10-27 16:13   ` Bowers, AndrewX
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 3/8] i40e: remove error_param_int label from i40e_vc_config_promiscuous_mode_msg Bimmy Pujari
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Bimmy Pujari @ 2016-10-25 23:08 UTC (permalink / raw)
  To: intel-wired-lan

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

This change makes it so that we are much more robust about defining what we
can and cannot offload.  Previously we were performing no checks.  This
should bring us up to parity with the i40e PF driver.

In addition the device only supports GSO as long as the MSS is 64 or
greater.  We were not checking this so an MSS less than that was resulting
in Tx hangs.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Change-ID: If533553ec92fc6ba694eab6ac81fdaf3004f3592
---
Testing Hints:
        This is half of the fix needed to address MSS less than 64.  This
        is the fix for upstream and kernels after 3.18.4, but we will need
        to come up with a separate fix for out-of-tree that can be stripped
        on kernels prior to 3.18.4.

        An easy test for this patch is to just set the MTU for an interface
        to a value 102.  Without this patch we should see Tx hangs with
        netperf and with we should be able to pass traffic without
        triggering Tx hangs.

 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 59 +++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index db36744..7bbb55f 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2172,6 +2172,64 @@ static int i40evf_change_mtu(struct net_device *netdev, int new_mtu)
 	return 0;
 }
 
+/**
+ * i40evf_features_check - Validate encapsulated packet conforms to limits
+ * @skb: skb buff
+ * @netdev: This physical port's netdev
+ * @features: Offload features that the stack believes apply
+ **/
+static netdev_features_t i40evf_features_check(struct sk_buff *skb,
+					       struct net_device *dev,
+					       netdev_features_t features)
+{
+	size_t len;
+
+	/* No point in doing any of this if neither checksum nor GSO are
+	 * being requested for this frame.  We can rule out both by just
+	 * checking for CHECKSUM_PARTIAL
+	 */
+	if (skb->ip_summed != CHECKSUM_PARTIAL)
+		return features;
+
+	/* We cannot support GSO if the MSS is going to be less than
+	 * 64 bytes.  If it is then we need to drop support for GSO.
+	 */
+	if (skb_is_gso(skb) && (skb_shinfo(skb)->gso_size < 64))
+		features &= ~NETIF_F_GSO_MASK;
+
+	/* MACLEN can support@most 63 words */
+	len = skb_network_header(skb) - skb->data;
+	if (len & ~(63 * 2))
+		goto out_err;
+
+	/* IPLEN and EIPLEN can support at most 127 dwords */
+	len = skb_transport_header(skb) - skb_network_header(skb);
+	if (len & ~(127 * 4))
+		goto out_err;
+
+	if (skb->encapsulation) {
+		/* L4TUNLEN can support 127 words */
+		len = skb_inner_network_header(skb) - skb_transport_header(skb);
+		if (len & ~(127 * 2))
+			goto out_err;
+
+		/* IPLEN can support at most 127 dwords */
+		len = skb_inner_transport_header(skb) -
+		      skb_inner_network_header(skb);
+		if (len & ~(127 * 4))
+			goto out_err;
+	}
+
+	/* No need to validate L4LEN as TCP is the only protocol with a
+	 * a flexible value and we support all possible values supported
+	 * by TCP, which is at most 15 dwords
+	 */
+
+	return features;
+out_err:
+	return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
+}
+
 #define I40EVF_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_TX |\
 			      NETIF_F_HW_VLAN_CTAG_RX |\
 			      NETIF_F_HW_VLAN_CTAG_FILTER)
@@ -2206,6 +2264,7 @@ static const struct net_device_ops i40evf_netdev_ops = {
 	.ndo_tx_timeout		= i40evf_tx_timeout,
 	.ndo_vlan_rx_add_vid	= i40evf_vlan_rx_add_vid,
 	.ndo_vlan_rx_kill_vid	= i40evf_vlan_rx_kill_vid,
+	.ndo_features_check	= i40evf_features_check,
 	.ndo_fix_features	= i40evf_fix_features,
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller	= i40evf_netpoll,
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S51-V2 3/8] i40e: remove error_param_int label from i40e_vc_config_promiscuous_mode_msg
  2016-10-25 23:08 [Intel-wired-lan] [next PATCH S51-V2 0/8] i40e/i40evf updates Bimmy Pujari
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 1/8] i40e: Be much more verbose about what we can and cannot offload Bimmy Pujari
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 2/8] i40evf: " Bimmy Pujari
@ 2016-10-25 23:08 ` Bimmy Pujari
  2016-10-26 22:07   ` Bowers, AndrewX
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 4/8] i40e: remove second check of VLAN_N_VID in i40e_vlan_rx_add_vid Bimmy Pujari
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Bimmy Pujari @ 2016-10-25 23:08 UTC (permalink / raw)
  To: intel-wired-lan

From: Jacob Keller <jacob.e.keller@intel.com>

This label is unnecessary, as are jumping to a block that checks aq_ret
and then immediately skipping it and returning. So just jump straight to
the error_param and remove this unnecessary label.

Also use goto error_param even in the last check for style consistency.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Change-ID: If487c7d10c4048e37c594e5eca167693aaed45f6
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 53b46553..46908c0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1536,7 +1536,7 @@ static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf,
 				vf->vf_id,
 				i40e_stat_str(&pf->hw, aq_ret),
 				i40e_aq_str(&pf->hw, aq_err));
-			goto error_param_int;
+			goto error_param;
 		}
 	}
 
@@ -1581,15 +1581,16 @@ static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf,
 							     allmulti, NULL,
 							     true);
 		aq_err = pf->hw.aq.asq_last_status;
-		if (aq_ret)
+		if (aq_ret) {
 			dev_err(&pf->pdev->dev,
 				"VF %d failed to set unicast promiscuous mode %8.8x err %s aq_err %s\n",
 				vf->vf_id, info->flags,
 				i40e_stat_str(&pf->hw, aq_ret),
 				i40e_aq_str(&pf->hw, aq_err));
+			goto error_param;
+		}
 	}
 
-error_param_int:
 	if (!aq_ret) {
 		dev_info(&pf->pdev->dev,
 			 "VF %d successfully set unicast promiscuous mode\n",
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S51-V2 4/8] i40e: remove second check of VLAN_N_VID in i40e_vlan_rx_add_vid
  2016-10-25 23:08 [Intel-wired-lan] [next PATCH S51-V2 0/8] i40e/i40evf updates Bimmy Pujari
                   ` (2 preceding siblings ...)
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 3/8] i40e: remove error_param_int label from i40e_vc_config_promiscuous_mode_msg Bimmy Pujari
@ 2016-10-25 23:08 ` Bimmy Pujari
  2016-10-26 22:09   ` Bowers, AndrewX
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 5/8] i40e: avoid duplicate private flags definitions Bimmy Pujari
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Bimmy Pujari @ 2016-10-25 23:08 UTC (permalink / raw)
  To: intel-wired-lan

From: Jacob Keller <jacob.e.keller@intel.com>

Replace a check of magic number 4095 with VLAN_N_VID. This
makes it obvious that a later check against VLAN_N_VID is
always true and can be removed.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Change-ID: I28998f127a61a529480ce63d8a07e266f6c63b7b
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++--
 1 file 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 d572f1d..4f8eae1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -2537,7 +2537,7 @@ static int i40e_vlan_rx_add_vid(struct net_device *netdev,
 	struct i40e_vsi *vsi = np->vsi;
 	int ret = 0;
 
-	if (vid > 4095)
+	if (vid >= VLAN_N_VID)
 		return -EINVAL;
 
 	/* If the network stack called us with vid = 0 then
@@ -2549,7 +2549,7 @@ static int i40e_vlan_rx_add_vid(struct net_device *netdev,
 	if (vid)
 		ret = i40e_vsi_add_vlan(vsi, vid);
 
-	if (!ret && (vid < VLAN_N_VID))
+	if (!ret)
 		set_bit(vid, vsi->active_vlans);
 
 	return ret;
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S51-V2 5/8] i40e: avoid duplicate private flags definitions
  2016-10-25 23:08 [Intel-wired-lan] [next PATCH S51-V2 0/8] i40e/i40evf updates Bimmy Pujari
                   ` (3 preceding siblings ...)
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 4/8] i40e: remove second check of VLAN_N_VID in i40e_vlan_rx_add_vid Bimmy Pujari
@ 2016-10-25 23:08 ` Bimmy Pujari
  2016-10-26 22:13   ` Bowers, AndrewX
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 6/8] i40e: Add Clause22 implementation Bimmy Pujari
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Bimmy Pujari @ 2016-10-25 23:08 UTC (permalink / raw)
  To: intel-wired-lan

From: Jacob Keller <jacob.e.keller@intel.com>

Separate the global private flags and the regular private flags per
interface into two arrays. Future additions of private flags will not
need to be duplicated which may lead to buggy code. Also rename
"i40e_priv_flags_strings_gl" to "i40e_gl_priv_flags_strings" for
clarity, as it reads more naturally.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Change-ID: I68caef3c9954eb7da342d7f9d20f2873186f2758
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 42 +++++++++++---------------
 1 file changed, 17 insertions(+), 25 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index b9e1162..f99c135 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -228,26 +228,22 @@ static const char i40e_gstrings_test[][ETH_GSTRING_LEN] = {
 
 #define I40E_TEST_LEN (sizeof(i40e_gstrings_test) / ETH_GSTRING_LEN)
 
-static const char i40e_priv_flags_strings_gl[][ETH_GSTRING_LEN] = {
+static const char i40e_priv_flags_strings[][ETH_GSTRING_LEN] = {
 	"MFP",
 	"LinkPolling",
 	"flow-director-atr",
 	"veb-stats",
 	"hw-atr-eviction",
-	"vf-true-promisc-support",
 };
 
-#define I40E_PRIV_FLAGS_GL_STR_LEN ARRAY_SIZE(i40e_priv_flags_strings_gl)
+#define I40E_PRIV_FLAGS_STR_LEN ARRAY_SIZE(i40e_priv_flags_strings)
 
-static const char i40e_priv_flags_strings[][ETH_GSTRING_LEN] = {
-	"NPAR",
-	"LinkPolling",
-	"flow-director-atr",
-	"veb-stats",
-	"hw-atr-eviction",
+/* Private flags with a global effect, restricted to PF 0 */
+static const char i40e_gl_priv_flags_strings[][ETH_GSTRING_LEN] = {
+	"vf-true-promisc-support",
 };
 
-#define I40E_PRIV_FLAGS_STR_LEN ARRAY_SIZE(i40e_priv_flags_strings)
+#define I40E_GL_PRIV_FLAGS_STR_LEN ARRAY_SIZE(i40e_gl_priv_flags_strings)
 
 /**
  * i40e_partition_setting_complaint - generic complaint for MFP restriction
@@ -1194,10 +1190,9 @@ static void i40e_get_drvinfo(struct net_device *netdev,
 		sizeof(drvinfo->fw_version));
 	strlcpy(drvinfo->bus_info, pci_name(pf->pdev),
 		sizeof(drvinfo->bus_info));
+	drvinfo->n_priv_flags = I40E_PRIV_FLAGS_STR_LEN;
 	if (pf->hw.pf_id == 0)
-		drvinfo->n_priv_flags = I40E_PRIV_FLAGS_GL_STR_LEN;
-	else
-		drvinfo->n_priv_flags = I40E_PRIV_FLAGS_STR_LEN;
+		drvinfo->n_priv_flags += I40E_GL_PRIV_FLAGS_STR_LEN;
 }
 
 static void i40e_get_ringparam(struct net_device *netdev,
@@ -1425,10 +1420,8 @@ static int i40e_get_sset_count(struct net_device *netdev, int sset)
 			return I40E_VSI_STATS_LEN(netdev);
 		}
 	case ETH_SS_PRIV_FLAGS:
-		if (pf->hw.pf_id == 0)
-			return I40E_PRIV_FLAGS_GL_STR_LEN;
-		else
-			return I40E_PRIV_FLAGS_STR_LEN;
+		return I40E_PRIV_FLAGS_STR_LEN +
+			(pf->hw.pf_id == 0 ? I40E_GL_PRIV_FLAGS_STR_LEN : 0);
 	default:
 		return -EOPNOTSUPP;
 	}
@@ -1626,15 +1619,14 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
 		/* BUG_ON(p - data != I40E_STATS_LEN * ETH_GSTRING_LEN); */
 		break;
 	case ETH_SS_PRIV_FLAGS:
+		for (i = 0; i < I40E_PRIV_FLAGS_STR_LEN; i++) {
+			memcpy(data, i40e_priv_flags_strings[i],
+			       ETH_GSTRING_LEN);
+			data += ETH_GSTRING_LEN;
+		}
 		if (pf->hw.pf_id == 0) {
-			for (i = 0; i < I40E_PRIV_FLAGS_GL_STR_LEN; i++) {
-				memcpy(data, i40e_priv_flags_strings_gl[i],
-				       ETH_GSTRING_LEN);
-				data += ETH_GSTRING_LEN;
-			}
-		} else {
-			for (i = 0; i < I40E_PRIV_FLAGS_STR_LEN; i++) {
-				memcpy(data, i40e_priv_flags_strings[i],
+			for (i = 0; i < I40E_GL_PRIV_FLAGS_STR_LEN; i++) {
+				memcpy(data, i40e_gl_priv_flags_strings[i],
 				       ETH_GSTRING_LEN);
 				data += ETH_GSTRING_LEN;
 			}
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S51-V2 6/8] i40e: Add Clause22 implementation
  2016-10-25 23:08 [Intel-wired-lan] [next PATCH S51-V2 0/8] i40e/i40evf updates Bimmy Pujari
                   ` (4 preceding siblings ...)
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 5/8] i40e: avoid duplicate private flags definitions Bimmy Pujari
@ 2016-10-25 23:08 ` Bimmy Pujari
  2016-10-26 22:21   ` Bowers, AndrewX
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 7/8] i40e: fix trivial typo in naming of i40e_sync_filters_subtask Bimmy Pujari
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 8/8] i40e: Add protocols over MCTP to i40e_aq_discover_capabilities Bimmy Pujari
  7 siblings, 1 reply; 17+ messages in thread
From: Bimmy Pujari @ 2016-10-25 23:08 UTC (permalink / raw)
  To: intel-wired-lan

From: Michal Kosiarz <michal.kosiarz@intel.com>

Some external PHYs require Clause22 method for accessing registers.
This patch also adds some defines to support blink led on devices using
10CBaseT PHY.

Signed-off-by: Michal Kosiarz <michal.kosiarz@intel.com>
Signed-off-by: Matt Jared <matthew.a.jared@intel.com>
Change-ID: I868a4326911900f6c89e7e522fda4968b0825f14
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 180 +++++++++++++++++------
 drivers/net/ethernet/intel/i40e/i40e_prototype.h |  12 +-
 drivers/net/ethernet/intel/i40e/i40e_type.h      |  19 ++-
 3 files changed, 159 insertions(+), 52 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 98791ba..838dc70 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -4396,7 +4396,99 @@ i40e_status i40e_aq_configure_partition_bw(struct i40e_hw *hw,
 }
 
 /**
- * i40e_read_phy_register
+ * i40e_read_phy_register_clause22
+ * @hw: pointer to the HW structure
+ * @reg: register address in the page
+ * @phy_adr: PHY address on MDIO interface
+ * @value: PHY register value
+ *
+ * Reads specified PHY register value
+ **/
+i40e_status i40e_read_phy_register_clause22(struct i40e_hw *hw,
+					u16 reg, u8 phy_addr, u16 *value)
+{
+	i40e_status status = I40E_ERR_TIMEOUT;
+	u8 port_num = (u8)hw->func_caps.mdio_port_num;
+	u32 command = 0;
+	u16 retry = 1000;
+
+	command = (reg << I40E_GLGEN_MSCA_DEVADD_SHIFT) |
+		  (phy_addr << I40E_GLGEN_MSCA_PHYADD_SHIFT) |
+		  (I40E_MDIO_CLAUSE22_OPCODE_READ_MASK) |
+		  (I40E_MDIO_CLAUSE22_STCODE_MASK) |
+		  (I40E_GLGEN_MSCA_MDICMD_MASK);
+	wr32(hw, I40E_GLGEN_MSCA(port_num), command);
+	do {
+		command = rd32(hw, I40E_GLGEN_MSCA(port_num));
+		if (!(command & I40E_GLGEN_MSCA_MDICMD_MASK)) {
+			status = 0;
+			break;
+		}
+		udelay(10);
+		retry--;
+	} while (retry);
+
+	if (status) {
+		i40e_debug(hw, I40E_DEBUG_PHY,
+			   "PHY: Can't write command to external PHY.\n");
+		goto phy_read_end;
+	}
+
+	if (!status) {
+		command = rd32(hw, I40E_GLGEN_MSRWD(port_num));
+		*value = (command & I40E_GLGEN_MSRWD_MDIRDDATA_MASK) >>
+			 I40E_GLGEN_MSRWD_MDIRDDATA_SHIFT;
+	} else {
+		i40e_debug(hw, I40E_DEBUG_PHY,
+			   "PHY: Can't read register value from external PHY.\n");
+	}
+
+phy_read_end:
+	return status;
+}
+
+/**
+ * i40e_write_phy_register_clause22
+ * @hw: pointer to the HW structure
+ * @reg: register address in the page
+ * @phy_adr: PHY address on MDIO interface
+ * @value: PHY register value
+ *
+ * Writes specified PHY register value
+ **/
+i40e_status i40e_write_phy_register_clause22(struct i40e_hw *hw,
+					u16 reg, u8 phy_addr, u16 value)
+{
+	i40e_status status = I40E_ERR_TIMEOUT;
+	u8 port_num = (u8)hw->func_caps.mdio_port_num;
+	u32 command  = 0;
+	u16 retry = 1000;
+
+	command = value << I40E_GLGEN_MSRWD_MDIWRDATA_SHIFT;
+	wr32(hw, I40E_GLGEN_MSRWD(port_num), command);
+
+	command = (reg << I40E_GLGEN_MSCA_DEVADD_SHIFT) |
+		  (phy_addr << I40E_GLGEN_MSCA_PHYADD_SHIFT) |
+		  (I40E_MDIO_CLAUSE22_OPCODE_WRITE_MASK) |
+		  (I40E_MDIO_CLAUSE22_STCODE_MASK) |
+		  (I40E_GLGEN_MSCA_MDICMD_MASK);
+
+	wr32(hw, I40E_GLGEN_MSCA(port_num), command);
+	do {
+		command = rd32(hw, I40E_GLGEN_MSCA(port_num));
+		if (!(command & I40E_GLGEN_MSCA_MDICMD_MASK)) {
+			status = 0;
+			break;
+		}
+		udelay(10);
+		retry--;
+	} while (retry);
+
+	return status;
+}
+
+/**
+ * i40e_read_phy_register_clause45
  * @hw: pointer to the HW structure
  * @page: registers page number
  * @reg: register address in the page
@@ -4405,9 +4497,8 @@ i40e_status i40e_aq_configure_partition_bw(struct i40e_hw *hw,
  *
  * Reads specified PHY register value
  **/
-i40e_status i40e_read_phy_register(struct i40e_hw *hw,
-				   u8 page, u16 reg, u8 phy_addr,
-				   u16 *value)
+i40e_status i40e_read_phy_register_clause45(struct i40e_hw *hw,
+				u8 page, u16 reg, u8 phy_addr, u16 *value)
 {
 	i40e_status status = I40E_ERR_TIMEOUT;
 	u32 command = 0;
@@ -4417,8 +4508,8 @@ i40e_status i40e_read_phy_register(struct i40e_hw *hw,
 	command = (reg << I40E_GLGEN_MSCA_MDIADD_SHIFT) |
 		  (page << I40E_GLGEN_MSCA_DEVADD_SHIFT) |
 		  (phy_addr << I40E_GLGEN_MSCA_PHYADD_SHIFT) |
-		  (I40E_MDIO_OPCODE_ADDRESS) |
-		  (I40E_MDIO_STCODE) |
+		  (I40E_MDIO_CLAUSE45_OPCODE_ADDRESS_MASK) |
+		  (I40E_MDIO_CLAUSE45_STCODE_MASK) |
 		  (I40E_GLGEN_MSCA_MDICMD_MASK) |
 		  (I40E_GLGEN_MSCA_MDIINPROGEN_MASK);
 	wr32(hw, I40E_GLGEN_MSCA(port_num), command);
@@ -4440,8 +4531,8 @@ i40e_status i40e_read_phy_register(struct i40e_hw *hw,
 
 	command = (page << I40E_GLGEN_MSCA_DEVADD_SHIFT) |
 		  (phy_addr << I40E_GLGEN_MSCA_PHYADD_SHIFT) |
-		  (I40E_MDIO_OPCODE_READ) |
-		  (I40E_MDIO_STCODE) |
+		  (I40E_MDIO_CLAUSE45_OPCODE_READ_MASK) |
+		  (I40E_MDIO_CLAUSE45_STCODE_MASK) |
 		  (I40E_GLGEN_MSCA_MDICMD_MASK) |
 		  (I40E_GLGEN_MSCA_MDIINPROGEN_MASK);
 	status = I40E_ERR_TIMEOUT;
@@ -4471,7 +4562,7 @@ i40e_status i40e_read_phy_register(struct i40e_hw *hw,
 }
 
 /**
- * i40e_write_phy_register
+ * i40e_write_phy_register_clause45
  * @hw: pointer to the HW structure
  * @page: registers page number
  * @reg: register address in the page
@@ -4480,9 +4571,8 @@ i40e_status i40e_read_phy_register(struct i40e_hw *hw,
  *
  * Writes value to specified PHY register
  **/
-i40e_status i40e_write_phy_register(struct i40e_hw *hw,
-				    u8 page, u16 reg, u8 phy_addr,
-				    u16 value)
+i40e_status i40e_write_phy_register_clause45(struct i40e_hw *hw,
+				u8 page, u16 reg, u8 phy_addr, u16 value)
 {
 	i40e_status status = I40E_ERR_TIMEOUT;
 	u32 command = 0;
@@ -4492,8 +4582,8 @@ i40e_status i40e_write_phy_register(struct i40e_hw *hw,
 	command = (reg << I40E_GLGEN_MSCA_MDIADD_SHIFT) |
 		  (page << I40E_GLGEN_MSCA_DEVADD_SHIFT) |
 		  (phy_addr << I40E_GLGEN_MSCA_PHYADD_SHIFT) |
-		  (I40E_MDIO_OPCODE_ADDRESS) |
-		  (I40E_MDIO_STCODE) |
+		  (I40E_MDIO_CLAUSE45_OPCODE_ADDRESS_MASK) |
+		  (I40E_MDIO_CLAUSE45_STCODE_MASK) |
 		  (I40E_GLGEN_MSCA_MDICMD_MASK) |
 		  (I40E_GLGEN_MSCA_MDIINPROGEN_MASK);
 	wr32(hw, I40E_GLGEN_MSCA(port_num), command);
@@ -4517,8 +4607,8 @@ i40e_status i40e_write_phy_register(struct i40e_hw *hw,
 
 	command = (page << I40E_GLGEN_MSCA_DEVADD_SHIFT) |
 		  (phy_addr << I40E_GLGEN_MSCA_PHYADD_SHIFT) |
-		  (I40E_MDIO_OPCODE_WRITE) |
-		  (I40E_MDIO_STCODE) |
+		  (I40E_MDIO_CLAUSE45_OPCODE_WRITE_MASK) |
+		  (I40E_MDIO_CLAUSE45_STCODE_MASK) |
 		  (I40E_GLGEN_MSCA_MDICMD_MASK) |
 		  (I40E_GLGEN_MSCA_MDIINPROGEN_MASK);
 	status = I40E_ERR_TIMEOUT;
@@ -4580,14 +4670,16 @@ i40e_status i40e_blink_phy_link_led(struct i40e_hw *hw,
 
 	for (gpio_led_port = 0; gpio_led_port < 3; gpio_led_port++,
 	     led_addr++) {
-		status = i40e_read_phy_register(hw, I40E_PHY_COM_REG_PAGE,
-						led_addr, phy_addr, &led_reg);
+		status = i40e_read_phy_register_clause45(hw,
+							 I40E_PHY_COM_REG_PAGE,
+							 led_addr, phy_addr,
+							 &led_reg);
 		if (status)
 			goto phy_blinking_end;
 		led_ctl = led_reg;
 		if (led_reg & I40E_PHY_LED_LINK_MODE_MASK) {
 			led_reg = 0;
-			status = i40e_write_phy_register(hw,
+			status = i40e_write_phy_register_clause45(hw,
 							 I40E_PHY_COM_REG_PAGE,
 							 led_addr, phy_addr,
 							 led_reg);
@@ -4599,20 +4691,18 @@ i40e_status i40e_blink_phy_link_led(struct i40e_hw *hw,
 
 	if (time > 0 && interval > 0) {
 		for (i = 0; i < time * 1000; i += interval) {
-			status = i40e_read_phy_register(hw,
-							I40E_PHY_COM_REG_PAGE,
-							led_addr, phy_addr,
-							&led_reg);
+			status = i40e_read_phy_register_clause45(hw,
+						I40E_PHY_COM_REG_PAGE,
+						led_addr, phy_addr, &led_reg);
 			if (status)
 				goto restore_config;
 			if (led_reg & I40E_PHY_LED_MANUAL_ON)
 				led_reg = 0;
 			else
 				led_reg = I40E_PHY_LED_MANUAL_ON;
-			status = i40e_write_phy_register(hw,
-							 I40E_PHY_COM_REG_PAGE,
-							 led_addr, phy_addr,
-							 led_reg);
+			status = i40e_write_phy_register_clause45(hw,
+						I40E_PHY_COM_REG_PAGE,
+						led_addr, phy_addr, led_reg);
 			if (status)
 				goto restore_config;
 			msleep(interval);
@@ -4620,8 +4710,9 @@ i40e_status i40e_blink_phy_link_led(struct i40e_hw *hw,
 	}
 
 restore_config:
-	status = i40e_write_phy_register(hw, I40E_PHY_COM_REG_PAGE, led_addr,
-					 phy_addr, led_ctl);
+	status = i40e_write_phy_register_clause45(hw,
+						  I40E_PHY_COM_REG_PAGE,
+						  led_addr, phy_addr, led_ctl);
 
 phy_blinking_end:
 	return status;
@@ -4652,8 +4743,10 @@ i40e_status i40e_led_get_phy(struct i40e_hw *hw, u16 *led_addr,
 
 	for (gpio_led_port = 0; gpio_led_port < 3; gpio_led_port++,
 	     temp_addr++) {
-		status = i40e_read_phy_register(hw, I40E_PHY_COM_REG_PAGE,
-						temp_addr, phy_addr, &reg_val);
+		status = i40e_read_phy_register_clause45(hw,
+							 I40E_PHY_COM_REG_PAGE,
+							 temp_addr, phy_addr,
+							 &reg_val);
 		if (status)
 			return status;
 		*val = reg_val;
@@ -4686,41 +4779,42 @@ i40e_status i40e_led_set_phy(struct i40e_hw *hw, bool on,
 	i = rd32(hw, I40E_PFGEN_PORTNUM);
 	port_num = (u8)(i & I40E_PFGEN_PORTNUM_PORT_NUM_MASK);
 	phy_addr = i40e_get_phy_address(hw, port_num);
-
-	status = i40e_read_phy_register(hw, I40E_PHY_COM_REG_PAGE, led_addr,
-					phy_addr, &led_reg);
+	status = i40e_read_phy_register_clause45(hw, I40E_PHY_COM_REG_PAGE,
+						 led_addr, phy_addr, &led_reg);
 	if (status)
 		return status;
 	led_ctl = led_reg;
 	if (led_reg & I40E_PHY_LED_LINK_MODE_MASK) {
 		led_reg = 0;
-		status = i40e_write_phy_register(hw, I40E_PHY_COM_REG_PAGE,
-						 led_addr, phy_addr, led_reg);
+		status = i40e_write_phy_register_clause45(hw,
+							  I40E_PHY_COM_REG_PAGE,
+							  led_addr, phy_addr,
+							  led_reg);
 		if (status)
 			return status;
 	}
-	status = i40e_read_phy_register(hw, I40E_PHY_COM_REG_PAGE,
-					led_addr, phy_addr, &led_reg);
+	status = i40e_read_phy_register_clause45(hw, I40E_PHY_COM_REG_PAGE,
+						 led_addr, phy_addr, &led_reg);
 	if (status)
 		goto restore_config;
 	if (on)
 		led_reg = I40E_PHY_LED_MANUAL_ON;
 	else
 		led_reg = 0;
-	status = i40e_write_phy_register(hw, I40E_PHY_COM_REG_PAGE,
-					 led_addr, phy_addr, led_reg);
+	status = i40e_write_phy_register_clause45(hw, I40E_PHY_COM_REG_PAGE,
+						  led_addr, phy_addr, led_reg);
 	if (status)
 		goto restore_config;
 	if (mode & I40E_PHY_LED_MODE_ORIG) {
 		led_ctl = (mode & I40E_PHY_LED_MODE_MASK);
-		status = i40e_write_phy_register(hw,
+		status = i40e_write_phy_register_clause45(hw,
 						 I40E_PHY_COM_REG_PAGE,
 						 led_addr, phy_addr, led_ctl);
 	}
 	return status;
 restore_config:
-	status = i40e_write_phy_register(hw, I40E_PHY_COM_REG_PAGE, led_addr,
-					 phy_addr, led_ctl);
+	status = i40e_write_phy_register_clause45(hw, I40E_PHY_COM_REG_PAGE,
+						  led_addr, phy_addr, led_ctl);
 	return status;
 }
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index 4660c5a..b1bf64e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -362,10 +362,14 @@ i40e_status i40e_aq_rx_ctl_write_register(struct i40e_hw *hw,
 				u32 reg_addr, u32 reg_val,
 				struct i40e_asq_cmd_details *cmd_details);
 void i40e_write_rx_ctl(struct i40e_hw *hw, u32 reg_addr, u32 reg_val);
-i40e_status i40e_read_phy_register(struct i40e_hw *hw, u8 page,
-				   u16 reg, u8 phy_addr, u16 *value);
-i40e_status i40e_write_phy_register(struct i40e_hw *hw, u8 page,
-				    u16 reg, u8 phy_addr, u16 value);
+i40e_status i40e_read_phy_register_clause22(struct i40e_hw *hw,
+					u16 reg, u8 phy_addr, u16 *value);
+i40e_status i40e_write_phy_register_clause22(struct i40e_hw *hw,
+					u16 reg, u8 phy_addr, u16 value);
+i40e_status i40e_read_phy_register_clause45(struct i40e_hw *hw,
+				u8 page, u16 reg, u8 phy_addr, u16 *value);
+i40e_status i40e_write_phy_register_clause45(struct i40e_hw *hw,
+				u8 page, u16 reg, u8 phy_addr, u16 value);
 u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num);
 i40e_status i40e_blink_phy_link_led(struct i40e_hw *hw,
 				    u32 time, u32 interval);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index d9a2660..cf085cd 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -90,14 +90,23 @@ enum i40e_debug_mask {
 	I40E_DEBUG_ALL			= 0xFFFFFFFF
 };
 
-#define I40E_MDIO_STCODE                0
-#define I40E_MDIO_OPCODE_ADDRESS        0
-#define I40E_MDIO_OPCODE_WRITE          I40E_MASK(1, \
+#define I40E_MDIO_CLAUSE22_STCODE_MASK	I40E_MASK(1, \
+						  I40E_GLGEN_MSCA_STCODE_SHIFT)
+#define I40E_MDIO_CLAUSE22_OPCODE_WRITE_MASK	I40E_MASK(1, \
 						  I40E_GLGEN_MSCA_OPCODE_SHIFT)
-#define I40E_MDIO_OPCODE_READ_INC_ADDR  I40E_MASK(2, \
+#define I40E_MDIO_CLAUSE22_OPCODE_READ_MASK	I40E_MASK(2, \
 						  I40E_GLGEN_MSCA_OPCODE_SHIFT)
-#define I40E_MDIO_OPCODE_READ           I40E_MASK(3, \
+
+#define I40E_MDIO_CLAUSE45_STCODE_MASK	I40E_MASK(0, \
+						  I40E_GLGEN_MSCA_STCODE_SHIFT)
+#define I40E_MDIO_CLAUSE45_OPCODE_ADDRESS_MASK	I40E_MASK(0, \
+						  I40E_GLGEN_MSCA_OPCODE_SHIFT)
+#define I40E_MDIO_CLAUSE45_OPCODE_WRITE_MASK	I40E_MASK(1, \
 						  I40E_GLGEN_MSCA_OPCODE_SHIFT)
+#define I40E_MDIO_CLAUSE45_OPCODE_READ_INC_ADDR_MASK	I40E_MASK(2, \
+						I40E_GLGEN_MSCA_OPCODE_SHIFT)
+#define I40E_MDIO_CLAUSE45_OPCODE_READ_MASK    I40E_MASK(3, \
+						I40E_GLGEN_MSCA_OPCODE_SHIFT)
 
 #define I40E_PHY_COM_REG_PAGE                   0x1E
 #define I40E_PHY_LED_LINK_MODE_MASK             0xF0
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S51-V2 7/8] i40e: fix trivial typo in naming of i40e_sync_filters_subtask
  2016-10-25 23:08 [Intel-wired-lan] [next PATCH S51-V2 0/8] i40e/i40evf updates Bimmy Pujari
                   ` (5 preceding siblings ...)
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 6/8] i40e: Add Clause22 implementation Bimmy Pujari
@ 2016-10-25 23:08 ` Bimmy Pujari
  2016-10-26 22:23   ` Bowers, AndrewX
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 8/8] i40e: Add protocols over MCTP to i40e_aq_discover_capabilities Bimmy Pujari
  7 siblings, 1 reply; 17+ messages in thread
From: Bimmy Pujari @ 2016-10-25 23:08 UTC (permalink / raw)
  To: intel-wired-lan

From: Jacob Keller <jacob.e.keller@intel.com>

A comment incorrectly referred to i40e_vsi_sync_filters_subtask which
does not actually exist. Reference the correct function instead.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Change-ID: I6bd805c605741ffb6fe34377259bb0d597edfafd
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++--
 1 file 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 4f8eae1..c7b3a39 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1211,12 +1211,12 @@ bool i40e_is_vsi_in_vlan(struct i40e_vsi *vsi)
 	 *    i40e_add_filter.
 	 *
 	 * 2) the only place where filters are actually removed is in
-	 *    i40e_vsi_sync_filters_subtask.
+	 *    i40e_sync_filters_subtask.
 	 *
 	 * Thus, we can simply use a boolean value, has_vlan_filters which we
 	 * will set to true when we add a vlan filter in i40e_add_filter. Then
 	 * we have to perform the full search after deleting filters in
-	 * i40e_vsi_sync_filters_subtask, but we already have to search
+	 * i40e_sync_filters_subtask, but we already have to search
 	 * filters here and can perform the check at the same time. This
 	 * results in avoiding embedding a loop for vlan mode inside another
 	 * loop over all the filters, and should maintain correctness as noted
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S51-V2 8/8] i40e: Add protocols over MCTP to i40e_aq_discover_capabilities
  2016-10-25 23:08 [Intel-wired-lan] [next PATCH S51-V2 0/8] i40e/i40evf updates Bimmy Pujari
                   ` (6 preceding siblings ...)
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 7/8] i40e: fix trivial typo in naming of i40e_sync_filters_subtask Bimmy Pujari
@ 2016-10-25 23:08 ` Bimmy Pujari
  2016-10-26 22:28   ` Bowers, AndrewX
  7 siblings, 1 reply; 17+ messages in thread
From: Bimmy Pujari @ 2016-10-25 23:08 UTC (permalink / raw)
  To: intel-wired-lan

From: Piotr Raczynski <piotr.raczynski@intel.com>

Add logical_id to I40E_AQ_CAP_ID_MNG_MODE capability starting from major
version 2.

Signed-off-by: Piotr Raczynski <piotr.raczynski@intel.com>
Change-ID: Idb29214b172ea5c70cbd45a99e6745c0215af7e4
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 8 ++++++++
 drivers/net/ethernet/intel/i40e/i40e_type.h   | 4 ++++
 drivers/net/ethernet/intel/i40evf/i40e_type.h | 4 ++++
 3 files changed, 16 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 838dc70..216e8fd 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -3147,6 +3147,14 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
 			break;
 		case I40E_AQ_CAP_ID_MNG_MODE:
 			p->management_mode = number;
+			if (major_rev > 1) {
+				p->mng_protocols_over_mctp = logical_id;
+				i40e_debug(hw, I40E_DEBUG_INIT,
+					   "HW Capability: Protocols over MCTP = %d\n",
+					   p->mng_protocols_over_mctp);
+			} else {
+				p->mng_protocols_over_mctp = 0;
+			}
 			break;
 		case I40E_AQ_CAP_ID_NPAR_ACTIVE:
 			p->npar_enable = number;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index cf085cd..e02cb73 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -263,6 +263,10 @@ struct i40e_hw_capabilities {
 #define I40E_NVM_IMAGE_TYPE_UDP_CLOUD	0x3
 
 	u32  management_mode;
+	u32  mng_protocols_over_mctp;
+#define I40E_MNG_PROTOCOL_PLDM		0x2
+#define I40E_MNG_PROTOCOL_OEM_COMMANDS	0x4
+#define I40E_MNG_PROTOCOL_NCSI		0x8
 	u32  npar_enable;
 	u32  os2bmc;
 	u32  valid_functions;
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h
index ca7afe5..515484c 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h
@@ -237,6 +237,10 @@ struct i40e_hw_capabilities {
 #define I40E_NVM_IMAGE_TYPE_UDP_CLOUD	0x3
 
 	u32  management_mode;
+	u32  mng_protocols_over_mctp;
+#define I40E_MNG_PROTOCOL_PLDM		0x2
+#define I40E_MNG_PROTOCOL_OEM_COMMANDS	0x4
+#define I40E_MNG_PROTOCOL_NCSI		0x8
 	u32  npar_enable;
 	u32  os2bmc;
 	u32  valid_functions;
-- 
2.4.11


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

* [Intel-wired-lan] [next PATCH S51-V2 1/8] i40e: Be much more verbose about what we can and cannot offload
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 1/8] i40e: Be much more verbose about what we can and cannot offload Bimmy Pujari
@ 2016-10-26 21:17   ` Bowers, AndrewX
  0 siblings, 0 replies; 17+ messages in thread
From: Bowers, AndrewX @ 2016-10-26 21: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: Tuesday, October 25, 2016 4:09 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S51-V2 1/8] i40e: Be much more
> verbose about what we can and cannot offload
> 
> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> This change makes it so that we are much more robust about defining what
> we can and cannot offload.  Previously we were just checking for the L4
> tunnel header length, however there are other fields we should be verifying
> as there are multiple scenarios in which we cannot perform hardware
> offloads.
> 
> In addition the device only supports GSO as long as the MSS is 64 or greater.
> We were not checking this so an MSS less than that was resulting in Tx hangs.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Change-ID: I5e2fd5f3075c73601b4b36327b771c64fcb6c31b
> ---
> Testing Hints:
>         This is half of the fix needed to address MSS less than 64.  This
>         is the fix for upstream and kernels after 3.18.4, but we will need
>         to come up with a separate fix for out-of-tree that can be stripped
>         on kernels prior to 3.18.4.
> 
>         An easy test for this patch is to just set the MTU for an interface
>         to a value 102.  Without this patch we should see Tx hangs with
>         netperf and with we should be able to pass traffic without
>         triggering Tx hangs.
> 
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 52
> ++++++++++++++++++++++++-----
>  1 file changed, 44 insertions(+), 8 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
No TX Hangs with MTU 102



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

* [Intel-wired-lan] [next PATCH S51-V2 3/8] i40e: remove error_param_int label from i40e_vc_config_promiscuous_mode_msg
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 3/8] i40e: remove error_param_int label from i40e_vc_config_promiscuous_mode_msg Bimmy Pujari
@ 2016-10-26 22:07   ` Bowers, AndrewX
  0 siblings, 0 replies; 17+ messages in thread
From: Bowers, AndrewX @ 2016-10-26 22:07 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: Tuesday, October 25, 2016 4:09 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S51-V2 3/8] i40e: remove
> error_param_int label from i40e_vc_config_promiscuous_mode_msg
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> This label is unnecessary, as are jumping to a block that checks aq_ret and
> then immediately skipping it and returning. So just jump straight to the
> error_param and remove this unnecessary label.
> 
> Also use goto error_param even in the last check for style consistency.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Change-ID: If487c7d10c4048e37c594e5eca167693aaed45f6
> ---
>  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

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



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

* [Intel-wired-lan] [next PATCH S51-V2 4/8] i40e: remove second check of VLAN_N_VID in i40e_vlan_rx_add_vid
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 4/8] i40e: remove second check of VLAN_N_VID in i40e_vlan_rx_add_vid Bimmy Pujari
@ 2016-10-26 22:09   ` Bowers, AndrewX
  0 siblings, 0 replies; 17+ messages in thread
From: Bowers, AndrewX @ 2016-10-26 22:09 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: Tuesday, October 25, 2016 4:09 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S51-V2 4/8] i40e: remove second
> check of VLAN_N_VID in i40e_vlan_rx_add_vid
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> Replace a check of magic number 4095 with VLAN_N_VID. This makes it
> obvious that a later check against VLAN_N_VID is always true and can be
> removed.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Change-ID: I28998f127a61a529480ce63d8a07e266f6c63b7b
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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



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

* [Intel-wired-lan] [next PATCH S51-V2 5/8] i40e: avoid duplicate private flags definitions
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 5/8] i40e: avoid duplicate private flags definitions Bimmy Pujari
@ 2016-10-26 22:13   ` Bowers, AndrewX
  0 siblings, 0 replies; 17+ messages in thread
From: Bowers, AndrewX @ 2016-10-26 22:13 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: Tuesday, October 25, 2016 4:09 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S51-V2 5/8] i40e: avoid duplicate
> private flags definitions
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> Separate the global private flags and the regular private flags per interface
> into two arrays. Future additions of private flags will not need to be
> duplicated which may lead to buggy code. Also rename
> "i40e_priv_flags_strings_gl" to "i40e_gl_priv_flags_strings" for clarity, as it
> reads more naturally.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Change-ID: I68caef3c9954eb7da342d7f9d20f2873186f2758
> ---
>  drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 42 +++++++++++------------
> ---
>  1 file changed, 17 insertions(+), 25 deletions(-)

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



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

* [Intel-wired-lan] [next PATCH S51-V2 6/8] i40e: Add Clause22 implementation
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 6/8] i40e: Add Clause22 implementation Bimmy Pujari
@ 2016-10-26 22:21   ` Bowers, AndrewX
  0 siblings, 0 replies; 17+ messages in thread
From: Bowers, AndrewX @ 2016-10-26 22:21 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: Tuesday, October 25, 2016 4:09 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Jared, Matthew A <matthew.a.jared@intel.com>; Kosiarz, Michal
> <michal.kosiarz@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S51-V2 6/8] i40e: Add Clause22
> implementation
> 
> From: Michal Kosiarz <michal.kosiarz@intel.com>
> 
> Some external PHYs require Clause22 method for accessing registers.
> This patch also adds some defines to support blink led on devices using
> 10CBaseT PHY.
> 
> Signed-off-by: Michal Kosiarz <michal.kosiarz@intel.com>
> Signed-off-by: Matt Jared <matthew.a.jared@intel.com>
> Change-ID: I868a4326911900f6c89e7e522fda4968b0825f14
> ---
>  drivers/net/ethernet/intel/i40e/i40e_common.c    | 180
> +++++++++++++++++------
>  drivers/net/ethernet/intel/i40e/i40e_prototype.h |  12 +-
>  drivers/net/ethernet/intel/i40e/i40e_type.h      |  19 ++-
>  3 files changed, 159 insertions(+), 52 deletions(-)

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



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

* [Intel-wired-lan] [next PATCH S51-V2 7/8] i40e: fix trivial typo in naming of i40e_sync_filters_subtask
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 7/8] i40e: fix trivial typo in naming of i40e_sync_filters_subtask Bimmy Pujari
@ 2016-10-26 22:23   ` Bowers, AndrewX
  0 siblings, 0 replies; 17+ messages in thread
From: Bowers, AndrewX @ 2016-10-26 22:23 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: Tuesday, October 25, 2016 4:09 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S51-V2 7/8] i40e: fix trivial typo in
> naming of i40e_sync_filters_subtask
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> A comment incorrectly referred to i40e_vsi_sync_filters_subtask which does
> not actually exist. Reference the correct function instead.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Change-ID: I6bd805c605741ffb6fe34377259bb0d597edfafd
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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



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

* [Intel-wired-lan] [next PATCH S51-V2 8/8] i40e: Add protocols over MCTP to i40e_aq_discover_capabilities
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 8/8] i40e: Add protocols over MCTP to i40e_aq_discover_capabilities Bimmy Pujari
@ 2016-10-26 22:28   ` Bowers, AndrewX
  0 siblings, 0 replies; 17+ messages in thread
From: Bowers, AndrewX @ 2016-10-26 22:28 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: Tuesday, October 25, 2016 4:09 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Raczynski, Piotr <piotr.raczynski@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S51-V2 8/8] i40e: Add protocols over
> MCTP to i40e_aq_discover_capabilities
> 
> From: Piotr Raczynski <piotr.raczynski@intel.com>
> 
> Add logical_id to I40E_AQ_CAP_ID_MNG_MODE capability starting from
> major version 2.
> 
> Signed-off-by: Piotr Raczynski <piotr.raczynski@intel.com>
> Change-ID: Idb29214b172ea5c70cbd45a99e6745c0215af7e4
> ---
>  drivers/net/ethernet/intel/i40e/i40e_common.c | 8 ++++++++
>  drivers/net/ethernet/intel/i40e/i40e_type.h   | 4 ++++
>  drivers/net/ethernet/intel/i40evf/i40e_type.h | 4 ++++
>  3 files changed, 16 insertions(+)

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



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

* [Intel-wired-lan] [next PATCH S51-V2 2/8] i40evf: Be much more verbose about what we can and cannot offload
  2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 2/8] i40evf: " Bimmy Pujari
@ 2016-10-27 16:13   ` Bowers, AndrewX
  0 siblings, 0 replies; 17+ messages in thread
From: Bowers, AndrewX @ 2016-10-27 16:13 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: Tuesday, October 25, 2016 4:09 PM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S51-V2 2/8] i40evf: Be much more
> verbose about what we can and cannot offload
> 
> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> This change makes it so that we are much more robust about defining what
> we can and cannot offload.  Previously we were performing no checks.  This
> should bring us up to parity with the i40e PF driver.
> 
> In addition the device only supports GSO as long as the MSS is 64 or greater.
> We were not checking this so an MSS less than that was resulting in Tx hangs.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Change-ID: If533553ec92fc6ba694eab6ac81fdaf3004f3592
> ---
> Testing Hints:
>         This is half of the fix needed to address MSS less than 64.  This
>         is the fix for upstream and kernels after 3.18.4, but we will need
>         to come up with a separate fix for out-of-tree that can be stripped
>         on kernels prior to 3.18.4.
> 
>         An easy test for this patch is to just set the MTU for an interface
>         to a value 102.  Without this patch we should see Tx hangs with
>         netperf and with we should be able to pass traffic without
>         triggering Tx hangs.
> 
>  drivers/net/ethernet/intel/i40evf/i40evf_main.c | 59
> +++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)

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



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

end of thread, other threads:[~2016-10-27 16:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-25 23:08 [Intel-wired-lan] [next PATCH S51-V2 0/8] i40e/i40evf updates Bimmy Pujari
2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 1/8] i40e: Be much more verbose about what we can and cannot offload Bimmy Pujari
2016-10-26 21:17   ` Bowers, AndrewX
2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 2/8] i40evf: " Bimmy Pujari
2016-10-27 16:13   ` Bowers, AndrewX
2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 3/8] i40e: remove error_param_int label from i40e_vc_config_promiscuous_mode_msg Bimmy Pujari
2016-10-26 22:07   ` Bowers, AndrewX
2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 4/8] i40e: remove second check of VLAN_N_VID in i40e_vlan_rx_add_vid Bimmy Pujari
2016-10-26 22:09   ` Bowers, AndrewX
2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 5/8] i40e: avoid duplicate private flags definitions Bimmy Pujari
2016-10-26 22:13   ` Bowers, AndrewX
2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 6/8] i40e: Add Clause22 implementation Bimmy Pujari
2016-10-26 22:21   ` Bowers, AndrewX
2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 7/8] i40e: fix trivial typo in naming of i40e_sync_filters_subtask Bimmy Pujari
2016-10-26 22:23   ` Bowers, AndrewX
2016-10-25 23:08 ` [Intel-wired-lan] [next PATCH S51-V2 8/8] i40e: Add protocols over MCTP to i40e_aq_discover_capabilities Bimmy Pujari
2016-10-26 22:28   ` Bowers, AndrewX

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.