From patchwork Fri May 13 08:39:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhu, Lingshan" X-Patchwork-Id: 12848511 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 60CD2C433FE for ; Fri, 13 May 2022 08:48:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378534AbiEMIsb (ORCPT ); Fri, 13 May 2022 04:48:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378536AbiEMIsS (ORCPT ); Fri, 13 May 2022 04:48:18 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EE1B13C4F8 for ; Fri, 13 May 2022 01:48:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652431697; x=1683967697; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5XiD0TDFUhUOH+XaPpecKMkFXnKyE6TM6h/zfwHWyJ4=; b=ACV72cFUY4o+XHFMSuu/i5yHxCAsnc3uEK+/28Snx2wm9C60XRePyeyT YKROFb0alriYAywqzGa+4tk2W5EZy1rk54YNMWuEdatRI2NEGks+SnDe+ a+VwInhHGoLfJ7oybanmm7GmxyywcP6vFFJaodwZMwTQkKz1aI0Bqvj0a 6HNPwWBpuPmIv828WBz2prnZ6SqlDN/cOajIdsjIipXm/iFepEs42ZXcB R1i3JHObEB83b297VtsKvopYyuQppGmC3wstlg6W1RUtuKkNxSS0KD051 lxu3lr6l/raF304iLptpn1IIvYlBGW962jAi2ZBzJyTMs3bgbFNyRiFim A==; X-IronPort-AV: E=McAfee;i="6400,9594,10345"; a="356682858" X-IronPort-AV: E=Sophos;i="5.91,221,1647327600"; d="scan'208";a="356682858" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 01:48:11 -0700 X-IronPort-AV: E=Sophos;i="5.91,221,1647327600"; d="scan'208";a="595122646" Received: from unknown (HELO ocsbesrhlrepo01.amr.corp.intel.com) ([10.240.193.73]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 01:48:09 -0700 From: Zhu Lingshan To: jasowang@redhat.com, mst@redhat.com Cc: virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, Zhu Lingshan Subject: [RFC 4/6] vDPA: !FEATURES_OK should not block querying device config space Date: Fri, 13 May 2022 16:39:33 +0800 Message-Id: <20220513083935.1253031-5-lingshan.zhu@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220513083935.1253031-1-lingshan.zhu@intel.com> References: <20220513083935.1253031-1-lingshan.zhu@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-State: RFC Users may want to query the config space of a vDPA device, to choose a appropriate one for a certain guest. This means the users need to read the config space before FEATURES_OK, and the existence of config space contents does not depend on FEATURES_OK. This commit removes FEATURES_OK blocker in vdpa_dev_config_fill() which calls vdpa_dev_net_config_fill() for virtio-net Signed-off-by: Zhu Lingshan --- drivers/vdpa/vdpa.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c index c820dd2b0307..030d96bdeed2 100644 --- a/drivers/vdpa/vdpa.c +++ b/drivers/vdpa/vdpa.c @@ -863,17 +863,9 @@ vdpa_dev_config_fill(struct vdpa_device *vdev, struct sk_buff *msg, u32 portid, { u32 device_id; void *hdr; - u8 status; int err; mutex_lock(&vdev->cf_mutex); - status = vdev->config->get_status(vdev); - if (!(status & VIRTIO_CONFIG_S_FEATURES_OK)) { - NL_SET_ERR_MSG_MOD(extack, "Features negotiation not completed"); - err = -EAGAIN; - goto out; - } - hdr = genlmsg_put(msg, portid, seq, &vdpa_nl_family, flags, VDPA_CMD_DEV_CONFIG_GET); if (!hdr) {