From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752914AbdBCI0M (ORCPT ); Fri, 3 Feb 2017 03:26:12 -0500 Received: from verein.lst.de ([213.95.11.211]:46635 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752840AbdBCI0I (ORCPT ); Fri, 3 Feb 2017 03:26:08 -0500 Date: Fri, 3 Feb 2017 09:26:06 +0100 From: Christoph Hellwig To: Jason Wang Cc: Christoph Hellwig , mst@redhat.com, axboe@kernel.dk, pbonzini@redhat.com, virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/9] virtio_pci: use shared interrupts for virtqueues Message-ID: <20170203082606.GB26800@lst.de> References: <1485504997-17584-1-git-send-email-hch@lst.de> <1485504997-17584-3-git-send-email-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 03, 2017 at 03:54:54PM +0800, Jason Wang wrote: > On 2017年01月27日 16:16, Christoph Hellwig wrote: >> + snprintf(vp_dev->msix_names[i + 1], >> + sizeof(*vp_dev->msix_names), "%s-%s", >> dev_name(&vp_dev->vdev.dev), names[i]); >> err = request_irq(pci_irq_vector(vp_dev->pci_dev, msix_vec), >> - vring_interrupt, 0, >> - vp_dev->msix_names[msix_vec], >> - vqs[i]); >> + vring_interrupt, IRQF_SHARED, >> + vp_dev->msix_names[i + 1], vqs[i]); > > Do we need to check per_vq_vectors before dereferencing msix_names[i + 1] ? No, we need to allocate the array larger in that case as want proper names for the interrupts.