From patchwork Tue Nov 8 00:39:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fenghua Yu X-Patchwork-Id: 16792 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2394811wru; Mon, 7 Nov 2022 16:44:35 -0800 (PST) X-Google-Smtp-Source: AMsMyM4vECa4GudEHkCOwqf3WQ2E9QZ0GtiANHyKbHM3aOm1B4KHO7XNJRyzrCH0FtbPgyc52g5t X-Received: by 2002:a17:907:31c4:b0:78d:9b2f:4e1a with SMTP id xf4-20020a17090731c400b0078d9b2f4e1amr49818390ejb.306.1667868275802; Mon, 07 Nov 2022 16:44:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667868275; cv=none; d=google.com; s=arc-20160816; b=MUh88Hy6fxnKgt0m6L8xluLg0PHxnH6E+I/NsZS9bo5riFlXqMTqAYtqz5YOHuTtZ/ ALTAh+Zc0Zdfc1UTQd32tpyDX8WNw9LqEN7DPv+VgXowRLMFyv/p08F2ANDKPI09IwHN 3WuXMO6jRqHlnfLeaCz8JrpyDDzFbAAvT5mtVR+UOONG+NeMydwiOJ1L6f69euGsmDe5 Kt52wC9M6gfkiKjk0iLCrS/WmRPE7u1m4tIWw6m5O9jwajY7EPwnx8iW0rgLdqmp4FkD jZEXngngTXLAsw8DUr114oEk78MOzmETzvYiQ4idLk349ALmUuOln6D1qU+/dgEL9z+F p0SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aFvGka0PKdo3oJZsxZ7wkmR1DYf8Rb2RR3flkJ5GJgQ=; b=JejxyIVh/XxZ9Fb91H7in5D5xOno71CpSkcJtT2VmU9QlW7cXpq0lBKpx0xtsoTAsC aEEtPFcZrx+ex1S8KeTkF42pibLYp+d+5CFi/xaj5toqXk0iGtCBjXqg3ETTa/O7Mr1u iub+jrA11ij8H6/sww4XQp4QxNMiS8z18iFTNJ0zPs8/fQQOn1hLhXjagcJ2ULtUbbXw I4IZqtCzqF7UwbymO7kFVzXxA6WEU39z1AD6dqobIb6EUtt3ay++S+7LmrtsrmE93MSN JXJ4W0NV9XdXRAUJzMPn8qCDWVio6lt6cfgNbrnDwGIY7ulfS+OtY4Frt+NL/P9h67A7 8PZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RX8Il+PB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc31-20020a170907169f00b00783698dd8b4si13380723ejc.722.2022.11.07.16.44.12; Mon, 07 Nov 2022 16:44:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RX8Il+PB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233098AbiKHAj6 (ORCPT + 99 others); Mon, 7 Nov 2022 19:39:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233035AbiKHAjx (ORCPT ); Mon, 7 Nov 2022 19:39:53 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB56713F9B; Mon, 7 Nov 2022 16:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667867992; x=1699403992; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t1uyAqwWGXeZJUcrnlaYpAGlOx/Hw9U2FxLGaHAypWw=; b=RX8Il+PBao4YtLS6+/FKZvboYM74UGCa0P1lWu5zOeLzNMsSTaGeC+ty 747vajoqW9iLe0vvgPd1jJ4Lopa0P3LKJO0W94oM6kEs5MYVczsIkG/Kc qhIJV5DRE8uRCH4Gyx3ryJ2qdXTkxAzDOn045VS8TH3Y5r5Cp37sIywXm nGn7EGccNVSKkaBsEUo8/Mz77AMdDE9+K5amQ1ZlphtVCtHUz1ztgoNiV zDgBvgBjB6aSmiqIDYQxF4mekjp2JXS1VHEJhtqYnujQNQ2cbf/bLsyZG Q+GhaopjKIJNzr/LXyunLYt6vtthTPTgsdzKHdFQ/yYmYKaqQSnIetiLc w==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="374833337" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="374833337" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 16:39:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="811041357" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="811041357" Received: from fyu1.sc.intel.com ([172.25.103.126]) by orsmga005.jf.intel.com with ESMTP; 07 Nov 2022 16:39:50 -0800 From: Fenghua Yu To: "Vinod Koul" , "Dave Jiang" Cc: dmaengine@vger.kernel.org, "linux-kernel" , Fenghua Yu Subject: [PATCH 3/3] dmaengine: idxd: Add descriptor definitions for translation fetch operation Date: Mon, 7 Nov 2022 16:39:44 -0800 Message-Id: <20221108003944.2095567-4-fenghua.yu@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20221108003944.2095567-1-fenghua.yu@intel.com> References: <20221108003944.2095567-1-fenghua.yu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748886645520287128?= X-GMAIL-MSGID: =?utf-8?q?1748886645520287128?= The translation fetch operation (0x0A) fetches address translations for the address range specified in the decriptor by issuing address translation (ATS) requests to the IOMMU. Add descriptor definitions for the operation so that user can use DSA to accelerate translation fetch. Signed-off-by: Fenghua Yu Reviewed-by: Dave Jiang --- include/uapi/linux/idxd.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/uapi/linux/idxd.h b/include/uapi/linux/idxd.h index 34294d99c1cb..9de48c561452 100644 --- a/include/uapi/linux/idxd.h +++ b/include/uapi/linux/idxd.h @@ -71,6 +71,7 @@ enum dsa_opcode { DSA_OPCODE_CR_DELTA, DSA_OPCODE_AP_DELTA, DSA_OPCODE_DUALCAST, + DSA_OPCODE_TRANSL_FETCH, DSA_OPCODE_CRCGEN = 0x10, DSA_OPCODE_COPY_CRC, DSA_OPCODE_DIF_CHECK, @@ -181,6 +182,7 @@ struct dsa_hw_desc { uint64_t pattern; uint64_t desc_list_addr; uint64_t pattern_lower; + uint64_t transl_fetch_addr; }; union { uint64_t dst_addr; @@ -191,6 +193,7 @@ struct dsa_hw_desc { union { uint32_t xfer_size; uint32_t desc_count; + uint32_t region_size; }; uint16_t int_handle; uint16_t rsvd1; @@ -250,6 +253,12 @@ struct dsa_hw_desc { uint64_t pattern_upper; }; + /* Translation fetch */ + struct { + uint64_t transl_fetch_res; + uint32_t region_stride; + }; + /* DIX generate */ struct { uint8_t dix_gen_res;