Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2029340pxb; Thu, 11 Feb 2021 02:23:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyzX5OtjogT6ubHhu8On52NiTUVZKCsu6XV+AKdTVr9wJXPrhLeOEaGj3qG01Ktl3gHWJw X-Received: by 2002:a17:906:1685:: with SMTP id s5mr7698402ejd.23.1613039037585; Thu, 11 Feb 2021 02:23:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613039037; cv=none; d=google.com; s=arc-20160816; b=aQtuluhdC7as4809zNusZjCAkoJ2AvPM1MrdExVLvXcYz8Ql06sy3/QrRYAQ9xBpjM zYiM+TUbd+UXi4V4pzBJtnk6gbhxGlcS4Uq65Cu641V2Q5RkW6leHY8HTAivh23eBdKv TwAsaAmFWB+Ytt+0HCvrNDOnezaxepZbge7KCUY1mK5xIqyFcy6P4jypYFOeIpHrujl7 29//jgkkpM35dBIone2rY7efWQCcaEPEV0tdGADLuiYTvPncANHb+595kfUjVI+xziCx OL99qmpg4MTefmjJmoKPj4NOes/1PofwV6bvgdBxxp6nhP5N0qrvgMYjicqyGFQj5J7Y nWXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Rhogk/kmOD28gajRsMGG1ocHU7evgTnTuSlQWFIoQW8=; b=DFIQ0x2ZqnAlHob5kybgudKAUImzxRr45endQZtipM6XLBMluucYIK6TR8BuXJdIcA +8MtRPGXwvfH+rDM1x7l/yX2F41JVf4zgpbYQIgDSR7JkLWGgcH3GE7BiRKlFlb3kzx5 Zs8aL4DNlRCDId/b4Eri8ZdjhPMotSXIJX9FlfMGPbnD2h4cCKhjBfHd9KK5G+EI49eG eIZXZM/sFX0cCy8QE9J+rbjiz5I1syHl57IL9N/nUx3pXK5tqFE4Qg97/Vj7RmGUAcV1 NguwddooajLKznN3CjLwJgFwbMOSmnLsSwToFK7/jC50NCiOCCRviPznM6o6UNGxFxcr PePQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="on0/DGg+"; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t24si3916898edi.583.2021.02.11.02.23.34; Thu, 11 Feb 2021 02:23:57 -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=@suse.com header.s=susede1 header.b="on0/DGg+"; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230242AbhBKKWv (ORCPT + 99 others); Thu, 11 Feb 2021 05:22:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:40986 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229766AbhBKKS1 (ORCPT ); Thu, 11 Feb 2021 05:18:27 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1613038660; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rhogk/kmOD28gajRsMGG1ocHU7evgTnTuSlQWFIoQW8=; b=on0/DGg+97nD1nkvxkD4VEqz3oR9LkeQaHrptcUN0K8YljfnjFg68saLoRag5dRxWts5xM gcYtqhCRJfyj1qxrUcVplOvFvSQTRp245Dkbp+hx1i7zitTFMX0alfy6CbM8J1j2ZIVT3N SkPqcYJ4CUuD45OjfSfrPTh+cYiLMW0= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id ACC86AF0F; Thu, 11 Feb 2021 10:17:40 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Wei Liu , Paul Durrant , "David S. Miller" , Jakub Kicinski Subject: [PATCH v2 4/8] xen/netback: fix spurious event detection for common event case Date: Thu, 11 Feb 2021 11:16:12 +0100 Message-Id: <20210211101616.13788-5-jgross@suse.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210211101616.13788-1-jgross@suse.com> References: <20210211101616.13788-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of a common event for rx and tx queue the event should be regarded to be spurious if no rx and no tx requests are pending. Unfortunately the condition for testing that is wrong causing to decide a event being spurious if no rx OR no tx requests are pending. Fix that plus using local variables for rx/tx pending indicators in order to split function calls and if condition. Fixes: 23025393dbeb3b ("xen/netback: use lateeoi irq binding") Signed-off-by: Juergen Gross --- V2: - new patch, fixing FreeBSD performance issue --- drivers/net/xen-netback/interface.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index acb786d8b1d8..e02a4fbb74de 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c @@ -162,13 +162,15 @@ irqreturn_t xenvif_interrupt(int irq, void *dev_id) { struct xenvif_queue *queue = dev_id; int old; + bool has_rx, has_tx; old = atomic_fetch_or(NETBK_COMMON_EOI, &queue->eoi_pending); WARN(old, "Interrupt while EOI pending\n"); - /* Use bitwise or as we need to call both functions. */ - if ((!xenvif_handle_tx_interrupt(queue) | - !xenvif_handle_rx_interrupt(queue))) { + has_tx = xenvif_handle_tx_interrupt(queue); + has_rx = xenvif_handle_rx_interrupt(queue); + + if (!has_rx && !has_tx) { atomic_andnot(NETBK_COMMON_EOI, &queue->eoi_pending); xen_irq_lateeoi(irq, XEN_EOI_FLAG_SPURIOUS); } -- 2.26.2