From patchwork Sat Oct 8 14:06:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 117661 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 50FB0A0542; Sat, 8 Oct 2022 07:56:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0866D40146; Sat, 8 Oct 2022 07:56:00 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 0B52940042 for ; Sat, 8 Oct 2022 07:55:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665208559; x=1696744559; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d2ShyrH5VXQaj3fHQ1pYUw6SpynIbXkuBCfyDWOJo7E=; b=Jd/boeQ+chYaAGKfetXo+UIsq/pPPYwf16S/G9hTo+MY5y757++rZZZO hIn/GrVKmV5BIUX/+FZMJhngtLbZ5j6Rdjpj3N0GvX2BwehrZ/hCSsiR4 ev9JbGV4Vi7a/UPqdRNIEqcrzdFgXQVOGVsTVuVC5e3qd8psTu1lW8jCo fcuiWmIEZL8wNYdD6nMCVlmirOawIybQHrx1HQfZgC0U9RWzlJjwm4VnB d8nnff17h6isYtMomrtB/yfqP6OgZyfgu3sT9HgR5wt2xBSOzsf3PaMAj UAnEmGtWYmjXvGyJONH74jW2t3gVTUxstjEZTECV0lZPDZ2WWvzSR3VGl g==; X-IronPort-AV: E=McAfee;i="6500,9779,10493"; a="284273142" X-IronPort-AV: E=Sophos;i="5.95,168,1661842800"; d="scan'208";a="284273142" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2022 22:55:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10493"; a="603122475" X-IronPort-AV: E=Sophos;i="5.95,168,1661842800"; d="scan'208";a="603122475" Received: from dpdk-qzhan15-test02.sh.intel.com ([10.67.115.4]) by orsmga006.jf.intel.com with ESMTP; 07 Oct 2022 22:55:56 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, Qi Zhang Subject: [PATCH v2] net/ice: fix DDP package init Date: Sat, 8 Oct 2022 10:06:29 -0400 Message-Id: <20221008140629.355646-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220907120603.169681-1-qi.z.zhang@intel.com> References: <20220907120603.169681-1-qi.z.zhang@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org ICE_DDP_PKG_SAME_VERSION_ALREADY_LOADED and ICE_DDP_PKG_COMPATIBLE_ALREADY_LOADED should not be treated as a DDP package init failure. Use ice_is_init_pkg_successful to check return value of ice_copy_and_init_pkg. Signed-off-by: Qi Zhang Tested-by: Zhimin Huang --- v2: - fix error from ice_copy_and_init_pkg not be esculated. drivers/net/ice/ice_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 8aa37722c3..6e21c38152 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -1841,17 +1841,17 @@ int ice_load_pkg(struct ice_adapter *adapter, bool use_dsn, uint64_t dsn) PMD_INIT_LOG(DEBUG, "DDP package name: %s", pkg_file); err = ice_copy_and_init_pkg(hw, buf, bufsz); - if (err) { + if (!ice_is_init_pkg_successful(err)) { PMD_INIT_LOG(ERR, "ice_copy_and_init_hw failed: %d\n", err); - goto out; + free(buf); + return -1; } /* store the loaded pkg type info */ adapter->active_pkg_type = ice_load_pkg_type(hw); -out: free(buf); - return err; + return 0; } static void