All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Jason Wang <jasowang@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kvm list <kvm@vger.kernel.org>,
	virtualization@lists.linux-foundation.org,
	Networking <netdev@vger.kernel.org>,
	Jason Gunthorpe <jgg@mellanox.com>,
	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 Pandit <parav@mellanox.com>,
	kevin.tian@intel.com, Stefan Hajnoczi <stefanha@redhat.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Christoph Hellwig <hch@infradead.org>,
	aadam@redhat.com, Jiri Pirko <jiri@mellanox.com>,
	shahafs@mellanox.com, hanand@xilinx.com, mhabets@solarflare.com,
	gdawar@xilinx.com, saugatm@xilinx.com, vmireyno@marvell.
Subject: Re: [PATCH V9 9/9] virtio: Intel IFC VF driver for VDPA
Date: Thu, 9 Apr 2020 16:25:15 -0400	[thread overview]
Message-ID: <20200409162427-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAK8P3a1RXUXs5oYjB=Jq5cpvG11eTnmJ+vc18_-0fzgTH6envA@mail.gmail.com>

On Thu, Apr 09, 2020 at 12:41:13PM +0200, Arnd Bergmann wrote:
> On Thu, Mar 26, 2020 at 3:08 PM Jason Wang <jasowang@redhat.com> wrote:
> >
> > From: Zhu Lingshan <lingshan.zhu@intel.com>
> >
> > This commit introduced two layers to drive IFC VF:
> >
> > (1) ifcvf_base layer, which handles IFC VF NIC hardware operations and
> >     configurations.
> >
> > (2) ifcvf_main layer, which complies to VDPA bus framework,
> >     implemented device operations for VDPA bus, handles device probe,
> >     bus attaching, vring operations, etc.
> >
> > Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
> > Signed-off-by: Bie Tiwei <tiwei.bie@intel.com>
> > Signed-off-by: Wang Xiao <xiao.w.wang@intel.com>
> > Signed-off-by: Jason Wang <jasowang@redhat.com>
> 
> > +
> > +#define IFCVF_QUEUE_ALIGNMENT  PAGE_SIZE
> > +#define IFCVF_QUEUE_MAX                32768
> > +static u16 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev)
> > +{
> > +       return IFCVF_QUEUE_ALIGNMENT;
> > +}
> 
> This fails to build on arm64 with 64kb page size (found in linux-next):
> 
> /drivers/vdpa/ifcvf/ifcvf_main.c: In function 'ifcvf_vdpa_get_vq_align':
> arch/arm64/include/asm/page-def.h:17:20: error: conversion from 'long
> unsigned int' to 'u16' {aka 'short unsigned int'} changes value from
> '65536' to '0' [-Werror=overflow]
>    17 | #define PAGE_SIZE  (_AC(1, UL) << PAGE_SHIFT)
>       |                    ^
> drivers/vdpa/ifcvf/ifcvf_base.h:37:31: note: in expansion of macro 'PAGE_SIZE'
>    37 | #define IFCVF_QUEUE_ALIGNMENT PAGE_SIZE
>       |                               ^~~~~~~~~
> drivers/vdpa/ifcvf/ifcvf_main.c:231:9: note: in expansion of macro
> 'IFCVF_QUEUE_ALIGNMENT'
>   231 |  return IFCVF_QUEUE_ALIGNMENT;
>       |         ^~~~~~~~~~~~~~~~~~~~~
> 
> It's probably good enough to just not allow the driver to be built in that
> configuration as it's fairly rare but unfortunately there is no simple Kconfig
> symbol for it.
> 
> In a similar driver, we did
> 
> config VMXNET3
>         tristate "VMware VMXNET3 ethernet driver"
>         depends on PCI && INET
>         depends on !(PAGE_SIZE_64KB || ARM64_64K_PAGES || \
>                      IA64_PAGE_SIZE_64KB || MICROBLAZE_64K_PAGES || \
>                      PARISC_PAGE_SIZE_64KB || PPC_64K_PAGES)
> 
> I think we should probably make PAGE_SIZE_64KB a global symbol
> in arch/Kconfig and have it selected by the other symbols so drivers
> like yours can add a dependency for it.
> 
>          Arnd

It's probably easier to make the alignment u32 - I don't really know why it's
u16, all callers seem to assign the result to a u32 value.

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Jason Wang <jasowang@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kvm list <kvm@vger.kernel.org>,
	virtualization@lists.linux-foundation.org,
	Networking <netdev@vger.kernel.org>,
	Jason Gunthorpe <jgg@mellanox.com>,
	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 Pandit <parav@mellanox.com>,
	kevin.tian@intel.com, Stefan Hajnoczi <stefanha@redhat.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	Christoph Hellwig <hch@infradead.org>,
	aadam@redhat.com, Jiri Pirko <jiri@mellanox.com>,
	shahafs@mellanox.com, hanand@xilinx.com, mhabets@solarflare.com,
	gdawar@xilinx.com, saugatm@xilinx.com, vmireyno@marvell.com,
	zhangweining@ruijie.com.cn, Bie Tiwei <tiwei.bie@intel.com>
Subject: Re: [PATCH V9 9/9] virtio: Intel IFC VF driver for VDPA
Date: Thu, 9 Apr 2020 16:25:15 -0400	[thread overview]
Message-ID: <20200409162427-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAK8P3a1RXUXs5oYjB=Jq5cpvG11eTnmJ+vc18_-0fzgTH6envA@mail.gmail.com>

On Thu, Apr 09, 2020 at 12:41:13PM +0200, Arnd Bergmann wrote:
> On Thu, Mar 26, 2020 at 3:08 PM Jason Wang <jasowang@redhat.com> wrote:
> >
> > From: Zhu Lingshan <lingshan.zhu@intel.com>
> >
> > This commit introduced two layers to drive IFC VF:
> >
> > (1) ifcvf_base layer, which handles IFC VF NIC hardware operations and
> >     configurations.
> >
> > (2) ifcvf_main layer, which complies to VDPA bus framework,
> >     implemented device operations for VDPA bus, handles device probe,
> >     bus attaching, vring operations, etc.
> >
> > Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
> > Signed-off-by: Bie Tiwei <tiwei.bie@intel.com>
> > Signed-off-by: Wang Xiao <xiao.w.wang@intel.com>
> > Signed-off-by: Jason Wang <jasowang@redhat.com>
> 
> > +
> > +#define IFCVF_QUEUE_ALIGNMENT  PAGE_SIZE
> > +#define IFCVF_QUEUE_MAX                32768
> > +static u16 ifcvf_vdpa_get_vq_align(struct vdpa_device *vdpa_dev)
> > +{
> > +       return IFCVF_QUEUE_ALIGNMENT;
> > +}
> 
> This fails to build on arm64 with 64kb page size (found in linux-next):
> 
> /drivers/vdpa/ifcvf/ifcvf_main.c: In function 'ifcvf_vdpa_get_vq_align':
> arch/arm64/include/asm/page-def.h:17:20: error: conversion from 'long
> unsigned int' to 'u16' {aka 'short unsigned int'} changes value from
> '65536' to '0' [-Werror=overflow]
>    17 | #define PAGE_SIZE  (_AC(1, UL) << PAGE_SHIFT)
>       |                    ^
> drivers/vdpa/ifcvf/ifcvf_base.h:37:31: note: in expansion of macro 'PAGE_SIZE'
>    37 | #define IFCVF_QUEUE_ALIGNMENT PAGE_SIZE
>       |                               ^~~~~~~~~
> drivers/vdpa/ifcvf/ifcvf_main.c:231:9: note: in expansion of macro
> 'IFCVF_QUEUE_ALIGNMENT'
>   231 |  return IFCVF_QUEUE_ALIGNMENT;
>       |         ^~~~~~~~~~~~~~~~~~~~~
> 
> It's probably good enough to just not allow the driver to be built in that
> configuration as it's fairly rare but unfortunately there is no simple Kconfig
> symbol for it.
> 
> In a similar driver, we did
> 
> config VMXNET3
>         tristate "VMware VMXNET3 ethernet driver"
>         depends on PCI && INET
>         depends on !(PAGE_SIZE_64KB || ARM64_64K_PAGES || \
>                      IA64_PAGE_SIZE_64KB || MICROBLAZE_64K_PAGES || \
>                      PARISC_PAGE_SIZE_64KB || PPC_64K_PAGES)
> 
> I think we should probably make PAGE_SIZE_64KB a global symbol
> in arch/Kconfig and have it selected by the other symbols so drivers
> like yours can add a dependency for it.
> 
>          Arnd

It's probably easier to make the alignment u32 - I don't really know why it's
u16, all callers seem to assign the result to a u32 value.


  parent reply	other threads:[~2020-04-09 20:25 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 14:01 [PATCH V9 0/9] vDPA support Jason Wang
2020-03-26 14:01 ` [PATCH V9 1/9] vhost: refine vhost and vringh kconfig Jason Wang
2020-04-01 11:21   ` Christian Borntraeger
2020-04-01 12:50     ` Jason Wang
2020-04-01 12:56       ` Christian Borntraeger
2020-04-01 13:02         ` Christian Borntraeger
2020-04-01 14:01           ` Michael S. Tsirkin
2020-04-01 14:13           ` Jason Wang
2020-04-01 14:18             ` Michael S. Tsirkin
2020-04-01 14:36               ` Jason Wang
2020-04-01 14:27             ` Michael S. Tsirkin
2020-04-01 14:50               ` Jason Wang
2020-04-01 15:57                 ` Michael S. Tsirkin
2020-04-01 18:53                   ` Christian Borntraeger
2020-04-01 13:22   ` Michael S. Tsirkin
2020-04-01 14:08     ` Jason Wang
2020-04-01 14:13       ` Michael S. Tsirkin
2020-04-01 14:29         ` Jason Wang
2020-04-01 14:35           ` Michael S. Tsirkin
2020-04-01 14:39             ` Jason Wang
2020-04-01 14:39           ` Michael S. Tsirkin
2020-04-01 14:43             ` Jason Wang
2020-04-01 16:05           ` Michael S. Tsirkin
2020-04-01 16:08           ` Michael S. Tsirkin
2020-04-02  3:22             ` Jason Wang
2020-04-02  3:22               ` Jason Wang
2020-04-02 14:03               ` Michael S. Tsirkin
2020-04-02 14:23                 ` Jason Wang
2020-04-02 14:38                   ` Michael S. Tsirkin
2020-04-02 14:56                     ` Jason Wang
2020-03-26 14:01 ` [PATCH V9 2/9] vhost: allow per device message handler Jason Wang
2020-03-26 14:01 ` [PATCH V9 3/9] vhost: factor out IOTLB Jason Wang
2020-03-26 14:01 ` [PATCH V9 4/9] vringh: IOTLB support Jason Wang
2020-03-26 14:01 ` [PATCH V9 5/9] vDPA: introduce vDPA bus Jason Wang
2020-03-26 14:01 ` [PATCH V9 6/9] virtio: introduce a vDPA based transport Jason Wang
2020-03-26 14:01 ` [PATCH V9 7/9] vhost: introduce vDPA-based backend Jason Wang
2021-11-01 14:11   ` Jason Gunthorpe
2021-11-02  3:52     ` Jason Wang
2021-11-02  3:52       ` Jason Wang
2021-11-02 15:56       ` Jason Gunthorpe
2021-11-03  7:34         ` Jason Wang
2021-11-03  7:34           ` Jason Wang
2020-03-26 14:01 ` [PATCH V9 8/9] vdpasim: vDPA device simulator Jason Wang
2020-04-10  7:45   ` Geert Uytterhoeven
2020-04-10  7:45     ` Geert Uytterhoeven
2020-04-10  8:23     ` Jason Wang
2020-04-10  8:23       ` Jason Wang
2020-03-26 14:01 ` [PATCH V9 9/9] virtio: Intel IFC VF driver for VDPA Jason Wang
2020-04-09 10:41   ` Arnd Bergmann
2020-04-09 10:41     ` Arnd Bergmann
2020-04-09 12:43     ` Jason Wang
2020-04-09 12:43       ` Jason Wang
2020-04-09 12:49       ` Zhu, Lingshan
2020-04-09 12:49         ` Zhu, Lingshan
2020-04-09 20:25     ` Michael S. Tsirkin [this message]
2020-04-09 20:25       ` Michael S. Tsirkin
2020-04-10  3:15       ` Zhu, Lingshan
2020-04-10  3:15         ` Zhu, Lingshan
2020-03-29 11:07 ` [PATCH V9 0/9] vDPA support Michael S. Tsirkin

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=20200409162427-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=aadam@redhat.com \
    --cc=arnd@arndb.de \
    --cc=cunming.liang@intel.com \
    --cc=eperezma@redhat.com \
    --cc=gdawar@xilinx.com \
    --cc=hanand@xilinx.com \
    --cc=hch@infradead.org \
    --cc=jasowang@redhat.com \
    --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=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. \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.