From patchwork Fri Mar 3 21:34:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fenghua Yu X-Patchwork-Id: 13159514 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A656C7EE32 for ; Fri, 3 Mar 2023 21:34:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231812AbjCCVeY (ORCPT ); Fri, 3 Mar 2023 16:34:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231795AbjCCVeX (ORCPT ); Fri, 3 Mar 2023 16:34:23 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D83471027A; Fri, 3 Mar 2023 13:34:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677879261; x=1709415261; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UJz0pCiqK7oMKPy2pp6vBg4X2Osf4pLe4Lvm2wE5zaA=; b=J7pP2euV83o+8BV2QpNzhbRLhOUGLdRZDgyWFZfVwfBKbySHAbnSVDYZ FWozGu08KrvdK3TPxHx/0v7Aj1IqS9itYC36B2kFs/f0H5ppWa7JCFKTk 7GIGcDXqD+t106fd3ytNm7F/LZKF+aO5wSNKygAxodJ72cF05jqVx3U9o 9r8guOy12CvFjXwiU4Zj0s+9gcWsUMNBzDOrjAkr5NOovzpWhiTwCuOoD M+xzTrG9HFNg998N6l89sFp9h7MCHKoA+TIjfOlLVOyKVuAe36pooIgjm QBM9qtp0CQFuNzc9SICNsrEWJOsFaZ4xxMzCBTipQlYjBdhXwmyvlELxF A==; X-IronPort-AV: E=McAfee;i="6500,9779,10638"; a="399976469" X-IronPort-AV: E=Sophos;i="5.98,231,1673942400"; d="scan'208";a="399976469" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 13:34:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10638"; a="675508701" X-IronPort-AV: E=Sophos;i="5.98,231,1673942400"; d="scan'208";a="675508701" Received: from fyu1.sc.intel.com ([172.25.103.126]) by orsmga002.jf.intel.com with ESMTP; 03 Mar 2023 13:34:19 -0800 From: Fenghua Yu To: "Vinod Koul" , "Dave Jiang" Cc: dmaengine@vger.kernel.org, "linux-kernel" , Fenghua Yu Subject: [PATCH v2 2/3] dmaengine: idxd: Add descriptor definitions for DIX generate operation Date: Fri, 3 Mar 2023 13:34:12 -0800 Message-Id: <20230303213413.3357431-3-fenghua.yu@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230303213413.3357431-1-fenghua.yu@intel.com> References: <20230303213413.3357431-1-fenghua.yu@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org The Data Integrity Extension (DIX) generate operation (0x17) computes the Data Integrity Field (DIF) on the source data and writes only the computed DIF for each source block to the PI destination address. Add descriptor definitions for this operation so that user can use DSA to accelerate DIX generate operation. Signed-off-by: Fenghua Yu Reviewed-by: Dave Jiang --- include/uapi/linux/idxd.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/uapi/linux/idxd.h b/include/uapi/linux/idxd.h index c43d7df5fc15..4c12e93a6aa6 100644 --- a/include/uapi/linux/idxd.h +++ b/include/uapi/linux/idxd.h @@ -78,6 +78,7 @@ enum dsa_opcode { DSA_OPCODE_DIF_INS, DSA_OPCODE_DIF_STRP, DSA_OPCODE_DIF_UPDT, + DSA_OPCODE_DIX_GEN = 0x17, DSA_OPCODE_CFLUSH = 0x20, }; @@ -248,6 +249,17 @@ struct dsa_hw_desc { /* Fill */ uint64_t pattern_upper; + /* DIX generate */ + struct { + uint8_t dix_gen_res; + uint8_t dest_dif_flags; + uint8_t dif_flags; + uint8_t dix_gen_res2[13]; + uint32_t ref_tag_seed; + uint16_t app_tag_mask; + uint16_t app_tag_seed; + }; + uint8_t op_specific[24]; }; } __attribute__((packed)); @@ -326,6 +338,14 @@ struct dsa_completion_record { uint16_t dif_upd_dest_app_tag; }; + /* DIX generate */ + struct { + uint64_t dix_gen_res; + uint32_t dix_ref_tag; + uint16_t dix_app_tag_mask; + uint16_t dix_app_tag; + }; + uint8_t op_specific[16]; }; } __attribute__((packed));