Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1511534ybb; Thu, 9 Apr 2020 03:42:30 -0700 (PDT) X-Google-Smtp-Source: APiQypINJ5ZBNlM9RJkt/rVDGUdFkQ9EX3aFaf1ZxPno95xwlpostRJgBR6AkZzV8xMatpFvv053 X-Received: by 2002:aca:57d6:: with SMTP id l205mr5562147oib.20.1586428949912; Thu, 09 Apr 2020 03:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586428949; cv=none; d=google.com; s=arc-20160816; b=FfXTg9ubMETV15j2rGqUm2A3TCnxJ5EYzLxjYg/UxOsTfZrmSqRcp/xKotgQfJk85y 1Uc/olWaympbSfYrZQ0RF6OeFGCywnM/OlqLzoxNpRZs8C3nLKqtncod3BY6XFoEX1iJ 2GBli/05ukuZ/m+jOSp27G8M6JR58hQ4gfEhYxQ0g06hnlGwRs0XdFoHOVur+RiJgDJH xjZkr48C9VAZcaZprfwJb2zLkFSJRMYjz/MFyZ9z9GaSZhZoVJ1yI9qWq07RLQUbNIvF 19dopOuFrMx5CkaRJrm9uu8tmQKHn2qRyiFnq0qU/8yYj1lA7PqC9+Y+gxpdqIouqHfp CvZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=dUCzKB5251kc/UcCjGAo+ju0O6rJIPVC+SNBDIX6CnE=; b=ZUcWDGIsOnCoKiABAr9JknyYx5alP9hfQ3ZhSzmHc4L6g31e0TCn0hzgoeLi2/8OPe 7BtcA6NktL8kZmo975LG0kPez2pr16Fwht3an0voU9UV1yAzRunXByeHyHIoRKMfKIrs fIsKX3eeXEms/04cS/aZgCr5zFXj+Aij63l7qHsKU03nug+w0BARCDoYubM7N1KWAAD+ qKW70S/M6pN8zoERYKS4SeksoWNYLa+WLHu1BXVi2DlLHYRYbdMWpujG1jazngDEXrcZ hKPdqGiWKWcsj/MZFj0tGeOVuXp/LJ/1uKWsJfeGOLkxLhb/ley8XlxsrJ6Mr1ibJwVj 6Fuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l19si3583784otp.119.2020.04.09.03.42.15; Thu, 09 Apr 2020 03:42:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726678AbgDIKld (ORCPT + 99 others); Thu, 9 Apr 2020 06:41:33 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:34085 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgDIKlc (ORCPT ); Thu, 9 Apr 2020 06:41:32 -0400 Received: from mail-qk1-f180.google.com ([209.85.222.180]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPSA (Nemesis) id 1M3UIe-1jLwOP22ni-000bUu; Thu, 09 Apr 2020 12:41:31 +0200 Received: by mail-qk1-f180.google.com with SMTP id z15so3395725qki.7; Thu, 09 Apr 2020 03:41:31 -0700 (PDT) X-Gm-Message-State: AGi0PuYB6P8o0aFEzfWoQU5AHd+quTzHr9uwJhbuRns7IN2hGas/tBj9 CPbMV3pCx+IvNRBQcqtrfu/63O9yGEyDmHLSGRg= X-Received: by 2002:a37:a52:: with SMTP id 79mr11506167qkk.3.1586428890169; Thu, 09 Apr 2020 03:41:30 -0700 (PDT) MIME-Version: 1.0 References: <20200326140125.19794-1-jasowang@redhat.com> <20200326140125.19794-10-jasowang@redhat.com> In-Reply-To: <20200326140125.19794-10-jasowang@redhat.com> From: Arnd Bergmann Date: Thu, 9 Apr 2020 12:41:13 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V9 9/9] virtio: Intel IFC VF driver for VDPA To: Jason Wang Cc: "Michael S. Tsirkin" , "linux-kernel@vger.kernel.org" , kvm list , virtualization@lists.linux-foundation.org, Networking , Jason Gunthorpe , 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 , kevin.tian@intel.com, Stefan Hajnoczi , Randy Dunlap , Christoph Hellwig , aadam@redhat.com, Jiri Pirko , shahafs@mellanox.com, hanand@xilinx.com, mhabets@solarflare.com, gdawar@xilinx.com, saugatm@xilinx.com, vmireyno@marvell.com, zhangweining@ruijie.com.cn, Bie Tiwei Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:HWzbXodPWtj3796KNdOWac9tTnFw3sd83DCpZ4tYyN9oV/qgGKH fh9QCRbNS0utuTU9EQtqCO6ZMTIIvNcRuhL2cqr0k4HKzZhz+uiywiNmgaemhac/AwdFKEV 9zFmQgVG0n0f9ah0sZX3TABPeCExNtqJrKy6wBA2cT8/U8m02VlfUZ1IzMekJGmjApBy+WU WL7xd2t0u6StYdxj92ELg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:FZrkDyo0urk=:LiTF4Hf9cz8JtqwzdwOHlC 7V9TCsJOYLCqqVJJo13Ie7d9LKCh8bV8SMM0SbMkYXJXKODaxUystJK7yjQuM5uEUTTDQLbt0 9A/e85+4X+QBIjN5zUkuVYPWJ2nZnFxYSDF+q/NpjUy515HKltJpmp5MF/che+ULTrLkLPrcq BxhrLOWxOlAb3R9PnzS8L/Nluk14VLNct3esVTMrAQfNS8Ri2DQNxcPhRMuBv737PXft0lsyQ D8RM1RHeGD4mTulcdYlppnNSLdcP3QkV6OakdtmVuvQdjuRHhITfoRTOna1S6DpttfhCLB3cM CCpf3k4qCPV7FJKVBkufBknimkXZIuiK72E2UQI8d5d9HJL7xH/7ASbhFD1f06oWednWvpmho FBma/1vv093R3IkpLh2May4rzttJnU5+XAYw2gigCHM26BgVJvnVU2xAggtliBp7v3YbEcK7I Xf/XHW+46yEV+yOJPUQGhKo+j5YJicEJk/DkBOfelTJFiaeF58EjmlAF9GCM6xbVv6kJPCm5p oB373GuFH9jSVGSTt6eSaUZ9dHvmDpnvwCitcdVPyFTUrLxq1dboPbDhnhUGJmZalPJarfTqH EGmnoInmTHXWexZY0PWxsvd9HXDgvkAAD8YxPl7/oQOLePUhEwqiAK9aGdkMnIa7oVIjF6Xls iVErHfLgKp8u2ZiWES7n61SzCHeb9JHudAhT9muDYsUSUzGnvVf1DI1wR3MLskPvF/M45CD8r cWQv9vKhv13MmdFpynWXOXFmL9mczotZpUKCUT7PxwBdnjh74LFYFIvG/LH9V3/Xq/Dyd+a4o x0fI0zggrorIi9rD7hqdDXISbeyaZ52nUZt+IRgXsFanzIjhu0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2020 at 3:08 PM Jason Wang wrote: > > From: Zhu Lingshan > > 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 > Signed-off-by: Bie Tiwei > Signed-off-by: Wang Xiao > Signed-off-by: Jason Wang > + > +#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