DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ophir Munk <ophirmu@mellanox.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>, Matan Azrad <matan@mellanox.com>,
	Raslan Darawsheh <rasland@mellanox.com>
Subject: Re: [dpdk-dev] [PATCH v1 2/8] net/mlx5: add mlx5 Linux specific file with getter functions
Date: Tue, 9 Jun 2020 08:40:08 +0000
Message-ID: <AM0PR05MB4209684AE9B5F835AEB9499DD1820@AM0PR05MB4209.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <ad9e6298-3a45-fc0c-afa9-db0359521276@intel.com>

Hi Ferruh,
Please see inline

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Monday, June 8, 2020 2:20 PM
> To: Ophir Munk <ophirmu@mellanox.com>; dev@dpdk.org; Matan Azrad
> <matan@mellanox.com>; Raslan Darawsheh <rasland@mellanox.com>
> Subject: Re: [dpdk-dev] [PATCH v1 2/8] net/mlx5: add mlx5 Linux specific file
> with getter functions
> 
> On 6/3/2020 4:05 PM, Ophir Munk wrote:
> > 'ctx' type (field in 'struct mlx5_ctx_shared') is changed from 'struct
> > ibv_context *' to 'void *'.  'ctx' members which are verbs dependent
> > (e.g. device_name) will be accessed through getter functions which are
> > added to a new file under Linux directory: linux/mlx5_os.c.
> >
> > Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
> > Acked-by: Matan Azrad <matan@mellanox.com>
> 
> <...>
> 
> > @@ -0,0 +1,87 @@
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > + * Copyright 2015 6WIND S.A.
> > + * Copyright 2020 Mellanox Technologies, Ltd  */
> 
> Just to double check if '6WIND' is copy/paste error in this new file?
> 

Some functions were moved from file mlx5.c (with 6WIND copyright) to this file
and renamed. 
Should 6WIND copyright be kept or removed in this file (mlx5_os.c)?

> <...>
> 
> > @@ -677,13 +677,14 @@ mlx5_dev_shared_handler_install(struct
> mlx5_dev_ctx_shared *sh)
> >  	int flags;
> >
> >  	sh->intr_handle.fd = -1;
> > -	flags = fcntl(sh->ctx->async_fd, F_GETFL);
> > -	ret = fcntl(sh->ctx->async_fd, F_SETFL, flags | O_NONBLOCK);
> > +	flags = fcntl(((struct ibv_context *)sh->ctx)->async_fd, F_GETFL);
> > +	ret = fcntl(((struct ibv_context *)sh->ctx)->async_fd,
> > +		    F_SETFL, flags | O_NONBLOCK);
> 
> As far as I understand you are trying to remove to the dependency to ibverbs,
> at least in root level, linux/x.c will have that dependency. (I assume this is for
> Windows support) The 'mlx5_os_get_ctx_device_path()' wrapper seems can
> work for it but what is the point of above usage, that you explicitly cast "void
> *" to "(struct ibv_context *)", so you still keep the ibv dependency?

The reason for keeping an explicit cast for async_fd (and not creating a new getter API)
is that this code snippet will be moved under linux in next commits where no getter function is needed.
I wanted to avoid adding a getter function here and then remove it in a follow up commit. 


  reply	other threads:[~2020-06-09  8:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 15:05 [dpdk-dev] [PATCH v1 0/8] mlx5 PMD multi OS support Ophir Munk
2020-06-03 15:05 ` [dpdk-dev] [PATCH v1 1/8] net/mlx5: rename mlx5 ibv shared struct Ophir Munk
2020-06-03 15:05 ` [dpdk-dev] [PATCH v1 2/8] net/mlx5: add mlx5 Linux specific file with getter functions Ophir Munk
2020-06-08 11:20   ` Ferruh Yigit
2020-06-09  8:40     ` Ophir Munk [this message]
2020-06-09  8:43       ` Ferruh Yigit
2020-06-03 15:05 ` [dpdk-dev] [PATCH v1 3/8] drivers: remove mlx5 protection domain dependency on ibv Ophir Munk
2020-06-03 15:05 ` [dpdk-dev] [PATCH v1 4/8] net/mlx5: remove attributes dependency on ibv and dv Ophir Munk
2020-06-03 15:05 ` [dpdk-dev] [PATCH v1 5/8] net/mlx5: remove umem field dependency on dv Ophir Munk
2020-06-03 15:06 ` [dpdk-dev] [PATCH v1 6/8] net/mlx5: refactor PCI probing under Linux Ophir Munk
2020-06-03 15:06 ` [dpdk-dev] [PATCH v1 7/8] net/mlx5: add mlx5 header file specific to Linux Ophir Munk
2020-06-08 11:31   ` Ferruh Yigit
2020-06-09  8:44     ` Ophir Munk
2020-06-09 11:48       ` Ferruh Yigit
2020-06-09 14:49         ` Ophir Munk
2020-06-03 15:06 ` [dpdk-dev] [PATCH v1 8/8] net/mlx5: remove ibv dependency in spawn struct Ophir Munk
2020-06-07  8:49 ` [dpdk-dev] [PATCH v1 0/8] mlx5 PMD multi OS support Raslan Darawsheh

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=AM0PR05MB4209684AE9B5F835AEB9499DD1820@AM0PR05MB4209.eurprd05.prod.outlook.com \
    --to=ophirmu@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=matan@mellanox.com \
    --cc=rasland@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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git