Skip to content

Commit

Permalink
Add Compatibility Changes to Run ONVM on Ubuntu 18.04.1 (#72)
Browse files Browse the repository at this point in the history
Modifies necessary files to make ONVM compatible with Ubuntu 18.04.1 LTS.

With the new Ubuntu version comes an upgraded version of gcc, which has stricter checks in place with regards to strict aliasing, formatting, etc. This pull request modifies code where these errors occurred.

Commit log:

* Updating makefiles

* Updating makefiles for gcc 7.3.0

* Update Makefile

* Updating Makefiles for Ubuntu 18.04.1 LTS compatibility

* Updating Makefiles

* Update Makefile

* Update onvm_common.h

* Update onvm_common.h

* Update onvm_common.h

* Update onvm_common.h

* Update cJSON.c

* Update onvm_nflib.c

* Update onvm_nflib.c

* testing

* Update cJSON.c

* tests

* testing

* Update Makefile

* Update onvm_init.c

* Update onvm_init.c

* Update onvm_init.c

* Update onvm_init.c

* Update onvm_init.c

* Update onvm_init.c

* Remove no changes

* Removing modified pr file

* Removing modified pr file

* Removing modified pr file

* Removing modified pr file

* Update pktgen-dpdk

* Revert "Update pktgen-dpdk"

This reverts commit aae8018.

* Update pktgen-dpdk

* Revert "Update pktgen-dpdk"

This reverts commit 1099ed8.

* Update pktgen-dpdk

* Revert "Update pktgen-dpdk"

This reverts commit 356de57.

* Update cJSON.c

* Fallthrough comments

* Update fallthrough comments
  • Loading branch information
dennisafa authored and koolzz committed Mar 21, 2019
1 parent 28689d7 commit f8488cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions onvm/lib/cJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,14 +633,17 @@ static const char *parse_string(cJSON *item, const char *str, const char **ep)
/* 10xxxxxx */
*--ptr2 = ((uc | 0x80) & 0xBF);
uc >>= 6;
/* FALLTHROUGH */
case 3:
/* 10xxxxxx */
*--ptr2 = ((uc | 0x80) & 0xBF);
uc >>= 6;
/* FALLTHROUGH */
case 2:
/* 10xxxxxx */
*--ptr2 = ((uc | 0x80) & 0xBF);
uc >>= 6;
/* FALLTHROUGH */
case 1:
/* depending on the length in bytes this determines the
* encoding ofthe first UTF8 byte */
Expand Down
6 changes: 3 additions & 3 deletions onvm/onvm_mgr/onvm_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ init(int argc, char *argv[]) {
retval = init_port(port_id);
if (retval != 0)
rte_exit(EXIT_FAILURE, "Cannot initialise port %u\n", port_id);
char event_msg_buf[20];
char event_msg_buf[22];
sprintf(event_msg_buf, "Port %d initialized", port_id);
onvm_stats_add_event(event_msg_buf, NULL);
}
Expand All @@ -235,7 +235,7 @@ init(int argc, char *argv[]) {
default_chain = onvm_sc_create();
retval = onvm_sc_append_entry(default_chain, ONVM_NF_ACTION_TONF, 1);
if (retval == ENOSPC) {
printf("chain length can not be larger than the maximum chain length\n");
printf("Chain length can not be larger than the maximum chain length\n");
exit(1);
}
printf("Default service chain: send to sdn NF\n");
Expand All @@ -244,7 +244,7 @@ init(int argc, char *argv[]) {
mz_scp = rte_memzone_reserve(MZ_SCP_INFO, sizeof(struct onvm_service_chain *),
rte_socket_id(), NO_FLAGS);
if (mz_scp == NULL)
rte_exit(EXIT_FAILURE, "Canot reserve memory zone for service chain pointer\n");
rte_exit(EXIT_FAILURE, "Cannot reserve memory zone for service chain pointer\n");
memset(mz_scp->addr, 0, sizeof(struct onvm_service_chain *));
default_sc_p = mz_scp->addr;
*default_sc_p = default_chain;
Expand Down
3 changes: 2 additions & 1 deletion onvm/onvm_nflib/onvm_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ static inline struct onvm_pkt_meta* onvm_get_pkt_meta(struct rte_mbuf* pkt) {
}

static inline uint8_t onvm_get_pkt_chain_index(struct rte_mbuf* pkt) {
return ((struct onvm_pkt_meta*)&pkt->udata64)->chain_index;
struct onvm_pkt_meta* pkt_meta = (struct onvm_pkt_meta*) &pkt->udata64;
return pkt_meta->chain_index;
}

/*
Expand Down

0 comments on commit f8488cc

Please sign in to comment.