patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/iavf: fix add and delete MAC address
@ 2022-08-10 18:54 peng1x.zhang
  0 siblings, 0 replies; only message in thread
From: peng1x.zhang @ 2022-08-10 18:54 UTC (permalink / raw)
  To: jingjing.wu, beilei.xing, stable; +Cc: Peng Zhang

From: Peng Zhang <peng1x.zhang@intel.com>

Response execution of command to add or delete MAC address is not correct 
under scenario of bonding device, and it would also induce to wrongly deal 
with subsequent commands' response. 

This patch is to fix the issue by adding the handling of response.

Fixes: 22b123a36d07 ("net/avf: initialize PMD") 

Signed-off-by: Peng Zhang <peng1x.zhang@intel.com>
---
 drivers/net/iavf/iavf_vchnl.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index f6da2cf4bd..edd445db05 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -189,6 +189,25 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)
 		}
 		_clear_cmd(vf);
 		break;
+	case VIRTCHNL_OP_ADD_ETH_ADDR:
+	case VIRTCHNL_OP_DEL_ETH_ADDR:
+		do {
+			result = iavf_read_msg_from_pf(adapter, args->out_size,
+						   args->out_buffer);
+			if (result == IAVF_MSG_CMD ||
+					    vf->pend_cmd == VIRTCHNL_OP_UNKNOWN)
+				break;
+			iavf_msec_delay(ASQ_DELAY_MS);
+		} while (i++ < MAX_TRY_TIMES);
+		if (i >= MAX_TRY_TIMES ||
+		vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) {
+			err = -1;
+			PMD_DRV_LOG(ERR, "No response or return failure (%d)"
+			" for cmd %d", vf->cmd_retval, args->ops);
+		}
+		_clear_cmd(vf);
+		break;
+
 	case VIRTCHNL_OP_REQUEST_QUEUES:
 		/*
 		 * ignore async reply, only wait for system message,
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-10 11:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10 18:54 [PATCH] net/iavf: fix add and delete MAC address peng1x.zhang

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).