Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp2019099ybg; Fri, 5 Jun 2020 03:33:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCegKGDjy0RykdXMScSYUPI+aWVx1dFlwm9Xf/6zIq8XFgFr0v8ySIP0cLifUu5yLUws/p X-Received: by 2002:a17:906:f115:: with SMTP id gv21mr7880566ejb.340.1591353203100; Fri, 05 Jun 2020 03:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591353203; cv=none; d=google.com; s=arc-20160816; b=WfVYeajxlahU0yxpeQPTBHQS+52ZAPbPY9oRTXSCOaaQcy+1oK4zGSDX1xdqnWptw1 TwhrWtSPMVNG+JOvttJd1SdrNwCLCtKRMOpcpu7BvChUiz5fAOZ56oRMduy3K0w90Uj3 yG1zS6r0VCfrOVMQ42n2jbeCaO5e671wb+xdqECPWu3HWqqe1O6MD1ua7FAwwdQ4CDun 58TDs/Xyga3zzHdvAILdFuy8wyYtrdCuijFgRPgCNCz4Di8HIbSrCytrP8XiRis1ZHHi 2PZGlzpaS4kQwQ95auTh6wNAq45DwAg6g9uQpRYcxti6yvzk1KvbwWumZdYBe5LHSa/K CAvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=G+xkFWQ/a62fRI6yRxkdMQGAiJmsIpwc3N1cn+pC26E=; b=NaiORVHEV7bk9TZSH+i2ggooAIDFsDWFpev2bp+KOMxoopK/KLSGRqKVFE/qYXeBqN iAoBtap8qtP3Esqdbtet5tGcCZdpalIaCb+cpw2Fd/nmpTaLGA4w6lUd1CCN6G0mispH Wl/OZnqQ2sMjouSOVdw+/+o48B+phXuBqU8gYxzvdIVh0sJLqssIKuQQcV5seVWF7odu reBqV2NjIQv0IehNDSmyQL8dzSf9TriWw6OQ287V8pkEe9Vk99s15qVKqN1D//RuWbpw ca7mxos9pBITQ22fMczxzNo8vQ3p0YIWxpF1EcGaZo8WBnV52d3kCBLW1J+Ui1Ch2LW5 kQRA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v6si3048655edj.537.2020.06.05.03.33.00; Fri, 05 Jun 2020 03:33:23 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726669AbgFEKbH (ORCPT + 99 others); Fri, 5 Jun 2020 06:31:07 -0400 Received: from mga18.intel.com ([134.134.136.126]:57119 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726645AbgFEKbE (ORCPT ); Fri, 5 Jun 2020 06:31:04 -0400 IronPort-SDR: IZw6TRNes93LzT2z9FKAiGiXoFSH5BxM6I3Mj8GuqoAbjyRRJx+/36gjuhPDkHz04kMJHH59WR FVdCJB5oyD3g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2020 03:31:04 -0700 IronPort-SDR: +zpebnjGfh6xj9sm4R3OIVRBs7GdDO/Rr2bEoYuCJTFva1PWcJal/MCFfuDziEwQL4hqgvCvef S6Od1Uf+9hxw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,476,1583222400"; d="scan'208";a="305024907" Received: from unknown (HELO localhost.localdomain.bj.intel.com) ([10.240.192.131]) by fmsmga002.fm.intel.com with ESMTP; 05 Jun 2020 03:31:01 -0700 From: Zhu Lingshan To: mst@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, jasowang@redhat.com Cc: lulu@redhat.com, dan.daly@intel.com, cunming.liang@intel.com, Zhu Lingshan Subject: [PATCH RESEND 2/5] ifcvf: ignore continuous setting same staus value Date: Fri, 5 Jun 2020 18:27:12 +0800 Message-Id: <1591352835-22441-3-git-send-email-lingshan.zhu@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1591352835-22441-1-git-send-email-lingshan.zhu@intel.com> References: <1591352835-22441-1-git-send-email-lingshan.zhu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org User space may try to set status of same value for multiple times, this patch can handle this case more efficiently by ignoring the same value of status settings. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c index d529ed6..63a6366 100644 --- a/drivers/vdpa/ifcvf/ifcvf_main.c +++ b/drivers/vdpa/ifcvf/ifcvf_main.c @@ -179,6 +179,9 @@ static void ifcvf_vdpa_set_status(struct vdpa_device *vdpa_dev, u8 status) adapter = dev_get_drvdata(vdpa_dev->dev.parent); status_old = ifcvf_get_status(vf); + if (status_old == status) + return; + if ((status_old & VIRTIO_CONFIG_S_DRIVER_OK) && !(status & VIRTIO_CONFIG_S_DRIVER_OK)) { ifcvf_stop_datapath(adapter); -- 1.8.3.1