From patchwork Tue Sep 27 03:01:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhu, Lingshan" X-Patchwork-Id: 12989788 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9ED2FC32771 for ; Tue, 27 Sep 2022 03:12:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbiI0DMm (ORCPT ); Mon, 26 Sep 2022 23:12:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231232AbiI0DLn (ORCPT ); Mon, 26 Sep 2022 23:11:43 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F23A9120B2; Mon, 26 Sep 2022 20:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664248180; x=1695784180; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2YQiwSWKHyCzhjsVYpVZs2o9N9e+lxz8vW92n7gfnJ4=; b=hq9NS1+gpH2pGcJQxEO3n4qTI5vktrLha5THkAV7toDBUP0OgdIC0lqd 1zLe6++NFmvAkS2YSJXQNPy4RpB8ip4gTc1xAhnBIlSChzIvpKKfkoZqz nPUJm7SckdINFAoDusWaGrM4LIO1926W3OEgd0ctVAJzYx6owMD2AICQP TXgT6G0CLcuePZfLMpPBQFAGR1qNM2prPnBDRnn8tTdoexOaQgwi3NOoH 3AyG+BSb98/bfIWamPc3WNwsPn1Y14qYN6hCvyMQhSpKoirMCBOghw33/ E/j57MZDse76PI9mznJ+2/vCvZdFBjcLqaSjoHfiSJ2JjkszdNb0cs5tE A==; X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="299922312" X-IronPort-AV: E=Sophos;i="5.93,348,1654585200"; d="scan'208";a="299922312" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 20:09:35 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="710387770" X-IronPort-AV: E=Sophos;i="5.93,348,1654585200"; d="scan'208";a="710387770" Received: from unknown (HELO localhost.localdomain.bj.intel.com) ([10.240.193.73]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 20:09:33 -0700 From: Zhu Lingshan To: jasowang@redhat.com, mst@redhat.com Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, kvm@vger.kernel.org, Zhu Lingshan Subject: [PATCH V2 RESEND 3/6] vDPA: check VIRTIO_NET_F_RSS for max_virtqueue_paris's presence Date: Tue, 27 Sep 2022 11:01:14 +0800 Message-Id: <20220927030117.5635-4-lingshan.zhu@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220927030117.5635-1-lingshan.zhu@intel.com> References: <20220927030117.5635-1-lingshan.zhu@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org virtio 1.2 spec says: max_virtqueue_pairs only exists if VIRTIO_NET_F_MQ or VIRTIO_NET_F_RSS is set. So when reporint MQ to userspace, it should check both VIRTIO_NET_F_MQ and VIRTIO_NET_F_RSS. unused parameter struct vdpa_device *vdev is removed Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/vdpa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c index e7765953307f..829fd4cfc038 100644 --- a/drivers/vdpa/vdpa.c +++ b/drivers/vdpa/vdpa.c @@ -800,13 +800,13 @@ static int vdpa_nl_cmd_dev_get_dumpit(struct sk_buff *msg, struct netlink_callba return msg->len; } -static int vdpa_dev_net_mq_config_fill(struct vdpa_device *vdev, - struct sk_buff *msg, u64 features, +static int vdpa_dev_net_mq_config_fill(struct sk_buff *msg, u64 features, const struct virtio_net_config *config) { u16 val_u16; - if ((features & BIT_ULL(VIRTIO_NET_F_MQ)) == 0) + if ((features & BIT_ULL(VIRTIO_NET_F_MQ)) == 0 && + (features & BIT_ULL(VIRTIO_NET_F_RSS)) == 0) return 0; val_u16 = le16_to_cpu(config->max_virtqueue_pairs);