From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B31B7A0545 for ; Wed, 10 Aug 2022 13:04:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E22A4068E; Wed, 10 Aug 2022 13:04:26 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 480D44067C for ; Wed, 10 Aug 2022 13:04:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660129465; x=1691665465; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xcqERJs/ELL6vQ3jAybL1ZYmwEpE3psIjzmz5HP+yRA=; b=XxMlMlpmPCPN4MwWfHjDPfvXo3yr2YZOtb47cnKmxrDwX+wpekoGVDS8 SlhJ0EWVvVj5DXT6/D65yzbrHyQclxfqPeJZjgJTFIYHUdHgl8RF3r7CJ CpLXqTSliNoGRvUO3IF33zDgJ2Fv6W+d51dmipmRRAtHlzQ3U5/4QMJs5 Z/zoQQQJeyqOum+8m+VUUHFHfawKi4/pMJEkrHoAoB9CPrvdxOD5bEwpi UqfN+9TiC2CulqHblSBX0QEEdDVX2XlJRYlz4WW/ooCZT48bdfyLmTFdQ 9vnnnLI3tmf/j2S/DPjYF8pdZH3ClAUpJ8OVHmoE9kRh9EOOYNrA2B4mU w==; X-IronPort-AV: E=McAfee;i="6400,9594,10434"; a="274108924" X-IronPort-AV: E=Sophos;i="5.93,227,1654585200"; d="scan'208";a="274108924" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2022 04:04:24 -0700 X-IronPort-AV: E=Sophos;i="5.93,227,1654585200"; d="scan'208";a="664851345" Received: from unknown (HELO localhost.localdomain) ([10.239.252.253]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2022 04:04:22 -0700 From: peng1x.zhang@intel.com To: jingjing.wu@intel.com, beilei.xing@intel.com, stable@dpdk.org Cc: Peng Zhang Subject: [PATCH] net/iavf: fix add and delete MAC address Date: Thu, 11 Aug 2022 02:54:56 +0800 Message-Id: <20220810185456.349299-1-peng1x.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Peng Zhang 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 --- 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