From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2F8F812A8 for ; Tue, 8 Mar 2016 09:49:27 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 08 Mar 2016 00:49:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,556,1449561600"; d="scan'208";a="904733104" Received: from yliu-dev.sh.intel.com ([10.239.66.49]) by orsmga001.jf.intel.com with ESMTP; 08 Mar 2016 00:48:59 -0800 From: Yuanhan Liu To: dev@dpdk.org Date: Tue, 8 Mar 2016 16:51:21 +0800 Message-Id: <1457427081-7290-1-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 Subject: [dpdk-dev] [PATCH] vhost: fix build error for old kernels X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2016 08:49:28 -0000 VIRTIO_NET_F_GUEST_ANNOUNCE is a new feature introduced since kernel v3.5. For older kernels (or more precisely, old distributions), we could simply define it manually, to fix the "macro not defined" error. Fixes: d293dac8f30e ("vhost: claim support of guest announce") Signed-off-by: Yuanhan Liu --- lib/librte_vhost/rte_virtio_net.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h index 7d1fde2..443245d 100644 --- a/lib/librte_vhost/rte_virtio_net.h +++ b/lib/librte_vhost/rte_virtio_net.h @@ -97,6 +97,11 @@ struct vhost_virtqueue { struct buf_vector buf_vec[BUF_VECTOR_MAX]; /**< for scatter RX. */ } __rte_cache_aligned; +/* Old kernels have no such macro defined */ +#ifndef VIRTIO_NET_F_GUEST_ANNOUNCE + #define VIRTIO_NET_F_GUEST_ANNOUNCE 21 +#endif + /* * Make an extra wrapper for VIRTIO_NET_F_MQ and -- 1.9.0