From: Parav Pandit <parav@mellanox.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
michal.lkml@markovi.net, davem@davemloft.net,
gregkh@linuxfoundation.org, jiri@mellanox.com,
kwankhede@nvidia.com
Cc: parav@mellanox.com, alex.williamson@redhat.com,
vuhuong@mellanox.com, yuvalav@mellanox.com,
jakub.kicinski@netronome.com, kvm@vger.kernel.org
Subject: [RFC net-next v1 1/3] vfio/mdev: Inherit dma masks of parent device
Date: Fri, 8 Mar 2019 16:07:54 -0600 [thread overview]
Message-ID: <1552082876-60228-2-git-send-email-parav@mellanox.com> (raw)
In-Reply-To: <1552082876-60228-1-git-send-email-parav@mellanox.com>
Inherit dma mask of parent device in child mdev devices, so that
protocol stack can use right dma mask while doing dma mappings.
Signed-off-by: Parav Pandit <parav@mellanox.com>
---
drivers/vfio/mdev/mdev_core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c
index 0212f0e..9b8bdc9 100644
--- a/drivers/vfio/mdev/mdev_core.c
+++ b/drivers/vfio/mdev/mdev_core.c
@@ -315,6 +315,10 @@ int mdev_device_create(struct kobject *kobj, struct device *dev, uuid_le uuid)
mdev->dev.parent = dev;
mdev->dev.bus = &mdev_bus_type;
mdev->dev.release = mdev_device_release;
+ mdev->dev.dma_mask = dev->dma_mask;
+ mdev->dev.dma_parms = dev->dma_parms;
+ mdev->dev.coherent_dma_mask = dev->coherent_dma_mask;
+
dev_set_name(&mdev->dev, "%pUl", uuid.b);
ret = device_register(&mdev->dev);
--
1.8.3.1
next prev parent reply other threads:[~2019-03-08 22:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-08 22:07 [RFC net-next v1 0/3] Support mlx5 mediated devices in host Parav Pandit
2019-03-08 22:07 ` Parav Pandit [this message]
2019-03-08 22:32 ` [RFC net-next v1 1/3] vfio/mdev: Inherit dma masks of parent device Alex Williamson
2019-03-09 3:55 ` Parav Pandit
2019-03-08 22:07 ` [RFC net-next v1 2/3] net/mlx5: Add mdev sub device life cycle command support Parav Pandit
2019-03-08 22:07 ` [RFC net-next v1 3/3] net/mlx5: Add mdev driver to bind to mdev devices Parav Pandit
2019-03-13 22:08 ` [RFC net-next v1 0/3] Support mlx5 mediated devices in host Jakub Kicinski
2019-03-14 21:38 ` Parav Pandit
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=1552082876-60228-2-git-send-email-parav@mellanox.com \
--to=parav@mellanox.com \
--cc=alex.williamson@redhat.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=jakub.kicinski@netronome.com \
--cc=jiri@mellanox.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=netdev@vger.kernel.org \
--cc=vuhuong@mellanox.com \
--cc=yuvalav@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).