Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1610116ybb; Thu, 9 Apr 2020 05:45:08 -0700 (PDT) X-Google-Smtp-Source: APiQypI132lg3qikHcjnURvNnOqMaQWSrAPgfaxuDjL6Dc3NnWq2iibo/r3MbMxFUPVvzyD8AKgz X-Received: by 2002:ac8:4907:: with SMTP id e7mr1894516qtq.300.1586436308606; Thu, 09 Apr 2020 05:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586436308; cv=none; d=google.com; s=arc-20160816; b=eCxGDy9jSTYy9RFuImyBp3YKB/kwHgiE9eGIBdWDZOdXq7Sp3HsAh8dwAE4okLIl3x jOajv9QTcCDZ/JhgpWUPpn0Y8K1JmGuccRZZ//H+DmsO2xcAaTsaCyqG7X3vR01o1fTE n3ldDRDHp3ddZBF6/+lxzAMyYOOec6E+iSbK9oQp1BGLMsiHJX7O9/oRMyCOtBZ9ZZ2w uNetKKpYG25z3FmgVSQT/ldm12l/ze05JF1Oenx4WX2bN7RIbnYvNX9BIxZ4kCzjIxlU acA1E4k8dQPLLamqe2WMQU0q+5K85UQVEHqDl29QaZjPKjI6aOBjknw8YTR5LXAQh6VG yZRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=hCTyTHNIoa/f4FCOf5RUI76bLbl3BtD2rSWLrU8gW5Y=; b=siH+QPhK7CqjH46G3iRjgSf6GFqoah7ifprNd7I6XKGeLqlN3ldM2YqcX1lJW1t5cG HNa9FPyA2aEdezzmsLhXojgLMKxoxRdTDxy57HlKkqvu5uThogXUO13YA/N8rCyJhYGm Qu1LE4VykfI1xjYnUxb3odeXV9Q4Q0UFl5CGbeJrdwPdUrsay4shVy7xMvK2rBEhi5oV NL6XP2fw099WPtdLsv543u7eWPqlA8BrhWkv1nqsgnc0hIHGX1FtpxtgYSllxO50f6ZP GgZIvsfO2m2r/lDygZGDBqnl4q80cJehwfbQ4iAVUt7MQaz8WuV54LCjGrCJQ7StmR2N UkNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bZMAYl4Q; 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 d19si3921640qtp.312.2020.04.09.05.44.52; Thu, 09 Apr 2020 05:45:08 -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=bZMAYl4Q; 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 S1726657AbgDIMoN (ORCPT + 99 others); Thu, 9 Apr 2020 08:44:13 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:38421 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726621AbgDIMoN (ORCPT ); Thu, 9 Apr 2020 08:44:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586436253; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hCTyTHNIoa/f4FCOf5RUI76bLbl3BtD2rSWLrU8gW5Y=; b=bZMAYl4QAGFPMpKROtpxLo8b7l2P34mC1ROPge8ll/H1nHUfZ7dhTbhygw/wO2lwrmmQBG D5G1lAcvFuM2HkWdk+Vp1mB1XTjXnhtsDAqOA4CsY2mpiDr6RYMg830QfV94kGPGd+Xw+5 ZkN7oAN6tCSKyNMlF7xTYCuHy92DLI0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-312-zWT1uXBlOtKpx36KjtI44w-1; Thu, 09 Apr 2020 08:44:11 -0400 X-MC-Unique: zWT1uXBlOtKpx36KjtI44w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 41F51DB61; Thu, 9 Apr 2020 12:44:08 +0000 (UTC) Received: from [10.72.12.130] (ovpn-12-130.pek2.redhat.com [10.72.12.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 07E9119756; Thu, 9 Apr 2020 12:43:50 +0000 (UTC) Subject: Re: [PATCH V9 9/9] virtio: Intel IFC VF driver for VDPA To: Arnd Bergmann , lingshan.zhu@intel.com 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, 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 References: <20200326140125.19794-1-jasowang@redhat.com> <20200326140125.19794-10-jasowang@redhat.com> From: Jason Wang Message-ID: Date: Thu, 9 Apr 2020 20:43:49 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/4/9 =E4=B8=8B=E5=8D=886:41, 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=3Doverflow] > 17 | #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) > | ^ > drivers/vdpa/ifcvf/ifcvf_base.h:37:31: note: in expansion of macro 'PAG= E_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 t= hat > configuration as it's fairly rare but unfortunately there is no simple = Kconfig > symbol for it. Or I think the 64KB alignment is probably more than enough. Ling Shan, can we use smaller value here? Thanks > > 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 >