* [dpdk-dev] [PATCH v2] af_packet: fix mbuf->port for eth_af_packet
@ 2015-12-10 10:10 xkr
2015-12-10 10:11 ` Thomas Monjalon
0 siblings, 1 reply; 2+ messages in thread
From: xkr @ 2015-12-10 10:10 UTC (permalink / raw)
To: linville; +Cc: dev
Fixes port number in mbuf structure when using with eth_af_packet
Signed-off-by: xkr <pavel.krauz@anritsu.com>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-10 10:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 10:10 [dpdk-dev] [PATCH v2] af_packet: fix mbuf->port for eth_af_packet xkr
2015-12-10 10:11 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).