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 4BFA94584B; Thu, 22 Aug 2024 21:49:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56E6342FE1; Thu, 22 Aug 2024 21:48:37 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by mails.dpdk.org (Postfix) with ESMTP id EFA1C42FD7 for ; Thu, 22 Aug 2024 21:48:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724356116; x=1755892116; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XaLM4bxvHc6aV3/5zDDeMTIoZ5nqIsy8JoLzI8dwADo=; b=L6Q5AZAQC808d2CRkqch3U3FxSbSTqqmwE8OT4bH35nCswtZ9tvcKUBa JgZiZx/cE2AAKebBZkh29KOqXEfv2XVe1SWezqYTQBN/6vdU0fIy1+f9k W+vRr+Zi6sIP+yJ/n3x36O8WjP3kQeog+Pjdpyk0zGz5wQGpVWi53SS3G oG0XZWzy2CsdkEFDcDgiiR899UhMvU+O5GG4mXMEurbLSMgL0Gkii748f yLZUQGjKy1xZfXT0LXd9dhyCXynrZqKZJDDviFSztGikLPrDkB8zGTXJM Pl00WQEH6LzH6GUsjpeR555PNX9mpovR/SWALqm8TE8dKh6Xcwwj8tMDL g==; X-CSE-ConnectionGUID: T71xxillQZucO2vX7bWkgA== X-CSE-MsgGUID: K/bG45YfTxyScqgIQ9anRw== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="22979701" X-IronPort-AV: E=Sophos;i="6.10,168,1719903600"; d="scan'208";a="22979701" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 12:48:35 -0700 X-CSE-ConnectionGUID: mukXzoYgS3arBCCkmPIvpw== X-CSE-MsgGUID: pe/kRxyyRtCP3mzTf6KMJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,168,1719903600"; d="scan'208";a="92301481" Received: from unknown (HELO npf-hyd-clx-03..) ([10.145.170.182]) by orviesa002.jf.intel.com with ESMTP; 22 Aug 2024 12:48:33 -0700 From: Soumyadeep Hore To: bruce.richardson@intel.com, ian.stokes@intel.com, aman.deep.singh@intel.com Cc: dev@dpdk.org, shaiq.wani@intel.com Subject: [PATCH v2 10/12] net/ice: support optional flags in signature segment header Date: Thu, 22 Aug 2024 18:53:44 +0000 Message-ID: <20240822185346.221885-11-soumyadeep.hore@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240822185346.221885-1-soumyadeep.hore@intel.com> References: <20240822095612.216214-1-soumyadeep.hore@intel.com> <20240822185346.221885-1-soumyadeep.hore@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 An optional flag field has been added to the signature segment header. The flags field contains two flags, a valid flag, and a last segment flag that indicates whether the segment is the last segment that will be downloaded to firmware. If the flag field's valid bit is NOT set, then as was done before, assume that this is the last segment being downloaded. However, if the flag field's valid bit IS set, then use the last segment flag to determine if this segment is the last segment to download. Signed-off-by: Soumyadeep Hore --- drivers/net/ice/base/ice_ddp.c | 13 ++++++++++--- drivers/net/ice/base/ice_ddp.h | 5 ++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/base/ice_ddp.c b/drivers/net/ice/base/ice_ddp.c index d0c1cb9660..90aaa6b331 100644 --- a/drivers/net/ice/base/ice_ddp.c +++ b/drivers/net/ice/base/ice_ddp.c @@ -499,12 +499,13 @@ ice_download_pkg_sig_seg(struct ice_hw *hw, struct ice_sign_seg *seg) * @idx: segment index * @start: starting buffer * @count: buffer count + * @last_seg: last segment being downloaded * * Note: idx must reference a ICE segment */ static enum ice_ddp_state ice_download_pkg_config_seg(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, - u32 idx, u32 start, u32 count) + u32 idx, u32 start, u32 count, bool last_seg) { struct ice_buf_table *bufs; enum ice_ddp_state state; @@ -522,7 +523,7 @@ ice_download_pkg_config_seg(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, return ICE_DDP_PKG_ERR; state = ice_dwnld_cfg_bufs_no_lock(hw, bufs->buf_array, start, count, - true); + last_seg); return state; } @@ -541,9 +542,11 @@ ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, { enum ice_ddp_state state; struct ice_sign_seg *seg; + bool last_seg = true; u32 conf_idx; u32 start; u32 count; + u32 flags; seg = (struct ice_sign_seg *)ice_get_pkg_seg_by_idx(pkg_hdr, idx); if (!seg) { @@ -554,6 +557,10 @@ ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, conf_idx = LE32_TO_CPU(seg->signed_seg_idx); start = LE32_TO_CPU(seg->signed_buf_start); count = LE32_TO_CPU(seg->signed_buf_count); + flags = LE32_TO_CPU(seg->flags); + + if (flags & ICE_SIGN_SEG_FLAGS_VALID) + last_seg = !!(flags & ICE_SIGN_SEG_FLAGS_LAST); state = ice_download_pkg_sig_seg(hw, seg); if (state) @@ -568,7 +575,7 @@ ice_dwnld_sign_and_cfg_segs(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr, } state = ice_download_pkg_config_seg(hw, pkg_hdr, conf_idx, start, - count); + count, last_seg); exit: return state; diff --git a/drivers/net/ice/base/ice_ddp.h b/drivers/net/ice/base/ice_ddp.h index 5761920207..5512669f44 100644 --- a/drivers/net/ice/base/ice_ddp.h +++ b/drivers/net/ice/base/ice_ddp.h @@ -177,7 +177,10 @@ struct ice_sign_seg { __le32 signed_seg_idx; __le32 signed_buf_start; __le32 signed_buf_count; -#define ICE_SIGN_SEG_RESERVED_COUNT 44 +#define ICE_SIGN_SEG_FLAGS_VALID 0x80000000 +#define ICE_SIGN_SEG_FLAGS_LAST 0x00000001 + __le32 flags; +#define ICE_SIGN_SEG_RESERVED_COUNT 40 u8 reserved[ICE_SIGN_SEG_RESERVED_COUNT]; struct ice_buf_table buf_tbl; }; -- 2.43.0