From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 367F9A0093 for ; Wed, 20 May 2020 18:55:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0B5E51C246; Wed, 20 May 2020 18:55:09 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 67EAB1C246 for ; Wed, 20 May 2020 18:55:07 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id e16so3865582wra.7 for ; Wed, 20 May 2020 09:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=gssCun1kebsRT11uAKiEL52uP/QZT4cjC+GkQoWNFkU=; b=It41cqRKZHUcfThe/9L7WsKddvC7JPjvq7UrSvP44qS4ZZcfHxxSGXygZLQv/jWXQb wv45lUUSGGo36AFFs7og84e9XPcALtrhJfMfA7M63FLjWVUm67K0vIh6avcTVJnUO8ZM GD0nJp6iPL6+iXltlS/sE+Nb81B5cgXJbeYIhWzlUXtGPPWiDfMiH41UCzGfMFhpTFet APsFU6CbtEsFjMh87HW/cHEbOgr+QnTAf7v1zRXIbnXRuYN4h4kPgMnTwxRuKnaj60Vk qYwIt5+wKawfHn/FnQmYttXSlZ8wTEFRAyk125AQH2qJ/1xDm6FD3n1IqgHTMvds5I2s M7Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=gssCun1kebsRT11uAKiEL52uP/QZT4cjC+GkQoWNFkU=; b=oLHuEk9ER7SdtG+ikv9L+g3Km3k1RwfuWnWCgbaWsvTtn88bBf5qd1407hM1OIDcgT keCT7adyTjuw2SifWWlRh6SiuqS9GCK8X8XylDhPsx/o0zteP4qrIzkVieFMvCtge/4x VxXPUF43rTk/G+q7tE6t0ur26paWevQDTJeGCb5HpNjTZUYcqjUWQXcaRCQyV3QdgyA2 uaiquCLATTae0uHtVwN5TBfHQmgFPyCUpaWJKiEmgbWp8Ole+gh00xBoU/J4uK3HUvOO Lw8du3qp6uJ1raosiYTVq1VDwVMXCpMSGrKQjy5n1edIDRyvUh02VB3fjXzKhwArffvV seFg== X-Gm-Message-State: AOAM530+X9S/lIZxLBqx4z8+iA5HLdRhle8HQdoxM5FnvYemTq1ALPOX hZjywWVcW/6cFBwit7WodXVMO2uNKww= X-Google-Smtp-Source: ABdhPJxJNbd6GD+uQMmnWWRpx4eJK6596MXXlH1nWxXQUR+r4ytod66uwlYol8FB+1T4SqEb+mhJhg== X-Received: by 2002:adf:ca0e:: with SMTP id o14mr5309643wrh.254.1589993706624; Wed, 20 May 2020 09:55:06 -0700 (PDT) Received: from bluca-lenovo ([2a01:4b00:f419:6f00:7a8e:ed70:5c52:ea3]) by smtp.gmail.com with ESMTPSA id y3sm3377550wrm.64.2020.05.20.09.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 09:55:05 -0700 (PDT) Message-ID: From: Luca Boccassi To: "Wangxiaoyun (Cloud)" Cc: dpdk stable , luoxingyu@huawei.com, yin.yinshi@huawei.com, luoxianjun@huawei.com, zhouguoyang@huawei.com Date: Wed, 20 May 2020 17:55:04 +0100 In-Reply-To: References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> <20200519130549.112823-67-luca.boccassi@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-stable] patch 'net/hinic/base: fix PF firmware hot-active problem' has been queued to stable release 19.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" These are all already included On Wed, 2020-05-20 at 20:29 +0800, Wangxiaoyun (Cloud) wrote: > Hi Luca Boccassi, > > These patches should be pushed to stable release 19.11.3 as follows: > 1) net/hinic: fix snprintf length --fixed by Kevin Traynor > 2) net/hinic: fix repeating log and length check --fixed by Kevin Traynor > 3) net/hinic: alloc IO memory with socketid > 4) net/hinic: fix LRO problems > > For hotupdate problem fixes, which needs the following 2 patches: > 5)net/hinic/base: fix hotupdate firmware problem > 6)net/hinic/base: fix PF firmware hotactive problem > But I found the patch 6) may conflict with other patches, should I push a > new patch about patch 6) with 19.11 stable branch? > > And the other two patches also need to push to stable release: > 7) net/hinic: the queues resource free problem fixes > 8) net/hinic: the pkt len updates of mbuf fixes > > Thanks. > Xiaoyun Wang > > 在 2020/5/19 21:03, luca.boccassi@gmail.com 写道: > > 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 11d98470395eff60937bbdff411b19f6ac00f76f Mon Sep 17 00:00:00 2001 > > From: Xiaoyun Wang > > Date: Fri, 10 Apr 2020 17:21:45 +0800 > > Subject: [PATCH] net/hinic/base: fix PF firmware hot-active problem > > > > [ upstream commit 036b61d85e4d1c45ac497a367c765ad463d2debf ] > > > > When FW is hotactive which means updating the FW but not needs > > to reboot OS, FW returns HINIC_DEV_BUSY_ACTIVE_FW for pf driver > > because firmware is being reinitialized, at which point the cmdq > > initialization that relies on the fw channel will fail, so driver > > should reinit the cmdq when port start. > > > > Fixes: 0194313b2df6 ("net/hinic/base: fix port start during FW hot update") > > > > Signed-off-by: Xiaoyun Wang > > --- > > drivers/net/hinic/base/hinic_pmd_cmdq.c | 7 +++-- > > drivers/net/hinic/base/hinic_pmd_hwdev.c | 4 +-- > > drivers/net/hinic/base/hinic_pmd_mgmt.c | 38 +++++++++++++----------- > > drivers/net/hinic/base/hinic_pmd_mgmt.h | 2 ++ > > drivers/net/hinic/base/hinic_pmd_nicio.c | 2 +- > > 5 files changed, 31 insertions(+), 22 deletions(-) > > > > diff --git a/drivers/net/hinic/base/hinic_pmd_cmdq.c b/drivers/net/hinic/base/hinic_pmd_cmdq.c > > index 685498ec2f..2e98b9c286 100644 > > --- a/drivers/net/hinic/base/hinic_pmd_cmdq.c > > +++ b/drivers/net/hinic/base/hinic_pmd_cmdq.c > > @@ -440,9 +440,12 @@ 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) > > + if (err == HINIC_MBOX_PF_BUSY_ACTIVE_FW || > > + err == HINIC_DEV_BUSY_ACTIVE_FW) { > > cmdqs->status |= HINIC_CMDQ_SET_FAIL; > > - PMD_DRV_LOG(ERR, "Set cmdq ctxt failed"); > > + PMD_DRV_LOG(ERR, "PF or VF fw is hot active"); > > + } > > + PMD_DRV_LOG(ERR, "Set cmdq ctxt failed, err: %d", err); > > return -EFAULT; > > } > > } > > diff --git a/drivers/net/hinic/base/hinic_pmd_hwdev.c b/drivers/net/hinic/base/hinic_pmd_hwdev.c > > index cf2a9701f2..fc11ecd7a4 100644 > > --- a/drivers/net/hinic/base/hinic_pmd_hwdev.c > > +++ b/drivers/net/hinic/base/hinic_pmd_hwdev.c > > @@ -529,7 +529,7 @@ static int hinic_vf_rx_tx_flush(struct hinic_hwdev *hwdev) > > > > err = hinic_reinit_cmdq_ctxts(hwdev); > > if (err) > > - PMD_DRV_LOG(WARNING, "Reinit cmdq failed"); > > + PMD_DRV_LOG(WARNING, "Reinit cmdq failed when vf flush"); > > > > return err; > > } > > @@ -587,7 +587,7 @@ static int hinic_pf_rx_tx_flush(struct hinic_hwdev *hwdev) > > > > err = hinic_reinit_cmdq_ctxts(hwdev); > > if (err) > > - PMD_DRV_LOG(WARNING, "Reinit cmdq failed"); > > + PMD_DRV_LOG(WARNING, "Reinit cmdq failed when pf flush"); > > > > return 0; > > } > > diff --git a/drivers/net/hinic/base/hinic_pmd_mgmt.c b/drivers/net/hinic/base/hinic_pmd_mgmt.c > > index eee50a80d1..ea79c300af 100644 > > --- a/drivers/net/hinic/base/hinic_pmd_mgmt.c > > +++ b/drivers/net/hinic/base/hinic_pmd_mgmt.c > > @@ -248,6 +248,19 @@ static void free_msg_buf(struct hinic_msg_pf_to_mgmt *pf_to_mgmt) > > free_recv_msg(&pf_to_mgmt->recv_msg_from_mgmt); > > } > > > > +static int hinic_get_mgmt_channel_status(void *hwdev) > > +{ > > + struct hinic_hwif *hwif = ((struct hinic_hwdev *)hwdev)->hwif; > > + u32 val; > > + > > + if (hinic_func_type((struct hinic_hwdev *)hwdev) == TYPE_VF) > > + return false; > > + > > + val = hinic_hwif_read_reg(hwif, HINIC_ICPL_RESERVD_ADDR); > > + > > + return HINIC_GET_MGMT_CHANNEL_STATUS(val, MGMT_CHANNEL_STATUS); > > +} > > + > > /** > > * send_msg_to_mgmt_async - send async message > > * @pf_to_mgmt: PF to MGMT channel > > @@ -309,6 +322,14 @@ static int send_msg_to_mgmt_sync(struct hinic_msg_pf_to_mgmt *pf_to_mgmt, > > u64 header; > > u16 cmd_size = mgmt_msg_len(msg_len); > > > > + /* If fw is hot active, return failed */ > > + if (hinic_get_mgmt_channel_status(pf_to_mgmt->hwdev)) { > > + if (mod == HINIC_MOD_COMM || mod == HINIC_MOD_L2NIC) > > + return HINIC_DEV_BUSY_ACTIVE_FW; > > + else > > + return -EBUSY; > > + } > > + > > if (direction == HINIC_MSG_RESPONSE) > > prepare_header(pf_to_mgmt, &header, msg_len, mod, ack_type, > > direction, cmd, resp_msg_id); > > @@ -462,19 +483,6 @@ unlock_sync_msg: > > return err; > > } > > > > -static int hinic_get_mgmt_channel_status(void *hwdev) > > -{ > > - struct hinic_hwif *hwif = ((struct hinic_hwdev *)hwdev)->hwif; > > - u32 val; > > - > > - if (hinic_func_type((struct hinic_hwdev *)hwdev) == TYPE_VF) > > - return false; > > - > > - val = hinic_hwif_read_reg(hwif, HINIC_ICPL_RESERVD_ADDR); > > - > > - return HINIC_GET_MGMT_CHANNEL_STATUS(val, MGMT_CHANNEL_STATUS); > > -} > > - > > int hinic_msg_to_mgmt_sync(void *hwdev, enum hinic_mod_type mod, u8 cmd, > > void *buf_in, u16 in_size, > > void *buf_out, u16 *out_size, u32 timeout) > > @@ -484,10 +492,6 @@ int hinic_msg_to_mgmt_sync(void *hwdev, enum hinic_mod_type mod, u8 cmd, > > if (!hwdev || in_size > HINIC_MSG_TO_MGMT_MAX_LEN) > > return -EINVAL; > > > > - /* If status is hot upgrading, don't send message to mgmt */ > > - if (hinic_get_mgmt_channel_status(hwdev)) > > - return -EPERM; > > - > > if (hinic_func_type(hwdev) == TYPE_VF) { > > rc = hinic_mbox_to_pf(hwdev, mod, cmd, buf_in, in_size, > > buf_out, out_size, timeout); > > diff --git a/drivers/net/hinic/base/hinic_pmd_mgmt.h b/drivers/net/hinic/base/hinic_pmd_mgmt.h > > index cc18843bf8..52b319ead4 100644 > > --- a/drivers/net/hinic/base/hinic_pmd_mgmt.h > > +++ b/drivers/net/hinic/base/hinic_pmd_mgmt.h > > @@ -34,6 +34,8 @@ > > #define HINIC_MSG_HEADER_P2P_IDX_MASK 0xF > > #define HINIC_MSG_HEADER_MSG_ID_MASK 0x3FF > > > > +#define HINIC_DEV_BUSY_ACTIVE_FW 0xFE > > + > > #define HINIC_MSG_HEADER_GET(val, member) \ > > (((val) >> HINIC_MSG_HEADER_##member##_SHIFT) & \ > > HINIC_MSG_HEADER_##member##_MASK) > > diff --git a/drivers/net/hinic/base/hinic_pmd_nicio.c b/drivers/net/hinic/base/hinic_pmd_nicio.c > > index 31a13fbdcf..d3e8f2e74d 100644 > > --- a/drivers/net/hinic/base/hinic_pmd_nicio.c > > +++ b/drivers/net/hinic/base/hinic_pmd_nicio.c > > @@ -536,7 +536,7 @@ int hinic_init_qp_ctxts(struct hinic_hwdev *hwdev) > > 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", > > + PMD_DRV_LOG(ERR, "Reinit cmdq context failed when dev start, err: %d", > > err); > > return err; > > } > >