Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3059677pxb; Sun, 28 Feb 2021 23:56:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJziRCXb0mRvLQIELR7rVCcQ6IwA2l2visUxXjfwP9NQ0PAC2FdSeTy69AmL2fA+nT/r4A2T X-Received: by 2002:a17:907:9709:: with SMTP id jg9mr7888837ejc.276.1614585365871; Sun, 28 Feb 2021 23:56:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614585365; cv=none; d=google.com; s=arc-20160816; b=XiPnj+08hvpKp/jiYRnPfWPN/MrhQUwNnrty/LQ0dzcGi2dhr3WMdCOUVTXUo6sNzh DlkjzXmScokukxZeTYDes//6MhtuWCY1te9YqUJ7ciU9weahUooFa+midJpX9hh8wU4c /Qu8iLKjVYuFR9nzRTfSNyRCPASJrA3XHAJ/CKlBaL1d/eiPTmzlNOMHeiaVavY44F5+ QPyCzpCUGVjLBlPTU0vF8k0nEuz6KhseBwsjMU/wO1z9g10VGvCZnpbT5vnWDnL9Zxgh 4ig80TyMDzpEtW442FqKx6G0aOSEhS/PE32iDO5CIu5gOVb5ZTTFv9qzl40p+6eq9sdi 5f5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=r0CNsQ5PANkIBnhwAb5s093rNx2yiWanVGyrgP1R4R4=; b=wP/Llro2LV4FEtkKPb48JIpPUlYpU2D6tKFA1Qcb4xf+TDIIcxXo49p771JYsvtCj5 BoS16crAdnkMRzDgKnItBlJLGfiVqQDbsbrlllZ2QyTsb6XO/Mj14LMeAG865nBrZbhj FXsrJTAa683hg1fJ6pSf7L78EDP60ralXjtSU4q/3T1dUzbPauxrRQ88teOoz9DwfEhr /hvDYpXoAzbOZ8hvQFkdlYZFite51rTt7zhGv913HSSqi6AycEaZCjqPYgBBnms6LfG3 wEabJZ31WDDaGgPpTqO59qhdxkOH+KPlqrJDUKzdGZsdWjtaxvcKO7y7PC+eIfr6cjk2 g+Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NUCXr67b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id l13si12647547edj.219.2021.02.28.23.55.43; Sun, 28 Feb 2021 23:56:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NUCXr67b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232636AbhCAHy2 (ORCPT + 99 others); Mon, 1 Mar 2021 02:54:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28137 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232623AbhCAHy1 (ORCPT ); Mon, 1 Mar 2021 02:54:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614585177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r0CNsQ5PANkIBnhwAb5s093rNx2yiWanVGyrgP1R4R4=; b=NUCXr67bWMIMDUZz4UsllEleQ/sytrPoM+u3myoKKcfKWQAr5an+1/hFtCQ1xG44py37mz 6YHbtxOeBJolrlJPBSQtFhI26eo+YGpGGcMGXDCrKPhp3FpwMz3+PHnQ9+5TwN5IEyqiXi GxzBp2NP3VPtusRKWOjgr/T0p90+KnU= 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-238-og48gR6wNbKswwmGmqyYpw-1; Mon, 01 Mar 2021 02:52:54 -0500 X-MC-Unique: og48gR6wNbKswwmGmqyYpw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8770E107ACF5; Mon, 1 Mar 2021 07:52:53 +0000 (UTC) Received: from wangxiaodeMacBook-Air.local (ovpn-13-188.pek2.redhat.com [10.72.13.188]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CC1C6A8EA; Mon, 1 Mar 2021 07:52:47 +0000 (UTC) Subject: Re: [PATCH] vdpa/mlx5: Fix wrong use of bit numbers To: Eli Cohen , mst@redhat.com, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org References: <20210301062817.39331-1-elic@nvidia.com> From: Jason Wang Message-ID: <959916f2-5fc9-bdb4-31ca-632fe0d98979@redhat.com> Date: Mon, 1 Mar 2021 15:52:45 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210301062817.39331-1-elic@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/3/1 2:28 下午, Eli Cohen wrote: > VIRTIO_F_VERSION_1 is a bit number. Use BIT_ULL() with mask > conditionals. > > Also, in mlx5_vdpa_is_little_endian() use BIT_ULL for consistency with > the rest of the code. > > Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") > Signed-off-by: Eli Cohen Acked-by: Jason Wang > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c > index dc7031132fff..7d21b857a94a 100644 > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c > @@ -821,7 +821,7 @@ static int create_virtqueue(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtque > MLX5_SET(virtio_q, vq_ctx, event_qpn_or_msix, mvq->fwqp.mqp.qpn); > MLX5_SET(virtio_q, vq_ctx, queue_size, mvq->num_ent); > MLX5_SET(virtio_q, vq_ctx, virtio_version_1_0, > - !!(ndev->mvdev.actual_features & VIRTIO_F_VERSION_1)); > + !!(ndev->mvdev.actual_features & BIT_ULL(VIRTIO_F_VERSION_1))); > MLX5_SET64(virtio_q, vq_ctx, desc_addr, mvq->desc_addr); > MLX5_SET64(virtio_q, vq_ctx, used_addr, mvq->device_addr); > MLX5_SET64(virtio_q, vq_ctx, available_addr, mvq->driver_addr); > @@ -1578,7 +1578,7 @@ static void teardown_virtqueues(struct mlx5_vdpa_net *ndev) > static inline bool mlx5_vdpa_is_little_endian(struct mlx5_vdpa_dev *mvdev) > { > return virtio_legacy_is_little_endian() || > - (mvdev->actual_features & (1ULL << VIRTIO_F_VERSION_1)); > + (mvdev->actual_features & BIT_ULL(VIRTIO_F_VERSION_1)); > } > > static __virtio16 cpu_to_mlx5vdpa16(struct mlx5_vdpa_dev *mvdev, u16 val)