From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5E694A0528; Sat, 11 Jul 2020 11:50:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BE7C21D93D; Sat, 11 Jul 2020 11:50:18 +0200 (CEST) Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) by dpdk.org (Postfix) with ESMTP id DCAE01C1F4 for ; Sat, 11 Jul 2020 11:50:17 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 573BC581631; Sat, 11 Jul 2020 05:50:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sat, 11 Jul 2020 05:50:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= fV4iNDXtbGiMzqeL/YLE78u7B9ApPp97vpMaIf/Vr7I=; b=ciWyuy1a6rWlh23w 31X6OC2ufAflHvoRxc1UAfLAkG92yssKpWzi7oaTBIkSKblcIrt6gKu+0wbuaHFg tWJCuVcTDimDwkutvRj6TdiG6hbo0v7ztokIENuMePmeTs/V9Ul8Hyq8iiTGWpLp iiMq0NLMuzejRt4Po8k+mV1NNvKVhtlczDfIKKdW9Ouo/7eKE37XWhG17XyGZmPe 2l1HRe+elqwk4dGWIpoeekxB/a96TTOS7q3XBBAp8RS7SiZvaK0NdHey+ZTfzQS0 363nSXKT8M20oooQQB46YssXLou2GgDsP6bFwTVGVIDjUkXHWt64TNPNS+BMoXMK 5xB5Zg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=fV4iNDXtbGiMzqeL/YLE78u7B9ApPp97vpMaIf/Vr 7I=; b=WSo26/iGEtanu3kQh1lpg2SHd2ENm+Aw1+aUJKIGNYnC4rzRnvxsKgmro w9E0zI8YSlV54UUnF7Al3yqyQ5nta/bjd4oYWFxnCtGNaxCh4NFdO/5iqR9Q744U NgH7F6uFk8ZjPIl/Xiz2GNDCyRgmKYapcNJmGIQQjJDzqPNdeEt18bAooE4jnFAu M+f9O1RY4aa91gmFKFki1IxVNH8UwvdTVCMM6fmKBbx+heHATyzIZ7Y57SYMIrBM 2K0Jhb5b8tpZZavQsHeYQICeV+Ju6Cmg4kfkX6Sw5B21m6loIHjpIz5tUk0tj9BN nPEd+cW+fbSCcF7sWApzSGQ23W6JQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrvdefgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 2171B328005E; Sat, 11 Jul 2020 05:50:15 -0400 (EDT) From: Thomas Monjalon To: "Ma, LihongX" Cc: "dev@dpdk.org" , "david.marchand@redhat.com" , "Yigit, Ferruh" , "grive@u256.net" , "Zhang, AlvinX" , "Xing, Beilei" , "Guo, Jia" , "Burakov, Anatoly" , "Richardson, Bruce" , "dmitry.kozliuk@gmail.com" , "navasile@linux.microsoft.com" , "dmitrym@microsoft.com" , "Kadam, Pallavi" , "talshn@mellanox.com" Date: Sat, 11 Jul 2020 11:50:13 +0200 Message-ID: <2673097.03gJbBfFMT@thomas> In-Reply-To: References: <20200710115324.3902559-1-thomas@monjalon.net> <20200710204034.4158330-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] pci: keep API compatibility with mmap values X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" 11/07/2020 05:27, Ma, LihongX: > Tested-by:ma,lhong For info, your name is written Lihong Ma Please remove patch content and avoid top-post when sending a test tag. > -----Original Message----- > From: dev On Behalf Of Thomas Monjalon > Sent: Saturday, July 11, 2020 4:41 AM > To: dev@dpdk.org > Cc: david.marchand@redhat.com; Yigit, Ferruh ; grive@u256.net; Zhang, AlvinX ; Xing, Beilei ; Guo, Jia ; Burakov, Anatoly ; Richardson, Bruce ; dmitry.kozliuk@gmail.com; navasile@linux.microsoft.com; dmitrym@microsoft.com; Kadam, Pallavi ; talshn@mellanox.com > Subject: [dpdk-dev] [PATCH v2] pci: keep API compatibility with mmap values > > The function pci_map_resource() returns MAP_FAILED in case of error. > When replacing the call to mmap() by rte_mem_map(), the error code became NULL, breaking the API. > This function is probably not used outside of DPDK, but it is still a problem for two reasons: > - the deprecation process was not followed > - the Linux function pci_vfio_mmap_bar() is broken for i40e > > The error code is reverted to the Unix value MAP_FAILED. > Windows needs to define this special value (-1 as in Unix). > After proper deprecation process, the API could be changed again if really needed. > > Because of the switch from mmap() to rte_mem_map(), another part of the API was changed: "int additional_flags" > are defined as "additional flags for the mapping range" > without mentioning it was directly used in mmap(). > Currently it is directly used in rte_mem_map(), that's why the values rte_map_flags must be mapped (sic) on the mmap ones in case of Unix OS. > > These are side effects of a badly defined API using Unix values. > > Bugzilla ID: 503 > Fixes: 2fd3567e5425 ("pci: use OS generic memory mapping functions") > Cc: talshn@mellanox.com > > Reported-by: David Marchand > Signed-off-by: Thomas Monjalon