From patchwork Tue Jun 11 21:14:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Tsirakis X-Patchwork-Id: 10988299 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 7045E13AF for ; Tue, 11 Jun 2019 21:16:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 631182855A for ; Tue, 11 Jun 2019 21:16:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57C85288D1; Tue, 11 Jun 2019 21:16:18 +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 C4ECD288D0 for ; Tue, 11 Jun 2019 21:16:17 +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 1hao6E-0003VS-Kl; Tue, 11 Jun 2019 21:14:34 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hao6C-0003VN-Mo for xen-devel@lists.xenproject.org; Tue, 11 Jun 2019 21:14:32 +0000 X-Inumbo-ID: e76792cc-8c8d-11e9-8980-bc764e045a96 Received: from mail-qk1-x742.google.com (unknown [2607:f8b0:4864:20::742]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id e76792cc-8c8d-11e9-8980-bc764e045a96; Tue, 11 Jun 2019 21:14:31 +0000 (UTC) Received: by mail-qk1-x742.google.com with SMTP id g18so8648917qkl.3 for ; Tue, 11 Jun 2019 14:14:31 -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; bh=ZWlQYcXiYq4K+TsBHQ76oJw3abz884c7rNhqBJDQvhY=; b=KzzJUiqqlWXmAXq5oChFYRxLoSmE+ijyAhUK9nJ8OyWiql9f5h6WwQoMHZ51YyZYfu MxYDUiGDTT5GSxQL780aeAZ8LX5beYdXBK6CHmntMRwqKbeEa4wXmUS4t9weUeI5JHQK lXJAEFjqydtrL6Lw+45AbuMoYRkBxPUR1QEQpqE1w2R2vbDWkaHM3UrMKO+z40K+kid0 XjX1lhbasV7crh7EiKXzQctP8DUXvLtirlpQFFhrnF4IyyMwPjfMQP4MOOKGbCb5N+hY 0c1OJtQ4EQ/joNJ8Jy0vvRE6iyWhSYEdiCmEgSDnEpewghEfkk8qR+/X5jjHwd2cpeMu VjzA== 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; bh=ZWlQYcXiYq4K+TsBHQ76oJw3abz884c7rNhqBJDQvhY=; b=I3XgWb1Uenf/1TaEOIa8m0X92XiGuQvumjfD1UW9bVdjlH766r1SpKa5AGZhf8JCwd WdHBG9dzp6KuACyvqeHmbUsi8Cj9esgR5JvwmiXfU/Z+l+IkYhTSU/75qSKZ2MME6HQI 16m/skbLyD0J89yjX+71xQj4Hk12LoPfeWa9yoCCQCuUT1l6ce9RLzzqi8sSqQ2lgNuT +Q1DwPTQU7lFZafJkI9qG0CV7LARMuDfdqd+6AwiK2MQiBGPQegdI8g+OwwSg+cdjvLb LbbT7NThmCR9Rz5+ZHNhhdVLwJZ+1nf/pADgZPxD/6VufLic5BeXgROScpKBCFGnGI2T lCEQ== X-Gm-Message-State: APjAAAUG2Ub5A44Qn1BmiE25EisjtmzpuAmV4H/cuMAz9xPXEi9XUWwr GoRyJnvlNyJTL0t5wjW2sWnM3JEqKYI= X-Google-Smtp-Source: APXvYqwi/Hp4L3catgRh/hI46DGvgqjaCvZ1OPd41JWpg/d6ozbPFfNyzZyH+Q0k2Rxe/jFfHYLFHQ== X-Received: by 2002:a37:9885:: with SMTP id a127mr42207785qke.230.1560287670745; Tue, 11 Jun 2019 14:14:30 -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 34sm10070811qtq.59.2019.06.11.14.14.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 14:14:30 -0700 (PDT) From: Nicholas Tsirakis X-Google-Original-From: Nicholas Tsirakis To: xen-devel@lists.xenproject.org Date: Tue, 11 Jun 2019 17:14:26 -0400 Message-Id: X-Mailer: git-send-email 2.17.1 Subject: [Xen-devel] [PATCH v2 1/2] argo: warn sendv() caller when ring is full 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 In its current state, if the destination ring is full, sendv() will requeue the message and return the rc of pending_requeue(), which will return 0 on success. This prevents the caller from distinguishing the difference between a successful write and a message that needs to be resent at a later time. Instead, capture the -EAGAIN value returned from ringbuf_insert() and *only* overwrite it if the rc of pending_requeue() is non-zero. This allows the caller to make intelligent decisions on -EAGAIN and still be alerted if the pending message fails to requeue. Signed-off-by: Nicholas Tsirakis --- xen/common/argo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/common/argo.c b/xen/common/argo.c index 13052b9239..2f874a570d 100644 --- a/xen/common/argo.c +++ b/xen/common/argo.c @@ -2048,9 +2048,13 @@ sendv(struct domain *src_d, xen_argo_addr_t *src_addr, message_type, &len); if ( ret == -EAGAIN ) { + int rc; + argo_dprintk("argo_ringbuf_sendv failed, EAGAIN\n"); /* requeue to issue a notification when space is there */ - ret = pending_requeue(dst_d, ring_info, src_id.domain_id, len); + rc = pending_requeue(dst_d, ring_info, src_id.domain_id, len); + if ( rc ) + ret = rc; } spin_unlock(&ring_info->L3_lock);