Skip to contentSkip to conversation

openvswitch: Enable LTO

PATCH Bruce Ashfield 1 participant 3 messages Mar 25, 2020 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 29 lines · Khem Raj

openvswitch binaries can shed some size with lto

packages/rdk-linux-gnueabi/openvswitch/openvswitch-ovsdb/files-in-package.txt +0 -0
@@ -1,7 +1,7 @@
drwxr-xr-x root       root             3488 ./usr
drwxr-xr-x root       root             3488 ./usr/bin
--rwxr-xr-x root       root           378984 ./usr/bin/ovsdb-client
--rwxr-xr-x root       root           353628 ./usr/bin/ovsdb-tool
--rwxr-xr-x root       root          1411216 ./usr/bin/ovs-vsctl
+-rwxr-xr-x root       root           203356 ./usr/bin/ovsdb-client
+-rwxr-xr-x root       root           233172 ./usr/bin/ovsdb-tool
+-rwxr-xr-x root       root           287012 ./usr/bin/ovs-vsctl
drwxr-xr-x root       root             3488 ./usr/sbin
--rwxr-xr-x root       root           379404 ./usr/sbin/ovsdb-server
+-rwxr-xr-x root       root           287672 ./usr/sbin/ovsdb-server
Cc Bruce Ashfield <[email protected]>
---
 recipes-networking/openvswitch/openvswitch_git.bb | 3 +++
 1 file changed, 3 insertions(+)
recipes-networking/openvswitch/openvswitch_git.bb +0 -0
index 07258be..bd74f49 100644

recipes-networking/openvswitch/openvswitch_git.bb LIC_FILES_CHKSUM = "file://LICENSE;md5=1ce5d23a6429dff345518758f13aaeab" · line 41

Quoted 5 lines
recipes-networking/openvswitch/openvswitch_git.bb +2 -0
@@ -37,6 +37,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1ce5d23a6429dff345518758f13aaeab"
 
 DPDK_INSTALL_DIR ?= "/opt/dpdk"
 
+CFLAGS += "-flto"
+LDFLAGS += "-flto"

Shouldn't this be something that is configurable ? I know that I want it to be. i.e. isn't there some sort of distro feature that we can use to enable or disable this by default ?

Bruce

Quoted 7 lines
recipes-networking/openvswitch/openvswitch_git.bb +1 -1
+
 PACKAGECONFIG ?= "libcap-ng"
 PACKAGECONFIG[dpdk] = "--with-dpdk=${STAGING_DIR_TARGET}${DPDK_INSTALL_DIR}/share/${TARGET_ARCH}-native-linuxapp-gcc,,dpdk,dpdk"
 PACKAGECONFIG[libcap-ng] = "--enable-libcapng,--disable-libcapng,libcap-ng,"
--

2.26.0

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

A message that is not in the archive (sent off-list or not yet received): CAMKF1sqYD1gw3qcw+edGawBZZWPz=qyGyHqrgY5xu1E94wcEkA@mail.gmail.com

#3 lore raw
Quoted 44 lines · Khem Raj
Quoted 32 lines · Bruce Ashfield
Quoted 30 lines · Khem Raj

openvswitch binaries can shed some size with lto

packages/rdk-linux-gnueabi/openvswitch/openvswitch-ovsdb/files-in-package.txt +0 -0
@@ -1,7 +1,7 @@
drwxr-xr-x root       root             3488 ./usr
drwxr-xr-x root       root             3488 ./usr/bin
--rwxr-xr-x root       root           378984 ./usr/bin/ovsdb-client
--rwxr-xr-x root       root           353628 ./usr/bin/ovsdb-tool
--rwxr-xr-x root       root          1411216 ./usr/bin/ovs-vsctl
+-rwxr-xr-x root       root           203356 ./usr/bin/ovsdb-client
+-rwxr-xr-x root       root           233172 ./usr/bin/ovsdb-tool
+-rwxr-xr-x root       root           287012 ./usr/bin/ovs-vsctl
drwxr-xr-x root       root             3488 ./usr/sbin
--rwxr-xr-x root       root           379404 ./usr/sbin/ovsdb-server
+-rwxr-xr-x root       root           287672 ./usr/sbin/ovsdb-server
Cc Bruce Ashfield <[email protected]>
---
 recipes-networking/openvswitch/openvswitch_git.bb | 3 +++
 1 file changed, 3 insertions(+)
recipes-networking/openvswitch/openvswitch_git.bb +0 -0
index 07258be..bd74f49 100644
@@ -37,6 +37,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1ce5d23a6429dff345518758f13aaeab"
 
Quoted 9 lines

recipes-networking/openvswitch/openvswitch_git.bb LIC_FILES_CHKSUM = "file://LICENSE;md5=1ce5d23a6429dff345518758f13aaeab" · line 41

Quoted 4 lines
recipes-networking/openvswitch/openvswitch_git.bb +2 -0
 DPDK_INSTALL_DIR ?= "/opt/dpdk"
 
+CFLAGS += "-flto"
+LDFLAGS += "-flto"

Shouldn't this be something that is configurable ? I know that I want it to be. i.e. isn't there some sort of distro feature that we can use to enable or disable this by default ?

Quoted 2 lines

yes distro feature is coming I will turn this into DISTRO feature too but in this case benefits are regardless

.... but nothing is bug free, there are documented cases of LTO causing issues. So until we get a distro knob to turn this off an on, what about something like ?

CFLAGS_LTO ?= "-flto"
LDFLAGS_LTO ?= "-flto"

CFLAGS += "${CFLAGS_LTO}"
LDFLAGS += "${LDFLAGS_LTO}"

So if we run into issues, we can easily bappend the LTO flags to nothing.

Bruce

Quoted 16 lines
Quoted 16 lines

Bruce

Quoted 7 lines
recipes-networking/openvswitch/openvswitch_git.bb +1 -1
+
 PACKAGECONFIG ?= "libcap-ng"
 PACKAGECONFIG[dpdk] = "--with-dpdk=${STAGING_DIR_TARGET}${DPDK_INSTALL_DIR}/share/${TARGET_ARCH}-native-linuxapp-gcc,,dpdk,dpdk"
 PACKAGECONFIG[libcap-ng] = "--enable-libcapng,--disable-libcapng,libcap-ng,"
--

2.26.0

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

A message that is not in the archive (sent off-list or not yet received): CAMKF1soSqYqHJCYerw0AUqiO0Z0bCi2-bfHyfgyCFp3JRO16xw@mail.gmail.com

#5 lore raw
Quoted 3 lines · Khem Raj

Sounds good to me. Let me first add lto as distro knob so hold on to it

ok! No worries, I'll wait on a new patch from you.

Cheers,

Bruce

Quoted 87 lines · Bruce Ashfield
Quoted 86 lines · Khem Raj
Quoted 44 lines · Bruce Ashfield
Quoted 32 lines · Khem Raj
Quoted 30 lines

openvswitch binaries can shed some size with lto

packages/rdk-linux-gnueabi/openvswitch/openvswitch-ovsdb/files-in-package.txt +0 -0
@@ -1,7 +1,7 @@
drwxr-xr-x root       root             3488 ./usr
drwxr-xr-x root       root             3488 ./usr/bin
--rwxr-xr-x root       root           378984 ./usr/bin/ovsdb-client
--rwxr-xr-x root       root           353628 ./usr/bin/ovsdb-tool
--rwxr-xr-x root       root          1411216 ./usr/bin/ovs-vsctl
+-rwxr-xr-x root       root           203356 ./usr/bin/ovsdb-client
+-rwxr-xr-x root       root           233172 ./usr/bin/ovsdb-tool
+-rwxr-xr-x root       root           287012 ./usr/bin/ovs-vsctl
drwxr-xr-x root       root             3488 ./usr/sbin
--rwxr-xr-x root       root           379404 ./usr/sbin/ovsdb-server
+-rwxr-xr-x root       root           287672 ./usr/sbin/ovsdb-server
Cc Bruce Ashfield <[email protected]>
---
 recipes-networking/openvswitch/openvswitch_git.bb | 3 +++
 1 file changed, 3 insertions(+)
recipes-networking/openvswitch/openvswitch_git.bb +0 -0
index 07258be..bd74f49 100644
@@ -37,6 +37,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1ce5d23a6429dff345518758f13aaeab"
 
Quoted 9 lines

recipes-networking/openvswitch/openvswitch_git.bb LIC_FILES_CHKSUM = "file://LICENSE;md5=1ce5d23a6429dff345518758f13aaeab" · line 41

Quoted 4 lines
recipes-networking/openvswitch/openvswitch_git.bb +2 -0
 DPDK_INSTALL_DIR ?= "/opt/dpdk"
 
+CFLAGS += "-flto"
+LDFLAGS += "-flto"

Shouldn't this be something that is configurable ? I know that I want it to be. i.e. isn't there some sort of distro feature that we can use to enable or disable this by default ?

Quoted 2 lines

yes distro feature is coming I will turn this into DISTRO feature too but in this case benefits are regardless

.... but nothing is bug free, there are documented cases of LTO causing issues. So until we get a distro knob to turn this off an on, what about something like ?

CFLAGS_LTO ?= "-flto"
LDFLAGS_LTO ?= "-flto"

CFLAGS += "${CFLAGS_LTO}"
LDFLAGS += "${LDFLAGS_LTO}"

So if we run into issues, we can easily bappend the LTO flags to nothing.

Bruce

Quoted 12 lines
Quoted 12 lines

Bruce

Quoted 7 lines
recipes-networking/openvswitch/openvswitch_git.bb +1 -1
+
 PACKAGECONFIG ?= "libcap-ng"
 PACKAGECONFIG[dpdk] = "--with-dpdk=${STAGING_DIR_TARGET}${DPDK_INSTALL_DIR}/share/${TARGET_ARCH}-native-linuxapp-gcc,,dpdk,dpdk"
 PACKAGECONFIG[libcap-ng] = "--enable-libcapng,--disable-libcapng,libcap-ng,"
--

2.26.0

Quoted 4 lines
Quoted 4 lines

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end
- "Use the force Harry" - Gandalf, Star Trek II

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II