Skip to content

Commit 4d96327

Browse files
committed
Merge: Ionic: driver update to v6.15.
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/785 JIRA: https://issues.redhat.com/browse/RHEL-88152 Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=67407394 ionic driver update to v6.15, most of the new changes are code improvmants and fixes. Signed-off-by: Mohammad Heib <mheib@redhat.com> Approved-by: Michal Schmidt <mschmidt@redhat.com> Approved-by: Kamal Heib <kheib@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents 02c22a5 + 9137b3a commit 4d96327

File tree

6 files changed

+131
-69
lines changed

6 files changed

+131
-69
lines changed

drivers/net/ethernet/pensando/ionic/ionic.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ struct ionic_lif;
1818
#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF 0x1002
1919
#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF 0x1003
2020

21-
#define IONIC_ASIC_TYPE_ELBA 2
22-
2321
#define DEVCMD_TIMEOUT 5
2422
#define IONIC_ADMINQ_TIME_SLICE msecs_to_jiffies(100)
2523

@@ -59,7 +57,6 @@ struct ionic {
5957
DECLARE_BITMAP(intrs, IONIC_INTR_CTRL_REGS_MAX);
6058
cpumask_var_t *affinity_masks;
6159
struct delayed_work doorbell_check_dwork;
62-
struct work_struct nb_work;
6360
struct notifier_block nb;
6461
struct rw_semaphore vf_op_lock; /* lock for VF operations */
6562
struct ionic_vf *vfs;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,10 @@ void ionic_dev_teardown(struct ionic *ionic)
277277
idev->phy_cmb_pages = 0;
278278
idev->cmb_npages = 0;
279279

280-
destroy_workqueue(ionic->wq);
280+
if (ionic->wq) {
281+
destroy_workqueue(ionic->wq);
282+
ionic->wq = NULL;
283+
}
281284
mutex_destroy(&idev->cmb_inuse_lock);
282285
}
283286

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

Lines changed: 87 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,20 @@ static int ionic_get_link_ksettings(struct net_device *netdev,
158158
25000baseCR_Full);
159159
copper_seen++;
160160
break;
161+
case IONIC_XCVR_PID_QSFP_50G_CR2_FC:
162+
case IONIC_XCVR_PID_QSFP_50G_CR2:
163+
ethtool_link_ksettings_add_link_mode(ks, supported,
164+
50000baseCR2_Full);
165+
copper_seen++;
166+
break;
167+
case IONIC_XCVR_PID_QSFP_200G_CR4:
168+
ethtool_link_ksettings_add_link_mode(ks, supported, 200000baseCR4_Full);
169+
copper_seen++;
170+
break;
171+
case IONIC_XCVR_PID_QSFP_400G_CR4:
172+
ethtool_link_ksettings_add_link_mode(ks, supported, 400000baseCR4_Full);
173+
copper_seen++;
174+
break;
161175
case IONIC_XCVR_PID_SFP_10GBASE_AOC:
162176
case IONIC_XCVR_PID_SFP_10GBASE_CU:
163177
ethtool_link_ksettings_add_link_mode(ks, supported,
@@ -196,6 +210,31 @@ static int ionic_get_link_ksettings(struct net_device *netdev,
196210
ethtool_link_ksettings_add_link_mode(ks, supported,
197211
25000baseSR_Full);
198212
break;
213+
case IONIC_XCVR_PID_QSFP_200G_AOC:
214+
case IONIC_XCVR_PID_QSFP_200G_SR4:
215+
ethtool_link_ksettings_add_link_mode(ks, supported,
216+
200000baseSR4_Full);
217+
break;
218+
case IONIC_XCVR_PID_QSFP_200G_FR4:
219+
ethtool_link_ksettings_add_link_mode(ks, supported,
220+
200000baseLR4_ER4_FR4_Full);
221+
break;
222+
case IONIC_XCVR_PID_QSFP_200G_DR4:
223+
ethtool_link_ksettings_add_link_mode(ks, supported,
224+
200000baseDR4_Full);
225+
break;
226+
case IONIC_XCVR_PID_QSFP_400G_FR4:
227+
ethtool_link_ksettings_add_link_mode(ks, supported,
228+
400000baseLR4_ER4_FR4_Full);
229+
break;
230+
case IONIC_XCVR_PID_QSFP_400G_DR4:
231+
ethtool_link_ksettings_add_link_mode(ks, supported,
232+
400000baseDR4_Full);
233+
break;
234+
case IONIC_XCVR_PID_QSFP_400G_SR4:
235+
ethtool_link_ksettings_add_link_mode(ks, supported,
236+
400000baseSR4_Full);
237+
break;
199238
case IONIC_XCVR_PID_SFP_10GBASE_SR:
200239
ethtool_link_ksettings_add_link_mode(ks, supported,
201240
10000baseSR_Full);
@@ -909,63 +948,20 @@ static int ionic_get_tunable(struct net_device *netdev,
909948
return 0;
910949
}
911950

912-
static int ionic_get_module_info(struct net_device *netdev,
913-
struct ethtool_modinfo *modinfo)
914-
951+
static int ionic_do_module_copy(u8 *dst, u8 *src, u32 len)
915952
{
916-
struct ionic_lif *lif = netdev_priv(netdev);
917-
struct ionic_dev *idev = &lif->ionic->idev;
918-
struct ionic_xcvr_status *xcvr;
919-
struct sfp_eeprom_base *sfp;
920-
921-
xcvr = &idev->port_info->status.xcvr;
922-
sfp = (struct sfp_eeprom_base *) xcvr->sprom;
923-
924-
/* report the module data type and length */
925-
switch (sfp->phys_id) {
926-
case SFF8024_ID_SFP:
927-
modinfo->type = ETH_MODULE_SFF_8079;
928-
modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
929-
break;
930-
case SFF8024_ID_QSFP_8436_8636:
931-
case SFF8024_ID_QSFP28_8636:
932-
modinfo->type = ETH_MODULE_SFF_8436;
933-
modinfo->eeprom_len = ETH_MODULE_SFF_8436_LEN;
934-
break;
935-
default:
936-
netdev_info(netdev, "unknown xcvr type 0x%02x\n",
937-
xcvr->sprom[0]);
938-
modinfo->type = 0;
939-
modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
940-
break;
941-
}
942-
943-
return 0;
944-
}
945-
946-
static int ionic_get_module_eeprom(struct net_device *netdev,
947-
struct ethtool_eeprom *ee,
948-
u8 *data)
949-
{
950-
struct ionic_lif *lif = netdev_priv(netdev);
951-
struct ionic_dev *idev = &lif->ionic->idev;
952-
struct ionic_xcvr_status *xcvr;
953-
char tbuf[sizeof(xcvr->sprom)];
953+
char tbuf[sizeof_field(struct ionic_xcvr_status, sprom)];
954954
int count = 10;
955-
u32 len;
956955

957956
/* The NIC keeps the module prom up-to-date in the DMA space
958957
* so we can simply copy the module bytes into the data buffer.
959958
*/
960-
xcvr = &idev->port_info->status.xcvr;
961-
len = min_t(u32, sizeof(xcvr->sprom), ee->len);
962-
963959
do {
964-
memcpy(data, xcvr->sprom, len);
965-
memcpy(tbuf, xcvr->sprom, len);
960+
memcpy(dst, src, len);
961+
memcpy(tbuf, src, len);
966962

967963
/* Let's make sure we got a consistent copy */
968-
if (!memcmp(data, tbuf, len))
964+
if (!memcmp(dst, tbuf, len))
969965
break;
970966

971967
} while (--count);
@@ -976,6 +972,48 @@ static int ionic_get_module_eeprom(struct net_device *netdev,
976972
return 0;
977973
}
978974

975+
static int ionic_get_module_eeprom_by_page(struct net_device *netdev,
976+
const struct ethtool_module_eeprom *page_data,
977+
struct netlink_ext_ack *extack)
978+
{
979+
struct ionic_lif *lif = netdev_priv(netdev);
980+
struct ionic_dev *idev = &lif->ionic->idev;
981+
u32 err = -EINVAL;
982+
u8 *src;
983+
984+
if (!page_data->length)
985+
return -EINVAL;
986+
987+
if (page_data->bank != 0) {
988+
NL_SET_ERR_MSG_MOD(extack, "Only bank 0 is supported");
989+
return -EINVAL;
990+
}
991+
992+
switch (page_data->page) {
993+
case 0:
994+
src = &idev->port_info->status.xcvr.sprom[page_data->offset];
995+
break;
996+
case 1:
997+
src = &idev->port_info->sprom_page1[page_data->offset - 128];
998+
break;
999+
case 2:
1000+
src = &idev->port_info->sprom_page2[page_data->offset - 128];
1001+
break;
1002+
case 17:
1003+
src = &idev->port_info->sprom_page17[page_data->offset - 128];
1004+
break;
1005+
default:
1006+
return -EOPNOTSUPP;
1007+
}
1008+
1009+
memset(page_data->data, 0, page_data->length);
1010+
err = ionic_do_module_copy(page_data->data, src, page_data->length);
1011+
if (err)
1012+
return err;
1013+
1014+
return page_data->length;
1015+
}
1016+
9791017
static int ionic_get_ts_info(struct net_device *netdev,
9801018
struct kernel_ethtool_ts_info *info)
9811019
{
@@ -1121,8 +1159,7 @@ static const struct ethtool_ops ionic_ethtool_ops = {
11211159
.set_rxfh = ionic_set_rxfh,
11221160
.get_tunable = ionic_get_tunable,
11231161
.set_tunable = ionic_set_tunable,
1124-
.get_module_info = ionic_get_module_info,
1125-
.get_module_eeprom = ionic_get_module_eeprom,
1162+
.get_module_eeprom_by_page = ionic_get_module_eeprom_by_page,
11261163
.get_pauseparam = ionic_get_pauseparam,
11271164
.set_pauseparam = ionic_set_pauseparam,
11281165
.get_fecparam = ionic_get_fecparam,

drivers/net/ethernet/pensando/ionic/ionic_if.h

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,10 @@ enum ionic_xcvr_pid {
12771277
IONIC_XCVR_PID_SFP_25GBASE_CR_S = 3,
12781278
IONIC_XCVR_PID_SFP_25GBASE_CR_L = 4,
12791279
IONIC_XCVR_PID_SFP_25GBASE_CR_N = 5,
1280-
1280+
IONIC_XCVR_PID_QSFP_50G_CR2_FC = 6,
1281+
IONIC_XCVR_PID_QSFP_50G_CR2 = 7,
1282+
IONIC_XCVR_PID_QSFP_200G_CR4 = 8,
1283+
IONIC_XCVR_PID_QSFP_400G_CR4 = 9,
12811284
/* Fiber */
12821285
IONIC_XCVR_PID_QSFP_100G_AOC = 50,
12831286
IONIC_XCVR_PID_QSFP_100G_ACC = 51,
@@ -1303,6 +1306,15 @@ enum ionic_xcvr_pid {
13031306
IONIC_XCVR_PID_SFP_25GBASE_ACC = 71,
13041307
IONIC_XCVR_PID_SFP_10GBASE_T = 72,
13051308
IONIC_XCVR_PID_SFP_1000BASE_T = 73,
1309+
IONIC_XCVR_PID_QSFP_200G_AOC = 74,
1310+
IONIC_XCVR_PID_QSFP_200G_FR4 = 75,
1311+
IONIC_XCVR_PID_QSFP_200G_DR4 = 76,
1312+
IONIC_XCVR_PID_QSFP_200G_SR4 = 77,
1313+
IONIC_XCVR_PID_QSFP_200G_ACC = 78,
1314+
IONIC_XCVR_PID_QSFP_400G_FR4 = 79,
1315+
IONIC_XCVR_PID_QSFP_400G_DR4 = 80,
1316+
IONIC_XCVR_PID_QSFP_400G_SR4 = 81,
1317+
IONIC_XCVR_PID_QSFP_400G_VR4 = 82,
13061318
};
13071319

13081320
/**
@@ -1404,6 +1416,8 @@ struct ionic_xcvr_status {
14041416
*/
14051417
union ionic_port_config {
14061418
struct {
1419+
#define IONIC_SPEED_400G 400000 /* 400G in Mbps */
1420+
#define IONIC_SPEED_200G 200000 /* 200G in Mbps */
14071421
#define IONIC_SPEED_100G 100000 /* 100G in Mbps */
14081422
#define IONIC_SPEED_50G 50000 /* 50G in Mbps */
14091423
#define IONIC_SPEED_40G 40000 /* 40G in Mbps */
@@ -2825,6 +2839,10 @@ union ionic_port_identity {
28252839
* @status: Port status data
28262840
* @stats: Port statistics data
28272841
* @mgmt_stats: Port management statistics data
2842+
* @sprom_epage: Extended Transceiver sprom
2843+
* @sprom_page1: Extended Transceiver sprom, page 1
2844+
* @sprom_page2: Extended Transceiver sprom, page 2
2845+
* @sprom_page17: Extended Transceiver sprom, page 17
28282846
* @rsvd: reserved byte(s)
28292847
* @pb_stats: uplink pb drop stats
28302848
*/
@@ -2835,8 +2853,17 @@ struct ionic_port_info {
28352853
struct ionic_port_stats stats;
28362854
struct ionic_mgmt_port_stats mgmt_stats;
28372855
};
2838-
/* room for pb_stats to start at 2k offset */
2839-
u8 rsvd[760];
2856+
union {
2857+
u8 sprom_epage[384];
2858+
struct {
2859+
u8 sprom_page1[128];
2860+
u8 sprom_page2[128];
2861+
u8 sprom_page17[128];
2862+
};
2863+
};
2864+
u8 rsvd[376];
2865+
2866+
/* pb_stats must start at 2k offset */
28402867
struct ionic_port_pb_stats pb_stats;
28412868
};
28422869

@@ -3209,7 +3236,11 @@ union ionic_adminq_comp {
32093236
#define IONIC_BAR0_INTR_CTRL_OFFSET 0x2000
32103237
#define IONIC_DEV_CMD_DONE 0x00000001
32113238

3212-
#define IONIC_ASIC_TYPE_CAPRI 0
3239+
#define IONIC_ASIC_TYPE_NONE 0
3240+
#define IONIC_ASIC_TYPE_CAPRI 1
3241+
#define IONIC_ASIC_TYPE_ELBA 2
3242+
#define IONIC_ASIC_TYPE_GIGLIO 3
3243+
#define IONIC_ASIC_TYPE_SALINA 4
32133244

32143245
/**
32153246
* struct ionic_doorbell - Doorbell register layout

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3265,7 +3265,7 @@ int ionic_lif_alloc(struct ionic *ionic)
32653265
lif->netdev->min_mtu = max_t(unsigned int, ETH_MIN_MTU,
32663266
le32_to_cpu(lif->identity->eth.min_frame_size));
32673267
lif->netdev->max_mtu =
3268-
le32_to_cpu(lif->identity->eth.max_frame_size) - ETH_HLEN - VLAN_HLEN;
3268+
le32_to_cpu(lif->identity->eth.max_frame_size) - VLAN_ETH_HLEN;
32693269

32703270
lif->neqs = ionic->neqs_per_lif;
32713271
lif->nxqs = ionic->ntxqs_per_lif;
@@ -3804,10 +3804,6 @@ int ionic_lif_init(struct ionic_lif *lif)
38043804
return err;
38053805
}
38063806

3807-
static void ionic_lif_notify_work(struct work_struct *ws)
3808-
{
3809-
}
3810-
38113807
static void ionic_lif_set_netdev_info(struct ionic_lif *lif)
38123808
{
38133809
struct ionic_admin_ctx ctx = {
@@ -3858,8 +3854,6 @@ int ionic_lif_register(struct ionic_lif *lif)
38583854

38593855
ionic_lif_register_phc(lif);
38603856

3861-
INIT_WORK(&lif->ionic->nb_work, ionic_lif_notify_work);
3862-
38633857
lif->ionic->nb.notifier_call = ionic_lif_notify;
38643858

38653859
err = register_netdevice_notifier(&lif->ionic->nb);
@@ -3869,8 +3863,8 @@ int ionic_lif_register(struct ionic_lif *lif)
38693863
/* only register LIF0 for now */
38703864
err = register_netdev(lif->netdev);
38713865
if (err) {
3872-
dev_err(lif->ionic->dev, "Cannot register net device, aborting\n");
3873-
ionic_lif_unregister_phc(lif);
3866+
dev_err(lif->ionic->dev, "Cannot register net device: %d, aborting\n", err);
3867+
ionic_lif_unregister(lif);
38743868
return err;
38753869
}
38763870

@@ -3885,7 +3879,6 @@ void ionic_lif_unregister(struct ionic_lif *lif)
38853879
{
38863880
if (lif->ionic->nb.notifier_call) {
38873881
unregister_netdevice_notifier(&lif->ionic->nb);
3888-
cancel_work_sync(&lif->ionic->nb_work);
38893882
lif->ionic->nb.notifier_call = NULL;
38903883
}
38913884

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ static int ionic_error_to_errno(enum ionic_status_code code)
8181
case IONIC_RC_EQTYPE:
8282
case IONIC_RC_EQID:
8383
case IONIC_RC_EINVAL:
84-
case IONIC_RC_ENOSUPP:
8584
return -EINVAL;
85+
case IONIC_RC_ENOSUPP:
86+
return -EOPNOTSUPP;
8687
case IONIC_RC_EPERM:
8788
return -EPERM;
8889
case IONIC_RC_ENOENT:

0 commit comments

Comments
 (0)