From: Pavel Krauz Date: Thu, 10 Dec 2015 10:25:05 +0000 (+0100) Subject: af_packet: set input port in mbuf X-Git-Tag: spdx-start~7799 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e01993bf82e8c0af74def9a38b92b56932df157f;p=dpdk.git af_packet: set input port in mbuf Fixes port number in mbuf structure when using with eth_af_packet Signed-off-by: Pavel Krauz --- diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 3237e6ecdf..767f36b656 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; }