From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-3.cisco.com (rcdn-iport-3.cisco.com [173.37.86.74]) by dpdk.org (Postfix) with ESMTP id 6347F568E for ; Thu, 17 Mar 2016 23:57:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1715; q=dns/txt; s=iport; t=1458255436; x=1459465036; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=tA+1oPBy2F6k9L/3g81bNJV/z4FFhLuEjdpsbIHQrk0=; b=ljwvpCzOWI7W+WM8vbLF6ZvgUstwaOeEDUQVPTaBt1KbW8wnMec+D3NU 03A1mf3KA+pQABImfUN1kGQoPEURR/K45+zaudoZb3pFYA03nD2d34DvJ O48I0DGqH32ZaU/MTthpGMQwwN1CoshDTSEL0C6TuSFYq8uT429EVSdRX U=; X-IronPort-AV: E=Sophos;i="5.24,351,1454976000"; d="scan'208";a="87573259" Received: from alln-core-8.cisco.com ([173.36.13.141]) by rcdn-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Mar 2016 22:57:15 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-8.cisco.com (8.14.5/8.14.5) with ESMTP id u2HMvFR4021200; Thu, 17 Mar 2016 22:57:15 GMT Received: by cisco.com (Postfix, from userid 392789) id 478ED3FAADAF; Thu, 17 Mar 2016 15:57:15 -0700 (PDT) From: John Daley To: dev@dpdk.org Cc: John Daley Date: Thu, 17 Mar 2016 15:57:07 -0700 Message-Id: <1458255427-12371-4-git-send-email-johndale@cisco.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1458255427-12371-1-git-send-email-johndale@cisco.com> References: <1458255427-12371-1-git-send-email-johndale@cisco.com> Subject: [dpdk-dev] [PATCH 3/3] enic: small cleanup- remove a packet_error conditional X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 22:57:16 -0000 Signed-off-by: John Daley --- 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