Skip to content

Commit

Permalink
[HICN-263] DO_NOT_MERGE
Browse files Browse the repository at this point in the history
Updating hicn-plugin and libtransport to vpp_1908

Change-Id: I8bdad9725ec50597d79b3dc9a8d151ca149c3808
Signed-off-by: Alberto Compagno <[email protected]>
  • Loading branch information
acompagn committed Aug 22, 2019
1 parent 1d896a7 commit 3abde45
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 24 deletions.
8 changes: 3 additions & 5 deletions hicn-plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,9 @@ endif()
execute_process(COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/hicn)
# These files are missing from vpp binary distribution
execute_process(
COMMAND curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_json_parser.py?h=stable/1904 -o ${CMAKE_BINARY_DIR}/vapi_json_parser.py
COMMAND curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_c_gen.py?h=stable/1904 -o ${CMAKE_BINARY_DIR}/vapi_c_gen.py
COMMAND curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_cpp_gen.py?h=stable/1904 -o ${CMAKE_BINARY_DIR}/vapi_cpp_gen.py
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/vnet/adj
COMMAND curl https://git.fd.io/vpp/plain/src/vnet/adj/adj_midchain.h?h=stable/1904 -o ${CMAKE_CURRENT_BINARY_DIR}/vnet/adj/adj_midchain.h
COMMAND curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_json_parser.py?h=stable/1908 -o ${CMAKE_BINARY_DIR}/vapi_json_parser.py
COMMAND curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_c_gen.py?h=stable/1908 -o ${CMAKE_BINARY_DIR}/vapi_c_gen.py
COMMAND curl https://git.fd.io/vpp/plain/src/vpp-api/vapi/vapi_cpp_gen.py?h=stable/1908 -o ${CMAKE_BINARY_DIR}/vapi_cpp_gen.py
)

add_custom_command(
Expand Down
10 changes: 5 additions & 5 deletions hicn-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ hICN-plugin has been tested in:

Build dependencies:

- VPP 19.04
- VPP 19.08
- DEB packages (can be found https://packagecloud.io/fdio/release/install):
- libvppinfra-dev
- vpp-dev

Running dependencies:

- VPP 19.04
- VPP 19.08
- DEB packages (can be found https://packagecloud.io/fdio/release/install):
- vpp
- vpp-plugin-core
Expand Down Expand Up @@ -209,9 +209,9 @@ hicn face app {add intfc <sw_if> {prod prefix <hicn_prefix> cs_size <size_in_pac
`hicn face ip`: manipulates ip application faces in the forwarder.
```
hicn face ip {add local <src_address> remote <dst_address> intfc <sw_if>} | {del id <face_id>}
<src_address> :the IPv4 or IPv6 local IP address to bind to
<dst_address> :the IPv4 or IPv6 address of the remote system
hicn face ip {[add local <src_address>] remote <dst_address> intfc <sw_if>} | {del id <face_id>}
<src_address> :the IPv4 or IPv6 local IP address to bind to (not mandatory, if not specified the local address is one of the address assigned to sw_if)
<dst_address> :the IPv4 or IPv6 address of the remote system
<sw_if> :software interface on thop of which we create the face
<face_id> :id of the face to remove
```
Expand Down
4 changes: 2 additions & 2 deletions hicn-plugin/src/data_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ vlib_buffer_clone_256_2 (vlib_main_t * vm, u32 src_buffer, u32 * buffers,
vlib_buffer_t *d = vlib_get_buffer (vm, buffers[i]);
d->current_data = s->current_data;
d->current_length = head_end_offset;
d->trace_index = s->trace_index;
d->trace_handle = s->trace_handle;

d->total_length_not_including_first_buffer = s->current_length -
head_end_offset;
Expand All @@ -94,7 +94,7 @@ vlib_buffer_clone_256_2 (vlib_main_t * vm, u32 src_buffer, u32 * buffers,
}
d->flags = s->flags | VLIB_BUFFER_NEXT_PRESENT;
d->flags &= ~VLIB_BUFFER_EXT_HDR_VALID;
d->trace_index = s->trace_index;
d->trace_handle = s->trace_handle;
clib_memcpy_fast (d->opaque, s->opaque, sizeof (s->opaque));
clib_memcpy_fast (d->opaque2, s->opaque2, sizeof (s->opaque2));
clib_memcpy_fast (vlib_buffer_get_current (d),
Expand Down
2 changes: 1 addition & 1 deletion hicn-plugin/src/strategy.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ hicn_forward_interest_fn (vlib_main_t * vm,
vlib_buffer_t *b1;
b1 = vlib_get_buffer (vm, from[1]);
CLIB_PREFETCH (b1, CLIB_CACHE_LINE_BYTES, LOAD);
CLIB_PREFETCH (&b1->trace_index, 2 * CLIB_CACHE_LINE_BYTES,
CLIB_PREFETCH (&b1->trace_handle, 2 * CLIB_CACHE_LINE_BYTES,
STORE);
}
/* Dequeue a packet buffer */
Expand Down
16 changes: 12 additions & 4 deletions libtransport/src/hicn/transport/core/memif_connector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,22 @@ int MemifConnector::createMemif(uint32_t index, uint8_t mode, char *s) {
args.num_m2s_rings = 1;
strncpy((char *)args.interface_name, IF_NAME, strlen(IF_NAME) + 1);
args.mode = memif_interface_mode_t::MEMIF_INTERFACE_MODE_IP;
args.socket_filename = (uint8_t *)socket_filename_.c_str();

TRANSPORT_LOGD("Socket filename: %s", args.socket_filename);
int err;

err= memif_create_socket (&args.socket, socket_filename_.c_str(),
nullptr);

if (TRANSPORT_EXPECT_FALSE(err != MEMIF_ERR_SUCCESS)) {
throw errors::RuntimeException(memif_strerror(err));
}

TRANSPORT_LOGD("Socket filename: %s", socket_filename_.c_str());

args.interface_id = index;
/* last argument for memif_create (void * private_ctx) is used by user
to identify connection. this context is returned with callbacks */
int err;

/* default interrupt */
if (s == nullptr) {
err = memif_create(&c->conn, &args, onConnect, onDisconnect, onInterrupt,
Expand Down Expand Up @@ -204,7 +212,7 @@ int MemifConnector::deleteMemif() {
return 0;
}

int MemifConnector::controlFdUpdate(int fd, uint8_t events) {
int MemifConnector::controlFdUpdate(int fd, uint8_t events, void *private_ctx) {
/* convert memif event definitions to epoll events */
if (events & MEMIF_FD_EVENT_DEL) {
return MemifConnector::main_event_reactor_.delFileDescriptor(fd);
Expand Down
2 changes: 1 addition & 1 deletion libtransport/src/hicn/transport/core/memif_connector.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class MemifConnector : public Connector {

int deleteMemif();

static int controlFdUpdate(int fd, uint8_t events);
static int controlFdUpdate(int fd, uint8_t events, void *private_ctx);

static int onConnect(memif_conn_handle_t conn, void *private_ctx);

Expand Down
6 changes: 3 additions & 3 deletions scripts/build-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ PACKAGECLOUD_RELEASE_REPO_DEB="https://packagecloud.io/install/repositories/fdio
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/1904"
VPP_BRANCH="stable/1908"

VPP_VERSION_DEB="19.04.2-release"
VPP_VERSION_RPM="19.04.2-release.x86_64"
VPP_VERSION_DEB="19.08-release"
VPP_VERSION_RPM="19.08-release.x86_64"

BUILD_TOOLS_UBUNTU="build-essential doxygen"
LIBSSL_LIBEVENT_UBUNTU="libevent-dev libssl-dev"
Expand Down
6 changes: 3 additions & 3 deletions scripts/build-sysrepo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ PACKAGECLOUD_RELEASE_REPO_DEB="https://packagecloud.io/install/repositories/fdio
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/1908"

VPP_VERSION_DEB="19.04-release"
VPP_VERSION_RPM="19.04-release.x86_64"
VPP_VERSION_DEB="19.08-release"
VPP_VERSION_RPM="19.08-release.x86_64"

BUILD_TOOLS_UBUNTU="build-essential doxygen"
LIBSSL_LIBEVENT_UBUNTU="libevent-dev libssl-dev"
Expand Down

0 comments on commit 3abde45

Please sign in to comment.