DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: "Ma, LihongX" <lihongx.ma@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>,
	"grive@u256.net" <grive@u256.net>,
	"Zhang, AlvinX" <alvinx.zhang@intel.com>,
	"Xing, Beilei" <beilei.xing@intel.com>,
	"Guo, Jia" <jia.guo@intel.com>,
	"Burakov, Anatoly" <anatoly.burakov@intel.com>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	"dmitry.kozliuk@gmail.com" <dmitry.kozliuk@gmail.com>,
	"navasile@linux.microsoft.com" <navasile@linux.microsoft.com>,
	"dmitrym@microsoft.com" <dmitrym@microsoft.com>,
	"Kadam, Pallavi" <pallavi.kadam@intel.com>,
	"talshn@mellanox.com" <talshn@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH v2] pci: keep API compatibility with mmap values
Date: Sat, 11 Jul 2020 11:50:13 +0200	[thread overview]
Message-ID: <2673097.03gJbBfFMT@thomas> (raw)
In-Reply-To: <BN8PR11MB3715C471B6AC5EF8F9927D619E620@BN8PR11MB3715.namprd11.prod.outlook.com>

11/07/2020 05:27, Ma, LihongX:
> Tested-by:ma,lhong<lihongx.ma@intel.com>

For info, your name is written Lihong Ma <lihongx.ma@intel.com>

Please remove patch content and avoid top-post when sending a test tag.


> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Saturday, July 11, 2020 4:41 AM
> To: dev@dpdk.org
> Cc: david.marchand@redhat.com; Yigit, Ferruh <ferruh.yigit@intel.com>; grive@u256.net; Zhang, AlvinX <alvinx.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Guo, Jia <jia.guo@intel.com>; Burakov, Anatoly <anatoly.burakov@intel.com>; Richardson, Bruce <bruce.richardson@intel.com>; dmitry.kozliuk@gmail.com; navasile@linux.microsoft.com; dmitrym@microsoft.com; Kadam, Pallavi <pallavi.kadam@intel.com>; 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 <david.marchand@redhat.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>





  reply	other threads:[~2020-07-11  9:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 11:53 [dpdk-dev] [PATCH] " Thomas Monjalon
2020-07-10 13:34 ` David Marchand
2020-07-10 15:39 ` Burakov, Anatoly
2020-07-10 16:17   ` Thomas Monjalon
2020-07-13  8:56     ` Burakov, Anatoly
2020-07-15  8:01     ` David Marchand
2020-07-10 17:10 ` Thomas Monjalon
2020-07-10 18:31 ` Dmitry Kozlyuk
2020-07-10 20:02   ` Thomas Monjalon
2020-07-10 20:40 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
2020-07-10 21:07   ` Dmitry Kozlyuk
2020-07-11  9:51     ` Thomas Monjalon
2020-07-11  3:27   ` Ma, LihongX
2020-07-11  9:50     ` Thomas Monjalon [this message]
2020-07-11  3:18 ` [dpdk-dev] [PATCH] " Ma, LihongX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2673097.03gJbBfFMT@thomas \
    --to=thomas@monjalon.net \
    --cc=alvinx.zhang@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=dmitrym@microsoft.com \
    --cc=ferruh.yigit@intel.com \
    --cc=grive@u256.net \
    --cc=jia.guo@intel.com \
    --cc=lihongx.ma@intel.com \
    --cc=navasile@linux.microsoft.com \
    --cc=pallavi.kadam@intel.com \
    --cc=talshn@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).