From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 1F0A12BF2 for ; Sat, 1 Apr 2017 09:25:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491031555; x=1522567555; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=7DhxCJnocmRgL+KQWPvI2pVhj+Gj7wobsad5m+2ZyZk=; b=wTgFXUoAUf+3KxhtsN26c+7aIEjE4ri/ZXGnpSY5xkKGA8h2nqh7eViv aESP9R4A+nUxE5DILG1zHTzyym++7Q==; Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Apr 2017 00:25:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,256,1486454400"; d="scan'208";a="67700690" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by orsmga002.jf.intel.com with ESMTP; 01 Apr 2017 00:25:40 -0700 From: Yuanhan Liu To: dev@dpdk.org Cc: Maxime Coquelin , Harris James R , Liu Changpeng , Yuanhan Liu Date: Sat, 1 Apr 2017 15:22:52 +0800 Message-Id: <1491031380-1499-15-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1491031380-1499-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1490705142-893-1-git-send-email-yuanhan.liu@linux.intel.com> <1491031380-1499-1-git-send-email-yuanhan.liu@linux.intel.com> Subject: [dpdk-dev] [PATCH v4 14/22] vhost: rename device ops struct 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: Sat, 01 Apr 2017 07:25:56 -0000 rename "virtio_net_device_ops" to "vhost_device_ops", to not let it be virtio-net specific. Signed-off-by: Yuanhan Liu Reviewed-by: Maxime Coquelin --- doc/guides/prog_guide/vhost_lib.rst | 2 +- doc/guides/rel_notes/release_17_05.rst | 3 +++ drivers/net/vhost/rte_eth_vhost.c | 2 +- examples/tep_termination/main.c | 2 +- examples/vhost/main.c | 2 +- lib/librte_vhost/Makefile | 2 +- lib/librte_vhost/rte_virtio_net.h | 4 ++-- lib/librte_vhost/socket.c | 6 +++--- lib/librte_vhost/vhost.h | 4 ++-- 9 files changed, 15 insertions(+), 12 deletions(-) diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst index 40f3b3b..e6e34f3 100644 --- a/doc/guides/prog_guide/vhost_lib.rst +++ b/doc/guides/prog_guide/vhost_lib.rst @@ -122,7 +122,7 @@ The following is an overview of some key Vhost API functions: starts an infinite loop, therefore it should be called in a dedicated thread. -* ``rte_vhost_driver_callback_register(path, virtio_net_device_ops)`` +* ``rte_vhost_driver_callback_register(path, vhost_device_ops)`` This function registers a set of callbacks, to let DPDK applications take the appropriate action when some events happen. The following events are diff --git a/doc/guides/rel_notes/release_17_05.rst b/doc/guides/rel_notes/release_17_05.rst index ebc28f5..a400bd0 100644 --- a/doc/guides/rel_notes/release_17_05.rst +++ b/doc/guides/rel_notes/release_17_05.rst @@ -224,6 +224,9 @@ API Changes * ``linux/if.h`` * ``rte_ether.h`` + * The vhost struct ``virtio_net_device_ops`` is renamed to + ``vhost_device_ops`` + ABI Changes ----------- diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index f6e49da..0b514cc 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -671,7 +671,7 @@ struct vhost_xstats_name_off { return 0; } -static struct virtio_net_device_ops vhost_ops = { +static struct vhost_device_ops vhost_ops = { .new_device = new_device, .destroy_device = destroy_device, .vring_state_changed = vring_state_changed, diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c index 18b977e..738f2d2 100644 --- a/examples/tep_termination/main.c +++ b/examples/tep_termination/main.c @@ -1081,7 +1081,7 @@ static inline void __attribute__((always_inline)) * These callback allow devices to be added to the data core when configuration * has been fully complete. */ -static const struct virtio_net_device_ops virtio_net_device_ops = { +static const struct vhost_device_ops virtio_net_device_ops = { .new_device = new_device, .destroy_device = destroy_device, }; diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 72a9d69..4395306 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1270,7 +1270,7 @@ static inline void __attribute__((always_inline)) * These callback allow devices to be added to the data core when configuration * has been fully complete. */ -static const struct virtio_net_device_ops virtio_net_device_ops = +static const struct vhost_device_ops virtio_net_device_ops = { .new_device = new_device, .destroy_device = destroy_device, diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile index 1b224b3..1262dcc 100644 --- a/lib/librte_vhost/Makefile +++ b/lib/librte_vhost/Makefile @@ -36,7 +36,7 @@ LIB = librte_vhost.a EXPORT_MAP := rte_vhost_version.map -LIBABIVER := 3 +LIBABIVER := 4 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 CFLAGS += -I vhost_user diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h index 9915751..4287c68 100644 --- a/lib/librte_vhost/rte_virtio_net.h +++ b/lib/librte_vhost/rte_virtio_net.h @@ -87,7 +87,7 @@ struct rte_vhost_vring { /** * Device and vring operations. */ -struct virtio_net_device_ops { +struct vhost_device_ops { int (*new_device)(int vid); /**< Add device. */ void (*destroy_device)(int vid); /**< Remove device. */ @@ -202,7 +202,7 @@ static inline uint64_t __attribute__((always_inline)) /* Register callbacks. */ int rte_vhost_driver_callback_register(const char *path, - struct virtio_net_device_ops const * const ops); + struct vhost_device_ops const * const ops); /* Start vhost driver session blocking loop. */ int rte_vhost_driver_session_start(void); diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index aa948b9..3b68fc9 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -78,7 +78,7 @@ struct vhost_user_socket { uint64_t supported_features; uint64_t features; - struct virtio_net_device_ops const *notify_ops; + struct vhost_device_ops const *notify_ops; }; struct vhost_user_connection { @@ -750,7 +750,7 @@ struct vhost_user_reconnect_list { */ int rte_vhost_driver_callback_register(const char *path, - struct virtio_net_device_ops const * const ops) + struct vhost_device_ops const * const ops) { struct vhost_user_socket *vsocket; @@ -763,7 +763,7 @@ struct vhost_user_reconnect_list { return vsocket ? 0 : -1; } -struct virtio_net_device_ops const * +struct vhost_device_ops const * vhost_driver_callback_get(const char *path) { struct vhost_user_socket *vsocket; diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index 672098b..225ff2e 100644 --- a/lib/librte_vhost/vhost.h +++ b/lib/librte_vhost/vhost.h @@ -191,7 +191,7 @@ struct virtio_net { struct ether_addr mac; uint16_t mtu; - struct virtio_net_device_ops const *notify_ops; + struct vhost_device_ops const *notify_ops; uint32_t nr_guest_pages; uint32_t max_guest_pages; @@ -265,7 +265,7 @@ static inline phys_addr_t __attribute__((always_inline)) void vhost_set_ifname(int, const char *if_name, unsigned int if_len); void vhost_enable_dequeue_zero_copy(int vid); -struct virtio_net_device_ops const *vhost_driver_callback_get(const char *path); +struct vhost_device_ops const *vhost_driver_callback_get(const char *path); /* * Backend-specific cleanup. -- 1.9.0