DPDK patches and discussions
 help / color / mirror / Atom feed
From: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <bluca@debian.org>,
	<luoxianjun@huawei.com>, <luoxingyu@huawei.com>,
	<zhouguoyang@huawei.com>, <xuanziyang2@huawei.com>,
	<shahar.belkar@huawei.com>, <yin.yinshi@huawei.com>,
	Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
Subject: [dpdk-dev] [PATCH v2 2/7] net/hinic/base: fix hotupdate firmware problem
Date: Tue, 17 Mar 2020 23:01:12 +0800	[thread overview]
Message-ID: <5013a1597f6d4db83ab46ae008df1ef7727f1610.1584456756.git.cloud.wangxiaoyun@huawei.com> (raw)
In-Reply-To: <cover.1584456756.git.cloud.wangxiaoyun@huawei.com>

When repeatedly hotupdate firmware and start/stop port at the same time,
port start may be failed when cmdq reinit failed at the fw active phase,
so if deteted status of cmdq is fail, then reinit the cmdq when port start.

Fixes: d9ce1917941c ("net/hinic/base: add hardware operation")
Signed-off-by: Xiaoyun wang <cloud.wangxiaoyun@huawei.com>
---
 drivers/net/hinic/base/hinic_pmd_cmdq.c  | 4 ++++
 drivers/net/hinic/base/hinic_pmd_cmdq.h  | 1 +
 drivers/net/hinic/base/hinic_pmd_nicio.c | 9 +++++++++
 3 files changed, 14 insertions(+)

diff --git a/drivers/net/hinic/base/hinic_pmd_cmdq.c b/drivers/net/hinic/base/hinic_pmd_cmdq.c
index d73e2bf..685498e 100644
--- a/drivers/net/hinic/base/hinic_pmd_cmdq.c
+++ b/drivers/net/hinic/base/hinic_pmd_cmdq.c
@@ -7,6 +7,7 @@
 #include "hinic_pmd_hwif.h"
 #include "hinic_pmd_wq.h"
 #include "hinic_pmd_mgmt.h"
+#include "hinic_pmd_mbox.h"
 #include "hinic_pmd_cmdq.h"
 
 #define CMDQ_CMD_TIMEOUT				5000 /* millisecond */
@@ -439,11 +440,14 @@ static int hinic_set_cmdq_ctxts(struct hinic_hwdev *hwdev)
 					     cmdq_ctxt, in_size, NULL,
 					     NULL, 0);
 		if (err) {
+			if (err == HINIC_MBOX_PF_BUSY_ACTIVE_FW)
+				cmdqs->status |= HINIC_CMDQ_SET_FAIL;
 			PMD_DRV_LOG(ERR, "Set cmdq ctxt failed");
 			return -EFAULT;
 		}
 	}
 
+	cmdqs->status &= ~HINIC_CMDQ_SET_FAIL;
 	cmdqs->status |= HINIC_CMDQ_ENABLE;
 
 	return 0;
diff --git a/drivers/net/hinic/base/hinic_pmd_cmdq.h b/drivers/net/hinic/base/hinic_pmd_cmdq.h
index da939e1..4ce0a4c 100644
--- a/drivers/net/hinic/base/hinic_pmd_cmdq.h
+++ b/drivers/net/hinic/base/hinic_pmd_cmdq.h
@@ -170,6 +170,7 @@ struct hinic_cmdq_ctxt {
 
 enum hinic_cmdq_status {
 	HINIC_CMDQ_ENABLE = BIT(0),
+	HINIC_CMDQ_SET_FAIL = BIT(1)
 };
 
 enum hinic_cmdq_cmd_type {
diff --git a/drivers/net/hinic/base/hinic_pmd_nicio.c b/drivers/net/hinic/base/hinic_pmd_nicio.c
index 59e39ed..31a13fb 100644
--- a/drivers/net/hinic/base/hinic_pmd_nicio.c
+++ b/drivers/net/hinic/base/hinic_pmd_nicio.c
@@ -533,6 +533,15 @@ int hinic_init_qp_ctxts(struct hinic_hwdev *hwdev)
 		return err;
 	}
 
+	if (hwdev->cmdqs->status & HINIC_CMDQ_SET_FAIL) {
+		err = hinic_reinit_cmdq_ctxts(hwdev);
+		if (err) {
+			PMD_DRV_LOG(ERR, "Reinit cmdq context failed, rc: %d\n",
+				err);
+			return err;
+		}
+	}
+
 	err = init_qp_ctxts(nic_io);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Init QP ctxts failed, rc: %d", err);
-- 
1.8.3.1


  parent reply	other threads:[~2020-03-17 14:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17 15:01 [dpdk-dev] [PATCH v2 0/7] Fix LRO issue and support Flow Control Xiaoyun wang
2020-03-17 15:01 ` [dpdk-dev] [PATCH v2 1/7] net/hinic: fix LRO problems Xiaoyun wang
2020-03-17 15:01 ` Xiaoyun wang [this message]
2020-03-17 15:01 ` [dpdk-dev] [PATCH v2 3/7] net/hinic/base: optimize doorbell area initialization Xiaoyun wang
2020-03-17 15:01 ` [dpdk-dev] [PATCH v2 4/7] net/hinic: remove 40GE Mezz card id Xiaoyun wang
2020-03-17 15:01 ` [dpdk-dev] [PATCH v2 5/7] net/hinic: Add Fdir filter type Xiaoyun wang
2020-03-17 15:01 ` [dpdk-dev] [PATCH v2 6/7] net/hinic/base: Optimize log files Xiaoyun wang
2020-03-17 15:01 ` [dpdk-dev] [PATCH v2 7/7] net/hinic/base: Support Pause flow control Xiaoyun wang
2020-03-20 10:05 ` [dpdk-dev] [PATCH v2 0/7] Fix LRO issue and support Flow Control Ferruh Yigit

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=5013a1597f6d4db83ab46ae008df1ef7727f1610.1584456756.git.cloud.wangxiaoyun@huawei.com \
    --to=cloud.wangxiaoyun@huawei.com \
    --cc=bluca@debian.org \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=luoxianjun@huawei.com \
    --cc=luoxingyu@huawei.com \
    --cc=shahar.belkar@huawei.com \
    --cc=xuanziyang2@huawei.com \
    --cc=yin.yinshi@huawei.com \
    --cc=zhouguoyang@huawei.com \
    /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).