aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/enic')
-rw-r--r--drivers/net/enic/enic.h1
-rw-r--r--drivers/net/enic/enic_clsf.c1
-rw-r--r--drivers/net/enic/enic_ethdev.c20
-rw-r--r--drivers/net/enic/enic_main.c31
-rw-r--r--drivers/net/enic/enic_rxtx.c10
5 files changed, 46 insertions, 17 deletions
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index a5e2e389..4c16ef17 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -51,7 +51,6 @@
#define DRV_NAME "enic_pmd"
#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Poll-mode Driver"
-#define DRV_VERSION "1.0.0.6"
#define DRV_COPYRIGHT "Copyright 2008-2015 Cisco Systems, Inc"
#define ENIC_WQ_MAX 8
diff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c
index 3365176a..e6f57bea 100644
--- a/drivers/net/enic/enic_clsf.c
+++ b/drivers/net/enic/enic_clsf.c
@@ -218,6 +218,7 @@ int enic_fdir_add_fltr(struct enic *enic, struct rte_eth_fdir_filter *params)
pos = rte_hash_add_key(enic->fdir.hash, params);
if (pos < 0) {
+ enic->fdir.stats.f_add++;
dev_err(enic, "Add hash key failed\n");
return pos;
}
diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
index 3c87b49e..59082d2a 100644
--- a/drivers/net/enic/enic_ethdev.c
+++ b/drivers/net/enic/enic_ethdev.c
@@ -142,9 +142,21 @@ static int enicpmd_dev_setup_intr(struct enic *enic)
if (!enic->cq[index].ctrl)
break;
}
-
if (enic->cq_count != index)
return 0;
+ for (index = 0; index < enic->wq_count; index++) {
+ if (!enic->wq[index].ctrl)
+ break;
+ }
+ if (enic->wq_count != index)
+ return 0;
+ /* check start of packet (SOP) RQs only in case scatter is disabled. */
+ for (index = 0; index < enic->rq_count; index++) {
+ if (!enic->rq[enic_sop_rq(index)].ctrl)
+ break;
+ }
+ if (enic->rq_count != index)
+ return 0;
ret = enic_alloc_intr_resources(enic);
if (ret) {
@@ -196,7 +208,6 @@ static int enicpmd_dev_tx_queue_start(struct rte_eth_dev *eth_dev,
ENICPMD_FUNC_TRACE();
enic_start_wq(enic, queue_idx);
- eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
return 0;
}
@@ -212,8 +223,6 @@ static int enicpmd_dev_tx_queue_stop(struct rte_eth_dev *eth_dev,
ret = enic_stop_wq(enic, queue_idx);
if (ret)
dev_err(enic, "error in stopping wq %d\n", queue_idx);
- else
- eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
return ret;
}
@@ -226,7 +235,6 @@ static int enicpmd_dev_rx_queue_start(struct rte_eth_dev *eth_dev,
ENICPMD_FUNC_TRACE();
enic_start_rq(enic, queue_idx);
- eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
return 0;
}
@@ -242,8 +250,6 @@ static int enicpmd_dev_rx_queue_stop(struct rte_eth_dev *eth_dev,
ret = enic_stop_rq(enic, queue_idx);
if (ret)
dev_err(enic, "error in stopping rq %d\n", queue_idx);
- else
- eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
return ret;
}
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index d8669cc0..542f0952 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -106,7 +106,7 @@ static void enic_free_wq_buf(struct vnic_wq_buf *buf)
{
struct rte_mbuf *mbuf = (struct rte_mbuf *)buf->mb;
- rte_mempool_put(mbuf->pool, mbuf);
+ rte_pktmbuf_free_seg(mbuf);
buf->mb = NULL;
}
@@ -123,6 +123,8 @@ static void enic_log_q_error(struct enic *enic)
}
for (i = 0; i < enic_vnic_rq_count(enic); i++) {
+ if (!enic->rq[i].in_use)
+ continue;
error_status = vnic_rq_error_status(&enic->rq[i]);
if (error_status)
dev_err(enic, "RQ[%d] error_status %d\n", i,
@@ -172,7 +174,8 @@ void enic_dev_stats_get(struct enic *enic, struct rte_eth_stats *r_stats)
* which can make ibytes be slightly higher than it should be.
*/
rx_packet_errors = rte_atomic64_read(&soft_stats->rx_packet_errors);
- rx_truncated = rx_packet_errors - stats->rx.rx_errors;
+ rx_truncated = rx_packet_errors - stats->rx.rx_errors -
+ stats->rx.rx_no_bufs;
r_stats->ipackets = stats->rx.rx_frames_ok - rx_truncated;
r_stats->opackets = stats->tx.tx_frames_ok;
@@ -518,30 +521,41 @@ void enic_free_rq(void *rxq)
void enic_start_wq(struct enic *enic, uint16_t queue_idx)
{
+ struct rte_eth_dev *eth_dev = enic->rte_dev;
vnic_wq_enable(&enic->wq[queue_idx]);
+ eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
}
int enic_stop_wq(struct enic *enic, uint16_t queue_idx)
{
- return vnic_wq_disable(&enic->wq[queue_idx]);
+ struct rte_eth_dev *eth_dev = enic->rte_dev;
+ int ret;
+
+ ret = vnic_wq_disable(&enic->wq[queue_idx]);
+ if (ret)
+ return ret;
+
+ eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
+ return 0;
}
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 rte_eth_dev *eth_dev = enic->rte_dev;
if (rq_data->in_use)
vnic_rq_enable(rq_data);
rte_mb();
vnic_rq_enable(rq_sop);
-
+ eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
}
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;
struct vnic_rq *rq_sop = &enic->rq[enic_sop_rq(queue_idx)];
struct vnic_rq *rq_data = &enic->rq[rq_sop->data_queue_idx];
@@ -552,8 +566,11 @@ int enic_stop_rq(struct enic *enic, uint16_t queue_idx)
if (ret2)
return ret2;
- else
+ else if (ret1)
return ret1;
+
+ eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
+ return 0;
}
int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
@@ -1128,7 +1145,7 @@ int enic_probe(struct enic *enic)
struct rte_pci_device *pdev = enic->pdev;
int err = -1;
- dev_debug(enic, " Initializing ENIC PMD version %s\n", DRV_VERSION);
+ dev_debug(enic, " Initializing ENIC PMD\n");
enic->bar0.vaddr = (void *)pdev->mem_resource[0].addr;
enic->bar0.len = pdev->mem_resource[0].len;
diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index 2f4a08c5..845a8e66 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -398,7 +398,14 @@ static inline void enic_free_wq_bufs(struct vnic_wq *wq, u16 completed_index)
pool = ((struct rte_mbuf *)buf->mb)->pool;
for (i = 0; i < nb_to_free; i++) {
buf = &wq->bufs[tail_idx];
- m = (struct rte_mbuf *)(buf->mb);
+ m = __rte_pktmbuf_prefree_seg((struct rte_mbuf *)(buf->mb));
+ buf->mb = NULL;
+
+ if (unlikely(m == NULL)) {
+ tail_idx = enic_ring_incr(desc_count, tail_idx);
+ continue;
+ }
+
if (likely(m->pool == pool)) {
RTE_ASSERT(nb_free < ENIC_MAX_WQ_DESCS);
free[nb_free++] = m;
@@ -409,7 +416,6 @@ static inline void enic_free_wq_bufs(struct vnic_wq *wq, u16 completed_index)
pool = m->pool;
}
tail_idx = enic_ring_incr(desc_count, tail_idx);
- buf->mb = NULL;
}
rte_mempool_put_bulk(pool, (void **)free, nb_free);