blob: 3f29f6ea9991df294f6f20140f8ff12544b179d1 [file] [log] [blame]
Todd Foggoaa292c8c2016-04-06 09:57:01 -04001From 2fa6a45ff9f9fb3108b09403e32393416bd0a732 Mon Sep 17 00:00:00 2001
2From: John Daley <johndale@cisco.com>
3Date: Thu, 17 Mar 2016 15:57:07 -0700
4Subject: [PATCH 18/22] enic: remove packet error conditional
John Lo23650e62016-03-29 16:14:35 -04005
John Lo23650e62016-03-29 16:14:35 -04006 small cleanup to remove conditional.
Todd Foggoaa292c8c2016-04-06 09:57:01 -04007
John Lo23650e62016-03-29 16:14:35 -04008 Signed-off-by: John Daley <johndale@cisco.com>
Todd Foggoaa292c8c2016-04-06 09:57:01 -04009---
10 drivers/net/enic/enic_rx.c | 10 +++-------
11 1 file changed, 3 insertions(+), 7 deletions(-)
John Lo23650e62016-03-29 16:14:35 -040012
13diff --git a/drivers/net/enic/enic_rx.c b/drivers/net/enic/enic_rx.c
14index 817a891..232987a 100644
15--- a/drivers/net/enic/enic_rx.c
16+++ b/drivers/net/enic/enic_rx.c
17@@ -266,7 +266,6 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
18 nb_hold = rq->rx_nb_hold; /* mbufs held by software */
19
20 while (nb_rx < nb_pkts) {
21- uint16_t rx_pkt_len;
22 volatile struct rq_enet_desc *rqd_ptr;
23 dma_addr_t dma_addr;
24 struct cq_desc cqd;
25@@ -295,10 +294,6 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
26
27 /* A packet error means descriptor and data are untrusted */
28 packet_error = enic_cq_rx_to_pkt_err_flags(&cqd, &ol_err_flags);
29- if (!packet_error)
30- rx_pkt_len = enic_cq_rx_desc_n_bytes(&cqd);
31- else
32- rx_pkt_len = 0;
33
34 /* Get the mbuf to return and replace with one just allocated */
35 rxmb = rq->mbuf_ring[rx_id];
36@@ -327,16 +322,17 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
37 rxmb->data_off = RTE_PKTMBUF_HEADROOM;
38 rxmb->nb_segs = 1;
39 rxmb->next = NULL;
40- rxmb->pkt_len = rx_pkt_len;
41- rxmb->data_len = rx_pkt_len;
42 rxmb->port = enic->port_id;
43 if (!packet_error) {
44+ rxmb->pkt_len = enic_cq_rx_desc_n_bytes(&cqd);
45 rxmb->packet_type = enic_cq_rx_flags_to_pkt_type(&cqd);
46 enic_cq_rx_to_pkt_flags(&cqd, rxmb);
47 } else {
48+ rxmb->pkt_len = 0;
49 rxmb->packet_type = 0;
50 rxmb->ol_flags = 0;
51 }
52+ rxmb->data_len = rxmb->pkt_len;
53
54 /* prefetch mbuf data for caller */
55 rte_packet_prefetch(RTE_PTR_ADD(rxmb->buf_addr,
Todd Foggoaa292c8c2016-04-06 09:57:01 -040056--
571.9.1
58