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 CC67BA0093 for ; Tue, 19 May 2020 15:06:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B8DB71D610; Tue, 19 May 2020 15:06:05 +0200 (CEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 4082A1D627 for ; Tue, 19 May 2020 15:06:04 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id m185so3470745wme.3 for ; Tue, 19 May 2020 06:06:04 -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=cIhwwiTZDQ17pYizAmfqkP/ameQ9J5yXVkHAv6a1m4U=; b=MDHHqv80Z5Ibtun+eMYcTKBal3vyGCU+u41Tt0XT+2aNizY+Fk5zjP+ABLj3X0k8P7 wtv8MAgXnNfZ+dRKdjquWHlpElg+8ivvN3ZNYzBGpuqlfphm7Amo0odBaoDpLQR5AcuV KhT9FDWTC7yRJd4GhVKOu6CmQMyMadT8QqhpoMCW4A2XN9lzSf3Q3mBOf8TVUsFj5cvs u4g320SRbNC55pMLcgl/rdcuA/XkDBsM1OsLs71fC5pyIN0kyrKbkpECTVAcL88FXmkF cE7caHjkAVSq87+Jm0gQrVd/hwMMgUtjHO0B5cz49H+j+zxK5WIm5LE+uYoBhEgWHNWt D2cw== 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=cIhwwiTZDQ17pYizAmfqkP/ameQ9J5yXVkHAv6a1m4U=; b=twZA2MWf1A8vH1Md/IGcokKtKMKiwzTquonlTvaSk9DNwuAsIvp2sS1af3ND9mvYwr /fI4uIruDw3RLZRLLRhOWqZ1Cvh9fZmOAD8CufFBDADi1EoOmjrxJHKEU9vCoPMNqqby LtxnVBxxNAjwPZSk4uHFzILzAe4yd4/fdpMwycjofQQsH+jeG/apCdejAlxsP1etDArL zzF+FJDwt0Xls2rXAMHfoUTuchZqwTvt/j4x/MsmzzLdoO8KL2nx+xf95fvIHluYh7Hj 6IOAC61Y06i8PLcaPlKTG1x9bjT5IUkX88gbwydzyNQAfS5Dw4gbPfRtj5Nbs0VXaJ23 Eqjw== X-Gm-Message-State: AOAM530zek8YMmCotcPxVG2UZLE/Y1jRloqYG63JIgyCx6xrUGn1HS31 S7WyW5o00NRF9agIDIPpFW0= X-Google-Smtp-Source: ABdhPJwKWDZOA64Y8qQpxSqDD9x00XBhGrew6RoIMihUj/IIT4Bpj6Fr/r8bp7ZIRmPPxFgqs7OjkQ== X-Received: by 2002:a1c:7407:: with SMTP id p7mr5750341wmc.114.1589893563025; Tue, 19 May 2020 06:06:03 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id a15sm20833935wrw.56.2020.05.19.06.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:06:02 -0700 (PDT) From: luca.boccassi@gmail.com To: Chengwen Feng Cc: Wei Hu , dpdk stable Date: Tue, 19 May 2020 14:02:20 +0100 Message-Id: <20200519130549.112823-5-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/hns3: fix default error code of command interface' 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 1cd4ab6cf4887dd09f2ccfadc9429bec320e453d Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Tue, 17 Mar 2020 17:12:03 +0800 Subject: [PATCH] net/hns3: fix default error code of command interface [ upstream commit 4f4ee5b79b85797b92ed3a3b9304d871124f0650 ] Currently, the hns3 PMD driver can interact with firmware through command to complete hardware configuration. The driver calls internal interface function named hns3_cmd_send to issues command to the firmware, and check the execution result of the command through desc_ret returned by firmware to driver. As the design of error code, when device is resetting hns3_cmd_send will only return -EBUSY or -EIO. But we found that if desc_ret is in [12,65535], for example the item doesn't exist when issuing the command to query some table item, hns3_cmd_send also return -EIO. This phenomenon will affect the processing logic for the return value. The root cause as below: When desc_ret is in [12,65535], in the static function named hns3_cmd_convert_err_code called by hns3_cmd_send, matches the default case and return -EIO. And then hns3_cmd_send return -EIO. This patch fixes it with the following modification. 1. Change the return value of the default case in the static function named hns3_cmd_convert_err_code from -EIO to -EREMOTEIO. 2. Modify the comment add errcode description of the internal interface function named hns3_cmd_send. Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware") Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_cmd.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/net/hns3/hns3_cmd.c b/drivers/net/hns3/hns3_cmd.c index 5ec3dfe016..c85168b319 100644 --- a/drivers/net/hns3/hns3_cmd.c +++ b/drivers/net/hns3/hns3_cmd.c @@ -289,7 +289,7 @@ hns3_cmd_convert_err_code(uint16_t desc_ret) case HNS3_CMD_INVALID: return -EBADR; default: - return -EIO; + return -EREMOTEIO; } } @@ -349,11 +349,23 @@ static int hns3_cmd_poll_reply(struct hns3_hw *hw) /* * hns3_cmd_send - send command to command queue - * @hw: pointer to the hw struct - * @desc: prefilled descriptor for describing the command - * @num : the number of descriptors to be sent * - * This is the main send command for command queue, it + * @param hw + * pointer to the hw struct + * @param desc + * prefilled descriptor for describing the command + * @param num + * the number of descriptors to be sent + * @return + * - -EBUSY if detect device is in resetting + * - -EIO if detect cmd csq corrupted (due to reset) or + * there is reset pending + * - -ENOMEM/-ETIME/...(Non-Zero) if other error case + * - Zero if operation completed successfully + * + * Note -BUSY/-EIO only used in reset case + * + * Note this is the main send command for command queue, it * sends the queue, cleans the queue, etc */ int -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:44.806152210 +0100 +++ 0005-net-hns3-fix-default-error-code-of-command-interface.patch 2020-05-19 14:04:44.052645400 +0100 @@ -1,8 +1,10 @@ -From 4f4ee5b79b85797b92ed3a3b9304d871124f0650 Mon Sep 17 00:00:00 2001 +From 1cd4ab6cf4887dd09f2ccfadc9429bec320e453d Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Tue, 17 Mar 2020 17:12:03 +0800 Subject: [PATCH] net/hns3: fix default error code of command interface +[ upstream commit 4f4ee5b79b85797b92ed3a3b9304d871124f0650 ] + Currently, the hns3 PMD driver can interact with firmware through command to complete hardware configuration. The driver calls internal interface function named hns3_cmd_send to issues command to the @@ -27,7 +29,6 @@ function named hns3_cmd_send. Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware") -Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Wei Hu (Xavier)