openstack: Move bridge port interface mapping to charm helpers (#448)
* ovs: Add ``add_bridge_bond`` function
The function allows the user to add bonded port in bridge from
interfaces and optionally attach data to the port and interfaces.
Depending on the configuration provided through the ``portdata``
and ``ifdatamap`` configuration options this function can be used
for adding bonds comprised of any interface type supported by
Open vSwitch.
* ovs: Add portdata parameter to ``add_bridge_port``
Allow to set arbitrary data on the created port.
Co-Authored-By: Aurelien Lourot <email address hidden>
* ovs: Allow ``add_bridge_port`` to leave promisc untouched
At present the function will actively turn promisc mode on or off
depending on the ``promisc`` argument.
This does not play nice with operating on ports that do not exist
or are visible to userland.
Make the ``promisc`` argument optional and do not attempt to set
it if argument is not provided. The default of 'False' is
retained for compatibility.
* openstack: Add DPDK context helpers
Move from neutron-openvswitch charm to enable sharing
among neutron-openvswitch, neutron-gateway, ovn-chassis
and ovn-dedicated-chassis charms.
Co-Authored-By: James Page <email address hidden>
Co-Authored-By: Nikolay Nikolaev <email address hidden>
Co-Authored-By: Ante Karamatic <email address hidden>
* openstack: Move bridge port interface mapping to c-h
This will allow uniform handling of network configuration
across ``neutron-openvswitch``, ``neutron-gateway`` and
the OVN chassis charms.
Note that the handling of this detail in the charm is
pre-deprecated.
The long term goal is for network connectivity detail to be
modelled in the server provisioning layer (such as MAAS) which in
turn will provide a Netplan YAML description that will be used to
drive Open vSwitch.
Until we get to that reality the charm will need to configure
this detail based on application level configuration options.
Rename and extend the ``BridgeBondMap`` class to
``BridgePortInterfaceMap`` and use the same data structures
internally for regular bridge interface mapping and the DPDK OVS
bonding support. Note in light of the pre-deprecation mentioned
above we only expose OVS bond configuration for the DPDK use case.
Co-authored-by: Aurelien Lourot <email address hidden>
Co-authored-by: James Page <email address hidden>
Co-authored-by: Nikolay Nikolaev <email address hidden>
Co-authored-by: Ante Karamatic <email address hidden>