From patchwork Fri Oct 18 14:17:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Przemek Kitszel X-Patchwork-Id: 1999193 X-Patchwork-Delegate: anthony.l.nguyen@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=xg00/yao; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XVRdZ3Mxbz1xth for ; Sat, 19 Oct 2024 01:18:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C314260B1F; Fri, 18 Oct 2024 14:18:40 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id FWniVBsbm46G; Fri, 18 Oct 2024 14:18:39 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E2A1A60AF1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1729261118; bh=EZH1BzP10Wdn25V9YJY/LJpAafYEgeZxOcxskj0tPWI=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=xg00/yao1JZ9nzhdsIEeN5ZX8dYhPIJmHsVf9Ao1m/MLwOE4V4Wpp4E0yi+9aUAQF 1csgr2OHSRhf3gXUiZxTOKenH9Q8arJv39GdaZ9pIZeDaAYrXUaj7yUB7uoZDuLuA3 ZcmtlPF7ozRdr7scF+8ceRDbBekwwnlOin4l8A87mnTckmuRGDwQziV0G65jSpm55c AHuN8o38uDlm9IPIoHB+xxQEZF6Mfsyf2xnlBI7waybU+jd3fI9UUOca7wGS/UR1mU +aviSnwUOmDEXEqt6+MSVxeCD/FLqtHY6SeLPppJW1tXF3WV3v4LahC84uQqGjIVnu RA93Jj0r9NNCA== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id E2A1A60AF1; Fri, 18 Oct 2024 14:18:38 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists1.osuosl.org (Postfix) with ESMTP id 913982804 for ; Fri, 18 Oct 2024 14:18:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7FB9E408E3 for ; Fri, 18 Oct 2024 14:18:35 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id NMu_Kt9WCfGA for ; Fri, 18 Oct 2024 14:18:34 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.8; helo=mgamail.intel.com; envelope-from=przemyslaw.kitszel@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 78100408E5 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 78100408E5 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by smtp4.osuosl.org (Postfix) with ESMTPS id 78100408E5 for ; Fri, 18 Oct 2024 14:18:34 +0000 (UTC) X-CSE-ConnectionGUID: U8LcHfCWR+ixtWLtxr8w0A== X-CSE-MsgGUID: tD/d1K0PROWkygsBnWemiw== X-IronPort-AV: E=McAfee;i="6700,10204,11229"; a="46293166" X-IronPort-AV: E=Sophos;i="6.11,213,1725346800"; d="scan'208";a="46293166" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2024 07:18:34 -0700 X-CSE-ConnectionGUID: XzIAdjJ4QiCcmKcyoKoefw== X-CSE-MsgGUID: G++cKWF7ROSHu7a6XlkMzg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,213,1725346800"; d="scan'208";a="78929748" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by fmviesa008.fm.intel.com with ESMTP; 18 Oct 2024 07:18:32 -0700 Received: from pkitszel-desk.tendawifi.com (unknown [10.245.246.186]) by irvmail002.ir.intel.com (Postfix) with ESMTP id DE4FC2FC66; Fri, 18 Oct 2024 15:18:29 +0100 (IST) From: Przemek Kitszel To: intel-wired-lan@lists.osuosl.org, Tony Nguyen Cc: netdev@vger.kernel.org, Jacob Keller , Przemek Kitszel , Paul Greenwalt , Ahmed Zaki , Dan Nowlin , Michal Swiatkowski , Pucha Himasekhar Reddy Date: Fri, 18 Oct 2024 16:17:37 +0200 Message-ID: <20241018141823.178918-6-przemyslaw.kitszel@intel.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20241018141823.178918-4-przemyslaw.kitszel@intel.com> References: <20241018141823.178918-4-przemyslaw.kitszel@intel.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1729261114; x=1760797114; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YwRF5hN8LiWMHJW+vgahFBnhO7gtBweNzskldU/Lyg4=; b=h9oEkOTRDlqWVG0R3+t/5SsY69017EI90fBbQJSJYpqBGYJua2XtuX28 VCVfOMOBE73xAPCgPmHCUGu2InzhOXAqmqbKsV2gtvQNSHjM4NuFcIxN/ tRv6DaoKNMH5Ygc9n29WRR2lXGb7R73eokZiFRfXYQdKAJn254NKupr5h a8I4W358kbsmb2V/ToqJMPJre4HozkZ6Ai4LxON7yzPIyCzA+va14PInm wsx9rG84KUw1KP7KDvdNoNg1rQyXMOj1nujWi4DHwovl0bc0gK6GI+8RV xa8lQam4fsjFlyMeIfqOZqaCVYK7HHBk/O1z5lkCklKPI4NgrbJvYT28A w==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=h9oEkOTR Subject: [Intel-wired-lan] [PATCH iwl-next v3 2/2] ice: support optional flags in signature segment header X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" An optional flag field has been added to the signature segment header. The field contains two flags, a "valid" bit, and a "last segment" bit that indicates whether the segment is the last segment that will be sent 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: Paul Greenwalt Signed-off-by: Ahmed Zaki Co-developed-by: Dan Nowlin Signed-off-by: Dan Nowlin Reviewed-by: Michal Swiatkowski Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Przemek Kitszel Reviewed-by: Simon Horman --- v2: co/- authorship change --- drivers/net/ethernet/intel/ice/ice_ddp.h | 5 ++++- drivers/net/ethernet/intel/ice/ice_ddp.c | 21 +++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ddp.h b/drivers/net/ethernet/intel/ice/ice_ddp.h index 79551da2a4b0..8a2d57fc5dae 100644 --- a/drivers/net/ethernet/intel/ice/ice_ddp.h +++ b/drivers/net/ethernet/intel/ice/ice_ddp.h @@ -181,7 +181,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; }; diff --git a/drivers/net/ethernet/intel/ice/ice_ddp.c b/drivers/net/ethernet/intel/ice/ice_ddp.c index 3e1173ef4b5c..5a70854b0ca2 100644 --- a/drivers/net/ethernet/intel/ice/ice_ddp.c +++ b/drivers/net/ethernet/intel/ice/ice_ddp.c @@ -1438,23 +1438,27 @@ ice_download_pkg_config_seg(struct ice_ddp_send_ctx *ctx, return ice_dwnld_cfg_bufs_no_lock(ctx, bufs->buf_array, start, count); } +static bool ice_is_last_sign_seg(u32 flags) +{ + return !(flags & ICE_SIGN_SEG_FLAGS_VALID) /* behavior prior to valid */ + || (flags & ICE_SIGN_SEG_FLAGS_LAST); +} + /** * ice_dwnld_sign_and_cfg_segs - download a signing segment and config segment * @ctx: context of the current buffers section to send * @pkg_hdr: pointer to package header * @idx: segment index (must be a signature segment) * * Note: idx must reference a signature segment */ static enum ice_ddp_state ice_dwnld_sign_and_cfg_segs(struct ice_ddp_send_ctx *ctx, struct ice_pkg_hdr *pkg_hdr, u32 idx) { + u32 conf_idx, start, count, flags; enum ice_ddp_state state; struct ice_sign_seg *seg; - u32 conf_idx; - u32 start; - u32 count; seg = (struct ice_sign_seg *)ice_get_pkg_seg_by_idx(pkg_hdr, idx); if (!seg) { @@ -1473,6 +1477,13 @@ ice_dwnld_sign_and_cfg_segs(struct ice_ddp_send_ctx *ctx, state = ice_download_pkg_config_seg(ctx, pkg_hdr, conf_idx, start, count); + + /* finish up by sending last hunk with "last" flag set if requested by + * DDP content */ + flags = le32_to_cpu(seg->flags); + if (ice_is_last_sign_seg(flags)) + state = ice_ddp_send_hunk(ctx, NULL); + return state; } @@ -1548,9 +1559,7 @@ ice_download_pkg_with_sig_seg(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr) hw->pkg_sign_type)) continue; - ice_dwnld_sign_and_cfg_segs(&ctx, pkg_hdr, i); - /* finish up by sending last hunk with "last" flag set */ - state = ice_ddp_send_hunk(&ctx, NULL); + state = ice_dwnld_sign_and_cfg_segs(&ctx, pkg_hdr, i); if (state) break; }