Skip to content

Commit

Permalink
Update relevant artifacts to add support for DPDK 16.04.
Browse files Browse the repository at this point in the history
Following changes are applied:
 - INSTALL.DPDK.md: CONFIG_RTE_BUILD_COMBINE_LIBS step has been
   removed because it is no longer present in DPDK configuration
   (combined library is created by default),
 - INSTALL.DPDK.md: VHost Cuse configuration is updated,
 - netdev-dpdk.c: Link speed definition is changed in DPDK and
   netdev_dpdk_get_features is updated accordingly,
 - netdev-dpdk.c: TSO and checksum offload has been disabled for
   vhostuser device.
 - .travis/linux-build.sh: DPDK version is updated and legacy
   flags have been removed in configuration.

Signed-off-by: Michal Weglicki <michalx.weglicki@intel.com>
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
  • Loading branch information
mweglicx authored and ddiproietto committed Apr 15, 2016
1 parent 40b5ea8 commit 362ca39
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 27 deletions.
3 changes: 1 addition & 2 deletions .travis/linux-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function install_dpdk()
cd dpdk-$1
fi
find ./ -type f | xargs sed -i 's/max-inline-insns-single=100/max-inline-insns-single=400/'
sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' config/common_linuxapp
echo 'CONFIG_RTE_BUILD_FPIC=y' >>config/common_linuxapp
sed -ri '/EXECENV_CFLAGS = -pthread -fPIC/{s/$/\nelse ifeq ($(CONFIG_RTE_BUILD_FPIC),y)/;s/$/\nEXECENV_CFLAGS = -pthread -fPIC/}' mk/exec-env/linuxapp/rte.vars.mk
make config CC=gcc T=x86_64-native-linuxapp-gcc
Expand All @@ -69,7 +68,7 @@ fi

if [ "$DPDK" ]; then
if [ -z "$DPDK_VER" ]; then
DPDK_VER="2.2.0"
DPDK_VER="16.04"
fi
install_dpdk $DPDK_VER
if [ "$CC" = "clang" ]; then
Expand Down
21 changes: 8 additions & 13 deletions INSTALL.DPDK.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,19 @@ OVS needs a system with 1GB hugepages support.
Building and Installing:
------------------------

Required: DPDK 2.2
Required: DPDK 16.04
Optional (if building with vhost-cuse): `fuse`, `fuse-devel` (`libfuse-dev`
on Debian/Ubuntu)

1. Configure build & install DPDK:
1. Set `$DPDK_DIR`

```
export DPDK_DIR=/usr/src/dpdk-2.2
export DPDK_DIR=/usr/src/dpdk-16.04
cd $DPDK_DIR
```

2. Update `config/common_linuxapp` so that DPDK generate single lib file.
(modification also required for IVSHMEM build)

`CONFIG_RTE_BUILD_COMBINE_LIBS=y`

Then run `make install` to build and install the library.
2. Then run `make install` to build and install the library.
For default install without IVSHMEM:

`make install T=x86_64-native-linuxapp-gcc DESTDIR=install`
Expand Down Expand Up @@ -496,7 +491,7 @@ the vswitchd.
DPDK vhost:
-----------

DPDK 2.2 supports two types of vhost:
DPDK 16.04 supports two types of vhost:

1. vhost-user
2. vhost-cuse
Expand All @@ -517,7 +512,7 @@ with OVS.
DPDK vhost-user Prerequisites:
-------------------------

1. DPDK 2.2 with vhost support enabled as documented in the "Building and
1. DPDK 16.04 with vhost support enabled as documented in the "Building and
Installing section"

2. QEMU version v2.1.0+
Expand Down Expand Up @@ -635,10 +630,10 @@ with OVS.
DPDK vhost-cuse Prerequisites:
-------------------------

1. DPDK 2.2 with vhost support enabled as documented in the "Building and
1. DPDK 16.04 with vhost support enabled as documented in the "Building and
Installing section"
As an additional step, you must enable vhost-cuse in DPDK by setting the
following additional flag in `config/common_linuxapp`:
following additional flag in `config/common_base`:

`CONFIG_RTE_LIBRTE_VHOST_USER=n`

Expand Down Expand Up @@ -938,7 +933,7 @@ Restrictions:
this with smaller page sizes.

Platform and Network Interface:
- By default with DPDK 2.2, a maximum of 64 TX queues can be used with an
- By default with DPDK 16.04, a maximum of 64 TX queues can be used with an
Intel XL710 Network Interface on a platform with more than 64 logical
cores. If a user attempts to add an XL710 interface as a DPDK port type to
a system as described above, an error will be reported that initialization
Expand Down
28 changes: 16 additions & 12 deletions lib/netdev-dpdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1736,35 +1736,35 @@ netdev_dpdk_get_features(const struct netdev *netdev,
link = dev->link;
ovs_mutex_unlock(&dev->mutex);

if (link.link_duplex == ETH_LINK_AUTONEG_DUPLEX) {
if (link.link_speed == ETH_LINK_SPEED_AUTONEG) {
*current = NETDEV_F_AUTONEG;
}
} else if (link.link_duplex == ETH_LINK_HALF_DUPLEX) {
if (link.link_speed == ETH_LINK_SPEED_10) {
if (link.link_duplex == ETH_LINK_HALF_DUPLEX) {
if (link.link_speed == ETH_SPEED_NUM_10M) {
*current = NETDEV_F_10MB_HD;
}
if (link.link_speed == ETH_LINK_SPEED_100) {
if (link.link_speed == ETH_SPEED_NUM_100M) {
*current = NETDEV_F_100MB_HD;
}
if (link.link_speed == ETH_LINK_SPEED_1000) {
if (link.link_speed == ETH_SPEED_NUM_1G) {
*current = NETDEV_F_1GB_HD;
}
} else if (link.link_duplex == ETH_LINK_FULL_DUPLEX) {
if (link.link_speed == ETH_LINK_SPEED_10) {
if (link.link_speed == ETH_SPEED_NUM_10M) {
*current = NETDEV_F_10MB_FD;
}
if (link.link_speed == ETH_LINK_SPEED_100) {
if (link.link_speed == ETH_SPEED_NUM_100M) {
*current = NETDEV_F_100MB_FD;
}
if (link.link_speed == ETH_LINK_SPEED_1000) {
if (link.link_speed == ETH_SPEED_NUM_1G) {
*current = NETDEV_F_1GB_FD;
}
if (link.link_speed == ETH_LINK_SPEED_10000) {
if (link.link_speed == ETH_SPEED_NUM_10G) {
*current = NETDEV_F_10GB_FD;
}
}

if (link.link_autoneg) {
*current |= NETDEV_F_AUTONEG;
}

return 0;
}

Expand Down Expand Up @@ -2240,6 +2240,10 @@ static int
dpdk_vhost_class_init(void)
{
rte_vhost_driver_callback_register(&virtio_net_device_ops);
rte_vhost_feature_disable(1ULL << VIRTIO_NET_F_HOST_TSO4
| 1ULL << VIRTIO_NET_F_HOST_TSO6
| 1ULL << VIRTIO_NET_F_CSUM);

ovs_thread_create("vhost_thread", start_vhost_loop, NULL);
return 0;
}
Expand Down

0 comments on commit 362ca39

Please sign in to comment.