DOC "Find the Vpp vlib library"
)
+find_library(VPP_LIBRARY_VPPAPICLIENT
+ NAMES vppapiclient
+ HINTS ${VPP_SEARCH_PATH_LIST}
+ PATH_SUFFIXES lib lib64
+ DOC "Find the Vpp vlib library"
+)
+
set(VPP_LIBRARIES ${VPP_LIBRARY_MEMORYCLIENT} ${VPP_LIBRARY_SVM} ${VPP_LIBRARY_INFRA} ${VPP_LIBRARY_VATPLUGIN} ${VPP_LIBRARY_VLIB})
set(VPP_INCLUDE_DIRS ${VPP_INCLUDE_DIR} ${VPP_INCLUDE_DIR}/vpp_plugins)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Vpp DEFAULT_MSG VPP_LIBRARIES VPP_INCLUDE_DIRS)
\ No newline at end of file
+find_package_handle_standard_args(Vpp DEFAULT_MSG VPP_LIBRARIES VPP_INCLUDE_DIRS)
Build dependencies:
-- VPP 19.01
+- VPP 19.04
- DEB packages:
- vpp
- vpp-lib
#include "pcs.h"
-/*
- * Node context data; we think this is per-thread/instance
- */
-typedef struct hicn_data_fwd_runtime_s
-{
- vlib_combined_counter_main_t repm_counters;
-
- /* per-cpu vector of cloned packets */
- u32 **clones;
-} hicn_data_fwd_runtime_t;
-
/* Trace context struct */
typedef struct
{
}
return n_buffers;
}
- n_buffers = vlib_buffer_alloc_from_free_list (vm, buffers, n_buffers,
- vlib_buffer_get_free_list_index
- (s));
+ n_buffers = vlib_buffer_alloc_from_pool (vm, buffers, n_buffers,
+ s->buffer_pool_index);
for (i = 0; i < n_buffers; i++)
{
d->current_data = s->current_data;
d->current_length = head_end_offset;
d->trace_index = s->trace_index;
- vlib_buffer_set_free_list_index (d,
- vlib_buffer_get_free_list_index (s));
d->total_length_not_including_first_buffer = s->current_length -
head_end_offset;
d->next_buffer = src_buffer;
}
vlib_buffer_advance (s, head_end_offset);
- s->n_add_refs = n_buffers - 1;
+ s->ref_count = n_buffers - 1;
while (s->flags & VLIB_BUFFER_NEXT_PRESENT)
{
s = vlib_get_buffer (vm, s->next_buffer);
- s->n_add_refs = n_buffers - 1;
+ s->ref_count = n_buffers - 1;
}
return n_buffers;
/**
* @brief Create multiple clones of buffer and store them
* in the supplied array. Unlike the function in the vlib library,
- * we allow src_buffer to have n_add_refs != 0.
+ * we allow src_buffer to have ref_count != 0.
*
* @param vm - (vlib_main_t *) vlib main data structure pointer
* @param src_buffer - (u32) source buffer index
s->total_length_not_including_first_buffer = 0;
u16 n_cloned = 0;
- u8 n_clone_src = 255 - s->n_add_refs;
+ u8 n_clone_src = 255 - s->ref_count;
/*
* We need to copy src for all the clones that cannot be chained in
* the src_buffer
*/
- /* MAX(n_add_refs) = 256 */
+ /* MAX(ref_count) = 256 */
if (n_buffers > n_clone_src)
{
vlib_buffer_t *copy;
n_buffers -= n_cloned;
}
/*
- * vlib_buffer_clone_256 check if n_add_refs is 0. We force it to be
+ * vlib_buffer_clone_256 check if ref_count is 0. We force it to be
* 0 before calling the function and we retore it to the right value
* after the function has been called
*/
- u8 tmp_n_add_refs = s->n_add_refs;
+ u8 tmp_ref_count = s->ref_count;
- s->n_add_refs = 0;
+ s->ref_count = 0;
/*
* The regular vlib_buffer_clone_256 does copy if we need to clone
* only one packet. While this is not a problem per se, it adds
* complexity to the code, especially because we need to add 1 to
- * n_add_refs when the packet is cloned.
+ * ref_count when the packet is cloned.
*/
n_cloned += vlib_buffer_clone_256_2 (vm,
src_buffer,
(buffers + n_cloned),
n_buffers, head_end_offset);
- s->n_add_refs += tmp_n_add_refs;
+ s->ref_count += tmp_ref_count;
return n_cloned;
}
* longer in any frame. The vlib_buffer will be freed when
* all its cloned vlib_buffer will be freed.
*/
- b0->n_add_refs--;
+ b0->ref_count--;
}
/* Delete the PIT entry */
* longer in any frame. The vlib_buffer will be freed when
* all its cloned vlib_buffer will be freed.
*/
- b0->n_add_refs--;
+ b0->ref_count--;
}
/* Delete the PIT entry */
else
{
/* Add one reference to maintain the buffer in the CS.
- * b0->n_add_refs == 0 has two meaning: it has 1 buffer or no buffer chained to it.
+ * b0->ref_count == 0 has two meaning: it has 1 buffer or no buffer chained to it.
* vlib_buffer_clone2 add a number of reference equalt to pitp->u.pit.faces.n_faces - 1
* as vlib_buffer_clone does. So after all the packet are forwarded the buffer stored in
- * the CS will have n_add_refs == 0;
+ * the CS will have ref_count == 0;
*/
- b0->n_add_refs++;
+ b0->ref_count++;
}
found = n_left_from =
.function = hicn_data_node_fn,
.name = "hicn-data-fwd",
.vector_size = sizeof(u32),
- .runtime_data_bytes = sizeof(hicn_data_fwd_runtime_t),
.format_trace = hicn_data_fwd_format_trace,
.type = VLIB_NODE_TYPE_INTERNAL,
.n_errors = ARRAY_LEN(hicn_data_fwd_error_strings),
else
{
vlib_buffer_advance (cs_buf, -buffer_advance);
- if (PREDICT_FALSE (cs_buf->n_add_refs == 255))
+ if (PREDICT_FALSE (cs_buf->ref_count == 255))
{
vlib_buffer_t *cs_buf2 = vlib_buffer_copy (vm, cs_buf);
vlib_buffer_advance (cs_buf, buffer_advance);
*bi0_cs = vlib_get_buffer_index (vm, cs_buf2);
- cs_buf->n_add_refs--;
+ cs_buf->ref_count--;
cs_buf = cs_buf2;
}
bytes_to_copy = 1500 - pkt_len;
}
/* Add content to the data packet */
- vlib_buffer_add_data (vm,
- VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX, &bi0,
- rb->data, bytes_to_copy);
+ vlib_buffer_add_data (vm, &bi0, rb->data, bytes_to_copy);
b0 = vlib_get_buffer (vm, bi0);
bytes_to_copy = 1500 - pkt_len;
}
/* Add content to the data packet */
- vlib_buffer_add_data (vm,
- VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX, &bi0,
- rb->data, bytes_to_copy);
+ vlib_buffer_add_data (vm, &bi0, rb->data, bytes_to_copy);
b0 = vlib_get_buffer (vm, bi0);
${LIBPARC_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${HICN_LIBRARIES}
- ${VPP_LIBRARIES}
+ ${VPP_LIBRARY_VPPAPICLIENT}
${ANDROID_LIBRARIES}
${OPENSSL_LIBRARIES}
${WINDOWS_LIBRARIES}
PACKAGECLOUD_RELEASE_REPO_RPM="https://packagecloud.io/install/repositories/fdio/release/script.rpm.sh"
VPP_GIT_REPO="https://git.fd.io/vpp"
-VPP_BRANCH="stable/1901"
+VPP_BRANCH="stable/1904"
-VPP_VERSION_DEB="19.01.1-release"
-VPP_VERSION_RPM="19.01.1-release.x86_64"
+VPP_VERSION_DEB="19.04-release"
+VPP_VERSION_RPM="19.04-release.x86_64"
BUILD_TOOLS_UBUNTU="build-essential doxygen"
LIBSSL_LIBEVENT_UBUNTU="libevent-dev libssl-dev"
-DEPS_UBUNTU="libparc-dev libasio-dev libcurl4-openssl-dev vpp-dev=${VPP_VERSION_DEB} vpp-lib=${VPP_VERSION_DEB}"
+DEPS_UBUNTU="libparc-dev libasio-dev libcurl4-openssl-dev vpp-dev=${VPP_VERSION_DEB} libvppinfra=${VPP_VERSION_DEB} libvppinfra-dev=${VPP_VERSION_DEB} vpp-plugin-core=${VPP_VERSION_DEB}"
# BUILD_TOOLS_GROUP_CENTOS="'Development Tools'"
DEPS_CENTOS="vpp-devel-${VPP_VERSION_RPM} vpp-lib-${VPP_VERSION_RPM} libparc-devel libcurl-devel asio-devel centos-release-scl devtoolset-7"
+DEPS_CENTOS_NOVERSION="vpp-devel vpp-lib libparc-devel libcurl-devel asio-devel centos-release-scl devtoolset-7"
LATEST_EPEL_REPO="http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
install_cmake() {
fi
cat /etc/resolv.conf
-
+``
CMAKE_INSTALL_SCRIPT_URL="https://cmake.org/files/v3.8/cmake-3.8.0-Linux-x86_64.sh"
CMAKE_INSTALL_SCRIPT="/tmp/install_cmake.sh"
curl ${CMAKE_INSTALL_SCRIPT_URL} > ${CMAKE_INSTALL_SCRIPT}
DISTRIB_ID=${1}
if [ "${DISTRIB_ID}" == "ubuntu" ]; then
+ rm -r /etc/apt/sources.list.d/*
curl -s ${PACKAGECLOUD_RELEASE_REPO_DEB} | sudo bash
elif [ "${DISTRIB_ID}" == "centos" ]; then
curl -s ${PACKAGECLOUD_RELEASE_REPO_RPM} | sudo bash
${CC_COMPILER} --version
export CC=${CC_COMPILER} CXX=${CXX_COMPILER}
-
- build_libmemif_static
fi
+ build_libmemif_static
+
# do nothing but check compiler version
c++ --version
}