#include <rte_branch_prediction.h>
#include <rte_memory.h>
#include <rte_memzone.h>
-#include <rte_tailq.h>
#include <rte_eal.h>
#include <rte_alarm.h>
#include <rte_ether.h>
#define PROCESS_SYS_EVENTS 0
-static int eth_vmxnet3_dev_init(struct eth_driver *eth_drv,
- struct rte_eth_dev *eth_dev);
+static int eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev);
static int vmxnet3_dev_configure(struct rte_eth_dev *dev);
static int vmxnet3_dev_start(struct rte_eth_dev *dev);
static void vmxnet3_dev_stop(struct rte_eth_dev *dev);
/*
* The set of PCI devices this driver supports
*/
-static struct rte_pci_id pci_id_vmxnet3_map[] = {
+static const struct rte_pci_id pci_id_vmxnet3_map[] = {
#define RTE_PCI_DEV_ID_DECL_VMXNET3(vend, dev) {RTE_PCI_DEVICE(vend, dev)},
#include "rte_pci_dev_ids.h"
{ .vendor_id = 0, /* sentinel */ },
};
-static struct eth_dev_ops vmxnet3_eth_dev_ops = {
+static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
.dev_configure = vmxnet3_dev_configure,
.dev_start = vmxnet3_dev_start,
.dev_stop = vmxnet3_dev_stop,
* It returns 0 on success.
*/
static int
-eth_vmxnet3_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
- struct rte_eth_dev *eth_dev)
+eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
{
struct rte_pci_device *pci_dev;
- struct vmxnet3_hw *hw =
- VMXNET3_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
+ struct vmxnet3_hw *hw = eth_dev->data->dev_private;
uint32_t mac_hi, mac_lo, ver;
PMD_INIT_FUNC_TRACE();
.drv_flags = RTE_PCI_DRV_NEED_MAPPING,
},
.eth_dev_init = eth_vmxnet3_dev_init,
- .dev_private_size = sizeof(struct vmxnet3_adapter),
+ .dev_private_size = sizeof(struct vmxnet3_hw),
};
/*
vmxnet3_dev_configure(struct rte_eth_dev *dev)
{
const struct rte_memzone *mz;
- struct vmxnet3_hw *hw =
- VMXNET3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct vmxnet3_hw *hw = dev->data->dev_private;
size_t size;
PMD_INIT_FUNC_TRACE();
/* Allocate memory structure for UPT1_RSSConf and configure */
mz = gpa_zone_reserve(dev, sizeof(struct VMXNET3_RSSConf), "rss_conf",
- rte_socket_id(), CACHE_LINE_SIZE);
+ rte_socket_id(), RTE_CACHE_LINE_SIZE);
if (mz == NULL) {
PMD_INIT_LOG(ERR,
"ERROR: Creating rss_conf structure zone");
vmxnet3_setup_driver_shared(struct rte_eth_dev *dev)
{
struct rte_eth_conf port_conf = dev->data->dev_conf;
- struct vmxnet3_hw *hw = VMXNET3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct vmxnet3_hw *hw = dev->data->dev_private;
Vmxnet3_DriverShared *shared = hw->shared;
Vmxnet3_DSDevRead *devRead = &shared->devRead;
uint32_t *mac_ptr;
for (i = 0; i < hw->num_tx_queues; i++) {
Vmxnet3_TxQueueDesc *tqd = &hw->tqd_start[i];
- vmxnet3_tx_queue_t *txq = dev->data->tx_queues[i];
+ vmxnet3_tx_queue_t *txq = dev->data->tx_queues[i];
tqd->ctrl.txNumDeferred = 0;
tqd->ctrl.txThreshold = 1;
tqd->conf.txRingBasePA = txq->cmd_ring.basePA;
tqd->conf.compRingBasePA = txq->comp_ring.basePA;
+ tqd->conf.dataRingBasePA = txq->data_ring.basePA;
tqd->conf.txRingSize = txq->cmd_ring.size;
tqd->conf.compRingSize = txq->comp_ring.size;
+ tqd->conf.dataRingSize = txq->data_ring.size;
tqd->conf.intrIdx = txq->comp_ring.intr_idx;
tqd->status.stopped = TRUE;
tqd->status.error = 0;
for (i = 0; i < hw->num_rx_queues; i++) {
Vmxnet3_RxQueueDesc *rqd = &hw->rqd_start[i];
- vmxnet3_rx_queue_t *rxq = dev->data->rx_queues[i];
+ vmxnet3_rx_queue_t *rxq = dev->data->rx_queues[i];
rqd->conf.rxRingBasePA[0] = rxq->cmd_ring[0].basePA;
rqd->conf.rxRingBasePA[1] = rxq->cmd_ring[1].basePA;
vmxnet3_dev_start(struct rte_eth_dev *dev)
{
int status, ret;
- struct vmxnet3_hw *hw = VMXNET3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct vmxnet3_hw *hw = dev->data->dev_private;
PMD_INIT_FUNC_TRACE();
}
/* Setting proper Rx Mode and issue Rx Mode Update command */
- vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_UCAST | VMXNET3_RXM_ALL_MULTI, 1);
+ vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_UCAST | VMXNET3_RXM_BCAST, 1);
/*
* Don't need to handle events for now
vmxnet3_dev_stop(struct rte_eth_dev *dev)
{
struct rte_eth_link link;
- struct vmxnet3_hw *hw =
- VMXNET3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct vmxnet3_hw *hw = dev->data->dev_private;
PMD_INIT_FUNC_TRACE();
static void
vmxnet3_dev_close(struct rte_eth_dev *dev)
{
- struct vmxnet3_hw *hw =
- VMXNET3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct vmxnet3_hw *hw = dev->data->dev_private;
PMD_INIT_FUNC_TRACE();
vmxnet3_dev_stop(dev);
hw->adapter_stopped = TRUE;
-
}
static void
vmxnet3_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
{
unsigned int i;
- struct vmxnet3_hw *hw = VMXNET3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct vmxnet3_hw *hw = dev->data->dev_private;
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS);
dev_info->min_rx_bufsize = 1518 + RTE_PKTMBUF_HEADROOM;
dev_info->max_rx_pktlen = 16384; /* includes CRC, cf MAXFRS register */
dev_info->max_mac_addrs = VMXNET3_MAX_MAC_ADDRS;
+
+ dev_info->default_txconf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS |
+ ETH_TXQ_FLAGS_NOOFFLOADS;
+ dev_info->flow_type_rss_offloads = VMXNET3_RSS_OFFLOAD_ALL;
}
/* return 0 means link status changed, -1 means not changed */
static int
vmxnet3_dev_link_update(struct rte_eth_dev *dev, __attribute__((unused)) int wait_to_complete)
{
- struct vmxnet3_hw *hw = VMXNET3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct vmxnet3_hw *hw = dev->data->dev_private;
struct rte_eth_link link;
uint32_t ret;
static void
vmxnet3_dev_promiscuous_enable(struct rte_eth_dev *dev)
{
- struct vmxnet3_hw *hw = VMXNET3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct vmxnet3_hw *hw = dev->data->dev_private;
vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_PROMISC, 1);
}
static void
vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev)
{
- struct vmxnet3_hw *hw = VMXNET3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct vmxnet3_hw *hw = dev->data->dev_private;
vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_PROMISC, 0);
}
static void
vmxnet3_dev_allmulticast_enable(struct rte_eth_dev *dev)
{
- struct vmxnet3_hw *hw = VMXNET3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct vmxnet3_hw *hw = dev->data->dev_private;
vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_ALL_MULTI, 1);
}
static void
vmxnet3_dev_allmulticast_disable(struct rte_eth_dev *dev)
{
- struct vmxnet3_hw *hw = VMXNET3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct vmxnet3_hw *hw = dev->data->dev_private;
vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_ALL_MULTI, 0);
}