Skip to content

Commit b3f064e

Browse files
emuslndavem330
authored andcommitted
ionic: add support for device id 0x1004
Add support for the management port device id. This is to capture the device and set it up for devlink use, but not set it up for network operations. We still use a netdev object in order to use the napi infrasucture for processing adminq and notifyq messages, we just don't register the netdev. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c220e52 commit b3f064e

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ struct ionic_lif;
1818

1919
#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF 0x1002
2020
#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF 0x1003
21+
#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_MGMT 0x1004
2122

2223
#define DEVCMD_TIMEOUT 10
2324

@@ -42,6 +43,7 @@ struct ionic {
4243
struct dentry *dentry;
4344
struct ionic_dev_bar bars[IONIC_BARS_MAX];
4445
unsigned int num_bars;
46+
bool is_mgmt_nic;
4547
struct ionic_identity ident;
4648
struct list_head lifs;
4749
struct ionic_lif *master_lif;

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
static const struct pci_device_id ionic_id_table[] = {
1616
{ PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF) },
1717
{ PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF) },
18+
{ PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_MGMT) },
1819
{ 0, } /* end of table */
1920
};
2021
MODULE_DEVICE_TABLE(pci, ionic_id_table);
@@ -224,6 +225,9 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
224225
pci_set_drvdata(pdev, ionic);
225226
mutex_init(&ionic->dev_cmd_lock);
226227

228+
ionic->is_mgmt_nic =
229+
ent->device == PCI_DEVICE_ID_PENSANDO_IONIC_ETH_MGMT;
230+
227231
/* Query system for DMA addressing limitation for the device. */
228232
err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(IONIC_ADDR_LEN));
229233
if (err) {
@@ -248,7 +252,8 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
248252
}
249253

250254
pci_set_master(pdev);
251-
pcie_print_link_status(pdev);
255+
if (!ionic->is_mgmt_nic)
256+
pcie_print_link_status(pdev);
252257

253258
err = ionic_map_bars(ionic);
254259
if (err)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ int ionic_devlink_register(struct ionic *ionic)
8282
err = devlink_port_register(dl, &ionic->dl_port, 0);
8383
if (err)
8484
dev_err(ionic->dev, "devlink_port_register failed: %d\n", err);
85-
else
85+
else if (!ionic->is_mgmt_nic)
8686
devlink_port_type_eth_set(&ionic->dl_port,
8787
ionic->master_lif->netdev);
8888

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,10 @@ static int ionic_init_nic_features(struct ionic_lif *lif)
11551155
netdev_features_t features;
11561156
int err;
11571157

1158+
/* no netdev features on the management device */
1159+
if (lif->ionic->is_mgmt_nic)
1160+
return 0;
1161+
11581162
/* set up what we expect to support by default */
11591163
features = NETIF_F_HW_VLAN_CTAG_TX |
11601164
NETIF_F_HW_VLAN_CTAG_RX |
@@ -2383,6 +2387,12 @@ int ionic_lifs_register(struct ionic *ionic)
23832387
{
23842388
int err;
23852389

2390+
/* the netdev is not registered on the management device, it is
2391+
* only used as a vehicle for napi operations on the adminq
2392+
*/
2393+
if (ionic->is_mgmt_nic)
2394+
return 0;
2395+
23862396
INIT_WORK(&ionic->nb_work, ionic_lif_notify_work);
23872397

23882398
ionic->nb.notifier_call = ionic_lif_notify;

0 commit comments

Comments
 (0)