[dpdk-stable] patch 'net/memif: fix init when already connected' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 14:53:43 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From d40bcdfb5953ddaa03f5a75b730addab36738ec7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BAlius=20Milan?= <jmilan.dev at gmail.com>
Date: Wed, 19 Feb 2020 09:19:16 +0100
Subject: [PATCH] net/memif: fix init when already connected
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 06123fdd6063e411ea78ed353f0d6114e500b1b3 ]

This patch fixes the situation when there is already connected pair of
memif interfaces and another slave tries to initiate the connection with
(already occupied) master. Expected behavior is that the second slave
is refused and gets disconnect message with reason: "Already connected",
while old connection remains functional.

Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD")

Signed-off-by: Július Milan <jmilan.dev at gmail.com>
Reviewed-by: Jakub Grajciar <jgrajcia at cisco.com>
---
 drivers/net/memif/memif_socket.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
index ad5e30b96e..c1967c67bf 100644
--- a/drivers/net/memif/memif_socket.c
+++ b/drivers/net/memif/memif_socket.c
@@ -204,6 +204,13 @@ memif_msg_receive_init(struct memif_control_channel *cc, memif_msg_t *msg)
 		pmd = dev->data->dev_private;
 		if (((pmd->flags & ETH_MEMIF_FLAG_DISABLED) == 0) &&
 		    pmd->id == i->id) {
+			if (pmd->flags & (ETH_MEMIF_FLAG_CONNECTING |
+					   ETH_MEMIF_FLAG_CONNECTED)) {
+				memif_msg_enq_disconnect(cc,
+							 "Already connected", 0);
+				return -1;
+			}
+
 			/* assign control channel to device */
 			cc->dev = dev;
 			pmd->cc = cc;
@@ -215,12 +222,6 @@ memif_msg_receive_init(struct memif_control_channel *cc, memif_msg_t *msg)
 				return -1;
 			}
 
-			if (pmd->flags & (ETH_MEMIF_FLAG_CONNECTING |
-					   ETH_MEMIF_FLAG_CONNECTED)) {
-				memif_msg_enq_disconnect(pmd->cc,
-							 "Already connected", 0);
-				return -1;
-			}
 			strlcpy(pmd->remote_name, (char *)i->name,
 				sizeof(pmd->remote_name));
 
@@ -765,6 +766,7 @@ memif_intr_handler(void *arg)
 	ret = memif_msg_receive(cc);
 	/* if driver failed to assign device */
 	if (cc->dev == NULL) {
+		memif_msg_send_from_queue(cc);
 		ret = rte_intr_callback_unregister_pending(&cc->intr_handle,
 							   memif_intr_handler,
 							   cc,
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 13:56:20.185689821 +0100
+++ 0033-net-memif-fix-init-when-already-connected.patch	2020-05-19 13:56:18.227501963 +0100
@@ -1,4 +1,4 @@
-From 06123fdd6063e411ea78ed353f0d6114e500b1b3 Mon Sep 17 00:00:00 2001
+From d40bcdfb5953ddaa03f5a75b730addab36738ec7 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?J=C3=BAlius=20Milan?= <jmilan.dev at gmail.com>
 Date: Wed, 19 Feb 2020 09:19:16 +0100
 Subject: [PATCH] net/memif: fix init when already connected
@@ -6,6 +6,8 @@
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
+[ upstream commit 06123fdd6063e411ea78ed353f0d6114e500b1b3 ]
+
 This patch fixes the situation when there is already connected pair of
 memif interfaces and another slave tries to initiate the connection with
 (already occupied) master. Expected behavior is that the second slave
@@ -13,7 +15,6 @@
 while old connection remains functional.
 
 Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD")
-Cc: stable at dpdk.org
 
 Signed-off-by: Július Milan <jmilan.dev at gmail.com>
 Reviewed-by: Jakub Grajciar <jgrajcia at cisco.com>
@@ -22,13 +23,13 @@
  1 file changed, 8 insertions(+), 6 deletions(-)
 
 diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c
-index 8ce2cc9faf..67794cb6fa 100644
+index ad5e30b96e..c1967c67bf 100644
 --- a/drivers/net/memif/memif_socket.c
 +++ b/drivers/net/memif/memif_socket.c
 @@ -204,6 +204,13 @@ memif_msg_receive_init(struct memif_control_channel *cc, memif_msg_t *msg)
  		pmd = dev->data->dev_private;
  		if (((pmd->flags & ETH_MEMIF_FLAG_DISABLED) == 0) &&
- 		    (pmd->id == i->id) && (pmd->role == MEMIF_ROLE_MASTER)) {
+ 		    pmd->id == i->id) {
 +			if (pmd->flags & (ETH_MEMIF_FLAG_CONNECTING |
 +					   ETH_MEMIF_FLAG_CONNECTED)) {
 +				memif_msg_enq_disconnect(cc,
@@ -52,7 +53,7 @@
  			strlcpy(pmd->remote_name, (char *)i->name,
  				sizeof(pmd->remote_name));
  
-@@ -772,6 +773,7 @@ memif_intr_handler(void *arg)
+@@ -765,6 +766,7 @@ memif_intr_handler(void *arg)
  	ret = memif_msg_receive(cc);
  	/* if driver failed to assign device */
  	if (cc->dev == NULL) {


More information about the stable mailing list