From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 7905AF90 for ; Mon, 30 Apr 2018 16:43:52 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id j5so14672419wme.5 for ; Mon, 30 Apr 2018 07:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8JyYS7x5ku+X+2g+CjPZtIs88619DwgCOhFt57fB8Ek=; b=LEK95/NmNfceZx8ZwdHlIOw21YEfruZFexr3atrWk1HufvQGNHS4D3U554OeIba5CW bXR2cw42BUQWAdYFHz7y67Bo1skR7YhKvsozB2UOWE88OqTuRVOLo91jTgM+z3PK5imE YCnDPyW+uzz7CjwPmnoUCS9OMaBwOum46ENgtHSm145aUZzFs403OIOKYJoySah6Tpy4 ovJl5J6fAI6rrqMndtN/+bJ1LqEh2AgUGTiqbpb6kJ4IGwBcNgiVMetr46QoQ5c5+3V1 63P9ioPpWaVDrIbqP2bJfZ0J7Trite10t001HjdPYC0VIizZY/XhIuAFotM4ehqSBMFW YGJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8JyYS7x5ku+X+2g+CjPZtIs88619DwgCOhFt57fB8Ek=; b=s9kWGGNJEggrYp/DeDMUlJD2+g5v4MnT1DbbQn3fW3S2UWEpHY/LWg2r6iMIOdHCcc ZF6Oz7vOLNfGuvOhyAmEFmXwCtc2hwX+acW9b93n5HHmSKr9zv9Rwo1C5QeehRbagCQV sowjp0b6fYJz4ZmG4u28Zq4tcKpL4e243Q1DbYjHLFQlTYnfahvYQqbiS7TxjAbEBjEL wsyOMfCAkX/t+FHzMxZYnyZOYNQK0MuD2plJ8jj7LoP6tO/+j1VsAq0i5Zt3DpqhdAJ5 gEBKOVceloBinY8A7L4zCSMi0cgiquRQA15yJ+KuWGgRTDgONLALJxEWuIh3AEu6BAnU Tdkg== X-Gm-Message-State: ALQs6tA/rKQgT+pzSdhbi0uFde1pYFjjVfB1Bow+09wcqLLrcfwgQoO5 tCnlEOQu/sRpdsS5dO3BMow= X-Google-Smtp-Source: AB8JxZpngSs6x+vsS0fS1hk3K5qxkLc5z+4ljcIfCqS65xFF1IaE/g5LNNx13pKacCOP4Jo3dif+Ng== X-Received: by 10.28.236.19 with SMTP id k19mr7998649wmh.11.1525099432127; Mon, 30 Apr 2018 07:43:52 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id 90-v6sm8040943wrl.79.2018.04.30.07.43.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:43:51 -0700 (PDT) From: luca.boccassi@gmail.com To: Anatoly Burakov Cc: dpdk stable Date: Mon, 30 Apr 2018 15:41:09 +0100 Message-Id: <20180430144223.18657-54-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430144223.18657-1-luca.boccassi@gmail.com> References: <20180430140606.4615-80-luca.boccassi@gmail.com> <20180430144223.18657-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'vfio: export functions even when disabled' has been queued to stable release 18.02.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 14:43:52 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 6d0f8aefc7c177a0d64107f5c3e8d2a713d09e5b Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Mon, 16 Apr 2018 13:13:56 +0100 Subject: [PATCH] vfio: export functions even when disabled [ upstream commit 6e8a721044c6ef677e67991f3f2a9bd0870eecc2 ] Previously, VFIO functions were not compiled in and exported if VFIO compilation was disabled. Fix this by actually compiling all of the functions unconditionally, and provide missing prototypes on Linux. Fixes: 279b581c897d ("vfio: expose functions") Fixes: 73a639085938 ("vfio: allow to map other memory regions") Fixes: 964b2f3bfb07 ("vfio: export some internal functions") Signed-off-by: Anatoly Burakov --- lib/librte_eal/bsdapp/eal/eal.c | 13 +------ lib/librte_eal/common/include/rte_vfio.h | 15 +++++--- lib/librte_eal/linuxapp/eal/eal_vfio.c | 64 +++++++++++++++++++++++++++++++- 3 files changed, 74 insertions(+), 18 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 4eafcb5ad..b1b8f7600 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -735,18 +736,6 @@ rte_eal_vfio_intr_mode(void) return RTE_INTR_MODE_NONE; } -/* dummy forward declaration. */ -struct vfio_device_info; - -/* dummy prototypes. */ -int rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, - int *vfio_dev_fd, struct vfio_device_info *device_info); -int rte_vfio_release_device(const char *sysfs_base, const char *dev_addr, int fd); -int rte_vfio_enable(const char *modname); -int rte_vfio_is_enabled(const char *modname); -int rte_vfio_noiommu_is_enabled(void); -int rte_vfio_clear_group(int vfio_group_fd); - int rte_vfio_setup_device(__rte_unused const char *sysfs_base, __rte_unused const char *dev_addr, __rte_unused int *vfio_dev_fd, diff --git a/lib/librte_eal/common/include/rte_vfio.h b/lib/librte_eal/common/include/rte_vfio.h index 249095e46..c98ba48dc 100644 --- a/lib/librte_eal/common/include/rte_vfio.h +++ b/lib/librte_eal/common/include/rte_vfio.h @@ -5,6 +5,10 @@ #ifndef _RTE_VFIO_H_ #define _RTE_VFIO_H_ +#ifdef __cplusplus +extern "C" { +#endif + /* * determine if VFIO is present on the system */ @@ -28,9 +32,12 @@ #define VFIO_NOIOMMU_MODE \ "/sys/module/vfio/parameters/enable_unsafe_noiommu_mode" -#ifdef __cplusplus -extern "C" { -#endif +#else /* not VFIO_PRESENT */ + +/* we don't need an actual definition, only pointer is used */ +struct vfio_device_info; + +#endif /* VFIO_PRESENT */ /** * Setup vfio_cfg for the device identified by its address. @@ -131,6 +138,4 @@ rte_vfio_clear_group(int vfio_group_fd); } #endif -#endif /* VFIO_PRESENT */ - #endif /* _RTE_VFIO_H_ */ diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index 9e593184c..d20ec8d9f 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -838,4 +838,66 @@ rte_vfio_noiommu_is_enabled(void) return c == 'Y'; } -#endif +#else + +int +rte_vfio_setup_device(__rte_unused const char *sysfs_base, + __rte_unused const char *dev_addr, + __rte_unused int *vfio_dev_fd, + __rte_unused struct vfio_device_info *device_info) +{ + return -1; +} + +int +rte_vfio_release_device(__rte_unused const char *sysfs_base, + __rte_unused const char *dev_addr, __rte_unused int fd) +{ + return -1; +} + +int +rte_vfio_enable(__rte_unused const char *modname) +{ + return -1; +} + +int +rte_vfio_is_enabled(__rte_unused const char *modname) +{ + return -1; +} + +int +rte_vfio_noiommu_is_enabled(void) +{ + return -1; +} + +int +rte_vfio_clear_group(__rte_unused int vfio_group_fd) +{ + return -1; +} + +int __rte_experimental +rte_vfio_get_group_num(__rte_unused const char *sysfs_base, + __rte_unused const char *dev_addr, + __rte_unused int *iommu_group_num) +{ + return -1; +} + +int __rte_experimental +rte_vfio_get_container_fd(void) +{ + return -1; +} + +int __rte_experimental +rte_vfio_get_group_fd(__rte_unused int iommu_group_num) +{ + return -1; +} + +#endif /* VFIO_PRESENT */ -- 2.14.2