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 098B2A0547; Thu, 9 Sep 2021 13:24:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E49C04013F; Thu, 9 Sep 2021 13:24:51 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 561094003E for ; Thu, 9 Sep 2021 13:24:50 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10101"; a="284463435" X-IronPort-AV: E=Sophos;i="5.85,280,1624345200"; d="scan'208";a="284463435" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2021 04:24:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,280,1624345200"; d="scan'208";a="694077137" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga006.fm.intel.com with ESMTP; 09 Sep 2021 04:24:49 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 9 Sep 2021 04:24:48 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 9 Sep 2021 04:24:48 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.176) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 9 Sep 2021 04:24:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UjFciDvAwRwpY0Ti+MAmo5HlhxHLEHrD0mOfh9SCVeu2wvGSWDHWHMyo2gj+OJ9IRE3wKkSWCNeME7bMM5N2rRRmSrqUYitlIhDyEm6PpFs+7t/dk7kbEFlPGSV1ZopbLoEvju7GYR38vyno1q5MbO3wZRU5KD9GR+6Hsv7Fz/hwkTJmCvxQkaSLhZjiCfjhrD5jzFOzAkyl8om1pTT0v1W9vZjIKLB2iY/Za+xRvTQ5mP2FAX7Zmtov1VL1vuCf0LmGWQvxr022nSFJbjdHQDHiFU2G5NAPXUW/xitnULAHqB8nQyf6nEvRl/4mVnC71n06ag+DdxxA4ysd7DyqlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=+ErUf1n0Nxs6c4O3B4iB3YGfuQxZVX6w2hLh4RpVufQ=; b=PEFvfpRGfAXEI97b7T85hrb2Z/VcXmxgPFVFHJksDcmBnQHahbHNxPu6EssUes75UCpb/otvmjeDczOjKxHH1EQLAzI9SsrmtCirrw1pXEsIoKLsHWDNxq3/IhZ+gNd/9yWFdDcUYTZ39DgQq+4jMVeCezpRQLfLa5K2mAb0ngu4nNM1dp9sFp15yPtSm8yM4gu1l5Z16YoX8QkFnf4fAajTrpeF0ERRgc71kCNBII2x59L5ed8FJ0Evn4siEEJ7HEOtYH1pVFlntmI6UMCObP+FNI0HD+zfdbrq1stfSZ6b9VlcmBu7a5PUYZG8M8ezi2Fu0kUnbZFJFRy7ptUwCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+ErUf1n0Nxs6c4O3B4iB3YGfuQxZVX6w2hLh4RpVufQ=; b=o2AeCs2A+q65zIIpWj1VoE4sC9gc7m4IrNCQ4NV+BBzfBMQ0sjc/I+hqEJ0+h8xaueKeE4aXOjdK34ivWJ6dnCEOb6T2jPeDK7zDkQY13Qr6WAtgwhwLyQQ+NBeJoUHNkIehKf/CqzUmpIpCWPD6qaRyUL5XQUG2zwVnCE02sc4= Authentication-Results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; Received: from SA2PR11MB5210.namprd11.prod.outlook.com (2603:10b6:806:fa::23) by SN6PR11MB3487.namprd11.prod.outlook.com (2603:10b6:805:c3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Thu, 9 Sep 2021 11:24:43 +0000 Received: from SA2PR11MB5210.namprd11.prod.outlook.com ([fe80::e5f6:85a1:af0d:705e]) by SA2PR11MB5210.namprd11.prod.outlook.com ([fe80::e5f6:85a1:af0d:705e%7]) with mapi id 15.20.4500.017; Thu, 9 Sep 2021 11:24:43 +0000 To: Kevin Laatz , CC: , , References: <20210903105001.1179328-1-kevin.laatz@intel.com> <20210908103016.1661914-1-kevin.laatz@intel.com> <20210908103016.1661914-11-kevin.laatz@intel.com> From: Conor Walsh Message-ID: <0c30d486-5538-409c-cdb8-786bbfa11192@intel.com> Date: Thu, 9 Sep 2021 12:24:38 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <20210908103016.1661914-11-kevin.laatz@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-ClientProxiedBy: DU2PR04CA0088.eurprd04.prod.outlook.com (2603:10a6:10:232::33) To SA2PR11MB5210.namprd11.prod.outlook.com (2603:10b6:806:fa::23) MIME-Version: 1.0 Received: from [192.168.1.20] (109.79.8.55) by DU2PR04CA0088.eurprd04.prod.outlook.com (2603:10a6:10:232::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Thu, 9 Sep 2021 11:24:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25e0cd22-6c41-465d-2f4c-08d973846be0 X-MS-TrafficTypeDiagnostic: SN6PR11MB3487: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JAjx1G860EtLV+Wktsa0koaJP+/MC2O8oVPXS/NBgfbtGFZxFOpZhqIA8sKLKqdSIEY1abM45UDKdXhMMX2hcA09GoqX84rb+cRcEJprQBNuLIVr4Xqt5fr6dkcBGgXFIQNyAb/+IWJxWRKXDghnVqRGE5kAjsofD4lvuSc90pFoMEok12pz7wNj2dDdw7WHG2TaPKiHrFVyKTVhDR+FhngZIrWqxVQKszfrSn+nxeN38+ehTGDuN2pUDENZUmCk2hYavQ7BsFYXyIZeAuxVvEG3PgMAAQNoNyJ0KK/iC8iGQvkEpbfx5rruJ44YfdD0xuBhQ5DY1fo13SOfL9JIuFhKF8L2rVo2zTCJgAnnOt7GUCx1bCEY3D23PJS5le1IMKlmodijCFVAMWx5uL0tidWOXQGmdIU6iriLpS/E1vVdmDVCw7/2zDfslkkbnRylFLr5KWq1l1A5LhvXU5eDodXhtHjtd4SnKaPW7JIw3Hf203JfNq8ZSwFQN7uqR+uEXfPxU0cuG5DqmVZa7hgOKliq9whyv0MdLc06ucyIIBg62aTDGdKKEgFI1YF1skWZjlMi3VqfTGuM0ksD4LIkQ3iy+LTh6w8QDpVKDssoRjOSvUngrfEl9zQc6gbZId5n5nawdm7F08Y2npaSLHHgZPdtqPmT7gC3KKjKTmMTCL/BNRMKBP4oIbI7cdSskf96w+QG0eLQ15RKZ+msKKfrlyAwMixsVNdt0Zwt3Wwrvnw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR11MB5210.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(39860400002)(346002)(376002)(31696002)(8936002)(31686004)(44832011)(5660300002)(36756003)(316002)(16576012)(6486002)(8676002)(26005)(2906002)(956004)(2616005)(38100700002)(6666004)(4326008)(86362001)(478600001)(186003)(66476007)(66946007)(66556008)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RzRZK0pLL2ZyVTJkUkRJSXlHQnN4bDAzeUZPU3lEcnJVUnpqbkhtTllJWERs?= =?utf-8?B?VHppaDJVMUlub1MxenhVNWlST2FicW5jSlhwTnBZZE1PUVlwTXNzbFEwWnBK?= =?utf-8?B?TjdXcmttMzVUYjRnZ3N5QjhPQkFyNkk5a2Nva1ZzOGFNVy9wZ05jS2JZWXd5?= =?utf-8?B?VVlmSFlva29UQzlERVUrVFNWb3F4Sm05MFdYVFhIbGw1OTJhZFp4b24wM3RR?= =?utf-8?B?V3g1eUdoUmI3bjBhSmVBbTMvM0QyeTYrQkxyNjlrbGM1S0pwNVQxaTIxdTNF?= =?utf-8?B?THk3RTQ1VklmVENRL1FJV1ppdllreEhqdmtiQnhTbHU5MWJDSGxHN2NwSFU4?= =?utf-8?B?Qm4zNXAwa3ltby9COWJDemNNZllPUk1UOVI0VXN4MjhTemF0SkZHOE5yV2pw?= =?utf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tcVpZVnJWWVAzQm05?= =?utf-8?B?amR0ME1yTWZ0aHhicXVmSis1cmtPQVRqdlRLR0JqT3g5M1ZvWmV6am1JeUFx?= =?utf-8?B?QUdTdnMwME5tYkNiRjNsdjZmS2h2TklXblBqZ2VwMXVrbmFNWmJhbFp4L3Y3?= =?utf-8?B?NDRHcmtPT3YwZ0k3dHNHM0FrTlIzQzVITEYwc0kzZnFqVi9LTzZVZFFMQS9o?= =?utf-8?B?MjZ1SlIwTEV6RTVpRHBZVVdiL1hWNFhhbFh6TWFFaG1HOEhnbDhiUFo5YXgz?= =?utf-8?B?bmVtRGYyWlMzQ1IwVE13Q1lyUXIxbTNPSjM2UlRsVmZPbHZ5dHpBMktsQ21a?= =?utf-8?B?QUc3Vlh2QWdPSWJZN0tTRkMzS1prcVhNdlhUUDBTNEU5S3hwcm9WY0pnVGl4?= =?utf-8?B?ckY3OEZjTUxxbDE1d0tkTnZWaVR2N0dtQ2pKWG9LdDJUcmhJYVR1NjljV2Zy?= =?utf-8?Q?oqAT10gnUF4IzBzHazS6F01iH+cQ8WK44UdDxTx?= X-MS-Exchange-CrossTenant-Network-Message-Id: 25e0cd22-6c41-465d-2f4c-08d973846be0 X-MS-Exchange-CrossTenant-AuthSource: SA2PR11MB5210.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2021 11:24:43.2994 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lDcXb+UWbOXzRKaecUP4LVESINO3zf3yKRSX2bF0gkU0VUYdOO2OvGXwNKQCp7Fd2Z0nq/9MnAJUb2cbvxZbqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3487 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 10/17] dma/idxd: add data-path job submission functions 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 Sender: "dev" > Add data path functions for enqueuing and submitting operations to DSA > devices. > > Signed-off-by: Bruce Richardson > Signed-off-by: Kevin Laatz > +static __rte_always_inline int > +__idxd_write_desc(struct rte_dmadev *dev, > + const uint32_t op_flags, > + const rte_iova_t src, > + const rte_iova_t dst, > + const uint32_t size, > + const uint32_t flags) > +{ > + struct idxd_dmadev *idxd = dev->dev_private; > + uint16_t mask = idxd->desc_ring_mask; > + uint16_t job_id = idxd->batch_start + idxd->batch_size; > + /* we never wrap batches, so we only mask the start and allow start+size to overflow */ > + uint16_t write_idx = (idxd->batch_start & mask) + idxd->batch_size; > + > + /* first check batch ring space then desc ring space */ > + if ((idxd->batch_idx_read == 0 && idxd->batch_idx_write == idxd->max_batches) || > + idxd->batch_idx_write + 1 == idxd->batch_idx_read) > + goto failed; > + if (((write_idx + 1) & mask) == (idxd->ids_returned & mask)) > + goto failed; > + > + /* write desc. Note: descriptors don't wrap, but the completion address does */ > + const uint64_t op_flags64 = (uint64_t)(op_flags | IDXD_FLAG_COMPLETION_ADDR_VALID) << 32; > + const uint64_t comp_addr = __desc_idx_to_iova(idxd, write_idx & mask); > + _mm256_store_si256((void *)&idxd->desc_ring[write_idx], > + _mm256_set_epi64x(dst, src, comp_addr, op_flags64)); > + _mm256_store_si256((void *)&idxd->desc_ring[write_idx].size, > + _mm256_set_epi64x(0, 0, 0, size)); > + > + idxd->batch_size++; > + > + rte_prefetch0_write(&idxd->desc_ring[write_idx + 1]); > + > + if (flags & RTE_DMA_OP_FLAG_SUBMIT) > + __submit(idxd); > + > + return job_id; > + > +failed: > + return -1; > +} If the failed goto just returns -1 it would probably be better to remove it and just return -1 in the 2 spots above. Reviewed-by: Conor Walsh