DPDK patches and discussions
 help / color / mirror / Atom feed
From: John Daley <johndale@cisco.com>
To: dev@dpdk.org
Cc: John Daley <johndale@cisco.com>
Subject: [dpdk-dev] [PATCH 3/3] enic: small cleanup- remove a packet_error conditional
Date: Thu, 17 Mar 2016 15:57:07 -0700	[thread overview]
Message-ID: <1458255427-12371-4-git-send-email-johndale@cisco.com> (raw)
In-Reply-To: <1458255427-12371-1-git-send-email-johndale@cisco.com>

Signed-off-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_rx.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/enic/enic_rx.c b/drivers/net/enic/enic_rx.c
index 817a891..232987a 100644
--- a/drivers/net/enic/enic_rx.c
+++ b/drivers/net/enic/enic_rx.c
@@ -266,7 +266,6 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 	nb_hold = rq->rx_nb_hold;	/* mbufs held by software */
 
 	while (nb_rx < nb_pkts) {
-		uint16_t rx_pkt_len;
 		volatile struct rq_enet_desc *rqd_ptr;
 		dma_addr_t dma_addr;
 		struct cq_desc cqd;
@@ -295,10 +294,6 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 
 		/* A packet error means descriptor and data are untrusted */
 		packet_error = enic_cq_rx_to_pkt_err_flags(&cqd, &ol_err_flags);
-		if (!packet_error)
-			rx_pkt_len = enic_cq_rx_desc_n_bytes(&cqd);
-		else
-			rx_pkt_len = 0;
 
 		/* Get the mbuf to return and replace with one just allocated */
 		rxmb = rq->mbuf_ring[rx_id];
@@ -327,16 +322,17 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		rxmb->data_off = RTE_PKTMBUF_HEADROOM;
 		rxmb->nb_segs = 1;
 		rxmb->next = NULL;
-		rxmb->pkt_len = rx_pkt_len;
-		rxmb->data_len = rx_pkt_len;
 		rxmb->port = enic->port_id;
 		if (!packet_error) {
+			rxmb->pkt_len = enic_cq_rx_desc_n_bytes(&cqd);
 			rxmb->packet_type = enic_cq_rx_flags_to_pkt_type(&cqd);
 			enic_cq_rx_to_pkt_flags(&cqd, rxmb);
 		} else {
+			rxmb->pkt_len = 0;
 			rxmb->packet_type = 0;
 			rxmb->ol_flags = 0;
 		}
+		rxmb->data_len = rxmb->pkt_len;
 
 		/* prefetch mbuf data for caller */
 		rte_packet_prefetch(RTE_PTR_ADD(rxmb->buf_addr,
-- 
2.7.0

  parent reply	other threads:[~2016-03-17 22:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17 22:57 [dpdk-dev] [PATCH 0/3] enic PMD receive path fixes John Daley
2016-03-17 22:57 ` [dpdk-dev] [PATCH 1/3] enic: mbuf->ol_flags could be set incorrectly John Daley
2016-03-17 22:57 ` [dpdk-dev] [PATCH 2/3] enic: handle error packets properly John Daley
2016-03-17 22:57 ` John Daley [this message]
2016-03-22 16:55 ` [dpdk-dev] [PATCH 0/3] enic PMD receive path fixes Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1458255427-12371-4-git-send-email-johndale@cisco.com \
    --to=johndale@cisco.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).