From patchwork Tue Aug 21 11:06:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 43795 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BAD302C38; Tue, 21 Aug 2018 13:06:58 +0200 (CEST) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 877602BF1 for ; Tue, 21 Aug 2018 13:06:57 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id m27-v6so9255238wrf.3 for ; Tue, 21 Aug 2018 04:06:57 -0700 (PDT) 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; bh=XjRj/EETR89MQJ1MCY1npp5Gqgw6Sc/gij83oW+Xfvk=; b=srB8mX3XD9ew1g5QGZsVC9EDLKjBY/JywQaCKUs+y5bNfYdbfjsJvf+ate/Ybtaxkj URz4jf6RVyEpu60/HLatGyRhln/msZ1eijNeRkToFTxzb76aNlPykSmyPuQrd+FebcVQ cmrc8tOmobcqQYT6d0LC1XzkMEZyznwTW46MykJddllEuiaFAjn/C4k78xpWKWJIyypb YlAJ2zvxMQY2l3ZMQ4yHfkoSOvp55tdiHBg0ivKkq/xn3bWkP7ZTuaIU3VcEm1Uk3ql2 dlww35nug6AEbUR7jjzs3A7LuuFhNgpYnFwlKtoigRCaiokT8ppNcHN5B3NFFqwnUnq+ MzCg== X-Gm-Message-State: APzg51CEUVz7QfYE0/0KysKG6L5UTINfsBBr1/HSgFJi5HbiGl46Gzcp H/06ou8fOToXJzTc3MSe5RgNWp9B X-Google-Smtp-Source: ANB0VdYkb+BhDjgz4OnUuD1s9iQwydPHjhGeu+vU36MN3iSaC9mwenuOL66ctmviS5IrWZnknoET4A== X-Received: by 2002:adf:e486:: with SMTP id i6-v6mr1088401wrm.145.1534849616964; Tue, 21 Aug 2018 04:06:56 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id x125-v6sm1786674wmg.27.2018.08.21.04.06.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Aug 2018 04:06:55 -0700 (PDT) From: Luca Boccassi To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com Date: Tue, 21 Aug 2018 12:06:49 +0100 Message-Id: <20180821110649.26711-1-bluca@debian.org> X-Mailer: git-send-email 2.18.0 Subject: [dpdk-dev] [PATCH] net/ixgbe: do not return internal code in rte_eth_dev_reset X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In case of a temporary failure the ixgbe driver can return the internal error IXGBE_ERR_RESET_FAILED to the application. Instead, return -EAGAIN as per the public API specification. Signed-off-by: Luca Boccassi Acked-by: Konstantin Ananyev --- drivers/net/ixgbe/base/ixgbe_vf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ixgbe/base/ixgbe_vf.c b/drivers/net/ixgbe/base/ixgbe_vf.c index 5b25a6b4d4..62f2bf2e7d 100644 --- a/drivers/net/ixgbe/base/ixgbe_vf.c +++ b/drivers/net/ixgbe/base/ixgbe_vf.c @@ -203,8 +203,13 @@ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw) usec_delay(5); } + /* + * This error code will be propagated to the app by rte_eth_dev_reset, + * so use a public error code rather than the internal-only + * IXGBE_ERR_RESET_FAILED + */ if (!timeout) - return IXGBE_ERR_RESET_FAILED; + return -EAGAIN; /* Reset VF registers to initial values */ ixgbe_virt_clr_reg(hw);