All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 net-next 0/5] ionic bits and bytes
@ 2020-03-17  3:22 Shannon Nelson
  2020-03-17  3:22 ` [PATCH v3 net-next 1/5] ionic: stop devlink warn on mgmt device Shannon Nelson
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Shannon Nelson @ 2020-03-17  3:22 UTC (permalink / raw)
  To: netdev, davem; +Cc: Shannon Nelson

These are a few little updates to the ionic driver while we are in between
other feature work.  While these are mostly Fixes, they are almost all low
priority and needn't be promoted to net.  The one higher need is patch 1,
but it is fixing something that hasn't made it out of net-next yet.

v3: allow decode of unknown transciever and use type
    codes from sfp.h
v2: add Fixes tags to patches 1-4, and a little
    description for patch 5

Shannon Nelson (5):
  ionic: stop devlink warn on mgmt device
  ionic: deinit rss only if selected
  ionic: remove adminq napi instance
  ionic: print data for unknown xcvr type
  ionic: add decode for IONIC_RC_ENOSUPP

 drivers/net/ethernet/pensando/ionic/ionic_devlink.c |  9 +++++++--
 drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 13 +++++++++----
 drivers/net/ethernet/pensando/ionic/ionic_lif.c     |  4 +++-
 drivers/net/ethernet/pensando/ionic/ionic_main.c    |  3 +++
 4 files changed, 22 insertions(+), 7 deletions(-)

-- 
2.17.1


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

* [PATCH v3 net-next 1/5] ionic: stop devlink warn on mgmt device
  2020-03-17  3:22 [PATCH v3 net-next 0/5] ionic bits and bytes Shannon Nelson
@ 2020-03-17  3:22 ` Shannon Nelson
  2020-03-17  3:22 ` [PATCH v3 net-next 2/5] ionic: deinit rss only if selected Shannon Nelson
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Shannon Nelson @ 2020-03-17  3:22 UTC (permalink / raw)
  To: netdev, davem; +Cc: Shannon Nelson

If we don't set a port type, the devlink code will eventually
print a WARN in the kernel log.  Because the mgmt device is
not really a useful port, don't register it as a devlink port.

Fixes: b3f064e9746d ("ionic: add support for device id 0x1004")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
---
 drivers/net/ethernet/pensando/ionic/ionic_devlink.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
index ed14164468a1..273c889faaad 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
@@ -77,12 +77,16 @@ int ionic_devlink_register(struct ionic *ionic)
 		return err;
 	}
 
+	/* don't register the mgmt_nic as a port */
+	if (ionic->is_mgmt_nic)
+		return 0;
+
 	devlink_port_attrs_set(&ionic->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL,
 			       0, false, 0, NULL, 0);
 	err = devlink_port_register(dl, &ionic->dl_port, 0);
 	if (err)
 		dev_err(ionic->dev, "devlink_port_register failed: %d\n", err);
-	else if (!ionic->is_mgmt_nic)
+	else
 		devlink_port_type_eth_set(&ionic->dl_port,
 					  ionic->master_lif->netdev);
 
@@ -93,6 +97,7 @@ void ionic_devlink_unregister(struct ionic *ionic)
 {
 	struct devlink *dl = priv_to_devlink(ionic);
 
-	devlink_port_unregister(&ionic->dl_port);
+	if (ionic->dl_port.registered)
+		devlink_port_unregister(&ionic->dl_port);
 	devlink_unregister(dl);
 }
-- 
2.17.1


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

* [PATCH v3 net-next 2/5] ionic: deinit rss only if selected
  2020-03-17  3:22 [PATCH v3 net-next 0/5] ionic bits and bytes Shannon Nelson
  2020-03-17  3:22 ` [PATCH v3 net-next 1/5] ionic: stop devlink warn on mgmt device Shannon Nelson
@ 2020-03-17  3:22 ` Shannon Nelson
  2020-03-17  3:22 ` [PATCH v3 net-next 3/5] ionic: remove adminq napi instance Shannon Nelson
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Shannon Nelson @ 2020-03-17  3:22 UTC (permalink / raw)
  To: netdev, davem; +Cc: Shannon Nelson

Don't bother de-initing RSS if it wasn't selected.

Fixes: aa3198819bea ("ionic: Add RSS support")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
---
 drivers/net/ethernet/pensando/ionic/ionic_lif.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index b903016193df..19fd7cc36f28 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -2066,7 +2066,8 @@ static void ionic_lif_deinit(struct ionic_lif *lif)
 	clear_bit(IONIC_LIF_F_INITED, lif->state);
 
 	ionic_rx_filters_deinit(lif);
-	ionic_lif_rss_deinit(lif);
+	if (lif->netdev->features & NETIF_F_RXHASH)
+		ionic_lif_rss_deinit(lif);
 
 	napi_disable(&lif->adminqcq->napi);
 	ionic_lif_qcq_deinit(lif, lif->notifyqcq);
-- 
2.17.1


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

* [PATCH v3 net-next 3/5] ionic: remove adminq napi instance
  2020-03-17  3:22 [PATCH v3 net-next 0/5] ionic bits and bytes Shannon Nelson
  2020-03-17  3:22 ` [PATCH v3 net-next 1/5] ionic: stop devlink warn on mgmt device Shannon Nelson
  2020-03-17  3:22 ` [PATCH v3 net-next 2/5] ionic: deinit rss only if selected Shannon Nelson
@ 2020-03-17  3:22 ` Shannon Nelson
  2020-03-17  3:22 ` [PATCH v3 net-next 4/5] ionic: print data for unknown xcvr type Shannon Nelson
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Shannon Nelson @ 2020-03-17  3:22 UTC (permalink / raw)
  To: netdev, davem; +Cc: Shannon Nelson

Remove the adminq's napi struct when tearing down
the adminq.

Fixes: 1d062b7b6f64 ("ionic: Add basic adminq support")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
---
 drivers/net/ethernet/pensando/ionic/ionic_lif.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index 19fd7cc36f28..12e3823b0bc1 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -2070,6 +2070,7 @@ static void ionic_lif_deinit(struct ionic_lif *lif)
 		ionic_lif_rss_deinit(lif);
 
 	napi_disable(&lif->adminqcq->napi);
+	netif_napi_del(&lif->adminqcq->napi);
 	ionic_lif_qcq_deinit(lif, lif->notifyqcq);
 	ionic_lif_qcq_deinit(lif, lif->adminqcq);
 
-- 
2.17.1


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

* [PATCH v3 net-next 4/5] ionic: print data for unknown xcvr type
  2020-03-17  3:22 [PATCH v3 net-next 0/5] ionic bits and bytes Shannon Nelson
                   ` (2 preceding siblings ...)
  2020-03-17  3:22 ` [PATCH v3 net-next 3/5] ionic: remove adminq napi instance Shannon Nelson
@ 2020-03-17  3:22 ` Shannon Nelson
  2020-03-17  3:22 ` [PATCH v3 net-next 5/5] ionic: add decode for IONIC_RC_ENOSUPP Shannon Nelson
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Shannon Nelson @ 2020-03-17  3:22 UTC (permalink / raw)
  To: netdev, davem; +Cc: Shannon Nelson

If we don't recognize the transceiver type, set the xcvr type
and data length such that ethtool can at least print the first
256 bytes and the reader can figure out why the transceiver
is not recognized.

While we're here, we can update the phy_id type values to use
the enum values in sfp.h.

Fixes: 4d03e00a2140 ("ionic: Add initial ethtool support")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
---
 drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
index a233716eac29..6996229facfd 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c
@@ -3,6 +3,7 @@
 
 #include <linux/module.h>
 #include <linux/netdevice.h>
+#include <linux/sfp.h>
 
 #include "ionic.h"
 #include "ionic_bus.h"
@@ -677,23 +678,27 @@ static int ionic_get_module_info(struct net_device *netdev,
 	struct ionic_lif *lif = netdev_priv(netdev);
 	struct ionic_dev *idev = &lif->ionic->idev;
 	struct ionic_xcvr_status *xcvr;
+	struct sfp_eeprom_base *sfp;
 
 	xcvr = &idev->port_info->status.xcvr;
+	sfp = (struct sfp_eeprom_base *) xcvr->sprom;
 
 	/* report the module data type and length */
-	switch (xcvr->sprom[0]) {
-	case 0x03: /* SFP */
+	switch (sfp->phys_id) {
+	case SFF8024_ID_SFP:
 		modinfo->type = ETH_MODULE_SFF_8079;
 		modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
 		break;
-	case 0x0D: /* QSFP */
-	case 0x11: /* QSFP28 */
+	case SFF8024_ID_QSFP_8436_8636:
+	case SFF8024_ID_QSFP28_8636:
 		modinfo->type = ETH_MODULE_SFF_8436;
 		modinfo->eeprom_len = ETH_MODULE_SFF_8436_LEN;
 		break;
 	default:
 		netdev_info(netdev, "unknown xcvr type 0x%02x\n",
 			    xcvr->sprom[0]);
+		modinfo->type = 0;
+		modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
 		break;
 	}
 
-- 
2.17.1


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

* [PATCH v3 net-next 5/5] ionic: add decode for IONIC_RC_ENOSUPP
  2020-03-17  3:22 [PATCH v3 net-next 0/5] ionic bits and bytes Shannon Nelson
                   ` (3 preceding siblings ...)
  2020-03-17  3:22 ` [PATCH v3 net-next 4/5] ionic: print data for unknown xcvr type Shannon Nelson
@ 2020-03-17  3:22 ` Shannon Nelson
  2020-03-17 20:19 ` [PATCH v3 net-next 0/5] ionic bits and bytes Jakub Kicinski
  2020-03-18  4:21 ` David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: Shannon Nelson @ 2020-03-17  3:22 UTC (permalink / raw)
  To: netdev, davem; +Cc: Shannon Nelson

Add decoding for a new firmware error code.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
---
 drivers/net/ethernet/pensando/ionic/ionic_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c
index e4a76e66f542..c5e3d7639f7e 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_main.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c
@@ -58,6 +58,8 @@ static const char *ionic_error_to_str(enum ionic_status_code code)
 		return "IONIC_RC_BAD_ADDR";
 	case IONIC_RC_DEV_CMD:
 		return "IONIC_RC_DEV_CMD";
+	case IONIC_RC_ENOSUPP:
+		return "IONIC_RC_ENOSUPP";
 	case IONIC_RC_ERROR:
 		return "IONIC_RC_ERROR";
 	case IONIC_RC_ERDMA:
@@ -76,6 +78,7 @@ static int ionic_error_to_errno(enum ionic_status_code code)
 	case IONIC_RC_EQTYPE:
 	case IONIC_RC_EQID:
 	case IONIC_RC_EINVAL:
+	case IONIC_RC_ENOSUPP:
 		return -EINVAL;
 	case IONIC_RC_EPERM:
 		return -EPERM;
-- 
2.17.1


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

* Re: [PATCH v3 net-next 0/5] ionic bits and bytes
  2020-03-17  3:22 [PATCH v3 net-next 0/5] ionic bits and bytes Shannon Nelson
                   ` (4 preceding siblings ...)
  2020-03-17  3:22 ` [PATCH v3 net-next 5/5] ionic: add decode for IONIC_RC_ENOSUPP Shannon Nelson
@ 2020-03-17 20:19 ` Jakub Kicinski
  2020-03-18  4:21 ` David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: Jakub Kicinski @ 2020-03-17 20:19 UTC (permalink / raw)
  To: Shannon Nelson; +Cc: netdev, davem

On Mon, 16 Mar 2020 20:22:05 -0700 Shannon Nelson wrote:
> These are a few little updates to the ionic driver while we are in between
> other feature work.  While these are mostly Fixes, they are almost all low
> priority and needn't be promoted to net.  The one higher need is patch 1,
> but it is fixing something that hasn't made it out of net-next yet.
> 
> v3: allow decode of unknown transciever and use type
>     codes from sfp.h
> v2: add Fixes tags to patches 1-4, and a little
>     description for patch 5

Reviewed-by: Jakub Kicinski <kuba@kernel.org>

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

* Re: [PATCH v3 net-next 0/5] ionic bits and bytes
  2020-03-17  3:22 [PATCH v3 net-next 0/5] ionic bits and bytes Shannon Nelson
                   ` (5 preceding siblings ...)
  2020-03-17 20:19 ` [PATCH v3 net-next 0/5] ionic bits and bytes Jakub Kicinski
@ 2020-03-18  4:21 ` David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2020-03-18  4:21 UTC (permalink / raw)
  To: snelson; +Cc: netdev

From: Shannon Nelson <snelson@pensando.io>
Date: Mon, 16 Mar 2020 20:22:05 -0700

> These are a few little updates to the ionic driver while we are in between
> other feature work.  While these are mostly Fixes, they are almost all low
> priority and needn't be promoted to net.  The one higher need is patch 1,
> but it is fixing something that hasn't made it out of net-next yet.
> 
> v3: allow decode of unknown transciever and use type
>     codes from sfp.h
> v2: add Fixes tags to patches 1-4, and a little
>     description for patch 5

Series applied to net-next.

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

end of thread, other threads:[~2020-03-18  4:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-17  3:22 [PATCH v3 net-next 0/5] ionic bits and bytes Shannon Nelson
2020-03-17  3:22 ` [PATCH v3 net-next 1/5] ionic: stop devlink warn on mgmt device Shannon Nelson
2020-03-17  3:22 ` [PATCH v3 net-next 2/5] ionic: deinit rss only if selected Shannon Nelson
2020-03-17  3:22 ` [PATCH v3 net-next 3/5] ionic: remove adminq napi instance Shannon Nelson
2020-03-17  3:22 ` [PATCH v3 net-next 4/5] ionic: print data for unknown xcvr type Shannon Nelson
2020-03-17  3:22 ` [PATCH v3 net-next 5/5] ionic: add decode for IONIC_RC_ENOSUPP Shannon Nelson
2020-03-17 20:19 ` [PATCH v3 net-next 0/5] ionic bits and bytes Jakub Kicinski
2020-03-18  4:21 ` David Miller

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