From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by dpdk.org (Postfix) with ESMTP id 6265C2BB0 for ; Thu, 25 Oct 2018 08:01:03 +0200 (CEST) Received: by mail-ed1-f68.google.com with SMTP id c1-v6so7276392ede.5 for ; Wed, 24 Oct 2018 23:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=clXg+eivpcwwffCeyo19CvoiUWktpbTIDq5fexq6UPk=; b=YmEH0V8EegchrMg2sHjtxZF3IDu6ZVCGbps6j8B2jU+s4aR7LIhzw127cJ2hH6eYtA F/oXNce+oI2o7SZE5sRIRej9f53N7StK28iCqRBNw+7jwTmSnhoYfNddUZRQHjH5rKF2 E1xaT7UwvAowlIAuibQYRmyeQHyKA5jzVzodGfgVfmRLLiiw2Svj+dm3Uv5wdWAWuWRe NpC54CD1QS1HRf3PyKx1vHC8JZ+a7yvLQQ5xt8eVwdBy/n+tM97LSOeT2WQ8+bMak7Zn D/uzTNcTXCRuELEl06BF3irJBGQGg75TI40oMwQFyJ7fJQHOKjStlJcbkoOs+UnVkycN i0wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=clXg+eivpcwwffCeyo19CvoiUWktpbTIDq5fexq6UPk=; b=p5wiErVZm5+v/OVsiM27kLs+MqJbTtPb/RO2Rxwej94AU1+rS0gCJHKJigEKHo2M9Z GwKYl/4wwX/bGdG/J3GBN+OBt3ptz+MM5NbYf0UlQRU9i2i2gDyFr/TnUaLrHbQwX2ej HpiVmd30yve3yasnAMu7p91ug/1eWKFw9Bh9Ge5f916qRof0pHBygCiipEOkCNS/51MS ZgQFbcr4CpPeITFjqAXbHT3LJmG0LTeYRatu2k1MfQh+b6PmUbQxyVxG0kdUrZz33all C9sbi8/YHfhxTkYFmlRJBPgpswvP1Mm4/WyNLYxul5ptc4JnIa/PxvadAug5pTuzLwz5 kVyQ== X-Gm-Message-State: AGRZ1gJZXJMLzKnJS0d8JhQK4gOlDON2FiJ0ij2LnB5SGhmHFNQTU+aQ TzO7ynSASyzu10TNa7zXZZI9ABxoIzeEczBcQLIjUg== X-Google-Smtp-Source: AJdET5e0azOoY3563qxEc5NF0tPlOTw+8hDQnOTraQqSRCYnkt1ofkyJISN6Rt1AqtcHj5/3UWNPlzJtkcT5hdGrE7E= X-Received: by 2002:a17:906:31db:: with SMTP id f27-v6mr344659ejf.186.1540447263058; Wed, 24 Oct 2018 23:01:03 -0700 (PDT) MIME-Version: 1.0 References: <1539967418-17824-1-git-send-email-alejandro.lucero@netronome.com> <1926208.EzcMdV4ig2@xps> In-Reply-To: From: Alejandro Lucero Date: Thu, 25 Oct 2018 07:00:51 +0100 Message-ID: To: Thomas Monjalon Cc: dev , Gaetan Rivet Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] bus/pci: use device driver name instead of handler type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2018 06:01:03 -0000 On Thu, Oct 25, 2018 at 6:30 AM Alejandro Lucero < alejandro.lucero@netronome.com> wrote: > > > On Thu, Oct 25, 2018 at 12:11 AM Thomas Monjalon > wrote: > >> 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? >> >> > Because it is not needed. VFIO is present if the kdrv field tells us so. > And at this point it is clear VFIO is present if that is the case. Otherwise this code is not executed. > > >> > - 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; >> > } >> >> >> >>