From patchwork Tue Jun 11 17:11:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Tsirakis X-Patchwork-Id: 10987913 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 69B076C5 for ; Tue, 11 Jun 2019 17:17:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D65023B24 for ; Tue, 11 Jun 2019 17:17:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E84F28694; Tue, 11 Jun 2019 17:17:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E4FE52873C for ; Tue, 11 Jun 2019 17:17:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hakMy-0006YT-Au; Tue, 11 Jun 2019 17:15:36 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hakJ6-0006Tt-D5 for xen-devel@lists.xenproject.org; Tue, 11 Jun 2019 17:11:36 +0000 X-Inumbo-ID: f76efcdc-8c6b-11e9-8980-bc764e045a96 Received: from mail-qt1-x841.google.com (unknown [2607:f8b0:4864:20::841]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id f76efcdc-8c6b-11e9-8980-bc764e045a96; Tue, 11 Jun 2019 17:11:35 +0000 (UTC) Received: by mail-qt1-x841.google.com with SMTP id y57so15470498qtk.4 for ; Tue, 11 Jun 2019 10:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=ziayDw4v7TqaC+TVnep2nFZ1Iu6htXCoSZGt4yUQ1yQ=; b=qvogJPHFOAmq6kcPdhGrvi1r5/HKQywxwG2470t6ecePqm9OF0Gc1ZXUjgtslZjKiw 2M+BiKUKu+AsimnrDelsnDApxUyJKH+X2WCNb+jXn5XuJOmXFNZkaIppQm0qbyL5MB6R TULQm3Eu413c9S8KmFnFMjq9K6rZheaFm0G5TeAwTtXjWujZM2r3om8rhGwcs9Q1rrEh WM9WnNwxMfMGqiUiJU4MA8Z3grxqGg8LuBrjWeHgQ5phwOZUa6Np8FCVW88ftHI+s7oi 7nvxBRSbEXP+CcUrecHVhkHF6vJKAelNvusXFfmv4ZgEYQMuWPQlQy18QtU7YydvEIeC mIKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=ziayDw4v7TqaC+TVnep2nFZ1Iu6htXCoSZGt4yUQ1yQ=; b=A8SMJIMCnGAjwgGCxX9yXOqPMCqdE9srSK5DP0qlhlGHrhKtFyPg2OITNZn8USjVP8 Yh6kfpAMP0kxwmvzr4sA/D0YhymEX7lWKTpk5YFrp2JCxo59CX5z6fF4RgajM5FAvgDd OTBXHwxiwx8oxlnqOk2nPNPpT+N+oehQ4PqJWDIIWEhSSDbWjmg1G34eM4eaYZCZTqJG rGynKAieMS/rHc6GE5kDORIJvL66oUTswWX4URp9ZYTFJcoM1VGfQtG3A1lwef5q0r2Z Yol2z4y7GiyGbvAE5RL58N8upfWKSyVM8IjY61/bZ0hnUQTOyHlizzgrlA7DsW6dB2aQ xBEw== X-Gm-Message-State: APjAAAWZbMFM8Y1Uh6Haz0qPoh8yCJTG6JrMK4X/2Od1YTrLkQUSNGlt rNJ34/MNpMiNX/tCLvMPJJnWT9O6pdDW8g== X-Google-Smtp-Source: APXvYqyzO/aAsZE/ZIuyekdXuIpc71vy8N+rUuRp7B4SfmYLbhRuIsOsrZ3hyeGy58xn/GXUIa/LwQ== X-Received: by 2002:ac8:17c8:: with SMTP id r8mr66281608qtk.319.1560273094537; Tue, 11 Jun 2019 10:11:34 -0700 (PDT) Received: from niko-Latitude-E7470.fios-router.home (pool-108-54-183-56.nycmny.fios.verizon.net. [108.54.183.56]) by smtp.gmail.com with ESMTPSA id q2sm7072848qkf.44.2019.06.11.10.11.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 10:11:34 -0700 (PDT) From: Nicholas Tsirakis X-Google-Original-From: Nicholas Tsirakis To: xen-devel@lists.xenproject.org Date: Tue, 11 Jun 2019 13:11:25 -0400 Message-Id: <43766a806049b9556dd73ed8c1d6368ab2b26c4f.1560272437.git.tsirakisn@ainfosec.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-Mailman-Approved-At: Tue, 11 Jun 2019 17:15:35 +0000 Subject: [Xen-devel] [PATCH 2/2] argo: correctly report pending message length X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Nicholas Tsirakis , Christopher Clark MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP When a message is requeue'd in Xen's internal queue, the queue entry contains the length of the message so that Xen knows to send a VIRQ to the respective domain when enough space frees up in the ring. Due to a small bug, however, Xen doesn't populate the length of the msg if a given write fails, so this length is always reported as zero. This causes Xen to spurriously wake up a domain even when the ring doesn't have enough space. This patch makes sure that the msg len is properly reported by populating it in the event of a write failure. Signed-off-by: Nicholas Tsirakis --- xen/common/argo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/common/argo.c b/xen/common/argo.c index 2f874a570d..eb541829d6 100644 --- a/xen/common/argo.c +++ b/xen/common/argo.c @@ -2050,6 +2050,12 @@ sendv(struct domain *src_d, xen_argo_addr_t *src_addr, { int rc; + /* + * if ringbuf_insert fails, then len will never be populated. + * make sure to populate it here. + */ + iov_count(iovs, niov, &len); + argo_dprintk("argo_ringbuf_sendv failed, EAGAIN\n"); /* requeue to issue a notification when space is there */ rc = pending_requeue(dst_d, ring_info, src_id.domain_id, len);