From: Timothy Redaelli <[email protected]>

When building with DPDK, every binary is linked against DPDK
libraries - including things like ovs-appctl, ovs-vsctl, and the
ovsdb utilities that have no business depending on datapath code.

This series addresses that by splitting libopenvswitch into two
libraries:

  - libopenvswitchutils: container datastructures, threading, I/O,
    logging, and other general utilities that any OVS component needs.

  - libopenvswitch: the existing datapath-related code, which now
    depends on libopenvswitchutils.

Utilities like the ovsdb suite and ovs-appctl can link against
libopenvswitchutils only, avoiding the DPDK dependency entirely.  The
result is a significant reduction in installed binary size:

  pre-series:  279.37 MB
  post-series: 185.47 MB  (~94 MB saved on Fedora 43 x86_64)

As part of the restructuring, the packets module is split into a
net-proto module (network protocol handling) and dp-packet (datapath
packet operations), with a handful of function renames to clarify the
separation.  The public header openvswitch/packets.h is renamed to
openvswitch/net-proto.h accordingly.

Future work could split things further - vconn, ofpbuf, and netdev
are candidates - though the ofp* dependency graph makes that harder
to untangle.

Changes since v1 (Aaron Conole <[email protected]>):
  - Reordered: flow_tnl_equal removal moved to patch 1 as suggested by
    David Marchand (independent cleanup, easier to review first)
  - Fixed: flow_tnl_src()/flow_tnl_dst() moved from lib/dp-packet.c to
    lib/flow.c as requested by David Marchand and Ilya Maximets
  - Fixed: missing packet_set_ipv6_flow_label and packet_set_ipv6_tc
    renames added to NEWS as pointed out by David Marchand
  - Fixed: FreeBSD build - added sys/socket.h before netinet/in.h in
    lib/net-proto.h, lib/dp-packet.c, and include/openvswitch/net-proto.h
    as acknowledged by Aaron Conole
  - Renamed: libovscommon -> libopenvswitchutils as suggested by
    David Marchand (who preferred libopenvswitchutils or -utils)
  - Renamed: include/openvswitch/packets.h -> include/openvswitch/net-proto.h
    as suggested by Ilya Maximets

Timothy Redaelli (5):
  lib/packets: Remove flow_tnl_equal.
  lib/net-proto: Create a new net-proto module for handling generic
    network protocols.
  lib/ct-state: Move ct-state macros to their own header.
  lib/dp-packet: Fold the 'packets' module into dp-packets.
  libs: Introduce libopenvswitchutils to isolate common routines.

 NEWS                                          |   18 +-
 configure.ac                                  |    2 +
 debian/rules                                  |    4 +-
 include/openvswitch/automake.mk               |    2 +-
 include/openvswitch/flow.h                    |    2 +-
 include/openvswitch/match.h                   |    2 +-
 include/openvswitch/meta-flow.h               |    2 +-
 .../openvswitch/{packets.h => net-proto.h}    |    7 +-
 lib/.gitignore                                |    1 +
 lib/automake.mk                               |  586 ++--
 lib/bfd.c                                     |    2 +-
 lib/bfd.h                                     |    2 +-
 lib/cfm.c                                     |    2 +-
 lib/cfm.h                                     |    1 -
 lib/classifier.c                              |    2 +-
 lib/conntrack-private.h                       |    1 -
 lib/conntrack.c                               |   12 +-
 lib/conntrack.h                               |    2 +-
 lib/ct-dpif.c                                 |    1 +
 lib/ct-dpif.h                                 |    3 +-
 lib/ct-state.h                                |   50 +
 lib/dhcp.h                                    |    1 -
 lib/dp-packet.c                               | 1472 +++++++++++
 lib/dp-packet.h                               |  111 +-
 lib/dpctl.c                                   |    1 -
 lib/dpif-netdev-extract-avx512.c              |    1 -
 lib/dpif-netdev-lookup-generic.c              |    2 +-
 lib/dpif-netdev-lookup.c                      |    1 +
 lib/dpif-netdev-private-extract.c             |    1 +
 lib/dpif-netdev-private-flow.h                |    1 +
 lib/dpif-netdev.c                             |    1 -
 lib/dpif-netdev.h                             |    1 -
 lib/dpif-netlink-rtnl.c                       |    1 +
 lib/dpif-netlink.c                            |    1 -
 lib/dpif-offload-dpdk-netdev.c                |    3 +-
 lib/dpif-offload-dpdk.c                       |    3 +
 lib/dpif.c                                    |    3 +-
 lib/dpif.h                                    |    1 -
 lib/flow.c                                    |   22 +-
 lib/flow.h                                    |  159 +-
 lib/ipf.c                                     |    2 +-
 lib/lacp.c                                    |    1 -
 lib/lacp.h                                    |    6 +-
 lib/libopenvswitchutils.pc.in                 |   11 +
 lib/libopenvswitchutils.sym.in                |    4 +
 lib/lldp/lldp.c                               |    1 -
 lib/lldp/lldpd-structs.h                      |    1 -
 lib/lldp/lldpd.c                              |    1 -
 lib/lldp/lldpd.h                              |    1 -
 lib/mac-learning.c                            |    2 +
 lib/mac-learning.h                            |    1 -
 lib/match.c                                   |    3 +-
 lib/mcast-snooping.h                          |    1 -
 lib/meta-flow.c                               |    5 +-
 lib/multipath.c                               |    1 -
 lib/net-proto.c                               |  893 +++++++
 lib/{packets.h => net-proto.h}                |  379 +--
 lib/netdev-afxdp.c                            |    1 -
 lib/netdev-bsd.c                              |    1 -
 lib/netdev-dpdk.c                             |    1 -
 lib/netdev-dummy.c                            |    1 -
 lib/netdev-linux.c                            |    9 +-
 lib/netdev-native-tnl.c                       |   10 +-
 lib/netdev-native-tnl.h                       |    1 -
 lib/netdev-provider.h                         |    1 -
 lib/netdev-vport.c                            |    1 -
 lib/netdev-windows.c                          |    1 -
 lib/netdev.c                                  |    1 -
 lib/netdev.h                                  |    1 -
 lib/nx-match.c                                |    2 +-
 lib/odp-execute-avx512.c                      |    4 +-
 lib/odp-execute-private.c                     |    1 +
 lib/odp-execute.c                             |    1 -
 lib/odp-util.c                                |    8 +-
 lib/odp-util.h                                |    1 +
 lib/ofp-ct.c                                  |    4 +-
 lib/ofp-ed-props.c                            |    2 -
 lib/ofp-match.c                               |    4 +-
 lib/ofp-parse.c                               |    2 +-
 lib/ofp-print.c                               |    1 -
 lib/ofp-util.c                                |    1 -
 lib/ovs-lldp.c                                |    1 -
 lib/ovs-lldp.h                                |    1 -
 lib/ovs-router.c                              |    1 -
 lib/packets.c                                 | 2351 -----------------
 lib/pcap-file.c                               |    1 -
 lib/route-table-bsd.c                         |    2 +-
 lib/route-table.c                             |    1 -
 lib/rstp-common.h                             |    1 -
 lib/rstp-state-machines.c                     |    1 -
 lib/rstp.c                                    |    1 -
 lib/rtnetlink.c                               |    2 +-
 lib/smap.c                                    |    2 +-
 lib/socket-util.c                             |    2 +-
 lib/stp.c                                     |    1 -
 lib/stream-ssl.c                              |    2 +-
 lib/stream-tcp.c                              |    1 -
 lib/stream-unix.c                             |    1 -
 lib/stream.c                                  |    1 -
 lib/tc.c                                      |    1 -
 lib/tnl-neigh-cache.c                         |    1 -
 lib/tnl-neigh-cache.h                         |    1 -
 lib/tnl-ports.h                               |    1 -
 lib/tun-metadata.c                            |    1 -
 lib/vconn.c                                   |    1 -
 ofproto/bond.c                                |    1 -
 ofproto/bond.h                                |    1 -
 ofproto/in-band.c                             |    1 -
 ofproto/netflow.c                             |    1 -
 ofproto/ofproto-dpif-ipfix.c                  |    1 -
 ofproto/ofproto-dpif-monitor.h                |    1 -
 ofproto/ofproto-dpif-sflow.c                  |    1 -
 ofproto/ofproto-dpif-upcall.c                 |    1 -
 ofproto/ofproto-dpif-xlate-cache.c            |    1 -
 ofproto/ofproto-dpif-xlate.c                  |    3 +-
 ofproto/ofproto.c                             |    1 -
 ofproto/tunnel.c                              |    1 -
 ovsdb/automake.mk                             |    6 +-
 tests/automake.mk                             |    8 +-
 tests/test-classifier.c                       |    2 +-
 tests/test-conntrack.c                        |    3 +-
 tests/test-csum.c                             |    6 +-
 tests/test-lib-route-table.c                  |    3 +-
 tests/test-netflow.c                          |    4 +-
 tests/test-netlink-conntrack.c                |    2 +
 tests/test-packets.c                          |    2 +-
 tests/test-rstp.c                             |    1 -
 tests/test-sflow.c                            |    2 +-
 tests/test-stp.c                              |    1 -
 utilities/automake.mk                         |   15 +-
 utilities/ovs-dpctl.c                         |    1 -
 utilities/ovs-ofctl.c                         |    2 +-
 vswitchd/automake.mk                          |    3 +-
 vswitchd/bridge.c                             |    1 -
 vtep/automake.mk                              |    2 +-
 135 files changed, 3216 insertions(+), 3104 deletions(-)
 rename include/openvswitch/{packets.h => net-proto.h} (95%)
 create mode 100644 lib/ct-state.h
 create mode 100644 lib/libopenvswitchutils.pc.in
 create mode 100644 lib/libopenvswitchutils.sym.in
 create mode 100644 lib/net-proto.c
 rename lib/{packets.h => net-proto.h} (77%)
 delete mode 100644 lib/packets.c

-- 
2.54.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to