NULL
};
+#define AR_VENDOR_ID 0x1d6c
static const struct rte_pci_id pci_id_ark_map[] = {
- {RTE_PCI_DEVICE(0x1d6c, 0x100d)},
- {RTE_PCI_DEVICE(0x1d6c, 0x100e)},
- {RTE_PCI_DEVICE(0x1d6c, 0x100f)},
- {RTE_PCI_DEVICE(0x1d6c, 0x1010)},
- {RTE_PCI_DEVICE(0x1d6c, 0x1017)},
- {RTE_PCI_DEVICE(0x1d6c, 0x1018)},
- {RTE_PCI_DEVICE(0x1d6c, 0x1019)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x100d)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x100e)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x100f)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1010)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1017)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1018)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1019)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101e)},
+ {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101f)},
{.vendor_id = 0, /* sentinel */ },
};
+/*
+ * This structure is used to statically define the capabilities
+ * of supported devices.
+ * Capabilities:
+ * rqpacing -
+ * Some HW variants require that PCIe read-requests be correctly throttled.
+ * This is called "rqpacing" and has to do with credit and flow control
+ * on certain Arkville implementations.
+ */
+struct ark_caps {
+ bool rqpacing;
+};
+struct ark_dev_caps {
+ uint32_t device_id;
+ struct ark_caps caps;
+};
+#define SET_DEV_CAPS(id, rqp) \
+ {id, {.rqpacing = rqp} }
+
+static const struct ark_dev_caps
+ark_device_caps[] = {
+ SET_DEV_CAPS(0x100d, true),
+ SET_DEV_CAPS(0x100e, true),
+ SET_DEV_CAPS(0x100f, true),
+ SET_DEV_CAPS(0x1010, false),
+ SET_DEV_CAPS(0x1017, true),
+ SET_DEV_CAPS(0x1018, true),
+ SET_DEV_CAPS(0x1019, true),
+ SET_DEV_CAPS(0x101e, false),
+ SET_DEV_CAPS(0x101f, false),
+ {.device_id = 0,}
+};
+
static int
eth_ark_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
struct rte_pci_device *pci_dev)
int ret;
int port_count = 1;
int p;
+ bool rqpacing = false;
ark->eth_dev = dev;
rte_eth_copy_pci_info(dev, pci_dev);
dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
+ p = 0;
+ while (ark_device_caps[p].device_id != 0) {
+ if (pci_dev->id.device_id == ark_device_caps[p].device_id) {
+ rqpacing = ark_device_caps[p].caps.rqpacing;
+ break;
+ }
+ p++;
+ }
+
/* Use dummy function until setup */
- dev->rx_pkt_burst = ð_ark_recv_pkts_noop;
- dev->tx_pkt_burst = ð_ark_xmit_pkts_noop;
+ dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
+ dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
ark->bar0 = (uint8_t *)pci_dev->mem_resource[0].addr;
ark->a_bar = (uint8_t *)pci_dev->mem_resource[2].addr;
ark->pktgen.v = (void *)&ark->bar0[ARK_PKTGEN_BASE];
ark->pktchkr.v = (void *)&ark->bar0[ARK_PKTCHKR_BASE];
- ark->rqpacing =
- (struct ark_rqpace_t *)(ark->bar0 + ARK_RCPACING_BASE);
+ if (rqpacing) {
+ ark->rqpacing =
+ (struct ark_rqpace_t *)(ark->bar0 + ARK_RCPACING_BASE);
+ } else {
+ ark->rqpacing = NULL;
+ }
ark->started = 0;
ark->pkt_dir_v = ARK_PKT_DIR_INIT_VAL;
return -1;
}
if (ark->sysctrl.t32[3] != 0) {
- if (ark_rqp_lasped(ark->rqpacing)) {
- ARK_PMD_LOG(ERR, "Arkville Evaluation System - "
- "Timer has Expired\n");
- return -1;
+ if (ark->rqpacing) {
+ if (ark_rqp_lasped(ark->rqpacing)) {
+ ARK_PMD_LOG(ERR, "Arkville Evaluation System - "
+ "Timer has Expired\n");
+ return -1;
+ }
+ ARK_PMD_LOG(WARNING, "Arkville Evaluation System - "
+ "Timer is Running\n");
}
- ARK_PMD_LOG(WARNING, "Arkville Evaluation System - "
- "Timer is Running\n");
}
ARK_PMD_LOG(DEBUG,
* known state
*/
ark->start_pg = 0;
+ ark->pg_running = 0;
ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
if (ark->pg == NULL)
return -1;
mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
}
- ark_udm_stop(ark->udm.v, 0);
- ark_udm_configure(ark->udm.v,
- RTE_PKTMBUF_HEADROOM,
- RTE_MBUF_DEFAULT_DATAROOM,
- ARK_RX_WRITE_TIME_NS);
- ark_udm_stats_reset(ark->udm.v);
- ark_udm_stop(ark->udm.v, 0);
-
/* TX -- DDM */
if (ark_ddm_stop(ark->ddm.v, 1))
ARK_PMD_LOG(ERR, "Unable to stop DDM\n");
ark_ddm_stats_reset(ark->ddm.v);
ark_ddm_stop(ark->ddm.v, 0);
- ark_rqp_stats_reset(ark->rqpacing);
+ if (ark->rqpacing)
+ ark_rqp_stats_reset(ark->rqpacing);
return 0;
}
if (ark->start_pg)
ark_pktchkr_run(ark->pc);
- if (ark->start_pg && (dev->data->port_id == 0)) {
+ if (ark->start_pg && !ark->pg_running) {
pthread_t thread;
/* Delay packet generatpr start allow the hardware to be ready
* This is only used for sanity checking with internal generator
*/
- if (rte_ctrl_thread_create(&thread, "ark-delay-pg", NULL,
+ char tname[32];
+ snprintf(tname, sizeof(tname), "ark-delay-pg-%d",
+ dev->data->port_id);
+
+ if (rte_ctrl_thread_create(&thread, tname, NULL,
ark_pktgen_delay_start, ark->pg)) {
ARK_PMD_LOG(ERR, "Could not create pktgen "
"starter thread\n");
return -1;
}
+ ark->pg_running = 1;
}
if (ark->user_ext.dev_start)
ark->user_data[dev->data->port_id]);
/* Stop the packet generator */
- if (ark->start_pg)
+ if (ark->start_pg && ark->pg_running) {
ark_pktgen_pause(ark->pg);
+ ark->pg_running = 0;
+ }
- dev->rx_pkt_burst = ð_ark_recv_pkts_noop;
- dev->tx_pkt_burst = ð_ark_xmit_pkts_noop;
+ dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
+ dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
/* STOP TX Side */
for (i = 0; i < dev->data->nb_tx_queues; i++) {
/*
* TODO This should only be called once for the device during shutdown
*/
- ark_rqp_dump(ark->rqpacing);
+ if (ark->rqpacing)
+ ark_rqp_dump(ark->rqpacing);
for (i = 0; i < dev->data->nb_tx_queues; i++) {
eth_ark_tx_queue_release(dev->data->tx_queues[i]);