DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/enic: fix error in init of RQ when not using Rx scatter
@ 2016-10-12 20:11 John Daley
  2016-10-12 20:11 ` [dpdk-dev] [PATCH 2/2] net/enic: revert "fix calculation of truncated packets" John Daley
  2016-10-19  9:43 ` [dpdk-dev] [PATCH 1/2] net/enic: fix error in init of RQ when not using Rx scatter Bruce Richardson
  0 siblings, 2 replies; 3+ messages in thread
From: John Daley @ 2016-10-12 20:11 UTC (permalink / raw)
  To: bruce.richardson; +Cc: dev, Nelson Escobar

From: Nelson Escobar <neescoba@cisco.com>

The Rx scatter patch was accidentally setting the index of the
secondary receive queue in the primary receive queue's initialization
when the secondary receive queue wasn't needed and was disabled.  This
caused some misleading hardware counters in some situations.

Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/base/vnic_rq.c | 6 ++++--
 drivers/net/enic/base/vnic_rq.h | 1 +
 drivers/net/enic/enic_main.c    | 2 ++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/enic/base/vnic_rq.c b/drivers/net/enic/base/vnic_rq.c
index 0e700a1..10a40c1 100644
--- a/drivers/net/enic/base/vnic_rq.c
+++ b/drivers/net/enic/base/vnic_rq.c
@@ -87,9 +87,11 @@ void vnic_rq_init_start(struct vnic_rq *rq, unsigned int cq_index,
 	iowrite32(0, &rq->ctrl->error_status);
 	iowrite32(fetch_index, &rq->ctrl->fetch_index);
 	iowrite32(posted_index, &rq->ctrl->posted_index);
-	if (rq->is_sop)
-		iowrite32(((rq->is_sop << 10) | rq->data_queue_idx),
+	if (rq->data_queue_enable)
+		iowrite32(((1 << 10) | rq->data_queue_idx),
 			  &rq->ctrl->data_ring);
+	else
+		iowrite32(0, &rq->ctrl->data_ring);
 }
 
 void vnic_rq_init(struct vnic_rq *rq, unsigned int cq_index,
diff --git a/drivers/net/enic/base/vnic_rq.h b/drivers/net/enic/base/vnic_rq.h
index 7d96b0f..f3fd39f 100644
--- a/drivers/net/enic/base/vnic_rq.h
+++ b/drivers/net/enic/base/vnic_rq.h
@@ -91,6 +91,7 @@ struct vnic_rq {
 	uint16_t rxst_idx;
 	uint32_t tot_pkts;
 	uint16_t data_queue_idx;
+	uint8_t data_queue_enable;
 	uint8_t is_sop;
 	uint8_t in_use;
 	struct rte_mbuf *pkt_first_seg;
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 622b317..836dcfe 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -640,10 +640,12 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
 
 	if (mbufs_per_pkt > 1) {
 		dev_info(enic, "Rq %u Scatter rx mode in use\n", queue_idx);
+		rq_sop->data_queue_enable = 1;
 		rq_data->in_use = 1;
 	} else {
 		dev_info(enic, "Rq %u Scatter rx mode not being used\n",
 			 queue_idx);
+		rq_sop->data_queue_enable = 0;
 		rq_data->in_use = 0;
 	}
 
-- 
2.10.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH 2/2] net/enic: revert "fix calculation of truncated packets"
  2016-10-12 20:11 [dpdk-dev] [PATCH 1/2] net/enic: fix error in init of RQ when not using Rx scatter John Daley
@ 2016-10-12 20:11 ` John Daley
  2016-10-19  9:43 ` [dpdk-dev] [PATCH 1/2] net/enic: fix error in init of RQ when not using Rx scatter Bruce Richardson
  1 sibling, 0 replies; 3+ messages in thread
From: John Daley @ 2016-10-12 20:11 UTC (permalink / raw)
  To: bruce.richardson; +Cc: dev, Nelson Escobar

From: Nelson Escobar <neescoba@cisco.com>

The reason this commit was needed was because of a misconfiguration of
the receive queue when not using Rx scatter.  This patch is
unnecessary if the receive queue is configured correctly.

Fixes: d142e1ac1089 ("net/enic: fix calculation of truncated packets")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 836dcfe..b65a079 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -174,8 +174,7 @@ 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 -
-		stats->rx.rx_no_bufs;
+	rx_truncated = rx_packet_errors - stats->rx.rx_errors;
 
 	r_stats->ipackets = stats->rx.rx_frames_ok - rx_truncated;
 	r_stats->opackets = stats->tx.tx_frames_ok;
-- 
2.10.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/enic: fix error in init of RQ when not using Rx scatter
  2016-10-12 20:11 [dpdk-dev] [PATCH 1/2] net/enic: fix error in init of RQ when not using Rx scatter John Daley
  2016-10-12 20:11 ` [dpdk-dev] [PATCH 2/2] net/enic: revert "fix calculation of truncated packets" John Daley
@ 2016-10-19  9:43 ` Bruce Richardson
  1 sibling, 0 replies; 3+ messages in thread
From: Bruce Richardson @ 2016-10-19  9:43 UTC (permalink / raw)
  To: John Daley; +Cc: dev, Nelson Escobar

On Wed, Oct 12, 2016 at 01:11:28PM -0700, John Daley wrote:
> From: Nelson Escobar <neescoba@cisco.com>
> 
> The Rx scatter patch was accidentally setting the index of the
> secondary receive queue in the primary receive queue's initialization
> when the secondary receive queue wasn't needed and was disabled.  This
> caused some misleading hardware counters in some situations.
> 
> Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx")
> 
> Signed-off-by: Nelson Escobar <neescoba@cisco.com>
> Reviewed-by: John Daley <johndale@cisco.com>

Patchset applied to dpdk-next-net/rel_16_11

/Bruce

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-19  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-12 20:11 [dpdk-dev] [PATCH 1/2] net/enic: fix error in init of RQ when not using Rx scatter John Daley
2016-10-12 20:11 ` [dpdk-dev] [PATCH 2/2] net/enic: revert "fix calculation of truncated packets" John Daley
2016-10-19  9:43 ` [dpdk-dev] [PATCH 1/2] net/enic: fix error in init of RQ when not using Rx scatter Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).