Commit 09dee69e authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'ionic-updates'



Shannon Nelson says:

====================
ionic updates

This is a set of small updates for the Pensando ionic driver, some
from internal work, some a result of mailing list discussions.

v4 - don't register mgmt device netdev
v3 - changed __attribute__(packed)) to __packed
v2 - removed print from ionic_init_module()
====================

Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c8e98343 1fcbebf1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -12,12 +12,12 @@ struct ionic_lif;

#define IONIC_DRV_NAME		"ionic"
#define IONIC_DRV_DESCRIPTION	"Pensando Ethernet NIC Driver"
#define IONIC_DRV_VERSION	"0.20.0-k"

#define PCI_VENDOR_ID_PENSANDO			0x1dd8

#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF	0x1002
#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF	0x1003
#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_MGMT	0x1004

#define DEVCMD_TIMEOUT  10

@@ -42,6 +42,7 @@ struct ionic {
	struct dentry *dentry;
	struct ionic_dev_bar bars[IONIC_BARS_MAX];
	unsigned int num_bars;
	bool is_mgmt_nic;
	struct ionic_identity ident;
	struct list_head lifs;
	struct ionic_lif *master_lif;
+22 −5
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
static const struct pci_device_id ionic_id_table[] = {
	{ PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF) },
	{ PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF) },
	{ PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_MGMT) },
	{ 0, }	/* end of table */
};
MODULE_DEVICE_TABLE(pci, ionic_id_table);
@@ -37,6 +38,9 @@ int ionic_bus_alloc_irq_vectors(struct ionic *ionic, unsigned int nintrs)

void ionic_bus_free_irq_vectors(struct ionic *ionic)
{
	if (!ionic->nintrs)
		return;

	pci_free_irq_vectors(ionic->pdev);
}

@@ -221,6 +225,9 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	pci_set_drvdata(pdev, ionic);
	mutex_init(&ionic->dev_cmd_lock);

	ionic->is_mgmt_nic =
		ent->device == PCI_DEVICE_ID_PENSANDO_IONIC_ETH_MGMT;

	/* Query system for DMA addressing limitation for the device. */
	err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(IONIC_ADDR_LEN));
	if (err) {
@@ -245,6 +252,8 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	}

	pci_set_master(pdev);
	if (!ionic->is_mgmt_nic)
		pcie_print_link_status(pdev);

	err = ionic_map_bars(ionic);
	if (err)
@@ -346,6 +355,11 @@ err_out_reset:
	ionic_reset(ionic);
err_out_teardown:
	ionic_dev_teardown(ionic);
	/* Don't fail the probe for these errors, keep
	 * the hw interface around for inspection
	 */
	return 0;

err_out_unmap_bars:
	ionic_unmap_bars(ionic);
	pci_release_regions(pdev);
@@ -369,11 +383,14 @@ static void ionic_remove(struct pci_dev *pdev)
	if (!ionic)
		return;

	if (ionic->master_lif) {
		ionic_devlink_unregister(ionic);
		ionic_lifs_unregister(ionic);
		ionic_lifs_deinit(ionic);
		ionic_lifs_free(ionic);
		ionic_bus_free_irq_vectors(ionic);
	}

	ionic_port_reset(ionic);
	ionic_reset(ionic);
	ionic_dev_teardown(ionic);
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ int ionic_devlink_register(struct ionic *ionic)
	err = devlink_port_register(dl, &ionic->dl_port, 0);
	if (err)
		dev_err(ionic->dev, "devlink_port_register failed: %d\n", err);
	else
	else if (!ionic->is_mgmt_nic)
		devlink_port_type_eth_set(&ionic->dl_port,
					  ionic->master_lif->netdev);

+10 −15
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@ static void ionic_get_drvinfo(struct net_device *netdev,
	struct ionic *ionic = lif->ionic;

	strlcpy(drvinfo->driver, IONIC_DRV_NAME, sizeof(drvinfo->driver));
	strlcpy(drvinfo->version, IONIC_DRV_VERSION, sizeof(drvinfo->version));
	strlcpy(drvinfo->fw_version, ionic->idev.dev_info.fw_version,
		sizeof(drvinfo->fw_version));
	strlcpy(drvinfo->bus_info, ionic_bus_info(ionic),
@@ -440,7 +439,7 @@ static int ionic_set_coalesce(struct net_device *netdev,
	if (coal != lif->rx_coalesce_hw) {
		lif->rx_coalesce_hw = coal;

		if (test_bit(IONIC_LIF_UP, lif->state)) {
		if (test_bit(IONIC_LIF_F_UP, lif->state)) {
			for (i = 0; i < lif->nxqs; i++) {
				qcq = lif->rxqcqs[i].qcq;
				ionic_intr_coal_init(lif->ionic->idev.intr_ctrl,
@@ -487,11 +486,11 @@ static int ionic_set_ringparam(struct net_device *netdev,
	    ring->rx_pending == lif->nrxq_descs)
		return 0;

	err = ionic_wait_for_bit(lif, IONIC_LIF_QUEUE_RESET);
	err = ionic_wait_for_bit(lif, IONIC_LIF_F_QUEUE_RESET);
	if (err)
		return err;

	running = test_bit(IONIC_LIF_UP, lif->state);
	running = test_bit(IONIC_LIF_F_UP, lif->state);
	if (running)
		ionic_stop(netdev);

@@ -500,7 +499,7 @@ static int ionic_set_ringparam(struct net_device *netdev,

	if (running)
		ionic_open(netdev);
	clear_bit(IONIC_LIF_QUEUE_RESET, lif->state);
	clear_bit(IONIC_LIF_F_QUEUE_RESET, lif->state);

	return 0;
}
@@ -531,11 +530,11 @@ static int ionic_set_channels(struct net_device *netdev,
	if (ch->combined_count == lif->nxqs)
		return 0;

	err = ionic_wait_for_bit(lif, IONIC_LIF_QUEUE_RESET);
	err = ionic_wait_for_bit(lif, IONIC_LIF_F_QUEUE_RESET);
	if (err)
		return err;

	running = test_bit(IONIC_LIF_UP, lif->state);
	running = test_bit(IONIC_LIF_F_UP, lif->state);
	if (running)
		ionic_stop(netdev);

@@ -543,7 +542,7 @@ static int ionic_set_channels(struct net_device *netdev,

	if (running)
		ionic_open(netdev);
	clear_bit(IONIC_LIF_QUEUE_RESET, lif->state);
	clear_bit(IONIC_LIF_F_QUEUE_RESET, lif->state);

	return 0;
}
@@ -553,7 +552,7 @@ static u32 ionic_get_priv_flags(struct net_device *netdev)
	struct ionic_lif *lif = netdev_priv(netdev);
	u32 priv_flags = 0;

	if (test_bit(IONIC_LIF_SW_DEBUG_STATS, lif->state))
	if (test_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state))
		priv_flags |= PRIV_F_SW_DBG_STATS;

	return priv_flags;
@@ -562,14 +561,10 @@ static u32 ionic_get_priv_flags(struct net_device *netdev)
static int ionic_set_priv_flags(struct net_device *netdev, u32 priv_flags)
{
	struct ionic_lif *lif = netdev_priv(netdev);
	u32 flags = lif->flags;

	clear_bit(IONIC_LIF_SW_DEBUG_STATS, lif->state);
	clear_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state);
	if (priv_flags & PRIV_F_SW_DBG_STATS)
		set_bit(IONIC_LIF_SW_DEBUG_STATS, lif->state);

	if (flags != lif->flags)
		lif->flags = flags;
		set_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state);

	return 0;
}
+17 −21
Original line number Diff line number Diff line
@@ -4,8 +4,6 @@
#ifndef _IONIC_IF_H_
#define _IONIC_IF_H_

#pragma pack(push, 1)

#define IONIC_DEV_INFO_SIGNATURE		0x44455649      /* 'DEVI' */
#define IONIC_DEV_INFO_VERSION			1
#define IONIC_IFNAMSIZ				16
@@ -366,7 +364,7 @@ union ionic_lif_config {
		u8     rsvd2[2];
		__le64 features;
		__le32 queue_count[IONIC_QTYPE_MAX];
	};
	} __packed;
	__le32 words[64];
};

@@ -417,7 +415,7 @@ union ionic_lif_identity {
			__le32 max_frame_size;
			u8 rsvd2[106];
			union ionic_lif_config config;
		} eth;
		} __packed eth;

		struct {
			u8 version;
@@ -439,8 +437,8 @@ union ionic_lif_identity {
			struct ionic_lif_logical_qtype rq_qtype;
			struct ionic_lif_logical_qtype cq_qtype;
			struct ionic_lif_logical_qtype eq_qtype;
		} rdma;
	};
		} __packed rdma;
	} __packed;
	__le32 words[512];
};

@@ -526,7 +524,7 @@ struct ionic_q_init_cmd {
	__le64 sg_ring_base;
	__le32 eq_index;
	u8     rsvd2[16];
};
} __packed;

/**
 * struct ionic_q_init_comp - Queue init command completion
@@ -1095,7 +1093,7 @@ struct ionic_port_status {
	u8     status;
	u8     rsvd[51];
	struct ionic_xcvr_status  xcvr;
};
} __packed;

/**
 * struct ionic_port_identify_cmd - Port identify command
@@ -1251,7 +1249,7 @@ struct ionic_port_getattr_comp {
		u8      pause_type;
		u8      loopback_mode;
		u8      rsvd2[11];
	};
	} __packed;
	u8     color;
};

@@ -1319,7 +1317,7 @@ struct ionic_dev_setattr_cmd {
		char    name[IONIC_IFNAMSIZ];
		__le64  features;
		u8      rsvd2[60];
	};
	} __packed;
};

/**
@@ -1334,7 +1332,7 @@ struct ionic_dev_setattr_comp {
	union {
		__le64  features;
		u8      rsvd2[11];
	};
	} __packed;
	u8     color;
};

@@ -1361,7 +1359,7 @@ struct ionic_dev_getattr_comp {
	union {
		__le64  features;
		u8      rsvd2[11];
	};
	} __packed;
	u8     color;
};

@@ -1426,7 +1424,7 @@ struct ionic_lif_setattr_cmd {
		} rss;
		u8	stats_ctl;
		u8      rsvd[60];
	};
	} __packed;
};

/**
@@ -1444,7 +1442,7 @@ struct ionic_lif_setattr_comp {
	union {
		__le64  features;
		u8      rsvd2[11];
	};
	} __packed;
	u8     color;
};

@@ -1483,7 +1481,7 @@ struct ionic_lif_getattr_comp {
		u8      mac[6];
		__le64  features;
		u8      rsvd2[11];
	};
	} __packed;
	u8     color;
};

@@ -1688,7 +1686,7 @@ struct ionic_vf_setattr_cmd {
		u8     linkstate;
		__le64 stats_pa;
		u8     pad[60];
	};
	} __packed;
};

struct ionic_vf_setattr_comp {
@@ -1726,7 +1724,7 @@ struct ionic_vf_getattr_comp {
		u8     linkstate;
		__le64 stats_pa;
		u8     pad[11];
	};
	} __packed;
	u8     color;
};

@@ -2472,7 +2470,7 @@ union ionic_dev_cmd_regs {
		union ionic_dev_cmd_comp    comp;
		u8                    rsvd[48];
		u32                   data[478];
	};
	} __packed;
	u32 words[512];
};

@@ -2485,7 +2483,7 @@ union ionic_dev_regs {
	struct {
		union ionic_dev_info_regs info;
		union ionic_dev_cmd_regs  devcmd;
	};
	} __packed;
	__le32 words[1024];
};

@@ -2575,6 +2573,4 @@ struct ionic_identity {
	union ionic_qos_identity qos;
};

#pragma pack(pop)

#endif /* _IONIC_IF_H_ */
Loading