From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] bus/pci: use device driver name instead of handler type Date: Thu, 25 Oct 2018 01:11:39 +0200 Message-ID: <1926208.EzcMdV4ig2@xps> References: <1539967418-17824-1-git-send-email-alejandro.lucero@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, gaetan.rivet@6wind.com To: Alejandro Lucero Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id BC75725B3 for ; Thu, 25 Oct 2018 01:11:38 +0200 (CEST) In-Reply-To: <1539967418-17824-1-git-send-email-alejandro.lucero@netronome.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, 19/10/2018 18:43, Alejandro Lucero: > --- a/drivers/bus/pci/linux/pci.c > +++ b/drivers/bus/pci/linux/pci.c > + char devname[RTE_DEV_NAME_MAX_LEN] = {0}; I think "" would be more appropriate than {0}. > const struct rte_intr_handle *intr_handle = &device->intr_handle; > > - switch (intr_handle->type) { > - case RTE_INTR_HANDLE_UIO: > - case RTE_INTR_HANDLE_UIO_INTX: > + switch (device->kdrv) { > + case RTE_KDRV_IGB_UIO: > return pci_uio_read_config(intr_handle, buf, len, offset); > - > -#ifdef VFIO_PRESENT Why this #ifdef is removed? > - case RTE_INTR_HANDLE_VFIO_MSIX: > - case RTE_INTR_HANDLE_VFIO_MSI: > - case RTE_INTR_HANDLE_VFIO_LEGACY: > + case RTE_KDRV_VFIO: > return pci_vfio_read_config(intr_handle, buf, len, offset); > -#endif > default: > + rte_pci_device_name(&device->addr, devname, > + RTE_DEV_NAME_MAX_LEN); > RTE_LOG(ERR, EAL, > - "Unknown handle type of fd %d\n", > - intr_handle->fd); > + "Unknown driver type for %s\n", devname); > return -1; > }