4 * Copyright(c) 2017 Cavium, Inc.. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Cavium, Inc. nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #include <rte_ethdev.h>
35 #include <rte_cycles.h>
36 #include <rte_malloc.h>
37 #include <rte_alarm.h>
40 #include "lio_23xx_vf.h"
41 #include "lio_ethdev.h"
45 * Atomically writes the link status information into global
46 * structure rte_eth_dev.
49 * - Pointer to the structure rte_eth_dev to read from.
50 * - Pointer to the buffer to be saved with the link status.
54 * - On failure, negative value.
57 lio_dev_atomic_write_link_status(struct rte_eth_dev *eth_dev,
58 struct rte_eth_link *link)
60 struct rte_eth_link *dst = ð_dev->data->dev_link;
61 struct rte_eth_link *src = link;
63 if (rte_atomic64_cmpset((uint64_t *)dst, *(uint64_t *)dst,
64 *(uint64_t *)src) == 0)
71 lio_hweight64(uint64_t w)
73 uint64_t res = w - ((w >> 1) & 0x5555555555555555ul);
76 (res & 0x3333333333333333ul) + ((res >> 2) & 0x3333333333333333ul);
77 res = (res + (res >> 4)) & 0x0F0F0F0F0F0F0F0Ful;
78 res = res + (res >> 8);
79 res = res + (res >> 16);
81 return (res + (res >> 32)) & 0x00000000000000FFul;
85 lio_dev_link_update(struct rte_eth_dev *eth_dev,
86 int wait_to_complete __rte_unused)
88 struct lio_device *lio_dev = LIO_DEV(eth_dev);
89 struct rte_eth_link link, old;
92 link.link_status = ETH_LINK_DOWN;
93 link.link_speed = ETH_SPEED_NUM_NONE;
94 link.link_duplex = ETH_LINK_HALF_DUPLEX;
95 memset(&old, 0, sizeof(old));
97 /* Return what we found */
98 if (lio_dev->linfo.link.s.link_up == 0) {
99 /* Interface is down */
100 if (lio_dev_atomic_write_link_status(eth_dev, &link))
102 if (link.link_status == old.link_status)
107 link.link_status = ETH_LINK_UP; /* Interface is up */
108 link.link_duplex = ETH_LINK_FULL_DUPLEX;
109 switch (lio_dev->linfo.link.s.speed) {
110 case LIO_LINK_SPEED_10000:
111 link.link_speed = ETH_SPEED_NUM_10G;
114 link.link_speed = ETH_SPEED_NUM_NONE;
115 link.link_duplex = ETH_LINK_HALF_DUPLEX;
118 if (lio_dev_atomic_write_link_status(eth_dev, &link))
121 if (link.link_status == old.link_status)
128 * Setup our receive queue/ringbuffer. This is the
129 * queue the Octeon uses to send us packets and
130 * responses. We are given a memory pool for our
131 * packet buffers that are used to populate the receive
135 * Pointer to the structure rte_eth_dev
138 * @param num_rx_descs
139 * Number of entries in the queue
141 * Where to allocate memory
143 * Pointer to the struction rte_eth_rxconf
145 * Pointer to the packet pool
148 * - On success, return 0
149 * - On failure, return -1
152 lio_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t q_no,
153 uint16_t num_rx_descs, unsigned int socket_id,
154 const struct rte_eth_rxconf *rx_conf __rte_unused,
155 struct rte_mempool *mp)
157 struct lio_device *lio_dev = LIO_DEV(eth_dev);
158 struct rte_pktmbuf_pool_private *mbp_priv;
159 uint32_t fw_mapped_oq;
162 if (q_no >= lio_dev->nb_rx_queues) {
163 lio_dev_err(lio_dev, "Invalid rx queue number %u\n", q_no);
167 lio_dev_dbg(lio_dev, "setting up rx queue %u\n", q_no);
169 fw_mapped_oq = lio_dev->linfo.rxpciq[q_no].s.q_no;
171 if ((lio_dev->droq[fw_mapped_oq]) &&
172 (num_rx_descs != lio_dev->droq[fw_mapped_oq]->max_count)) {
174 "Reconfiguring Rx descs not supported. Configure descs to same value %u or restart application\n",
175 lio_dev->droq[fw_mapped_oq]->max_count);
179 mbp_priv = rte_mempool_get_priv(mp);
180 buf_size = mbp_priv->mbuf_data_room_size - RTE_PKTMBUF_HEADROOM;
182 if (lio_setup_droq(lio_dev, fw_mapped_oq, num_rx_descs, buf_size, mp,
184 lio_dev_err(lio_dev, "droq allocation failed\n");
188 eth_dev->data->rx_queues[q_no] = lio_dev->droq[fw_mapped_oq];
194 * Release the receive queue/ringbuffer. Called by
198 * Opaque pointer to the receive queue to release
204 lio_dev_rx_queue_release(void *rxq)
206 struct lio_droq *droq = rxq;
207 struct lio_device *lio_dev = droq->lio_dev;
210 /* Run time queue deletion not supported */
211 if (lio_dev->port_configured)
216 lio_delete_droq_queue(droq->lio_dev, oq_no);
221 * Allocate and initialize SW ring. Initialize associated HW registers.
224 * Pointer to structure rte_eth_dev
229 * @param num_tx_descs
230 * Number of ringbuffer descriptors
233 * NUMA socket id, used for memory allocations
236 * Pointer to the structure rte_eth_txconf
239 * - On success, return 0
240 * - On failure, return -errno value
243 lio_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t q_no,
244 uint16_t num_tx_descs, unsigned int socket_id,
245 const struct rte_eth_txconf *tx_conf __rte_unused)
247 struct lio_device *lio_dev = LIO_DEV(eth_dev);
248 int fw_mapped_iq = lio_dev->linfo.txpciq[q_no].s.q_no;
251 if (q_no >= lio_dev->nb_tx_queues) {
252 lio_dev_err(lio_dev, "Invalid tx queue number %u\n", q_no);
256 lio_dev_dbg(lio_dev, "setting up tx queue %u\n", q_no);
258 if ((lio_dev->instr_queue[fw_mapped_iq] != NULL) &&
259 (num_tx_descs != lio_dev->instr_queue[fw_mapped_iq]->max_count)) {
261 "Reconfiguring Tx descs not supported. Configure descs to same value %u or restart application\n",
262 lio_dev->instr_queue[fw_mapped_iq]->max_count);
266 retval = lio_setup_iq(lio_dev, q_no, lio_dev->linfo.txpciq[q_no],
267 num_tx_descs, lio_dev, socket_id);
270 lio_dev_err(lio_dev, "Runtime IQ(TxQ) creation failed.\n");
274 retval = lio_setup_sglists(lio_dev, q_no, fw_mapped_iq,
275 lio_dev->instr_queue[fw_mapped_iq]->max_count,
279 lio_delete_instruction_queue(lio_dev, fw_mapped_iq);
283 eth_dev->data->tx_queues[q_no] = lio_dev->instr_queue[fw_mapped_iq];
289 * Release the transmit queue/ringbuffer. Called by
293 * Opaque pointer to the transmit queue to release
299 lio_dev_tx_queue_release(void *txq)
301 struct lio_instr_queue *tq = txq;
302 struct lio_device *lio_dev = tq->lio_dev;
303 uint32_t fw_mapped_iq_no;
305 /* Run time queue deletion not supported */
306 if (lio_dev->port_configured)
311 lio_delete_sglist(tq);
313 fw_mapped_iq_no = tq->txpciq.s.q_no;
314 lio_delete_instruction_queue(tq->lio_dev, fw_mapped_iq_no);
319 * Api to check link state.
322 lio_dev_get_link_status(struct rte_eth_dev *eth_dev)
324 struct lio_device *lio_dev = LIO_DEV(eth_dev);
325 uint16_t timeout = LIO_MAX_CMD_TIMEOUT;
326 struct lio_link_status_resp *resp;
327 union octeon_link_status *ls;
328 struct lio_soft_command *sc;
331 if (!lio_dev->intf_open)
334 resp_size = sizeof(struct lio_link_status_resp);
335 sc = lio_alloc_soft_command(lio_dev, 0, resp_size, 0);
339 resp = (struct lio_link_status_resp *)sc->virtrptr;
340 lio_prepare_soft_command(lio_dev, sc, LIO_OPCODE,
341 LIO_OPCODE_INFO, 0, 0, 0);
343 /* Setting wait time in seconds */
344 sc->wait_time = LIO_MAX_CMD_TIMEOUT / 1000;
346 if (lio_send_soft_command(lio_dev, sc) == LIO_IQ_SEND_FAILED)
347 goto get_status_fail;
349 while ((*sc->status_word == LIO_COMPLETION_WORD_INIT) && --timeout) {
350 lio_flush_iq(lio_dev, lio_dev->instr_queue[sc->iq_no]);
355 goto get_status_fail;
357 ls = &resp->link_info.link;
359 lio_swap_8B_data((uint64_t *)ls, sizeof(union octeon_link_status) >> 3);
361 if (lio_dev->linfo.link.link_status64 != ls->link_status64) {
362 lio_dev->linfo.link.link_status64 = ls->link_status64;
363 lio_dev_link_update(eth_dev, 0);
366 lio_free_soft_command(sc);
371 lio_free_soft_command(sc);
374 /* This function will be invoked every LSC_TIMEOUT ns (100ms)
375 * and will update link state if it changes.
378 lio_sync_link_state_check(void *eth_dev)
380 struct lio_device *lio_dev =
381 (((struct rte_eth_dev *)eth_dev)->data->dev_private);
383 if (lio_dev->port_configured)
384 lio_dev_get_link_status(eth_dev);
386 /* Schedule periodic link status check.
387 * Stop check if interface is close and start again while opening.
389 if (lio_dev->intf_open)
390 rte_eal_alarm_set(LIO_LSC_TIMEOUT, lio_sync_link_state_check,
395 lio_dev_start(struct rte_eth_dev *eth_dev)
397 struct lio_device *lio_dev = LIO_DEV(eth_dev);
400 lio_dev_info(lio_dev, "Starting port %d\n", eth_dev->data->port_id);
402 if (lio_dev->fn_list.enable_io_queues(lio_dev))
405 /* Ready for link status updates */
406 lio_dev->intf_open = 1;
409 /* start polling for lsc */
410 ret = rte_eal_alarm_set(LIO_LSC_TIMEOUT,
411 lio_sync_link_state_check,
415 "link state check handler creation failed\n");
416 goto dev_lsc_handle_error;
421 dev_lsc_handle_error:
422 lio_dev->intf_open = 0;
427 static int lio_dev_configure(struct rte_eth_dev *eth_dev)
429 struct lio_device *lio_dev = LIO_DEV(eth_dev);
430 uint16_t timeout = LIO_MAX_CMD_TIMEOUT;
431 int retval, num_iqueues, num_oqueues;
432 uint8_t mac[ETHER_ADDR_LEN], i;
433 struct lio_if_cfg_resp *resp;
434 struct lio_soft_command *sc;
435 union lio_if_cfg if_cfg;
438 PMD_INIT_FUNC_TRACE();
440 /* Re-configuring firmware not supported.
441 * Can't change tx/rx queues per port from initial value.
443 if (lio_dev->port_configured) {
444 if ((lio_dev->nb_rx_queues != eth_dev->data->nb_rx_queues) ||
445 (lio_dev->nb_tx_queues != eth_dev->data->nb_tx_queues)) {
447 "rxq/txq re-conf not supported. Restart application with new value.\n");
453 lio_dev->nb_rx_queues = eth_dev->data->nb_rx_queues;
454 lio_dev->nb_tx_queues = eth_dev->data->nb_tx_queues;
456 resp_size = sizeof(struct lio_if_cfg_resp);
457 sc = lio_alloc_soft_command(lio_dev, 0, resp_size, 0);
461 resp = (struct lio_if_cfg_resp *)sc->virtrptr;
463 /* Firmware doesn't have capability to reconfigure the queues,
464 * Claim all queues, and use as many required
467 if_cfg.s.num_iqueues = lio_dev->nb_tx_queues;
468 if_cfg.s.num_oqueues = lio_dev->nb_rx_queues;
469 if_cfg.s.base_queue = 0;
471 if_cfg.s.gmx_port_id = lio_dev->pf_num;
473 lio_prepare_soft_command(lio_dev, sc, LIO_OPCODE,
474 LIO_OPCODE_IF_CFG, 0,
477 /* Setting wait time in seconds */
478 sc->wait_time = LIO_MAX_CMD_TIMEOUT / 1000;
480 retval = lio_send_soft_command(lio_dev, sc);
481 if (retval == LIO_IQ_SEND_FAILED) {
482 lio_dev_err(lio_dev, "iq/oq config failed status: %x\n",
484 /* Soft instr is freed by driver in case of failure. */
485 goto nic_config_fail;
488 /* Sleep on a wait queue till the cond flag indicates that the
489 * response arrived or timed-out.
491 while ((*sc->status_word == LIO_COMPLETION_WORD_INIT) && --timeout) {
492 lio_flush_iq(lio_dev, lio_dev->instr_queue[sc->iq_no]);
493 lio_process_ordered_list(lio_dev);
497 retval = resp->status;
499 lio_dev_err(lio_dev, "iq/oq config failed\n");
500 goto nic_config_fail;
503 lio_swap_8B_data((uint64_t *)(&resp->cfg_info),
504 sizeof(struct octeon_if_cfg_info) >> 3);
506 num_iqueues = lio_hweight64(resp->cfg_info.iqmask);
507 num_oqueues = lio_hweight64(resp->cfg_info.oqmask);
509 if (!(num_iqueues) || !(num_oqueues)) {
511 "Got bad iqueues (%016lx) or oqueues (%016lx) from firmware.\n",
512 (unsigned long)resp->cfg_info.iqmask,
513 (unsigned long)resp->cfg_info.oqmask);
514 goto nic_config_fail;
518 "interface %d, iqmask %016lx, oqmask %016lx, numiqueues %d, numoqueues %d\n",
519 eth_dev->data->port_id,
520 (unsigned long)resp->cfg_info.iqmask,
521 (unsigned long)resp->cfg_info.oqmask,
522 num_iqueues, num_oqueues);
524 lio_dev->linfo.num_rxpciq = num_oqueues;
525 lio_dev->linfo.num_txpciq = num_iqueues;
527 for (i = 0; i < num_oqueues; i++) {
528 lio_dev->linfo.rxpciq[i].rxpciq64 =
529 resp->cfg_info.linfo.rxpciq[i].rxpciq64;
530 lio_dev_dbg(lio_dev, "index %d OQ %d\n",
531 i, lio_dev->linfo.rxpciq[i].s.q_no);
534 for (i = 0; i < num_iqueues; i++) {
535 lio_dev->linfo.txpciq[i].txpciq64 =
536 resp->cfg_info.linfo.txpciq[i].txpciq64;
537 lio_dev_dbg(lio_dev, "index %d IQ %d\n",
538 i, lio_dev->linfo.txpciq[i].s.q_no);
541 lio_dev->linfo.hw_addr = resp->cfg_info.linfo.hw_addr;
542 lio_dev->linfo.gmxport = resp->cfg_info.linfo.gmxport;
543 lio_dev->linfo.link.link_status64 =
544 resp->cfg_info.linfo.link.link_status64;
546 /* 64-bit swap required on LE machines */
547 lio_swap_8B_data(&lio_dev->linfo.hw_addr, 1);
548 for (i = 0; i < ETHER_ADDR_LEN; i++)
549 mac[i] = *((uint8_t *)(((uint8_t *)&lio_dev->linfo.hw_addr) +
552 /* Copy the permanent MAC address */
553 ether_addr_copy((struct ether_addr *)mac, ð_dev->data->mac_addrs[0]);
555 lio_dev->glist_lock =
556 rte_zmalloc(NULL, sizeof(*lio_dev->glist_lock) * num_iqueues, 0);
557 if (lio_dev->glist_lock == NULL)
560 lio_dev->glist_head =
561 rte_zmalloc(NULL, sizeof(*lio_dev->glist_head) * num_iqueues,
563 if (lio_dev->glist_head == NULL) {
564 rte_free(lio_dev->glist_lock);
565 lio_dev->glist_lock = NULL;
569 lio_dev_link_update(eth_dev, 0);
571 lio_dev->port_configured = 1;
573 lio_free_soft_command(sc);
575 /* Disable iq_0 for reconf */
576 lio_dev->fn_list.disable_io_queues(lio_dev);
579 lio_dev->fn_list.setup_device_regs(lio_dev);
581 /* Free iq_0 used during init */
582 lio_free_instr_queue0(lio_dev);
587 lio_dev_err(lio_dev, "Failed retval %d\n", retval);
588 lio_free_soft_command(sc);
589 lio_free_instr_queue0(lio_dev);
594 /* Define our ethernet definitions */
595 static const struct eth_dev_ops liovf_eth_dev_ops = {
596 .dev_configure = lio_dev_configure,
597 .dev_start = lio_dev_start,
598 .link_update = lio_dev_link_update,
599 .rx_queue_setup = lio_dev_rx_queue_setup,
600 .rx_queue_release = lio_dev_rx_queue_release,
601 .tx_queue_setup = lio_dev_tx_queue_setup,
602 .tx_queue_release = lio_dev_tx_queue_release,
606 lio_check_pf_hs_response(void *lio_dev)
608 struct lio_device *dev = lio_dev;
610 /* check till response arrives */
611 if (dev->pfvf_hsword.coproc_tics_per_us)
614 cn23xx_vf_handle_mbox(dev);
616 rte_eal_alarm_set(1, lio_check_pf_hs_response, lio_dev);
620 * \brief Identify the LIO device and to map the BAR address space
621 * @param lio_dev lio device
624 lio_chip_specific_setup(struct lio_device *lio_dev)
626 struct rte_pci_device *pdev = lio_dev->pci_dev;
627 uint32_t dev_id = pdev->id.device_id;
632 case LIO_CN23XX_VF_VID:
633 lio_dev->chip_id = LIO_CN23XX_VF_VID;
634 ret = cn23xx_vf_setup_device(lio_dev);
639 lio_dev_err(lio_dev, "Unsupported Chip\n");
643 lio_dev_info(lio_dev, "DEVICE : %s\n", s);
649 lio_first_time_init(struct lio_device *lio_dev,
650 struct rte_pci_device *pdev)
654 PMD_INIT_FUNC_TRACE();
656 /* set dpdk specific pci device pointer */
657 lio_dev->pci_dev = pdev;
659 /* Identify the LIO type and set device ops */
660 if (lio_chip_specific_setup(lio_dev)) {
661 lio_dev_err(lio_dev, "Chip specific setup failed\n");
665 /* Initialize soft command buffer pool */
666 if (lio_setup_sc_buffer_pool(lio_dev)) {
667 lio_dev_err(lio_dev, "sc buffer pool allocation failed\n");
671 /* Initialize lists to manage the requests of different types that
672 * arrive from applications for this lio device.
674 lio_setup_response_list(lio_dev);
676 if (lio_dev->fn_list.setup_mbox(lio_dev)) {
677 lio_dev_err(lio_dev, "Mailbox setup failed\n");
681 /* Check PF response */
682 lio_check_pf_hs_response((void *)lio_dev);
684 /* Do handshake and exit if incompatible PF driver */
685 if (cn23xx_pfvf_handshake(lio_dev))
689 cn23xx_vf_ask_pf_to_do_flr(lio_dev);
690 /* Wait for FLR for 100ms per SRIOV specification */
693 if (cn23xx_vf_set_io_queues_off(lio_dev)) {
694 lio_dev_err(lio_dev, "Setting io queues off failed\n");
698 if (lio_dev->fn_list.setup_device_regs(lio_dev)) {
699 lio_dev_err(lio_dev, "Failed to configure device registers\n");
703 if (lio_setup_instr_queue0(lio_dev)) {
704 lio_dev_err(lio_dev, "Failed to setup instruction queue 0\n");
708 dpdk_queues = (int)lio_dev->sriov_info.rings_per_vf;
710 lio_dev->max_tx_queues = dpdk_queues;
711 lio_dev->max_rx_queues = dpdk_queues;
713 /* Enable input and output queues for this device */
714 if (lio_dev->fn_list.enable_io_queues(lio_dev))
720 lio_free_sc_buffer_pool(lio_dev);
721 if (lio_dev->mbox[0])
722 lio_dev->fn_list.free_mbox(lio_dev);
723 if (lio_dev->instr_queue[0])
724 lio_free_instr_queue0(lio_dev);
730 lio_eth_dev_uninit(struct rte_eth_dev *eth_dev)
732 struct lio_device *lio_dev = LIO_DEV(eth_dev);
734 PMD_INIT_FUNC_TRACE();
736 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
739 /* lio_free_sc_buffer_pool */
740 lio_free_sc_buffer_pool(lio_dev);
742 rte_free(eth_dev->data->mac_addrs);
743 eth_dev->data->mac_addrs = NULL;
745 eth_dev->rx_pkt_burst = NULL;
746 eth_dev->tx_pkt_burst = NULL;
752 lio_eth_dev_init(struct rte_eth_dev *eth_dev)
754 struct rte_pci_device *pdev = RTE_DEV_TO_PCI(eth_dev->device);
755 struct lio_device *lio_dev = LIO_DEV(eth_dev);
757 PMD_INIT_FUNC_TRACE();
759 eth_dev->rx_pkt_burst = &lio_dev_recv_pkts;
760 eth_dev->tx_pkt_burst = &lio_dev_xmit_pkts;
762 /* Primary does the initialization. */
763 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
766 rte_eth_copy_pci_info(eth_dev, pdev);
767 eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
769 if (pdev->mem_resource[0].addr) {
770 lio_dev->hw_addr = pdev->mem_resource[0].addr;
772 PMD_INIT_LOG(ERR, "ERROR: Failed to map BAR0\n");
776 lio_dev->eth_dev = eth_dev;
777 /* set lio device print string */
778 snprintf(lio_dev->dev_string, sizeof(lio_dev->dev_string),
779 "%s[%02x:%02x.%x]", pdev->driver->driver.name,
780 pdev->addr.bus, pdev->addr.devid, pdev->addr.function);
782 lio_dev->port_id = eth_dev->data->port_id;
784 if (lio_first_time_init(lio_dev, pdev)) {
785 lio_dev_err(lio_dev, "Device init failed\n");
789 eth_dev->dev_ops = &liovf_eth_dev_ops;
790 eth_dev->data->mac_addrs = rte_zmalloc("lio", ETHER_ADDR_LEN, 0);
791 if (eth_dev->data->mac_addrs == NULL) {
793 "MAC addresses memory allocation failed\n");
794 eth_dev->dev_ops = NULL;
795 eth_dev->rx_pkt_burst = NULL;
796 eth_dev->tx_pkt_burst = NULL;
800 rte_atomic64_set(&lio_dev->status, LIO_DEV_RUNNING);
803 lio_dev->port_configured = 0;
804 /* Always allow unicast packets */
805 lio_dev->ifflags |= LIO_IFFLAG_UNICAST;
810 /* Set of PCI devices this driver supports */
811 static const struct rte_pci_id pci_id_liovf_map[] = {
812 { RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, LIO_CN23XX_VF_VID) },
813 { .vendor_id = 0, /* sentinel */ }
816 static struct eth_driver rte_liovf_pmd = {
818 .id_table = pci_id_liovf_map,
819 .drv_flags = RTE_PCI_DRV_NEED_MAPPING,
820 .probe = rte_eth_dev_pci_probe,
821 .remove = rte_eth_dev_pci_remove,
823 .eth_dev_init = lio_eth_dev_init,
824 .eth_dev_uninit = lio_eth_dev_uninit,
825 .dev_private_size = sizeof(struct lio_device),
828 RTE_PMD_REGISTER_PCI(net_liovf, rte_liovf_pmd.pci_drv);
829 RTE_PMD_REGISTER_PCI_TABLE(net_liovf, pci_id_liovf_map);
830 RTE_PMD_REGISTER_KMOD_DEP(net_liovf, "* igb_uio | vfio");