From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 0029F5F25; Mon, 3 Sep 2018 16:18:21 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id n2-v6so835027wrw.7; Mon, 03 Sep 2018 07:18:21 -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:in-reply-to :references; bh=ca2qKxGKipcJ2eVnCk1qORo+KU4ie5LQ54i+2RXGy1c=; b=A6bvBS7UWgObbtXfVwR6SfptOjEB6MMR3Es2rsB+K8qTgBBD734cNIoPGea4qOxl95 soNW4QlzOzb+vz4xNx3rNKSGZJ+S0VaKu7jAcldIB/f0/Br+ZfVA1RJBMcXKGi4IlcrR e//tkeHH68hkIRkbXQJUtab96i/5VJonlUvCvD4Ely1rEe31kvHtCEBLifn0I3O5n+m2 cq9e1KEMux9v5iKkODluAPjIgI2oMekmxFESd73hdJ7EJTbISWzPMrJll+ZG/yoOBzUI iX57OyuSOo2Qav1kbvXwBcAb/ws5juek872/p6pjml+FQ7fJnR/a/Xeh5VxvYu0yOpGW cEbA== X-Gm-Message-State: APzg51DnMIWU32mqrBs5YCPdYHgvqAxu4V1TZKU/62JLyLu6EIVk8x0n sdhRYuH50EFhLAiVwS36Z1T8IrcC X-Google-Smtp-Source: ANB0VdZ2MYyfquLuP5G/LqGe1H+/QGeZE8c7fTv2cnb7PMHwwentHxngc6DWnIBk4jiSklOsNd5v0g== X-Received: by 2002:adf:e792:: with SMTP id n18-v6mr8153471wrm.136.1535984301111; Mon, 03 Sep 2018 07:18:21 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id w3-v6sm12956295wrn.16.2018.09.03.07.18.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 07:18:19 -0700 (PDT) From: Luca Boccassi To: dev@dpdk.org Cc: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, qi.z.zhang@intel.com, Luca Boccassi , stable@dpdk.org Date: Mon, 3 Sep 2018 15:18:11 +0100 Message-Id: <20180903141811.5893-1-bluca@debian.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180821110649.26711-1-bluca@debian.org> References: <20180821110649.26711-1-bluca@debian.org> Subject: [dpdk-dev] [PATCH v2] 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: , X-List-Received-Date: Mon, 03 Sep 2018 14:18:22 -0000 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. Fixes: cddaf87a1ecb ("lib: fix unused values") Cc: stable@dpdk.org Signed-off-by: Luca Boccassi --- v2: added fixes and cc: stable move change to eth_ixgbevf_dev_init from the base code drivers/net/ixgbe/ixgbe_ethdev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 26b192737f..eab9e2e7e6 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1619,7 +1619,12 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) */ if ((diag != IXGBE_SUCCESS) && (diag != IXGBE_ERR_INVALID_MAC_ADDR)) { PMD_INIT_LOG(ERR, "VF Initialization Failure: %d", diag); - return diag; + /* + * 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 + */ + return -EAGAIN; } /* negotiate mailbox API version to use with the PF. */ -- 2.18.0