Todd Foggoa | a292c8c | 2016-04-06 09:57:01 -0400 | [diff] [blame] | 1 | From 2fa6a45ff9f9fb3108b09403e32393416bd0a732 Mon Sep 17 00:00:00 2001 |
| 2 | From: John Daley <johndale@cisco.com> |
| 3 | Date: Thu, 17 Mar 2016 15:57:07 -0700 |
| 4 | Subject: [PATCH 18/22] enic: remove packet error conditional |
John Lo | 23650e6 | 2016-03-29 16:14:35 -0400 | [diff] [blame] | 5 | |
John Lo | 23650e6 | 2016-03-29 16:14:35 -0400 | [diff] [blame] | 6 | small cleanup to remove conditional. |
Todd Foggoa | a292c8c | 2016-04-06 09:57:01 -0400 | [diff] [blame] | 7 | |
John Lo | 23650e6 | 2016-03-29 16:14:35 -0400 | [diff] [blame] | 8 | Signed-off-by: John Daley <johndale@cisco.com> |
Todd Foggoa | a292c8c | 2016-04-06 09:57:01 -0400 | [diff] [blame] | 9 | --- |
| 10 | drivers/net/enic/enic_rx.c | 10 +++------- |
| 11 | 1 file changed, 3 insertions(+), 7 deletions(-) |
John Lo | 23650e6 | 2016-03-29 16:14:35 -0400 | [diff] [blame] | 12 | |
| 13 | diff --git a/drivers/net/enic/enic_rx.c b/drivers/net/enic/enic_rx.c |
| 14 | index 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 Foggoa | a292c8c | 2016-04-06 09:57:01 -0400 | [diff] [blame] | 56 | -- |
| 57 | 1.9.1 |
| 58 | |