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 AF67C4404F; Wed, 12 Jun 2024 17:09:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F5704278A; Wed, 12 Jun 2024 17:03:56 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id E384C4270A for ; Wed, 12 Jun 2024 17:03:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204633; x=1749740633; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8QjRm75lVhSGB0JKRTYHacmVPS4VlDN8KKpVMdt9eCM=; b=cuGiz4/Yk3sUcJ+Vk0NM7ukIkOQdQVVt2tb/Go1ymbJwO9n7MkDc+4Ri wYKKDB4LjSpF0xk3mBprMUrg6NyXX6pqoCNjABRJZQFnQTj/FsdURPvWf EaqW+u2jGz8Bkl2gy5QRLvTvYaPxIPCMoed7Zob4YU2abBKRJzL+6FY3R ymxlkbxlPdoDH5of6lID/qKyfI3LZGQt7cC8HTqnrgVOZv9KYA4SB3GNu kHK6gDdf9pNdU7vqbq+kDQ3JKv3GKSAaOP8VqB7TWEzBck05UOK7ROkHl jPMHIET3N1gMkkR7+8RqCoNbT2iVuj4ywsvNsypTjfIEa9aon53SMBOoN w==; X-CSE-ConnectionGUID: 2BA2nVfkTcWKUrhFGdNvYg== X-CSE-MsgGUID: n123o5VfSRSakLK7B5OrbQ== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459240" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459240" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:03:52 -0700 X-CSE-ConnectionGUID: 4A/EoW9DT6maODTmCeFqhw== X-CSE-MsgGUID: /pOwhN9OS1WQEve7lPoKfA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39924963" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:03:51 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Grzegorz Nitka Subject: [PATCH v2 022/148] net/ice/base: improve find recipe routine Date: Wed, 12 Jun 2024 16:00:16 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@intel.com> 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: Ian Stokes 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 448ec26fe2..db9b021035 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