Skip to contentSkip to conversation

null: set port_id in mbufs received from null PMD

PATCH Applied Sean Harte 4 participants 4 messages May 27, 2016 – Jun 13, 2016 Network drivers

lore
Share & tools
lore

Sean Harte

author
#0 lore raw

PATCH 1/1 null: set port_id in mbufs received from null PMD

Ensure that the port field is set in mbufs received from the null PMD.

---
 drivers/net/null/rte_eth_null.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/null/rte_eth_null.c +4 -0
index 5e8e203..ab440f3 100644
@@ -69,6 +69,7 @@ struct null_queue {
 struct pmd_internals {
 	unsigned packet_size;
 	unsigned packet_copy;
+	uint8_t port_id;
 
 	struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT];
 	struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT];
@@ -114,6 +115,7 @@ eth_null_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 		bufs[i]->pkt_len = packet_size;
 		bufs[i]->nb_segs = 1;
 		bufs[i]->next = NULL;
+		bufs[i]->port = h->internals->port_id;
 	}
 
 	rte_atomic64_add(&(h->rx_pkts), i);
@@ -142,6 +144,7 @@ eth_null_copy_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 		bufs[i]->pkt_len = packet_size;
 		bufs[i]->nb_segs = 1;
 		bufs[i]->next = NULL;
+		bufs[i]->port = h->internals->port_id;
 	}
 
 	rte_atomic64_add(&(h->rx_pkts), i);
@@ -529,6 +532,7 @@ eth_dev_null_create(const char *name,
 
 	internals->packet_size = packet_size;
 	internals->packet_copy = packet_copy;
+	internals->port_id = eth_dev->data->port_id;
 
 	internals->flow_type_rss_offloads =  ETH_RSS_PROTO_MASK;
 	internals->reta_size = RTE_DIM(internals->reta_conf) * RTE_RETA_GROUP_SIZE;
Signature · 1 line
2.5.0
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Sean Harte
Sent: Friday, May 27, 2016 1:27 PM
To: [email protected]
Cc: [email protected]; Harte, Sean <[email protected]>
Subject: [dpdk-dev] [PATCH v1] null: set port_id in mbufs received from null PMD

Ensure that the port field is set in mbufs received from the null PMD.

#2 lore raw
Quoted 8 lines · John
Quoted 8 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Sean Harte
Sent: Friday, May 27, 2016 1:27 PM
To: [email protected]
Cc: [email protected]; Harte, Sean <[email protected]>
Subject: [dpdk-dev] [PATCH v1] null: set port_id in mbufs received from null PMD

Quoted 5 lines
Quoted 3 lines

Ensure that the port field is set in mbufs received from the null PMD.

#3 lore raw
Quoted 9 lines · Tetsuya Mukawa
Quoted 8 lines · John
Quoted 8 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Sean Harte
Sent: Friday, May 27, 2016 1:27 PM
To: [email protected]
Cc: [email protected]; Harte, Sean <[email protected]>
Subject: [dpdk-dev] [PATCH v1] null: set port_id in mbufs received from null PMD

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Ensure that the port field is set in mbufs received from the null PMD.

Applied to dpdk-next-net/rel_16_07

/Bruce