git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: fix some typos
[dpdk.git]
/
drivers
/
net
/
enic
/
enic_main.c
diff --git
a/drivers/net/enic/enic_main.c
b/drivers/net/enic/enic_main.c
index
85cd8d3
..
8af0ccd
100644
(file)
--- a/
drivers/net/enic/enic_main.c
+++ b/
drivers/net/enic/enic_main.c
@@
-40,6
+40,7
@@
#include <libgen.h>
#include <rte_pci.h>
#include <libgen.h>
#include <rte_pci.h>
+#include <rte_bus_pci.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
#include <rte_memzone.h>
#include <rte_malloc.h>
#include <rte_mbuf.h>
@@
-137,6
+138,7
@@
static void enic_clear_soft_stats(struct enic *enic)
struct enic_soft_stats *soft_stats = &enic->soft_stats;
rte_atomic64_clear(&soft_stats->rx_nombuf);
rte_atomic64_clear(&soft_stats->rx_packet_errors);
struct enic_soft_stats *soft_stats = &enic->soft_stats;
rte_atomic64_clear(&soft_stats->rx_nombuf);
rte_atomic64_clear(&soft_stats->rx_packet_errors);
+ rte_atomic64_clear(&soft_stats->tx_oversized);
}
static void enic_init_soft_stats(struct enic *enic)
}
static void enic_init_soft_stats(struct enic *enic)
@@
-144,6
+146,7
@@
static void enic_init_soft_stats(struct enic *enic)
struct enic_soft_stats *soft_stats = &enic->soft_stats;
rte_atomic64_init(&soft_stats->rx_nombuf);
rte_atomic64_init(&soft_stats->rx_packet_errors);
struct enic_soft_stats *soft_stats = &enic->soft_stats;
rte_atomic64_init(&soft_stats->rx_nombuf);
rte_atomic64_init(&soft_stats->rx_packet_errors);
+ rte_atomic64_init(&soft_stats->tx_oversized);
enic_clear_soft_stats(enic);
}
enic_clear_soft_stats(enic);
}
@@
-154,16
+157,17
@@
void enic_dev_stats_clear(struct enic *enic)
enic_clear_soft_stats(enic);
}
enic_clear_soft_stats(enic);
}
-
void
enic_dev_stats_get(struct enic *enic, struct rte_eth_stats *r_stats)
+
int
enic_dev_stats_get(struct enic *enic, struct rte_eth_stats *r_stats)
{
struct vnic_stats *stats;
struct enic_soft_stats *soft_stats = &enic->soft_stats;
int64_t rx_truncated;
uint64_t rx_packet_errors;
{
struct vnic_stats *stats;
struct enic_soft_stats *soft_stats = &enic->soft_stats;
int64_t rx_truncated;
uint64_t rx_packet_errors;
+ int ret = vnic_dev_stats_dump(enic->vdev, &stats);
- if (
vnic_dev_stats_dump(enic->vdev, &stats)
) {
+ if (
ret
) {
dev_err(enic, "Error in getting stats\n");
dev_err(enic, "Error in getting stats\n");
- return;
+ return
ret
;
}
/* The number of truncated packets can only be calculated by
}
/* The number of truncated packets can only be calculated by
@@
-183,42
+187,37
@@
void enic_dev_stats_get(struct enic *enic, struct rte_eth_stats *r_stats)
r_stats->obytes = stats->tx.tx_bytes_ok;
r_stats->ierrors = stats->rx.rx_errors + stats->rx.rx_drop;
r_stats->obytes = stats->tx.tx_bytes_ok;
r_stats->ierrors = stats->rx.rx_errors + stats->rx.rx_drop;
- r_stats->oerrors = stats->tx.tx_errors;
+ r_stats->oerrors = stats->tx.tx_errors
+ + rte_atomic64_read(&soft_stats->tx_oversized);
r_stats->imissed = stats->rx.rx_no_bufs + rx_truncated;
r_stats->rx_nombuf = rte_atomic64_read(&soft_stats->rx_nombuf);
r_stats->imissed = stats->rx.rx_no_bufs + rx_truncated;
r_stats->rx_nombuf = rte_atomic64_read(&soft_stats->rx_nombuf);
+ return 0;
}
}
-void enic_del_mac_address(struct enic *enic)
+void enic_del_mac_address(struct enic *enic
, int mac_index
)
{
{
- if (vnic_dev_del_addr(enic->vdev, enic->mac_addr))
+ struct rte_eth_dev *eth_dev = enic->rte_dev;
+ uint8_t *mac_addr = eth_dev->data->mac_addrs[mac_index].addr_bytes;
+
+ if (vnic_dev_del_addr(enic->vdev, mac_addr))
dev_err(enic, "del mac addr failed\n");
}
dev_err(enic, "del mac addr failed\n");
}
-
void
enic_set_mac_address(struct enic *enic, uint8_t *mac_addr)
+
int
enic_set_mac_address(struct enic *enic, uint8_t *mac_addr)
{
int err;
if (!is_eth_addr_valid(mac_addr)) {
dev_err(enic, "invalid mac address\n");
{
int err;
if (!is_eth_addr_valid(mac_addr)) {
dev_err(enic, "invalid mac address\n");
- return;
- }
-
- err = vnic_dev_del_addr(enic->vdev, enic->mac_addr);
- if (err) {
- dev_err(enic, "del mac addr failed\n");
- return;
+ return -EINVAL;
}
}
- ether_addr_copy((struct ether_addr *)mac_addr,
- (struct ether_addr *)enic->mac_addr);
-
err = vnic_dev_add_addr(enic->vdev, mac_addr);
err = vnic_dev_add_addr(enic->vdev, mac_addr);
- if (err)
{
+ if (err)
dev_err(enic, "add mac addr failed\n");
dev_err(enic, "add mac addr failed\n");
- return;
- }
+ return err;
}
static void
}
static void
@@
-228,7
+227,7
@@
enic_free_rq_buf(struct rte_mbuf **mbuf)
return;
rte_pktmbuf_free(*mbuf);
return;
rte_pktmbuf_free(*mbuf);
- mbuf = NULL;
+
*
mbuf = NULL;
}
void enic_init_vnic_resources(struct enic *enic)
}
void enic_init_vnic_resources(struct enic *enic)
@@
-240,14
+239,14
@@
void enic_init_vnic_resources(struct enic *enic)
struct vnic_rq *data_rq;
for (index = 0; index < enic->rq_count; index++) {
struct vnic_rq *data_rq;
for (index = 0; index < enic->rq_count; index++) {
- cq_idx = enic_cq_rq(enic, enic_
sop_rq
(index));
+ cq_idx = enic_cq_rq(enic, enic_
rte_rq_idx_to_sop_idx
(index));
- vnic_rq_init(&enic->rq[enic_
sop_rq
(index)],
+ vnic_rq_init(&enic->rq[enic_
rte_rq_idx_to_sop_idx
(index)],
cq_idx,
error_interrupt_enable,
error_interrupt_offset);
cq_idx,
error_interrupt_enable,
error_interrupt_offset);
- data_rq = &enic->rq[enic_
data_rq
(index)];
+ data_rq = &enic->rq[enic_
rte_rq_idx_to_data_idx
(index)];
if (data_rq->in_use)
vnic_rq_init(data_rq,
cq_idx,
if (data_rq->in_use)
vnic_rq_init(data_rq,
cq_idx,
@@
-284,7
+283,7
@@
void enic_init_vnic_resources(struct enic *enic)
0 /* cq_entry_enable */,
1 /* cq_message_enable */,
0 /* interrupt offset */,
0 /* cq_entry_enable */,
1 /* cq_message_enable */,
0 /* interrupt offset */,
- (u64)enic->wq[index].cqmsg_rz->
phys_addr
);
+ (u64)enic->wq[index].cqmsg_rz->
iova
);
}
vnic_intr_init(&enic->intr,
}
vnic_intr_init(&enic->intr,
@@
-317,7
+316,7
@@
enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq)
}
mb->data_off = RTE_PKTMBUF_HEADROOM;
}
mb->data_off = RTE_PKTMBUF_HEADROOM;
- dma_addr = (dma_addr_t)(mb->buf_
physaddr
+ dma_addr = (dma_addr_t)(mb->buf_
iova
+ RTE_PKTMBUF_HEADROOM);
rq_enet_desc_enc(rqd, dma_addr,
(rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
+ RTE_PKTMBUF_HEADROOM);
rq_enet_desc_enc(rqd, dma_addr,
(rq->is_sop ? RQ_ENET_TYPE_ONLY_SOP
@@
-363,7
+362,7
@@
enic_alloc_consistent(void *priv, size_t size,
}
vaddr = rz->addr;
}
vaddr = rz->addr;
- *dma_handle = (dma_addr_t)rz->
phys_addr
;
+ *dma_handle = (dma_addr_t)rz->
iova
;
mze = rte_malloc("enic memzone entry",
sizeof(struct enic_memzone_entry), 0);
mze = rte_malloc("enic memzone entry",
sizeof(struct enic_memzone_entry), 0);
@@
-372,6
+371,7
@@
enic_alloc_consistent(void *priv, size_t size,
pr_err("%s : Failed to allocate memory for memzone list\n",
__func__);
rte_memzone_free(rz);
pr_err("%s : Failed to allocate memory for memzone list\n",
__func__);
rte_memzone_free(rz);
+ return NULL;
}
mze->rz = rz;
}
mze->rz = rz;
@@
-395,7
+395,7
@@
enic_free_consistent(void *priv,
rte_spinlock_lock(&enic->memzone_list_lock);
LIST_FOREACH(mze, &enic->memzone_list, entries) {
if (mze->rz->addr == vaddr &&
rte_spinlock_lock(&enic->memzone_list_lock);
LIST_FOREACH(mze, &enic->memzone_list, entries) {
if (mze->rz->addr == vaddr &&
- mze->rz->
phys_addr
== dma_handle)
+ mze->rz->
iova
== dma_handle)
break;
}
if (mze == NULL) {
break;
}
if (mze == NULL) {
@@
-426,8
+426,7
@@
int enic_link_update(struct enic *enic)
}
static void
}
static void
-enic_intr_handler(__rte_unused struct rte_intr_handle *handle,
- void *arg)
+enic_intr_handler(void *arg)
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)arg;
struct enic *enic = pmd_priv(dev);
{
struct rte_eth_dev *dev = (struct rte_eth_dev *)arg;
struct enic *enic = pmd_priv(dev);
@@
-435,7
+434,7
@@
enic_intr_handler(__rte_unused struct rte_intr_handle *handle,
vnic_intr_return_all_credits(&enic->intr);
enic_link_update(enic);
vnic_intr_return_all_credits(&enic->intr);
enic_link_update(enic);
- _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
+ _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL
, NULL
);
enic_log_q_error(enic);
}
enic_log_q_error(enic);
}
@@
-461,17
+460,17
@@
int enic_enable(struct enic *enic)
for (index = 0; index < enic->rq_count; index++) {
err = enic_alloc_rx_queue_mbufs(enic,
for (index = 0; index < enic->rq_count; index++) {
err = enic_alloc_rx_queue_mbufs(enic,
- &enic->rq[enic_
sop_rq
(index)]);
+ &enic->rq[enic_
rte_rq_idx_to_sop_idx
(index)]);
if (err) {
dev_err(enic, "Failed to alloc sop RX queue mbufs\n");
return err;
}
err = enic_alloc_rx_queue_mbufs(enic,
if (err) {
dev_err(enic, "Failed to alloc sop RX queue mbufs\n");
return err;
}
err = enic_alloc_rx_queue_mbufs(enic,
- &enic->rq[enic_
data_rq
(index)]);
+ &enic->rq[enic_
rte_rq_idx_to_data_idx
(index)]);
if (err) {
/* release the allocated mbufs for the sop rq*/
enic_rxmbuf_queue_release(enic,
if (err) {
/* release the allocated mbufs for the sop rq*/
enic_rxmbuf_queue_release(enic,
- &enic->rq[enic_
sop_rq
(index)]);
+ &enic->rq[enic_
rte_rq_idx_to_sop_idx
(index)]);
dev_err(enic, "Failed to alloc data RX queue mbufs\n");
return err;
dev_err(enic, "Failed to alloc data RX queue mbufs\n");
return err;
@@
-540,7
+539,7
@@
void enic_free_rq(void *rxq)
if (rq_data->in_use)
vnic_rq_free(rq_data);
if (rq_data->in_use)
vnic_rq_free(rq_data);
- vnic_cq_free(&enic->cq[
rq_sop->index
]);
+ vnic_cq_free(&enic->cq[
enic_sop_rq_idx_to_cq_idx(rq_sop->index)
]);
rq_sop->in_use = 0;
rq_data->in_use = 0;
rq_sop->in_use = 0;
rq_data->in_use = 0;
@@
-568,8
+567,10
@@
int enic_stop_wq(struct enic *enic, uint16_t queue_idx)
void enic_start_rq(struct enic *enic, uint16_t queue_idx)
{
void enic_start_rq(struct enic *enic, uint16_t queue_idx)
{
- struct vnic_rq *rq_sop = &enic->rq[enic_sop_rq(queue_idx)];
- struct vnic_rq *rq_data = &enic->rq[rq_sop->data_queue_idx];
+ struct vnic_rq *rq_sop;
+ struct vnic_rq *rq_data;
+ rq_sop = &enic->rq[enic_rte_rq_idx_to_sop_idx(queue_idx)];
+ rq_data = &enic->rq[rq_sop->data_queue_idx];
struct rte_eth_dev *eth_dev = enic->rte_dev;
if (rq_data->in_use)
struct rte_eth_dev *eth_dev = enic->rte_dev;
if (rq_data->in_use)
@@
-583,8
+584,10
@@
int enic_stop_rq(struct enic *enic, uint16_t queue_idx)
{
int ret1 = 0, ret2 = 0;
struct rte_eth_dev *eth_dev = enic->rte_dev;
{
int ret1 = 0, ret2 = 0;
struct rte_eth_dev *eth_dev = enic->rte_dev;
- struct vnic_rq *rq_sop = &enic->rq[enic_sop_rq(queue_idx)];
- struct vnic_rq *rq_data = &enic->rq[rq_sop->data_queue_idx];
+ struct vnic_rq *rq_sop;
+ struct vnic_rq *rq_data;
+ rq_sop = &enic->rq[enic_rte_rq_idx_to_sop_idx(queue_idx)];
+ rq_data = &enic->rq[rq_sop->data_queue_idx];
ret2 = vnic_rq_disable(rq_sop);
rte_mb();
ret2 = vnic_rq_disable(rq_sop);
rte_mb();
@@
-602,11
+605,11
@@
int enic_stop_rq(struct enic *enic, uint16_t queue_idx)
int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
unsigned int socket_id, struct rte_mempool *mp,
int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
unsigned int socket_id, struct rte_mempool *mp,
- uint16_t nb_desc)
+ uint16_t nb_desc
, uint16_t free_thresh
)
{
int rc;
{
int rc;
- uint16_t sop_queue_idx = enic_
sop_rq
(queue_idx);
- uint16_t data_queue_idx = enic_
data_rq
(queue_idx);
+ uint16_t sop_queue_idx = enic_
rte_rq_idx_to_sop_idx
(queue_idx);
+ uint16_t data_queue_idx = enic_
rte_rq_idx_to_data_idx
(queue_idx);
struct vnic_rq *rq_sop = &enic->rq[sop_queue_idx];
struct vnic_rq *rq_data = &enic->rq[data_queue_idx];
unsigned int mbuf_size, mbufs_per_pkt;
struct vnic_rq *rq_sop = &enic->rq[sop_queue_idx];
struct vnic_rq *rq_data = &enic->rq[data_queue_idx];
unsigned int mbuf_size, mbufs_per_pkt;
@@
-623,6
+626,10
@@
int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
rq_data->socket_id = socket_id;
rq_data->mp = mp;
rq_sop->in_use = 1;
rq_data->socket_id = socket_id;
rq_data->mp = mp;
rq_sop->in_use = 1;
+ rq_sop->rx_free_thresh = free_thresh;
+ rq_data->rx_free_thresh = free_thresh;
+ dev_debug(enic, "Set queue_id:%u free thresh:%u\n", queue_idx,
+ free_thresh);
mbuf_size = (uint16_t)(rte_pktmbuf_data_room_size(mp) -
RTE_PKTMBUF_HEADROOM);
mbuf_size = (uint16_t)(rte_pktmbuf_data_room_size(mp) -
RTE_PKTMBUF_HEADROOM);
@@
-964,7
+971,7
@@
static int enic_set_rsscpu(struct enic *enic, u8 rss_hash_bits)
for (i = 0; i < (1 << rss_hash_bits); i++)
(*rss_cpu_buf_va).cpu[i / 4].b[i % 4] =
for (i = 0; i < (1 << rss_hash_bits); i++)
(*rss_cpu_buf_va).cpu[i / 4].b[i % 4] =
- enic_
sop_rq
(i % enic->rq_count);
+ enic_
rte_rq_idx_to_sop_idx
(i % enic->rq_count);
err = enic_set_rss_cpu(enic,
rss_cpu_buf_pa,
err = enic_set_rss_cpu(enic,
rss_cpu_buf_pa,
@@
-1113,11
+1120,12
@@
static int
enic_reinit_rq(struct enic *enic, unsigned int rq_idx)
{
struct vnic_rq *sop_rq, *data_rq;
enic_reinit_rq(struct enic *enic, unsigned int rq_idx)
{
struct vnic_rq *sop_rq, *data_rq;
- unsigned int cq_idx
= enic_cq_rq(enic, rq_idx)
;
+ unsigned int cq_idx;
int rc = 0;
int rc = 0;
- sop_rq = &enic->rq[enic_sop_rq(rq_idx)];
- data_rq = &enic->rq[enic_data_rq(rq_idx)];
+ sop_rq = &enic->rq[enic_rte_rq_idx_to_sop_idx(rq_idx)];
+ data_rq = &enic->rq[enic_rte_rq_idx_to_data_idx(rq_idx)];
+ cq_idx = rq_idx;
vnic_cq_clean(&enic->cq[cq_idx]);
vnic_cq_init(&enic->cq[cq_idx],
vnic_cq_clean(&enic->cq[cq_idx]);
vnic_cq_init(&enic->cq[cq_idx],
@@
-1133,12
+1141,14
@@
enic_reinit_rq(struct enic *enic, unsigned int rq_idx)
0 /* cq_message_addr */);
0 /* cq_message_addr */);
- vnic_rq_init_start(sop_rq, enic_cq_rq(enic, enic_sop_rq(rq_idx)),
- 0, sop_rq->ring.desc_count - 1, 1, 0);
+ vnic_rq_init_start(sop_rq, enic_cq_rq(enic,
+ enic_rte_rq_idx_to_sop_idx(rq_idx)), 0,
+ sop_rq->ring.desc_count - 1, 1, 0);
if (data_rq->in_use) {
vnic_rq_init_start(data_rq,
if (data_rq->in_use) {
vnic_rq_init_start(data_rq,
- enic_cq_rq(enic, enic_data_rq(rq_idx)),
- 0, data_rq->ring.desc_count - 1, 1, 0);
+ enic_cq_rq(enic,
+ enic_rte_rq_idx_to_data_idx(rq_idx)), 0,
+ data_rq->ring.desc_count - 1, 1, 0);
}
rc = enic_alloc_rx_queue_mbufs(enic, sop_rq);
}
rc = enic_alloc_rx_queue_mbufs(enic, sop_rq);
@@
-1175,6
+1185,9
@@
int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
old_mtu = eth_dev->data->mtu;
config_mtu = enic->config.mtu;
old_mtu = eth_dev->data->mtu;
config_mtu = enic->config.mtu;
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return -E_RTE_SECONDARY;
+
if (new_mtu > enic->max_mtu) {
dev_err(enic,
"MTU not updated: requested (%u) greater than max (%u)\n",
if (new_mtu > enic->max_mtu) {
dev_err(enic,
"MTU not updated: requested (%u) greater than max (%u)\n",
@@
-1211,7
+1224,8
@@
int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
for (rq_idx = 0; rq_idx < enic->rq_count * 2; rq_idx++) {
rq = &enic->rq[rq_idx];
if (rq->is_sop && rq->in_use) {
for (rq_idx = 0; rq_idx < enic->rq_count * 2; rq_idx++) {
rq = &enic->rq[rq_idx];
if (rq->is_sop && rq->in_use) {
- rc = enic_stop_rq(enic, enic_rq_sop(rq_idx));
+ rc = enic_stop_rq(enic,
+ enic_sop_rq_idx_to_rte_idx(rq_idx));
if (rc) {
dev_err(enic, "Failed to stop Rq %u\n", rq_idx);
goto set_mtu_done;
if (rc) {
dev_err(enic, "Failed to stop Rq %u\n", rq_idx);
goto set_mtu_done;
@@
-1219,7
+1233,7
@@
int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
}
}
}
}
- /* replace Rx func
it
on with a no-op to avoid getting stale pkts */
+ /* replace Rx func
ti
on with a no-op to avoid getting stale pkts */
eth_dev->rx_pkt_burst = enic_dummy_recv_pkts;
rte_mb();
eth_dev->rx_pkt_burst = enic_dummy_recv_pkts;
rte_mb();
@@
-1233,11
+1247,11
@@
int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
/* free and reallocate RQs with the new MTU */
for (rq_idx = 0; rq_idx < enic->rq_count; rq_idx++) {
/* free and reallocate RQs with the new MTU */
for (rq_idx = 0; rq_idx < enic->rq_count; rq_idx++) {
- rq = &enic->rq[enic_
sop_rq
(rq_idx)];
+ rq = &enic->rq[enic_
rte_rq_idx_to_sop_idx
(rq_idx)];
enic_free_rq(rq);
rc = enic_alloc_rq(enic, rq_idx, rq->socket_id, rq->mp,
enic_free_rq(rq);
rc = enic_alloc_rq(enic, rq_idx, rq->socket_id, rq->mp,
- rq->tot_nb_desc);
+ rq->tot_nb_desc
, rq->rx_free_thresh
);
if (rc) {
dev_err(enic,
"Fatal MTU alloc error- No traffic will pass\n");
if (rc) {
dev_err(enic,
"Fatal MTU alloc error- No traffic will pass\n");
@@
-1259,7
+1273,7
@@
int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
/* restart Rx traffic */
for (rq_idx = 0; rq_idx < enic->rq_count; rq_idx++) {
/* restart Rx traffic */
for (rq_idx = 0; rq_idx < enic->rq_count; rq_idx++) {
- rq = &enic->rq[enic_
sop_rq
(rq_idx)];
+ rq = &enic->rq[enic_
rte_rq_idx_to_sop_idx
(rq_idx)];
if (rq->is_sop && rq->in_use)
enic_start_rq(enic, rq_idx);
}
if (rq->is_sop && rq->in_use)
enic_start_rq(enic, rq_idx);
}
@@
-1297,16
+1311,20
@@
static int enic_dev_init(struct enic *enic)
/* Get the supported filters */
enic_fdir_info(enic);
/* Get the supported filters */
enic_fdir_info(enic);
- eth_dev->data->mac_addrs = rte_zmalloc("enic_mac_addr", ETH_ALEN, 0);
+ eth_dev->data->mac_addrs = rte_zmalloc("enic_mac_addr", ETH_ALEN
+ * ENIC_MAX_MAC_ADDR, 0);
if (!eth_dev->data->mac_addrs) {
dev_err(enic, "mac addr storage alloc failed, aborting.\n");
return -1;
}
ether_addr_copy((struct ether_addr *) enic->mac_addr,
if (!eth_dev->data->mac_addrs) {
dev_err(enic, "mac addr storage alloc failed, aborting.\n");
return -1;
}
ether_addr_copy((struct ether_addr *) enic->mac_addr,
-
ð_dev->data->mac_addrs[0]
);
+
eth_dev->data->mac_addrs
);
vnic_dev_set_reset_flag(enic->vdev, 0);
vnic_dev_set_reset_flag(enic->vdev, 0);
+ LIST_INIT(&enic->flows);
+ rte_spinlock_init(&enic->flows_lock);
+
/* set up link status checking */
vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */
/* set up link status checking */
vnic_dev_notify_set(enic->vdev, -1); /* No Intr for notify */
@@
-1321,6
+1339,10
@@
int enic_probe(struct enic *enic)
dev_debug(enic, " Initializing ENIC PMD\n");
dev_debug(enic, " Initializing ENIC PMD\n");
+ /* if this is a secondary process the hardware is already initialized */
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return 0;
+
enic->bar0.vaddr = (void *)pdev->mem_resource[0].addr;
enic->bar0.len = pdev->mem_resource[0].len;
enic->bar0.vaddr = (void *)pdev->mem_resource[0].addr;
enic->bar0.len = pdev->mem_resource[0].len;