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 30F9FA0093 for ; Tue, 19 May 2020 15:06:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1ABAC1D603; Tue, 19 May 2020 15:06:22 +0200 (CEST) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 437551D63F for ; Tue, 19 May 2020 15:06:21 +0200 (CEST) Received: by mail-wm1-f66.google.com with SMTP id f13so2977018wmc.5 for ; Tue, 19 May 2020 06:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cA8FtqCyMK59/PnzXLpVPhiDNyvL6Hv8jwoNQZVIQnQ=; b=LJ/QQegSX/8NEVkCxkcc6urTmyKPnMdjj2JKhjBqkKrueR8Cm38lLPolwXBp6fKLCa VscaJO3H4EkZTfBTipF6+fd3JqJzdHvMK2H6vF4xklx9h03/DAMzOXU+EB+A3DmREC23 TGZpchtngjMVGTOXJujc1oS4Fg2r0+B9Qog3lUJqkZTbht1X4P84E6GNrma1Cpfj7q0W A6pxVysuULvDvzpDrWutj1mgwGsl0fCd1pHGUWZEjqjGC2QJvFGIJwLSTSlOvvcfC5lZ Ca9xEZNJNgYsIwBzBdWds6xxakHXdyleBEP7zG8mRpcFChx/lSiUJt/SCNrmImfgB7Qw QGig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cA8FtqCyMK59/PnzXLpVPhiDNyvL6Hv8jwoNQZVIQnQ=; b=AqMHGF2nvL4pAC4frbqHe8/aRjZ+SoHZ3uXOh5xfyorawcDe4PkWptgHYbaiQ+UC0C BEYHZZ2gGcihhE6BWkhtWIecX+PCFDGBwwcTRmZJxNsZNIFHQzr/BfyiihI5mYJuYUEK Y9RVKj7UJUz10EoyKxUG+mlZLFiFRyeXDXP4bmZ6WLmAzQsvWHheUHTmEvLEulNuILDB ihTRVCnTNaPP74pKoC3Fr+QP11UH6U4zB2WmJiAhaoGrPEVPLBWnqdBJNb8MrR8USd9K O6UrkSqKaSC8RFMC4vqGylHOMaE76Ij5Usk2fs6ig5bnQrbdnIpe994s1k8/L10y9psj JvoA== X-Gm-Message-State: AOAM531cBGQ73G8a7EtC6BfjzP4Fai7i9TKWal/a6NZUnK4z62v9y7+X V4xuuUYX8x8AZxViPXxtOVgHc5GkQdcTmiE/ X-Google-Smtp-Source: ABdhPJwn+2eu6ePap717d/QypCPDXfAFFus8MMvUdkQM1c/NWs2suYQqQUvQrwkIedSWLan6kJpkCw== X-Received: by 2002:a1c:c3c6:: with SMTP id t189mr5266316wmf.94.1589893580096; Tue, 19 May 2020 06:06:20 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id p23sm1293818wma.17.2020.05.19.06.06.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:06:18 -0700 (PDT) From: luca.boccassi@gmail.com To: Xiaoyun Wang Cc: dpdk stable Date: Tue, 19 May 2020 14:02:25 +0100 Message-Id: <20200519130549.112823-10-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hinic/base: fix port start during FW hot update' 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" 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 d57282791c7b346e138cb451935834b7b4d84d50 Mon Sep 17 00:00:00 2001 From: Xiaoyun Wang Date: Tue, 17 Mar 2020 23:01:12 +0800 Subject: [PATCH] net/hinic/base: fix port start during FW hot update [ upstream commit 0194313b2df66d9308c79f501d1018a99b32098b ] 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 cmdq fails, then reinit the cmdq when port start. Fixes: d9ce1917941c ("net/hinic/base: add hardware operation") Signed-off-by: Xiaoyun Wang --- 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 d73e2bf592..685498ec2f 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 da939e16fa..4ce0a4c5b8 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 59e39ed984..31a13fbdcf 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); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:44.999169703 +0100 +++ 0010-net-hinic-base-fix-port-start-during-FW-hot-update.patch 2020-05-19 14:04:44.068645689 +0100 @@ -1,14 +1,15 @@ -From 0194313b2df66d9308c79f501d1018a99b32098b Mon Sep 17 00:00:00 2001 +From d57282791c7b346e138cb451935834b7b4d84d50 Mon Sep 17 00:00:00 2001 From: Xiaoyun Wang Date: Tue, 17 Mar 2020 23:01:12 +0800 Subject: [PATCH] net/hinic/base: fix port start during FW hot update +[ upstream commit 0194313b2df66d9308c79f501d1018a99b32098b ] + 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 cmdq fails, then reinit the cmdq when port start. Fixes: d9ce1917941c ("net/hinic/base: add hardware operation") -Cc: stable@dpdk.org Signed-off-by: Xiaoyun Wang ---