patches for DPDK stable branches
 help / color / mirror / Atom feed
From: peng1x.zhang@intel.com
To: jingjing.wu@intel.com, beilei.xing@intel.com, stable@dpdk.org
Cc: Peng Zhang <peng1x.zhang@intel.com>
Subject: [PATCH] net/iavf: fix add and delete MAC address
Date: Thu, 11 Aug 2022 02:54:56 +0800	[thread overview]
Message-ID: <20220810185456.349299-1-peng1x.zhang@intel.com> (raw)

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


                 reply	other threads:[~2022-08-10 11:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220810185456.349299-1-peng1x.zhang@intel.com \
    --to=peng1x.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    /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).