From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by dpdk.org (Postfix) with ESMTP id 6CDC23F9 for ; Thu, 5 Jun 2014 19:06:24 +0200 (CEST) Received: by mail-pb0-f41.google.com with SMTP id uo5so1377652pbc.14 for ; Thu, 05 Jun 2014 10:06:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=0hCCQh2cpFrljgXAW7IGdH/WkJ26czbB8XJUx+y/5gI=; b=KtIsyzbBJkjnuVyXu0FDU7VHw6/TJGbY1aBsX50y+XN1s68WqztZ0c/VNp1SRd888v WL9jvVnqsEv1dT3qFAKGQMLGrWhPc3n5hp6kDt1S5wJGH090tvb18tVKglKqLaDlZMoK w9bB7Zt6dAXDIY3V0OOhz1GFDvFlMaTcqFPi39PXYLZ36c9UmytB5O0sBe019ltk7+e+ dv7sGLqalXxQqJZs9XceTOBK199eHhnADP5nNhXPdkZwOQxwAnhA3ZyYKnHnQ69lfMvi BukwVmw2QZPI5CfNQKTNr8I2Zfmn9IggCC7oQXuIDrahCInQBD119/7KCaQgoVi0ud8i EgQg== X-Gm-Message-State: ALoCoQkk9reD0U6upHK5AppQ9EL7s90IMiWfnLndWkFTRATJyudA8w/kCXoWODpqS38dfpyP7eSe X-Received: by 10.68.160.163 with SMTP id xl3mr79879460pbb.39.1401987996854; Thu, 05 Jun 2014 10:06:36 -0700 (PDT) Received: from nehalam.linuxnetplumber.net (static-50-53-83-51.bvtn.or.frontiernet.net. [50.53.83.51]) by mx.google.com with ESMTPSA id sh5sm25032489pbc.21.2014.06.05.10.06.36 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 05 Jun 2014 10:06:36 -0700 (PDT) Date: Thu, 5 Jun 2014 10:06:33 -0700 From: Stephen Hemminger To: Alan Carew Message-ID: <20140605100633.6a6047bd@nehalam.linuxnetplumber.net> In-Reply-To: <1401979159-14576-1-git-send-email-alan.carew@intel.com> References: <1401979159-14576-1-git-send-email-alan.carew@intel.com> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 0/4] librte_pmd_virtio :Fix: virtio_pci.h non-existent virtio feature bit-flag tested X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2014 17:06:24 -0000 On Thu, 5 Jun 2014 15:39:15 +0100 Alan Carew wrote: > This series addresses an issue with librte_pmd_virtio where the offset to the > virtio device specific header may be incorrect depending on whether MSI-X has > been enabled or not. > > If MSI-X is configured the device specific header is placed at byte offset 24 > relative to the IO base address. > If MSI-X is not configured the device specific header is placed at > byte offset 20. > > The following macro defined in virtio_pci.h is used to test the > presence of the MSI-X header and determine the correct offset: > #define VIRTIO_PCI_CONFIG(hw) (((hw)->guest_features & VIRTIO_PCI_FLAG_MSIX) ? 24 : 20) > > However, VIRTIO_PCI_FLAG_MSIX is not a guest_feature nor is it part of the > Virtio Specification and resolves to the VIRTIO_NET_F_MAC feature as both > are #defined as 0x20. > > VIRTIO_PCI_FLAG_MSIX or similar flag should instead be set by the kernel > driver allocating resources and passed to user space for testing. > i.e. > #define VIRTIO_PCI_CONFIG(hw) (((hw)->intr_mode & IGBUIO_MSIX_INTR_MODE) ? 24 : 20) > > To enable this testing of interrupt mode, this series allows for the kernel > driver(igb_uio) to place the configured interrupt mode into a sysfs entry. > sysfs is then parsed by eal_pci to determine the configured mode, which > allows all user space devices to correctly determine the interrupt mode, > including virtio_ethdev. Why not scan for the IRQ in /proc/interrupts rather than changing the kernel driver. I ask because my goal is to get rid of igb_uio and it's quirks and use uio_pci_generic instead.