This feature is unused, so remove it.
There is exactly one adapter / lif / ethdev per port.
Signed-off-by: Andrew Boyer <aboyer@pensando.io>
const char *name;
struct ionic_dev_bar bars[IONIC_BARS_MAX];
struct ionic_identity ident;
- struct ionic_lif *lifs[IONIC_LIFS_MAX];
+ struct ionic_lif *lif;
uint32_t num_bars;
- uint32_t nlifs;
uint32_t max_ntxqs_per_lif;
uint32_t max_nrxqs_per_lif;
uint32_t max_mac_addrs;
}
void
-ionic_dev_cmd_lif_init(struct ionic_dev *idev, uint16_t lif_index,
- rte_iova_t info_pa)
+ionic_dev_cmd_lif_init(struct ionic_dev *idev, rte_iova_t info_pa)
{
union ionic_dev_cmd cmd = {
.lif_init.opcode = IONIC_CMD_LIF_INIT,
- .lif_init.index = lif_index,
.lif_init.info_pa = info_pa,
};
}
void
-ionic_dev_cmd_lif_reset(struct ionic_dev *idev, uint16_t lif_index)
+ionic_dev_cmd_lif_reset(struct ionic_dev *idev)
{
union ionic_dev_cmd cmd = {
.lif_init.opcode = IONIC_CMD_LIF_RESET,
- .lif_init.index = lif_index,
};
ionic_dev_cmd_go(idev, &cmd);
return lif->kern_dbpage + q->hw_type;
}
-int
-ionic_db_page_num(struct ionic_lif *lif, int pid)
-{
- return (lif->index * 0) + pid;
-}
-
void
ionic_intr_init(struct ionic_dev *idev, struct ionic_intr_info *intr,
unsigned long index)
void
ionic_dev_cmd_adminq_init(struct ionic_dev *idev,
struct ionic_qcq *qcq,
- uint16_t lif_index, uint16_t intr_index)
+ uint16_t intr_index)
{
struct ionic_queue *q = &qcq->q;
struct ionic_cq *cq = &qcq->cq;
union ionic_dev_cmd cmd = {
.q_init.opcode = IONIC_CMD_Q_INIT,
- .q_init.lif_index = lif_index,
.q_init.type = q->type,
.q_init.index = q->index,
.q_init.flags = IONIC_QINIT_F_ENA,
void ionic_dev_cmd_lif_identify(struct ionic_dev *idev, uint8_t type,
uint8_t ver);
-void ionic_dev_cmd_lif_init(struct ionic_dev *idev, uint16_t lif_index,
- rte_iova_t addr);
-void ionic_dev_cmd_lif_reset(struct ionic_dev *idev, uint16_t lif_index);
+void ionic_dev_cmd_lif_init(struct ionic_dev *idev, rte_iova_t addr);
+void ionic_dev_cmd_lif_reset(struct ionic_dev *idev);
void ionic_dev_cmd_adminq_init(struct ionic_dev *idev, struct ionic_qcq *qcq,
- uint16_t lif_index, uint16_t intr_index);
+ uint16_t intr_index);
struct ionic_doorbell __iomem *ionic_db_map(struct ionic_lif *lif,
struct ionic_queue *q);
-int ionic_db_page_num(struct ionic_lif *lif, int pid);
int ionic_cq_init(struct ionic_lif *lif, struct ionic_cq *cq,
struct ionic_intr_info *intr, uint32_t num_descs,
ionic_dev_interrupt_handler(void *param)
{
struct ionic_adapter *adapter = (struct ionic_adapter *)param;
- uint32_t i;
IONIC_PRINT(DEBUG, "->");
- for (i = 0; i < adapter->nlifs; i++) {
- if (adapter->lifs[i])
- ionic_notifyq_handler(adapter->lifs[i], -1);
- }
+ if (adapter->lif)
+ ionic_notifyq_handler(adapter->lif, -1);
}
static int
rte_eth_copy_pci_info(eth_dev, pci_dev);
eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
- lif->index = adapter->nlifs;
lif->eth_dev = eth_dev;
lif->adapter = adapter;
- adapter->lifs[adapter->nlifs] = lif;
+ adapter->lif = lif;
IONIC_PRINT(DEBUG, "Up to %u MAC addresses supported",
adapter->max_mac_addrs);
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
- adapter->lifs[lif->index] = NULL;
+ adapter->lif = NULL;
ionic_lif_deinit(lif);
ionic_lif_free(lif);
adapter->max_mac_addrs = adapter->ident.lif.eth.max_ucast_filters;
- adapter->nlifs = 0;
- for (i = 0; i < adapter->ident.dev.nlifs; i++) {
- snprintf(name, sizeof(name), "net_%s_lif_%lu",
- pci_dev->device.name, i);
-
- err = rte_eth_dev_create(&pci_dev->device, name,
- sizeof(struct ionic_lif),
- NULL, NULL,
- eth_ionic_dev_init, adapter);
- if (err) {
- IONIC_PRINT(ERR, "Cannot create eth device for "
- "ionic lif %s", name);
- break;
- }
+ if (adapter->ident.dev.nlifs != 1) {
+ IONIC_PRINT(ERR, "Unexpected request for %d LIFs",
+ adapter->ident.dev.nlifs);
+ goto err_free_adapter;
+ }
- adapter->nlifs++;
+ snprintf(name, sizeof(name), "%s_lif", pci_dev->device.name);
+ err = rte_eth_dev_create(&pci_dev->device,
+ name, sizeof(struct ionic_lif),
+ NULL, NULL, eth_ionic_dev_init, adapter);
+ if (err) {
+ IONIC_PRINT(ERR, "Cannot create eth device for %s", name);
+ goto err_free_adapter;
}
err = ionic_configure_intr(adapter);
struct ionic_adapter *adapter = NULL;
struct rte_eth_dev *eth_dev;
struct ionic_lif *lif;
- uint32_t i;
- /* Adapter lookup is using (the first) eth_dev name */
- snprintf(name, sizeof(name), "net_%s_lif_0",
- pci_dev->device.name);
+ /* Adapter lookup is using the eth_dev name */
+ snprintf(name, sizeof(name), "%s_lif", pci_dev->device.name);
eth_dev = rte_eth_dev_allocated(name);
if (eth_dev) {
if (adapter) {
ionic_unconfigure_intr(adapter);
- for (i = 0; i < adapter->nlifs; i++) {
- lif = adapter->lifs[i];
- rte_eth_dev_destroy(lif->eth_dev, eth_ionic_dev_uninit);
- }
+ rte_eth_dev_destroy(eth_dev, eth_ionic_dev_uninit);
rte_free(adapter);
}
.pending_work = true,
.cmd.q_control = {
.opcode = IONIC_CMD_Q_CONTROL,
- .lif_index = lif->index,
.type = q->type,
.index = q->index,
.oper = IONIC_Q_ENABLE,
.pending_work = true,
.cmd.q_control = {
.opcode = IONIC_CMD_Q_CONTROL,
- .lif_index = lif->index,
.type = q->type,
.index = q->index,
.oper = IONIC_Q_DISABLE,
IONIC_PRINT_CALL();
- ionic_dev_cmd_lif_reset(idev, lif->index);
+ ionic_dev_cmd_lif_reset(idev);
err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
if (err)
IONIC_PRINT(WARNING, "Failed to reset %s", lif->name);
.pending_work = true,
.cmd.rx_mode_set = {
.opcode = IONIC_CMD_RX_MODE_SET,
- .lif_index = lif->index,
.rx_mode = rx_mode,
},
};
.pending_work = true,
.cmd.lif_setattr = {
.opcode = IONIC_CMD_LIF_SETATTR,
- .index = lif->index,
.attr = IONIC_LIF_ATTR_MTU,
.mtu = new_mtu,
},
{
struct ionic_adapter *adapter = lif->adapter;
uint32_t socket_id = rte_socket_id();
- int dbpage_num;
int err;
/*
rte_spinlock_init(&lif->adminq_lock);
rte_spinlock_init(&lif->adminq_service_lock);
- dbpage_num = ionic_db_page_num(lif, 0);
-
- lif->kern_dbpage = ionic_bus_map_dbpage(adapter, dbpage_num);
+ lif->kern_dbpage = ionic_bus_map_dbpage(adapter, 0);
if (!lif->kern_dbpage) {
IONIC_PRINT(ERR, "Cannot map dbpage, aborting");
return -ENOMEM;
struct ionic_q_init_comp comp;
int err;
- ionic_dev_cmd_adminq_init(idev, qcq, lif->index, qcq->intr.index);
+ ionic_dev_cmd_adminq_init(idev, qcq, qcq->intr.index);
err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
if (err)
return err;
.pending_work = true,
.cmd.q_init = {
.opcode = IONIC_CMD_Q_INIT,
- .lif_index = lif->index,
.type = q->type,
.index = q->index,
.flags = (IONIC_QINIT_F_IRQ | IONIC_QINIT_F_ENA),
.pending_work = true,
.cmd.lif_setattr = {
.opcode = IONIC_CMD_LIF_SETATTR,
- .index = lif->index,
.attr = IONIC_LIF_ATTR_FEATURES,
.features = lif->features,
},
.pending_work = true,
.cmd.q_init = {
.opcode = IONIC_CMD_Q_INIT,
- .lif_index = lif->index,
.type = q->type,
.index = q->index,
.flags = IONIC_QINIT_F_SG,
.pending_work = true,
.cmd.q_init = {
.opcode = IONIC_CMD_Q_INIT,
- .lif_index = lif->index,
.type = q->type,
.index = q->index,
.flags = IONIC_QINIT_F_SG,
.pending_work = true,
.cmd.lif_getattr = {
.opcode = IONIC_CMD_LIF_GETATTR,
- .index = lif->index,
.attr = IONIC_LIF_ATTR_MAC,
},
};
.pending_work = true,
.cmd.lif_setattr = {
.opcode = IONIC_CMD_LIF_SETATTR,
- .index = lif->index,
.attr = IONIC_LIF_ATTR_NAME,
},
};
memset(&lif->stats_base, 0, sizeof(lif->stats_base));
- ionic_dev_cmd_lif_init(idev, lif->index, lif->info_pa);
+ ionic_dev_cmd_lif_init(idev, lif->info_pa);
err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
ionic_dev_cmd_comp(idev, &comp);
if (err)
ionic_lifs_size(struct ionic_adapter *adapter)
{
struct ionic_identity *ident = &adapter->ident;
- uint32_t nlifs = ident->dev.nlifs;
uint32_t nintrs, dev_nintrs = ident->dev.nintrs;
adapter->max_ntxqs_per_lif =
adapter->max_nrxqs_per_lif =
ident->lif.eth.config.queue_count[IONIC_QTYPE_RXQ];
- nintrs = nlifs * 1 /* notifyq */;
+ nintrs = 1 /* notifyq */;
if (nintrs > dev_nintrs) {
IONIC_PRINT(ERR,
struct ionic_adapter *adapter;
struct rte_eth_dev *eth_dev;
uint16_t port_id; /**< Device port identifier */
- uint32_t index;
uint32_t hw_index;
uint32_t state;
uint32_t ntxqcqs;