DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavel Krauz <pavel.krauz@anritsu.com>
To: linville@tuxdriver.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3] af_packet: fix mbuf->port for eth_af_packet
Date: Thu, 10 Dec 2015 11:25:05 +0100	[thread overview]
Message-ID: <1449743105-9631-1-git-send-email-pavel.krauz@anritsu.com> (raw)

Fixes port number in mbuf structure when using with eth_af_packet

Signed-off-by: Pavel Krauz <pavel.krauz@anritsu.com>
---
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

             reply	other threads:[~2015-12-10 10:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 10:25 Pavel Krauz [this message]
2015-12-10 21:15 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449743105-9631-1-git-send-email-pavel.krauz@anritsu.com \
    --to=pavel.krauz@anritsu.com \
    --cc=dev@dpdk.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).