Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7830762ybh; Fri, 9 Aug 2019 00:20:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDjO9jwWoTiYIJ1U+aS2pBtU3l5Wh5iuUjtIa4aKpDRS18Rt573uraVTOk9Y4T/XPPN/EO X-Received: by 2002:a63:db47:: with SMTP id x7mr16249510pgi.375.1565335218092; Fri, 09 Aug 2019 00:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565335218; cv=none; d=google.com; s=arc-20160816; b=H7H6/pdccYltga5mJXSsmPLnjAWJyW4dKCAvn58/Pc6yzCcQz08+cYrkZIZCdzfx5V z6r13GfJd93DDqN2anfXWFUnr6jh3vhhHD4QqHMTMRBHNDiYTGgwg3WdSbwGlvX986pF OoEM03R78ME9nGq4NAHJkkJqdv9+8yPYwVF8TFvsDsqFPQ75nQMfvxOoRKAeXQdZzfko u+A96RGis/XN+6KdCWpwZUa+1LA4TxhvXIGtvGeUOsBbUQMaTLInBZ0ZIJEbs7F/bZhD XBTyQM0QKn398g3fNHp5niA7kAc30/5m86SBwvNP7AFiG0ibnmIgO2FQBecun4DIwExW Wt2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=TS0CV0A2jKyKsexMt8Oa8TykOJ7mFEt6CITledGBFE0=; b=w+rzRRbUf1eS2kn0UP8j/wuUWPG6jE1HcXNstvKM3MjMgEkZ0AAXw8p67IS2WNfVAW uUyHqV/o8dN+5D61PPzRrRUC74mlkFxE39LRtZ3CTM6MrcnLKxV2dNNBNAuo3bbEbJP4 P/YN7jwdMFQQDLT8nGuTrxTztAOqkaFLGxbrKH8XjCV4J25TqrxsJn0kM1NybvggdaXw Izeil5b+vdCeqVR51s/etTVOZIMkEMnOlDlVs3ruKNhit/LmIvRkOkaJqm6hM/3DazAY xOzrkowLf0A0m1GoyunPcl2QortFGIrNKqRHSD97iZsaCyphlmMH6TBhWWKnQz37lrh5 ZJ5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r15si53166028pgj.71.2019.08.09.00.20.01; Fri, 09 Aug 2019 00:20:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405567AbfHIGsy (ORCPT + 99 others); Fri, 9 Aug 2019 02:48:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44864 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405239AbfHIGsy (ORCPT ); Fri, 9 Aug 2019 02:48:54 -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 5E8F72CD811; Fri, 9 Aug 2019 06:48:54 +0000 (UTC) Received: from dhcp201-121.englab.pnq.redhat.com (unknown [10.65.16.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46ADF1001925; Fri, 9 Aug 2019 06:48:49 +0000 (UTC) From: Pankaj Gupta To: amit@kernel.org, mst@redhat.com Cc: arnd@arndb.de, gregkh@linuxfoundation.org, virtualization@lists.linux-foundation.org, jasowang@redhat.com, linux-kernel@vger.kernel.org, pagupta@redhat.com, xiaohli@redhat.com Subject: [PATCH v3 0/2] virtio_console: fix replug of virtio console port Date: Fri, 9 Aug 2019 12:18:45 +0530 Message-Id: <20190809064847.28918-1-pagupta@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.29]); Fri, 09 Aug 2019 06:48:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series fixes the issue with unplug/replug of a port in virtio console driver which fails with an error "Error allocating inbufs\n". Patch 1 makes use of 'virtqueue_detach_unused_buf' function to detach the unused buffers during port hotunplug time. Patch 2 updates the next avail index for packed ring code. Tested the packed ring code with the qemu virtio 1.1 device code posted here [1]. Changes from v2 Better change log in patch2 - [Greg] Changes from v1[2] Make virtio packed ring code compatible with split ring - [Michael] [1] https://marc.info/?l=qemu-devel&m=156471883703948&w=2 [2] https://lkml.org/lkml/2019/3/4/517 Pankaj Gupta (2): virtio_console: free unused buffers with port delete virtio: decrement avail idx with buffer detach for packed ring char/virtio_console.c | 14 +++++++++++--- virtio/virtio_ring.c | 6 ++++++ 2 files changed, 17 insertions(+), 3 deletions(-) -- 2.21.0