From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4E928454EF; Tue, 25 Jun 2024 13:17:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF03242DCE; Tue, 25 Jun 2024 13:15:51 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id D2E9B427C7 for ; Tue, 25 Jun 2024 13:15:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314131; x=1750850131; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OfCmHoWp+lo+Z6StGu15vcL7qnXRrx5WIOkyYCjvFeo=; b=jgSLlV/2e6CSrEaI9xFktcwWymhpFY9PVity4m5uGPMF828tjfVmZFd6 EtugCpitS+XHSRO0gvFyHU0tshvxk88wil4bG5w0/n71eayklstUy0mlc BxwYVFEVFSTAF3Iiq5PvRymFoHxxO+GBsqUOAKVwybC7ubkBGmuVY/TqG 7N+TQJi85KiguVUDPAMJgDEExLvPrj4k8UB+AmBnqctF99Qm+AZY3kDNT u/cuqVYie1mxvTFsKiRFexmKrciyArrA+xSLB3E+glsjtklSIdh8/v4Ev 381LmWqHW1sgbJOTpkK8jIEYx5ltEHtmGEATpkX9DYog0BrbJEKAkBFtI Q==; X-CSE-ConnectionGUID: dMSz5NDXRRqjx636Ll5GOQ== X-CSE-MsgGUID: PaeyLj74Sh+KYtmpL22cIQ== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080104" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080104" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:15:30 -0700 X-CSE-ConnectionGUID: wP5qKX5CQd+JXD5RGnsWsg== X-CSE-MsgGUID: QCT7hJBQQvOQuOmJZVhE4g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43719002" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:15:30 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Grzegorz Nitka , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 019/129] net/ice/base: improve find recipe routine Date: Tue, 25 Jun 2024 12:12:24 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Grzegorz Nitka Return error if there were no recipes found. Signed-off-by: Grzegorz Nitka Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_switch.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 7f4a7f68de..7528d35ca7 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -2457,6 +2457,11 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid, if (status) goto err_unroll; + if (!num_recps) { + status = ICE_ERR_PARAM; + goto err_unroll; + } + /* Get recipe to profile map so that we can get the fv from lkups that * we read for a recipe from FW. Since we want to minimize the number of * times we make this FW call, just make one call and cache the copy -- 2.43.0