From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: [PATCH v3 17/20] vhost: reserve few more space for future extension Date: Tue, 7 Jun 2016 11:52:07 +0800 Message-ID: <1465271530-27878-18-git-send-email-yuanhan.liu@linux.intel.com> References: <1463117111-27050-1-git-send-email-yuanhan.liu@linux.intel.com> <1465271530-27878-1-git-send-email-yuanhan.liu@linux.intel.com> Cc: huawei.xie@intel.com, Thomas Monjalon , Panu Matilainen , Traynor Kevin , Rich Lane , Tetsuya Mukawa , Yuanhan Liu To: dev@dpdk.org Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 1CC527F58 for ; Tue, 7 Jun 2016 05:51:51 +0200 (CEST) In-Reply-To: <1465271530-27878-1-git-send-email-yuanhan.liu@linux.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" "virtio_net_device_ops" is the only left open struct that an application can access, therefore, it's the only place that might introduce potential ABI break in future for extension. So, do some reservation for it. 5 should be pretty enough, considering that we have barely touched it for a long while. Another reason to choose 5 is for cache alignment: 5 makes the struct 64 bytes for 64 bit machine. With this, it's confidence to say that we might be able to be free from the ABI violation forever. Signed-off-by: Yuanhan Liu Tested-by: Rich Lane Acked-by: Rich Lane --- lib/librte_vhost/rte_virtio_net.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h index fc1d799..bc2b74b 100644 --- a/lib/librte_vhost/rte_virtio_net.h +++ b/lib/librte_vhost/rte_virtio_net.h @@ -66,6 +66,8 @@ struct virtio_net_device_ops { void (*destroy_device)(int vid); /**< Remove device. */ int (*vring_state_changed)(int vid, uint16_t queue_id, int enable); /**< triggered when a vring is enabled or disabled */ + + void *reserved[5]; /**< Reserved for future extension */ }; /** -- 1.9.0