Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2066119ybb; Thu, 9 Apr 2020 14:31:05 -0700 (PDT) X-Google-Smtp-Source: APiQypISHbz8nR4GjwDCKTmDUIE0JpS+MRmFTe/RF1uWYODO0qqx50odBpq7+M+JwTOMnKddVpNd X-Received: by 2002:aed:2f01:: with SMTP id l1mr1489968qtd.37.1586467865510; Thu, 09 Apr 2020 14:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586467865; cv=none; d=google.com; s=arc-20160816; b=t0PuskjHyTSgnVLnoZkQV+VK8cKBn0GpW5VaDaESX3ZzNYfSpgawflfLiU2SLcDwl4 Bzh5cJ0H6vZfX5NsUrrKBA/41CHfyQIwUZLnQ5pOEUQkJNO/MSblfod9Ksk47YlXSgh6 5t8qI/jf/rxHJqMJMPZ+gVIMZ6FVAd/x2ie2tKEhde9Yq2+d8+EFdsQCtIbJk6Ony4ig tHRZkydoHpPpbU8JD6anRuDndxDDyMANFeiAYX1+vPLbOkhAH2rJb4YakrfuBz11FICA bSM4vknlIpJj+QCrSPYT0HPRDFRrLJbsLOK2KqsM/oUd3ka98NVROYC9VyJ8P4hiXMq4 Jxig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=L8axp0M5oMyn2GgLyL35ut9Src771+7B+nC1atGx9hE=; b=WLln7y1pi78LMY2eqBExI5IyTfrXp/8RMDOz/2zCrDs5CoYL3TWg7h2x6fqQy9KayC rIwR1kq3aJ//P0UO2g6VygL2MvXrG50nW3TdI0yNoFEon73SOePeBYEGdAYoJsTP8gWX a7Ep6VR4440D4AFv2rdVuiltl6r69R2zXw/3JlW3LPuJdZbLD7wnT1Jb/vJjd1RbeQJY LoPYHpaBPiDjs0CqXl1gdYLUGUDo1Bjh3PvSEtofNBzvGwKYKtdmRxugXXENJGWUZC2E 97BAUV9F5tDd2qKTTXa7COwKYr9SbzHwnsxKVa4WUWSHCBSvmUUZgueHwpN1TjLZQQSP rsJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CtodDgnm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21si2250900qtn.214.2020.04.09.14.30.47; Thu, 09 Apr 2020 14:31:05 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CtodDgnm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbgDIUZX (ORCPT + 99 others); Thu, 9 Apr 2020 16:25:23 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:21420 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726681AbgDIUZX (ORCPT ); Thu, 9 Apr 2020 16:25:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586463922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=L8axp0M5oMyn2GgLyL35ut9Src771+7B+nC1atGx9hE=; b=CtodDgnmq14Flol6VGruMyhaU1bHSCY72jifTfhul+kYGHODaHiyY3/B/HBS+lTwR33Bj9 QkxqTti1MfRM5Na21hiRn7rdTJlK3HtcaDV5IEz1CnLAxZMEW9xIPjcsxgA+JXtCUeMVmh 9IakI0XvXCYw1Uc1ixVJsp1w3rfezkE= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-163-hDlMFfmkMGaXR6aCZ0CgOg-1; Thu, 09 Apr 2020 16:25:21 -0400 X-MC-Unique: hDlMFfmkMGaXR6aCZ0CgOg-1 Received: by mail-wr1-f71.google.com with SMTP id r17so1619703wrg.19 for ; Thu, 09 Apr 2020 13:25:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=L8axp0M5oMyn2GgLyL35ut9Src771+7B+nC1atGx9hE=; b=GJXxAR/Kr4E6pH10orUima07Z3N1xnwhaN3jwk7J+a37qyMgu/l6L7pxDfCoLI5bCy qWPLfsQmIT38CFkGH1vjePe0jcvS1AcFefwKRytkR2vE0eRgHiZtdFNmI6K90aDwoERG 0S9092ZotLRlxTx2IaBNCQ4S8Nf8mDL6r65LYoXuih1sZ+51CA0P/sWaQDS3wSaTbx2B WQc+X5RkVKueyuBgPU81nVfuYy+N7Lt/DkIfKd3QS1leIY18tPfq6Hm768DHwy9GKeF4 sPhVQUW7DPE/aPFv0CKxkjek9MV4SsAWn56mDrOH3HjDC7OrE+mRLFbqbHphcdy/Nkpm 9KUA== X-Gm-Message-State: AGi0PuYKby5igyHNGEmtRdsH2baikEh5qs5oohG/Zqc02kdv6gbUomOu Gh7N08y6Du4A7go2GxAkfv0i1oZ/jyDiSMfihsjVKV0kP0cOvxgaz6Qd1YLhWFdjVNssHOsvHK7 H4AHfec7j0nFbttPT27YyQ8C3 X-Received: by 2002:a5d:5273:: with SMTP id l19mr962754wrc.42.1586463920112; Thu, 09 Apr 2020 13:25:20 -0700 (PDT) X-Received: by 2002:a5d:5273:: with SMTP id l19mr962722wrc.42.1586463919863; Thu, 09 Apr 2020 13:25:19 -0700 (PDT) Received: from redhat.com (bzq-109-67-97-76.red.bezeqint.net. [109.67.97.76]) by smtp.gmail.com with ESMTPSA id s13sm25438882wrw.20.2020.04.09.13.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 13:25:19 -0700 (PDT) Date: Thu, 9 Apr 2020 16:25:15 -0400 From: "Michael S. Tsirkin" To: Arnd Bergmann Cc: Jason Wang , "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 Subject: Re: [PATCH V9 9/9] virtio: Intel IFC VF driver for VDPA Message-ID: <20200409162427-mutt-send-email-mst@kernel.org> References: <20200326140125.19794-1-jasowang@redhat.com> <20200326140125.19794-10-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 09, 2020 at 12:41:13PM +0200, Arnd Bergmann wrote: > 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 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.