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 C24B0A0C41; Wed, 15 Sep 2021 15:52:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7CA4B4014F; Wed, 15 Sep 2021 15:52:10 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 4BA734003C for ; Wed, 15 Sep 2021 15:52:08 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10107"; a="222364789" X-IronPort-AV: E=Sophos;i="5.85,295,1624345200"; d="scan'208";a="222364789" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2021 06:52:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,295,1624345200"; d="scan'208";a="698307480" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga006.fm.intel.com with ESMTP; 15 Sep 2021 06:52:06 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 15 Sep 2021 06:52:06 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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; Wed, 15 Sep 2021 06:52:06 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 15 Sep 2021 06:52:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rhs7OjKa1DzjL0J+Tal8zQxjdD+GaUjL6eqK5m3mJKCe0TbJ++S5J8Ncft/CyRbA/CZ2lb7WRDLbXmZZDWVWOceQ5zUNU/2NhV5V2og2JhmO7FoHihhrgdRj0mkSCcyn2NqYvTAVI77b4LqtiIoWPy4nsCcxDWs5dzHnN11zEgUSv8EKlCsDYZrW7Qki24PIG+tfKQn0DormwxhzlStLh3rTIUSqq/pN9jY+lFoSlEshtWqwQN9w8iZGmaccbr+cvA/WOpmhM5Z+v0PKf3Rqg9a5RgV8bO+3aPBiggwU5y9e/xOsYIg+Eh8Wa94NSVPTVMP/nBpHuq0jaqyJYGw3fw== 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=5pL09bKaX7hd1IJZ+DGOZduOEhgmmvr18PcMDC8mEJA=; b=DQ45XnnJg8q6CJEYAK+EkNXI2V3eReH8RYahrFBlGCjSI3Py2POkrZX6lQXf6qRq+JCAps5J1eMQqGJTJBueVeKr14jcurAqOjUVZnxUGgtTroomBNX44D2UGUvcidxI/Kca3FQjVc5UXKImFbksfY1a9A+9QbizWJN/uFuyR/Y1Vk1tFRfYJpk+9HCd5SJWfaPlR0/mgpisOoOyWk1x04DLwFJeDJYJ9JfyrfeQHqkaIONbBKK0mdAHuOfjyGg+wLCagi5XPeYO73hTO6DXbnsFnRI5kaKl7pagyoXdI+Ofcl2VLVOpV9traouJykDItnSEhQ5tKcPUpl3kP9T2bQ== 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=5pL09bKaX7hd1IJZ+DGOZduOEhgmmvr18PcMDC8mEJA=; b=YI64Se0Z4r5+ZV4yN5A++chvEuDt5p3uUjOrVB5IQxH2+qJnTkMxh3ps50XP6X669WUBXSbNKprLN1vMXlwu1BBX5lsqZCFy93s4Y30E0ihlo37Z36QamB1gUFX0rxLJFkff6+5ba+N1wjxCaaOuVcPUtgi6N20OvQXL+EYA8RU= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from SJ0PR11MB5055.namprd11.prod.outlook.com (2603:10b6:a03:2d9::10) by SJ0PR11MB4893.namprd11.prod.outlook.com (2603:10b6:a03:2ac::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Wed, 15 Sep 2021 13:52:02 +0000 Received: from SJ0PR11MB5055.namprd11.prod.outlook.com ([fe80::78d4:6f82:aa87:c271]) by SJ0PR11MB5055.namprd11.prod.outlook.com ([fe80::78d4:6f82:aa87:c271%7]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 13:52:02 +0000 To: Chengwen Feng , , , , , , CC: , , , , , , , , , , References: <1625231891-2963-1-git-send-email-fengchengwen@huawei.com> <20210907125649.49794-1-fengchengwen@huawei.com> <20210907125649.49794-5-fengchengwen@huawei.com> From: Kevin Laatz Message-ID: Date: Wed, 15 Sep 2021 14:51:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: <20210907125649.49794-5-fengchengwen@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-ClientProxiedBy: DB8PR04CA0030.eurprd04.prod.outlook.com (2603:10a6:10:110::40) To SJ0PR11MB5055.namprd11.prod.outlook.com (2603:10b6:a03:2d9::10) MIME-Version: 1.0 Received: from [192.168.1.15] (109.76.76.227) by DB8PR04CA0030.eurprd04.prod.outlook.com (2603:10a6:10:110::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Wed, 15 Sep 2021 13:51:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2a96f994-9e82-4312-1012-08d9784ffe83 X-MS-TrafficTypeDiagnostic: SJ0PR11MB4893: 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:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k3LWozDNBsSxY08fwzmm3QYrxkJmd+dq4FBImYPrr+BX3k/BUqRf2SgizGPBf2vC2T+HpggVS31T0QdyJF/nigNOgM4a0aO13a42cinexgk2adRCuSEBcD3rPR4NlsycFQShHVttOwxMPNYvqJqo1IBbqsON+z3Z1+UODW/8F5luJFCOQWeum8lij0sFMDD40w8T56mkDA0ns1TYsfcpUPw1oChlo5Rfgbn8SsR7M1ofd4fYjRqmEJ4JGdHQTVIZULRl+pQuAmsy4d9zJPtUyTyWZvvGAWjjFjPqcWoSo3JAYPyX5nDYvUpCT2ch5k2t79JKVPURFHmZ8KIRMBbFtXfMeZ/AfelRFzbQT9cinZKC+OxJmV21jd5X/4PVp00l5R0Sb4y/KBLmjche5DuWW98DTGNi3teURO2uXKYXMvepaXB6+yNRxdgbKvjYqXs6IcViQtP87x7ionOGRwBrjzbm6dZxQSoOXZwiZ6HTqrzu3FUykAKroNKYBNIf/5MuzVgDbxhf0VpKLHcv4gMYIl39Fanc4E+Zf5cZrN4zU0cjEJWm6zcOmqc7/xUlNqHoFUy7K+2WUxq4Qv/xxKK6ZR2Aw3fcaJ2CaVsSdq2NR4GNDx2/2euj7c9G0wTh9mgD0bwd1dXduvlxh94/eRMTcmqD18u6JHRsjtUHOfKhFQlWEi2VPinuW2ZgaAurN0ubyXafz4DR1I38R/v5CYRAZwmHT0Ujo5lDQomdy2fk3K8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5055.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(136003)(366004)(376002)(396003)(346002)(8936002)(2616005)(956004)(38100700002)(7416002)(86362001)(66946007)(4326008)(31696002)(44832011)(5660300002)(6486002)(8676002)(316002)(2906002)(107886003)(478600001)(6666004)(186003)(16576012)(31686004)(66574015)(66476007)(83380400001)(66556008)(53546011)(36756003)(26005)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UGs0UkMzRGx3VDNScFdJM0FQb3BpRWw1R2RaL09YV0l3K3NmbjNZUzl2UERT?= =?utf-8?B?RVl2cjJCZ1d5K2xhakphYjcxY255YVVlK0prcXZxZnFuZlJ6Nm1YdzFXOFlr?= =?utf-8?B?cCt0THg0RStGWk81c0xOTGZPbDRGRm9TYVROQVIxUG5BeG1BbC9CUTBYZ25B?= =?utf-8?B?TkVoejhSbGxDc1gyTjZ3UU9hWUtsSVRlNVpSb29wRGdXU3BGY0kwNDZYL3lZ?= =?utf-8?B?U0t5c1hTSTdRait1TnlsT1c3TTJHTjVma3F3VStnVitTMUVlUWozKzltUWJS?= =?utf-8?B?d2xpMlZOOERMNnJNYWJtNzNCZGd2cEtwaWt4VkZyb3oyWTlzZ2lHSDYxLzU0?= =?utf-8?B?d0F1bzRFOEt4QStiQjRvWjVzSy9sSCtOanFvNXh2ZVBYVHlSQWF6UmlhbDQ2?= =?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3MUU4dWxuMENjekJ1?= =?utf-8?B?QjloWkRWQmVqajE0U29HaExFeWg3YXhPb2dUaUw5b2FReDZsMVVvRmxCZlFl?= =?utf-8?B?bVhVSENwbFNwdDQ4V0ZLc2VDS3FSVWtaOXhzNHh6TnRmZzVIZzJ4VndFN21S?= =?utf-8?B?OFVNTmRvNHBuZUJEbGs2N2ZmOVRXVzFJTXZUTFhud3o2RmJ3MkVOQzZaRFQz?= =?utf-8?B?b3c5cGdWWGQzd0hSTmUvNDRsWFovYldTZEdtcDhYcjlpVE5BeFRpV0ZiZ0lM?= =?utf-8?B?NHoxU1QrdlcrYy9MY0Q4ajJZUW5MK2g1UWNpWldDUHM3WjMzbU1HMWlGdDJy?= =?utf-8?B?bHcvY2cyZkV2NC9HY0NFZFdSbFJxTGErMzYvblYyZ21GemNFUy9QbUdJRm9t?= =?utf-8?B?bkJZOVVKdVlFV0NKR2NSSXY5cXhaRTNpa2dnMnQ0Q2RZRENKdGFSUXBaNzRq?= =?utf-8?Q?4RKOnN91kNvj5iueLU7gSq6DeNrmDGkkYlXaoA2?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2a96f994-9e82-4312-1012-08d9784ffe83 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5055.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 13:52:01.9289 (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: rN1loFkscRJMsaW8ubUkqE1NrlT5jM8LW9/5k5IsHjYk8JJyfG+J7ZXoThSE1OO3NWDJP0a+VXgHh8BXFQe70A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4893 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v21 4/7] dmadev: introduce DMA device library implementation 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" On 07/09/2021 13:56, Chengwen Feng wrote: > This patch introduce DMA device library implementation which includes > configuration and I/O with the DMA devices. > > Signed-off-by: Chengwen Feng > Acked-by: Bruce Richardson > Acked-by: Morten Brørup > Reviewed-by: Kevin Laatz > Reviewed-by: Conor Walsh > --- > config/rte_config.h | 3 + > lib/dmadev/meson.build | 1 + > lib/dmadev/rte_dmadev.c | 607 +++++++++++++++++++++++++++++++++++ > lib/dmadev/rte_dmadev.h | 118 ++++++- > lib/dmadev/rte_dmadev_core.h | 2 + > lib/dmadev/version.map | 1 + > 6 files changed, 720 insertions(+), 12 deletions(-) > create mode 100644 lib/dmadev/rte_dmadev.c > [snip] > /** > * @warning > @@ -941,10 +1018,27 @@ rte_dmadev_completed(uint16_t dev_id, uint16_t vchan, const uint16_t nb_cpls, > * status array are also set. > */ > __rte_experimental > -uint16_t > +static inline uint16_t > rte_dmadev_completed_status(uint16_t dev_id, uint16_t vchan, > const uint16_t nb_cpls, uint16_t *last_idx, > - enum rte_dma_status_code *status); > + enum rte_dma_status_code *status) > +{ > + struct rte_dmadev *dev = &rte_dmadevices[dev_id]; > + uint16_t idx; > + > +#ifdef RTE_DMADEV_DEBUG > + if (!rte_dmadev_is_valid_dev(dev_id) || !dev->data->dev_started || > + vchan >= dev->data->dev_conf.nb_vchans || > + nb_cpls == 0 || status == NULL) > + return 0; > + RTE_FUNC_PTR_OR_ERR_RET(*dev->completed_status, 0); > +#endif > + > + if (last_idx == NULL) > + last_idx = &idx; Hi Chengwen, An internal coverity scan on the IDXD dmadev driver patches flagged a potential null pointer dereference when using completed_status(). IMO it is a false positive for the driver code since it should be checked at the library API level, however the check is also not present in the library. For the v22, can you add the NULL pointer check for status here, like you have for last_idx, please? /Kevin > + > + return (*dev->completed_status)(dev, vchan, nb_cpls, last_idx, status); > +} > > #ifdef __cplusplus > } >