Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1544808 > unrolled thread

[PATCH net 1/2] net: netcp: ethss: fix errors in ethtool ops

Started byMurali Karicheri <m-karicheri2@ti.com>
First post2016-12-20 00:00 +0100
Last post2016-12-20 20:20 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net 1/2] net: netcp: ethss: fix errors in ethtool ops Murali Karicheri <m-karicheri2@ti.com> - 2016-12-20 00:00 +0100
    [PATCH net 2/2] net: netcp: ethss: fix 10gbe host port tx pri map configuration Murali Karicheri <m-karicheri2@ti.com> - 2016-12-20 00:00 +0100
      Re: [PATCH net 2/2] net: netcp: ethss: fix 10gbe host port tx pri  map configuration David Miller <davem@davemloft.net> - 2016-12-20 20:20 +0100
    Re: [PATCH net 1/2] net: netcp: ethss: fix errors in ethtool ops David Miller <davem@davemloft.net> - 2016-12-20 20:20 +0100

#1544808 — [PATCH net 1/2] net: netcp: ethss: fix errors in ethtool ops

FromMurali Karicheri <m-karicheri2@ti.com>
Date2016-12-20 00:00 +0100
Subject[PATCH net 1/2] net: netcp: ethss: fix errors in ethtool ops
Message-ID<sQf4u-5w1-5@gated-at.bofh.it>
From: WingMan Kwok <w-kwok2@ti.com>

In ethtool ops, it needs to retrieve the corresponding
ethss module (gbe or xgbe) from the net_device structure.
Prior to this patch, the retrieving procedure only
checks for the gbe module.  This patch fixes the issue
by checking the xgbe module if the net_device structure
does not correspond to the gbe module.

Signed-off-by: WingMan Kwok <w-kwok2@ti.com>
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
 drivers/net/ethernet/ti/netcp_ethss.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index c7e547e..a31931c 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -1746,6 +1746,17 @@ static void keystone_set_msglevel(struct net_device *ndev, u32 value)
 	netcp->msg_enable = value;
 }
 
+static struct gbe_intf *keystone_get_intf_data(struct netcp_intf *netcp)
+{
+	struct gbe_intf *gbe_intf;
+
+	gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
+	if (!gbe_intf)
+		gbe_intf = netcp_module_get_intf_data(&xgbe_module, netcp);
+
+	return gbe_intf;
+}
+
 static void keystone_get_stat_strings(struct net_device *ndev,
 				      uint32_t stringset, uint8_t *data)
 {
@@ -1754,7 +1765,7 @@ static void keystone_get_stat_strings(struct net_device *ndev,
 	struct gbe_priv *gbe_dev;
 	int i;
 
-	gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
+	gbe_intf = keystone_get_intf_data(netcp);
 	if (!gbe_intf)
 		return;
 	gbe_dev = gbe_intf->gbe_dev;
@@ -1778,7 +1789,7 @@ static int keystone_get_sset_count(struct net_device *ndev, int stringset)
 	struct gbe_intf *gbe_intf;
 	struct gbe_priv *gbe_dev;
 
-	gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
+	gbe_intf = keystone_get_intf_data(netcp);
 	if (!gbe_intf)
 		return -EINVAL;
 	gbe_dev = gbe_intf->gbe_dev;
@@ -1896,7 +1907,7 @@ static void keystone_get_ethtool_stats(struct net_device *ndev,
 	struct gbe_intf *gbe_intf;
 	struct gbe_priv *gbe_dev;
 
-	gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
+	gbe_intf = keystone_get_intf_data(netcp);
 	if (!gbe_intf)
 		return;
 
@@ -1920,7 +1931,7 @@ static int keystone_get_link_ksettings(struct net_device *ndev,
 	if (!phy)
 		return -EINVAL;
 
-	gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
+	gbe_intf = keystone_get_intf_data(netcp);
 	if (!gbe_intf)
 		return -EINVAL;
 
@@ -1953,7 +1964,7 @@ static int keystone_set_link_ksettings(struct net_device *ndev,
 	if (!phy)
 		return -EINVAL;
 
-	gbe_intf = netcp_module_get_intf_data(&gbe_module, netcp);
+	gbe_intf = keystone_get_intf_data(netcp);
 	if (!gbe_intf)
 		return -EINVAL;
 
-- 
1.9.1

[toc] | [next] | [standalone]


#1544811 — [PATCH net 2/2] net: netcp: ethss: fix 10gbe host port tx pri map configuration

FromMurali Karicheri <m-karicheri2@ti.com>
Date2016-12-20 00:00 +0100
Subject[PATCH net 2/2] net: netcp: ethss: fix 10gbe host port tx pri map configuration
Message-ID<sQf4u-5w1-21@gated-at.bofh.it>
In reply to#1544808
From: WingMan Kwok <w-kwok2@ti.com>

This patch adds the missing 10gbe host port tx priority map
configurations.

Signed-off-by: WingMan Kwok <w-kwok2@ti.com>
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
 drivers/net/ethernet/ti/netcp_ethss.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
index a31931c..7d9e36f 100644
--- a/drivers/net/ethernet/ti/netcp_ethss.c
+++ b/drivers/net/ethernet/ti/netcp_ethss.c
@@ -94,6 +94,7 @@
 
 /* offset relative to base of XGBE_SS_REG_INDEX */
 #define XGBE10_SGMII_MODULE_OFFSET	0x100
+#define IS_SS_ID_XGBE(d)		((d)->ss_version == XGBE_SS_VERSION_10)
 /* offset relative to base of XGBE_SM_REG_INDEX */
 #define XGBE10_HOST_PORT_OFFSET		0x34
 #define XGBE10_SLAVE_PORT_OFFSET	0x64
@@ -2322,7 +2323,7 @@ static void gbe_init_host_port(struct gbe_priv *priv)
 	int bypass_en = 1;
 
 	/* Host Tx Pri */
-	if (IS_SS_ID_NU(priv))
+	if (IS_SS_ID_NU(priv) || IS_SS_ID_XGBE(priv))
 		writel(HOST_TX_PRI_MAP_DEFAULT,
 		       GBE_REG_ADDR(priv, host_port_regs, tx_pri_map));
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1545391 — Re: [PATCH net 2/2] net: netcp: ethss: fix 10gbe host port tx pri map configuration

FromDavid Miller <davem@davemloft.net>
Date2016-12-20 20:20 +0100
SubjectRe: [PATCH net 2/2] net: netcp: ethss: fix 10gbe host port tx pri map configuration
Message-ID<sQy78-1ef-41@gated-at.bofh.it>
In reply to#1544811
From: Murali Karicheri <m-karicheri2@ti.com>
Date: Mon, 19 Dec 2016 17:55:57 -0500

> From: WingMan Kwok <w-kwok2@ti.com>
> 
> This patch adds the missing 10gbe host port tx priority map
> configurations.
> 
> Signed-off-by: WingMan Kwok <w-kwok2@ti.com>
> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
> Signed-off-by: Sekhar Nori <nsekhar@ti.com>

Applied.

[toc] | [prev] | [next] | [standalone]


#1545385

FromDavid Miller <davem@davemloft.net>
Date2016-12-20 20:20 +0100
Message-ID<sQy77-1ef-13@gated-at.bofh.it>
In reply to#1544808
From: Murali Karicheri <m-karicheri2@ti.com>
Date: Mon, 19 Dec 2016 17:55:56 -0500

> From: WingMan Kwok <w-kwok2@ti.com>
> 
> In ethtool ops, it needs to retrieve the corresponding
> ethss module (gbe or xgbe) from the net_device structure.
> Prior to this patch, the retrieving procedure only
> checks for the gbe module.  This patch fixes the issue
> by checking the xgbe module if the net_device structure
> does not correspond to the gbe module.
> 
> Signed-off-by: WingMan Kwok <w-kwok2@ti.com>
> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
> Signed-off-by: Sekhar Nori <nsekhar@ti.com>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web