From: Jason Wang <jasowang@redhat.com>
To: Jason Gunthorpe <jgg@mellanox.com>
Cc: mst@redhat.com, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org, virtualization@lists.linux-foundation.org,
netdev@vger.kernel.org, maxime.coquelin@redhat.com,
cunming.liang@intel.com, zhihong.wang@intel.com,
rob.miller@broadcom.com, xiao.w.wang@intel.com,
lingshan.zhu@intel.com, eperezma@redhat.com, lulu@redhat.com,
parav@mellanox.com, kevin.tian@intel.com, stefanha@redhat.com,
rdunlap@infradead.org, hch@infradead.org, aadam@redhat.com,
jiri@mellanox.com, shahafs@mellanox.com, hanand@xilinx.com,
mhabets@solarflare.com, gdawar@xilinx.com, saugatm@xilinx.com,
vmireyno@marvell.com
Subject: Re: [PATCH V8 5/9] vDPA: introduce vDPA bus
Date: Thu, 26 Mar 2020 13:51:41 +0800 [thread overview]
Message-ID: <a1474a55-7525-7c3e-a806-e3f53850a590@redhat.com> (raw)
In-Reply-To: <20200325122949.GW13183@mellanox.com>
On 2020/3/25 下午8:29, Jason Gunthorpe wrote:
> On Wed, Mar 25, 2020 at 04:27:07PM +0800, Jason Wang wrote:
>> +struct vdpa_device *__vdpa_alloc_device(struct device *parent,
>> + const struct vdpa_config_ops *config,
>> + size_t size);
>> +
>> +#define vdpa_alloc_device(dev_struct, member, parent, config) \
>> + container_of(__vdpa_alloc_device( \
>> + parent, config, \
>> + sizeof(struct dev_struct) + \
>> + BUILD_BUG_ON_ZERO(offsetof( \
>> + struct dev_struct, member))), \
>> + struct dev_struct, member)
> This all looks robust now, one minor remark is to not do 'struct
> dev_struct' here so the caller has to do
>
> vdpa_alloc_device(struct foo, vpda, ...)
>
> Which suggests to the reader something unusual is happening
>
> Jason
Yes, that's better.
But my understanding is that this can be done on top.
Thanks
next prev parent reply other threads:[~2020-03-26 5:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-25 8:27 [PATCH V8 0/9] vDPA support Jason Wang
2020-03-25 8:27 ` [PATCH V8 1/9] vhost: refine vhost and vringh kconfig Jason Wang
2020-03-25 8:27 ` [PATCH V8 2/9] vhost: allow per device message handler Jason Wang
2020-03-25 8:27 ` [PATCH V8 3/9] vhost: factor out IOTLB Jason Wang
2020-03-25 8:27 ` [PATCH V8 4/9] vringh: IOTLB support Jason Wang
2020-03-25 8:27 ` [PATCH V8 5/9] vDPA: introduce vDPA bus Jason Wang
2020-03-25 12:29 ` Jason Gunthorpe
2020-03-26 5:51 ` Jason Wang [this message]
2020-03-25 8:27 ` [PATCH V8 6/9] virtio: introduce a vDPA based transport Jason Wang
2020-03-25 8:27 ` [PATCH V8 7/9] vhost: introduce vDPA-based backend Jason Wang
2020-03-25 8:27 ` [PATCH V8 8/9] vdpasim: vDPA device simulator Jason Wang
2020-03-25 8:27 ` [PATCH V8 9/9] virtio: Intel IFC VF driver for VDPA Jason Wang
2020-03-25 12:34 ` Jason Gunthorpe
2020-03-26 5:50 ` Jason Wang
2020-03-26 12:17 ` Jason Gunthorpe
2020-03-26 13:56 ` Jason Wang
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=a1474a55-7525-7c3e-a806-e3f53850a590@redhat.com \
--to=jasowang@redhat.com \
--cc=aadam@redhat.com \
--cc=cunming.liang@intel.com \
--cc=eperezma@redhat.com \
--cc=gdawar@xilinx.com \
--cc=hanand@xilinx.com \
--cc=hch@infradead.org \
--cc=jgg@mellanox.com \
--cc=jiri@mellanox.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=lingshan.zhu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lulu@redhat.com \
--cc=maxime.coquelin@redhat.com \
--cc=mhabets@solarflare.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=parav@mellanox.com \
--cc=rdunlap@infradead.org \
--cc=rob.miller@broadcom.com \
--cc=saugatm@xilinx.com \
--cc=shahafs@mellanox.com \
--cc=stefanha@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=vmireyno@marvell.com \
--cc=xiao.w.wang@intel.com \
--cc=zhihong.wang@intel.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).