blob: e8f74db5bf63e62a9c5f39cdef25c10c2ad76a54 [file] [log] [blame]
John Lo23650e62016-03-29 16:14:35 -04001commit 3253bbc79c8a1eddf791d9ec11bcea4a004d258e
2Author: John Daley <johndale@cisco.com>
3Date: Thu Mar 17 15:57:05 2016 -0700
4
5 enic: fix mbuf flags on Rx
6
7 In the receive path, the function to set mbuf ol_flags used the
8 mbuf packet_type before it was set.
9
10 Fixes: 947d860c821f ("enic: improve Rx performance")
11
12 Signed-off-by: John Daley <johndale@cisco.com>
13
14diff --git a/drivers/net/enic/enic_rx.c b/drivers/net/enic/enic_rx.c
15index 945a60f..59ebaa4 100644
16--- a/drivers/net/enic/enic_rx.c
17+++ b/drivers/net/enic/enic_rx.c
18@@ -210,7 +210,7 @@ enic_cq_rx_to_pkt_flags(struct cq_desc *cqd, struct rte_mbuf *mbuf)
19 ciflags = enic_cq_rx_desc_ciflags(cqrd);
20 bwflags = enic_cq_rx_desc_bwflags(cqrd);
21
22- ASSERT(mbuf->ol_flags == 0);
23+ mbuf->ol_flags = 0;
24
25 /* flags are meaningless if !EOP */
26 if (unlikely(!enic_cq_rx_desc_eop(ciflags)))
27@@ -340,10 +340,10 @@ enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
28 rxmb->pkt_len = rx_pkt_len;
29 rxmb->data_len = rx_pkt_len;
30 rxmb->port = enic->port_id;
31+ rxmb->packet_type = enic_cq_rx_flags_to_pkt_type(&cqd);
32 rxmb->ol_flags = ol_err_flags;
33 if (!ol_err_flags)
34 enic_cq_rx_to_pkt_flags(&cqd, rxmb);
35- rxmb->packet_type = enic_cq_rx_flags_to_pkt_type(&cqd);
36
37 /* prefetch mbuf data for caller */
38 rte_packet_prefetch(RTE_PTR_ADD(rxmb->buf_addr,