net/memif: add multiple memif data transmission support

Message ID 1571232181-5874-1-git-send-email-anand.sunkad@benisontech.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series net/memif: add multiple memif data transmission support |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-compilation success Compile Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Anand Sunkad Oct. 16, 2019, 1:22 p.m. UTC
  When Multiple slave/master Memif interfaces are created in single
process data transmission over second connection is not successful.

Issue is because of "mq->in_port" is not initialized with
"dev->data->port_id" in memif_msg_enq_add_ring() and
memif_msg_receive_add_ring() functions, and while transmitting packets
over second connection in eth_memif_tx function it refer "mq->in_port"
which is always zero, and leads to data transmission always in 0th port.

To mitigate the issue,"mq->in_port" is initialized with
"dev->data->port_id" in memif_msg_enq_add_ring() and
memif_msg_receive_add_ring() functions.

Signed-off-by: Anand Sunkad <anand.sunkad@benisontech.com>
---
 drivers/net/memif/memif_socket.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Jakub Grajciar -X (jgrajcia - PANTHEON TECH SRO at Cisco) Oct. 17, 2019, 11:28 a.m. UTC | #1
> -----Original Message-----
> From: Anand Sunkad <anand.sunkad@benisontech.com>
> Sent: Wednesday, October 16, 2019 3:22 PM
> To: Jakub Grajciar -X (jgrajcia - PANTHEON TECHNOLOGIES at Cisco)
> <jgrajcia@cisco.com>
> Cc: dev@dpdk.org; Vivek Gupta <vivekg@benisontech.com>; Thomas
> Mulamangalath <thomas.mulamangalath@benisontech.com>; Anand Sunkad
> <anand.sunkad@benisontech.com>
> Subject: [PATCH] net/memif: add multiple memif data transmission support
> 
> When Multiple slave/master Memif interfaces are created in single process
> data transmission over second connection is not successful.
> 
> Issue is because of "mq->in_port" is not initialized with "dev->data->port_id"
> in memif_msg_enq_add_ring() and
> memif_msg_receive_add_ring() functions, and while transmitting packets
> over second connection in eth_memif_tx function it refer "mq->in_port"
> which is always zero, and leads to data transmission always in 0th port.
> 
> To mitigate the issue,"mq->in_port" is initialized with "dev->data->port_id" in
> memif_msg_enq_add_ring() and
> memif_msg_receive_add_ring() functions.
> 
> Signed-off-by: Anand Sunkad <anand.sunkad@benisontech.com>

Good catch, however you want to initialize mq->in_port in memif_tx_queue_setup().

Thanks,
Jakub
  

Patch

diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index 0c71f6c..ef8c509 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -322,6 +322,7 @@ 
 	mq->log2_ring_size = ar->log2_ring_size;
 	mq->region = ar->region;
 	mq->ring_offset = ar->offset;
+	mq->in_port = dev->data->port_id;
 
 	return 0;
 }
@@ -464,6 +465,7 @@ 
 	ar->log2_ring_size = mq->log2_ring_size;
 	ar->flags = (type == MEMIF_RING_S2M) ? MEMIF_MSG_ADD_RING_FLAG_S2M : 0;
 	ar->private_hdr_size = 0;
+	mq->in_port = dev->data->port_id;
 
 	return 0;
 }