From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AD6CC04AB4 for ; Fri, 17 May 2019 05:36:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 76E3020848 for ; Fri, 17 May 2019 05:36:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727909AbfEQFgA (ORCPT ); Fri, 17 May 2019 01:36:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51660 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727317AbfEQFgA (ORCPT ); Fri, 17 May 2019 01:36:00 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7DB4D81DE6; Fri, 17 May 2019 05:35:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 58AE01001DD2; Fri, 17 May 2019 05:35:59 +0000 (UTC) Received: from zmail21.collab.prod.int.phx2.redhat.com (zmail21.collab.prod.int.phx2.redhat.com [10.5.83.24]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0AB9A1806B10; Fri, 17 May 2019 05:35:59 +0000 (UTC) Date: Fri, 17 May 2019 01:35:58 -0400 (EDT) From: Pankaj Gupta To: Jakub =?utf-8?Q?Staro=C5=84?= Cc: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-acpi@vger.kernel.org, qemu-devel@nongnu.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jack@suse.cz, mst@redhat.com, jasowang@redhat.com, david@fromorbit.com, lcapitulino@redhat.com, adilger kernel , smbarber@google.com, zwisler@kernel.org, aarcange@redhat.com, dave jiang , darrick wong , vishal l verma , david@redhat.com, willy@infradead.org, hch@infradead.org, jmoyer@redhat.com, nilal@redhat.com, lenb@kernel.org, kilobyte@angband.pl, riel@surriel.com, yuval shaia , stefanha@redhat.com, pbonzini@redhat.com, dan j williams , kwolf@redhat.com, tytso@mit.edu, xiaoguangrong eric , cohuck@redhat.com, rjw@rjwysocki.net, imammedo@redhat.com Message-ID: <1954162775.29408078.1558071358974.JavaMail.zimbra@redhat.com> In-Reply-To: References: <20190514145422.16923-1-pagupta@redhat.com> <20190514145422.16923-3-pagupta@redhat.com> Subject: Re: [Qemu-devel] [PATCH v9 2/7] virtio-pmem: Add virtio pmem driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.116.188, 10.4.195.1] Thread-Topic: virtio-pmem: Add virtio pmem driver Thread-Index: Jfq72a6Lppgn6G/na6kHvdhmTQkM6g== X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 17 May 2019 05:35:59 +0000 (UTC) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Hi Jakub, > > On 5/14/19 7:54 AM, Pankaj Gupta wrote: > > + if (!list_empty(&vpmem->req_list)) { > > + req_buf = list_first_entry(&vpmem->req_list, > > + struct virtio_pmem_request, list); > > + req_buf->wq_buf_avail = true; > > + wake_up(&req_buf->wq_buf); > > + list_del(&req_buf->list); > Yes, this change is the right one, thank you! Thank you for the confirmation. > > > + /* > > + * If virtqueue_add_sgs returns -ENOSPC then req_vq virtual > > + * queue does not have free descriptor. We add the request > > + * to req_list and wait for host_ack to wake us up when free > > + * slots are available. > > + */ > > + while ((err = virtqueue_add_sgs(vpmem->req_vq, sgs, 1, 1, req, > > + GFP_ATOMIC)) == -ENOSPC) { > > + > > + dev_err(&vdev->dev, "failed to send command to virtio pmem" \ > > + "device, no free slots in the virtqueue\n"); > > + req->wq_buf_avail = false; > > + list_add_tail(&req->list, &vpmem->req_list); > > + spin_unlock_irqrestore(&vpmem->pmem_lock, flags); > > + > > + /* A host response results in "host_ack" getting called */ > > + wait_event(req->wq_buf, req->wq_buf_avail); > > + spin_lock_irqsave(&vpmem->pmem_lock, flags); > > + } > > + err1 = virtqueue_kick(vpmem->req_vq); > > + spin_unlock_irqrestore(&vpmem->pmem_lock, flags); > > + > > + /* > > + * virtqueue_add_sgs failed with error different than -ENOSPC, we can't > > + * do anything about that. > > + */ > > + if (err || !err1) { > > + dev_info(&vdev->dev, "failed to send command to virtio pmem device\n"); > > + err = -EIO; > > + } else { > > + /* A host repsonse results in "host_ack" getting called */ > > + wait_event(req->host_acked, req->done); > > + err = req->ret; > > +I confirm that the failures I was facing with the `-ENOSPC` error path are > > not present in v9. Can I take it your reviewed/acked-by? or tested-by tag? for the virtio patch :) Thank you, Pankaj > > Best, > Jakub Staron > >