From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from kra.main.intgin.net (unknown [194.213.35.114]) by dpdk.org (Postfix) with ESMTP id ED3B08D39 for ; Thu, 10 Dec 2015 11:25:06 +0100 (CET) Received: by kra.main.intgin.net (Postfix, from userid 206) id B0E72E1F89; Thu, 10 Dec 2015 11:25:06 +0100 (CET) From: Pavel Krauz To: linville@tuxdriver.com Date: Thu, 10 Dec 2015 11:25:05 +0100 Message-Id: <1449743105-9631-1-git-send-email-pavel.krauz@anritsu.com> X-Mailer: git-send-email 1.8.4.5 Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH v3] af_packet: fix mbuf->port for eth_af_packet 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, 10 Dec 2015 10:25:07 -0000 Fixes port number in mbuf structure when using with eth_af_packet Signed-off-by: Pavel Krauz --- v3: * corrected signed-off display name v2: * properly formated for git drivers/net/af_packet/rte_eth_af_packet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 3237e6e..767f36b 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -74,6 +74,7 @@ struct pkt_rx_queue { unsigned int framenum; struct rte_mempool *mb_pool; + uint8_t in_port; volatile unsigned long rx_pkts; volatile unsigned long err_pkts; @@ -160,6 +161,7 @@ eth_af_packet_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) ppd->tp_status = TP_STATUS_KERNEL; if (++framenum >= framecount) framenum = 0; + mbuf->port = pkt_q->in_port; /* account for the receive frame */ bufs[i] = mbuf; @@ -365,6 +367,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, } dev->data->rx_queues[rx_queue_id] = pkt_q; + pkt_q->in_port = dev->data->port_id; return 0; } -- 1.8.4.5