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 AFD114C99 for ; Thu, 25 Oct 2018 11:45:12 +0200 (CEST) Received: by mail-ed1-f68.google.com with SMTP id r1-v6so7824553edd.7 for ; Thu, 25 Oct 2018 02:45:12 -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=Ckqg2+tseiUQwpI0R24ngU/UKO2sykuuKHT46VmW9jY=; b=MNOULfuBpxf60g3i2sTA5FCgOHF2Nx8+lM14IuRCBfXqCg1o8O+rBB2N2egFBIGhh9 f2s2SZj2rmHIaMDEXkBAMhhbX+fgWKUyOU7q0uJZJ7zQWR0jowLJHLPK+rB0c6Cq4WYt Vt6WpzoFqfMdRTPJitduG02BYGQpWHtZGPHqv7RusKApQLwGiOgPKulS8B2JpjbR/2ch QPOYCWrlm7SowAwv0YaMGOvZ5jy3j/3Ln7pAuQ+VhldAZlBlKYDtwpjMFGEo3HoTse9i v8vvbB8+h22Oqo2gyzHCHRlqJwvhMLPwgl8+9kQ6p+4auY7idRIaWM+uqGrKx5AXApOV umIQ== 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=Ckqg2+tseiUQwpI0R24ngU/UKO2sykuuKHT46VmW9jY=; b=rXaO+1t+zHg7YhEX3QIGpOeTErgLr+a0LrrEZEMAcmLFGjUFWfVKe20qAkHsrL7ub2 /KtCjcYywVCltkvAPqUaOsNHeMXUCEfmkTxDfWcmViwZv5KKFZmBDgZFX/p5cXusTpyd G3DQUMJ7opqm+XfP0UWlObR5I5lo/oj+Rwh2sxO0JYpr+EG8DRioe5gl54bIERwPKmUN 7UMjDGmrtuZCCpkef7rkfcBBFImRK2NUlnZm2kPqBHAqO7tDRIIiKQ2ZxAEZZExz0Njm +ceqlmE/8GTxr23jWjkLjy/RGEJeR+nWg7agRBcR5N3yN6B/Y2gTrDdiYbrXxNaHiTOS XxTw== X-Gm-Message-State: AGRZ1gKYNN2RnEJj4Qcyy5pOlP+GO8F4l9YgT+ToN1639hdX1ieWqWlZ qdvER4aVMHdR8/GWJVXQBxW4xj0J24Nl1xyUwJGFedS8 X-Google-Smtp-Source: AJdET5dg1v6MygvkTKzzMouq6QmhY4IXWvCLR44QrO34/I6Tpn/tHGcxkqUrHTEOwJNzP1tUAJq4xS8BX0ffoZo26Ws= X-Received: by 2002:aa7:c313:: with SMTP id l19-v6mr924298edq.173.1540460712335; Thu, 25 Oct 2018 02:45:12 -0700 (PDT) MIME-Version: 1.0 References: <1539967418-17824-1-git-send-email-alejandro.lucero@netronome.com> <1926208.EzcMdV4ig2@xps> <4f2c94c7-8999-80ba-62a0-024551c15e6e@intel.com> In-Reply-To: <4f2c94c7-8999-80ba-62a0-024551c15e6e@intel.com> From: Alejandro Lucero Date: Thu, 25 Oct 2018 10:45:01 +0100 Message-ID: To: "Burakov, Anatoly" Cc: Thomas Monjalon , 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 09:45:12 -0000 On Thu, Oct 25, 2018 at 10:29 AM Burakov, Anatoly wrote: > On 25-Oct-18 7:00 AM, Alejandro Lucero wrote: > > 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. > > Actually, i think Thomas is right here. The #ifdef shouldn't be removed, > because if this is not defined, the function is simply not present - see > pci_init.h, VFIO-related functions are only declared if VFIO_PRESENT is > defined. > > Right. I did not try to compile without VFIO, but I have just done this and it fails. I will send another version using the #ifdef for VFIO. Thanks > > > > > >> > >> > >>>> - 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; > >>>> } > >>> > >>> > >>> > >>> > > > > > -- > Thanks, > Anatoly >