Skip to content

Commit 9f57db9

Browse files
committed
Merge branch 'ionic-bits-and-bytes'
Shannon Nelson says: ==================== ionic bits and bytes 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 ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents c7cba83 + b2133d8 commit 9f57db9

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

drivers/net/ethernet/pensando/ionic/ionic_devlink.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,16 @@ int ionic_devlink_register(struct ionic *ionic)
7777
return err;
7878
}
7979

80+
/* don't register the mgmt_nic as a port */
81+
if (ionic->is_mgmt_nic)
82+
return 0;
83+
8084
devlink_port_attrs_set(&ionic->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL,
8185
0, false, 0, NULL, 0);
8286
err = devlink_port_register(dl, &ionic->dl_port, 0);
8387
if (err)
8488
dev_err(ionic->dev, "devlink_port_register failed: %d\n", err);
85-
else if (!ionic->is_mgmt_nic)
89+
else
8690
devlink_port_type_eth_set(&ionic->dl_port,
8791
ionic->master_lif->netdev);
8892

@@ -93,6 +97,7 @@ void ionic_devlink_unregister(struct ionic *ionic)
9397
{
9498
struct devlink *dl = priv_to_devlink(ionic);
9599

96-
devlink_port_unregister(&ionic->dl_port);
100+
if (ionic->dl_port.registered)
101+
devlink_port_unregister(&ionic->dl_port);
97102
devlink_unregister(dl);
98103
}

drivers/net/ethernet/pensando/ionic/ionic_ethtool.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <linux/module.h>
55
#include <linux/netdevice.h>
6+
#include <linux/sfp.h>
67

78
#include "ionic.h"
89
#include "ionic_bus.h"
@@ -677,23 +678,27 @@ static int ionic_get_module_info(struct net_device *netdev,
677678
struct ionic_lif *lif = netdev_priv(netdev);
678679
struct ionic_dev *idev = &lif->ionic->idev;
679680
struct ionic_xcvr_status *xcvr;
681+
struct sfp_eeprom_base *sfp;
680682

681683
xcvr = &idev->port_info->status.xcvr;
684+
sfp = (struct sfp_eeprom_base *) xcvr->sprom;
682685

683686
/* report the module data type and length */
684-
switch (xcvr->sprom[0]) {
685-
case 0x03: /* SFP */
687+
switch (sfp->phys_id) {
688+
case SFF8024_ID_SFP:
686689
modinfo->type = ETH_MODULE_SFF_8079;
687690
modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
688691
break;
689-
case 0x0D: /* QSFP */
690-
case 0x11: /* QSFP28 */
692+
case SFF8024_ID_QSFP_8436_8636:
693+
case SFF8024_ID_QSFP28_8636:
691694
modinfo->type = ETH_MODULE_SFF_8436;
692695
modinfo->eeprom_len = ETH_MODULE_SFF_8436_LEN;
693696
break;
694697
default:
695698
netdev_info(netdev, "unknown xcvr type 0x%02x\n",
696699
xcvr->sprom[0]);
700+
modinfo->type = 0;
701+
modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
697702
break;
698703
}
699704

drivers/net/ethernet/pensando/ionic/ionic_lif.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2066,9 +2066,11 @@ static void ionic_lif_deinit(struct ionic_lif *lif)
20662066
clear_bit(IONIC_LIF_F_INITED, lif->state);
20672067

20682068
ionic_rx_filters_deinit(lif);
2069-
ionic_lif_rss_deinit(lif);
2069+
if (lif->netdev->features & NETIF_F_RXHASH)
2070+
ionic_lif_rss_deinit(lif);
20702071

20712072
napi_disable(&lif->adminqcq->napi);
2073+
netif_napi_del(&lif->adminqcq->napi);
20722074
ionic_lif_qcq_deinit(lif, lif->notifyqcq);
20732075
ionic_lif_qcq_deinit(lif, lif->adminqcq);
20742076

drivers/net/ethernet/pensando/ionic/ionic_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ static const char *ionic_error_to_str(enum ionic_status_code code)
5858
return "IONIC_RC_BAD_ADDR";
5959
case IONIC_RC_DEV_CMD:
6060
return "IONIC_RC_DEV_CMD";
61+
case IONIC_RC_ENOSUPP:
62+
return "IONIC_RC_ENOSUPP";
6163
case IONIC_RC_ERROR:
6264
return "IONIC_RC_ERROR";
6365
case IONIC_RC_ERDMA:
@@ -76,6 +78,7 @@ static int ionic_error_to_errno(enum ionic_status_code code)
7678
case IONIC_RC_EQTYPE:
7779
case IONIC_RC_EQID:
7880
case IONIC_RC_EINVAL:
81+
case IONIC_RC_ENOSUPP:
7982
return -EINVAL;
8083
case IONIC_RC_EPERM:
8184
return -EPERM;

0 commit comments

Comments
 (0)