From 865a5a174426ca65a9cd227ab4709f3268358990 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 09 2022 09:45:48 +0000 Subject: import nmstate-2.0.0-5.el9_0 --- diff --git a/SOURCES/BZ_2100471-ovs-dpdk-add-support-to-rx-queue-parameter.patch b/SOURCES/BZ_2100471-ovs-dpdk-add-support-to-rx-queue-parameter.patch new file mode 100644 index 0000000..2f43b5d --- /dev/null +++ b/SOURCES/BZ_2100471-ovs-dpdk-add-support-to-rx-queue-parameter.patch @@ -0,0 +1,115 @@ +From f9c2d3ad2f3abe948361bf0a79831f38d709c7d3 Mon Sep 17 00:00:00 2001 +From: Fernando Fernandez Mancera +Date: Mon, 16 May 2022 15:59:11 +0200 +Subject: [PATCH 1/5] ovs, dpdk: add support to rx-queue parameter + +``` +--- +interfaces: + - name: ovs-br0 + type: ovs-bridge + state: up + bridge: + options: + datapath: netdev + port: + - name: ovs0 + - name: ovs0 + type: ovs-interface + state: up + dpdk: + devargs: "000:18:00.2" + rx-queue: 10 +``` + +Integration test case added. + +Signed-off-by: Fernando Fernandez Mancera +--- + examples/ovsbridge_dpdk_create.yml | 1 + + libnmstate/ifaces/ovs.py | 15 +++++++++++- + libnmstate/nm/ovs.py | 2 ++ + libnmstate/schema.py | 1 + + tests/integration/ovs_test.py | 23 ++++++++++++++++-- + tests/lib/ifaces/ovs_iface_test.py | 38 +++++++++++++++++++++++++++++- + 6 files changed, 76 insertions(+), 4 deletions(-) + +diff --git a/examples/ovsbridge_dpdk_create.yml b/examples/ovsbridge_dpdk_create.yml +index 8395936e..9acc19cd 100644 +--- a/examples/ovsbridge_dpdk_create.yml ++++ b/examples/ovsbridge_dpdk_create.yml +@@ -13,3 +13,4 @@ interfaces: + state: up + dpdk: + devargs: "000:18:00.2" ++ rx-queue: 10 +diff --git a/libnmstate/ifaces/ovs.py b/libnmstate/ifaces/ovs.py +index 411455ba..447b8326 100644 +--- a/libnmstate/ifaces/ovs.py ++++ b/libnmstate/ifaces/ovs.py +@@ -279,6 +279,14 @@ class OvsInternalIface(BaseIface): + else None + ) + ++ @property ++ def rx_queue(self): ++ return ( ++ self.dpdk_config.get(OVSInterface.Dpdk.RX_QUEUE) ++ if self.dpdk_config ++ else None ++ ) ++ + @property + def peer(self): + return ( +@@ -293,9 +301,14 @@ class OvsInternalIface(BaseIface): + OVSInterface.Patch.PEER, + ) + validate_string( +- self.patch_config.get(OVSInterface.Dpdk.DEVARGS), ++ self.dpdk_config.get(OVSInterface.Dpdk.DEVARGS), + OVSInterface.Dpdk.DEVARGS, + ) ++ validate_integer( ++ self.dpdk_config.get(OVSInterface.Dpdk.RX_QUEUE), ++ OVSInterface.Dpdk.RX_QUEUE, ++ minimum=0, ++ ) + super().pre_edit_validation_and_cleanup() + self._validate_ovs_mtu_mac_confliction() + +diff --git a/libnmstate/nm/ovs.py b/libnmstate/nm/ovs.py +index 9922ffb2..8ddc42d7 100644 +--- a/libnmstate/nm/ovs.py ++++ b/libnmstate/nm/ovs.py +@@ -149,6 +149,7 @@ def create_patch_setting(patch_state): + def create_dpdk_setting(dpdk_state): + dpdk_setting = NM.SettingOvsDpdk.new() + dpdk_setting.props.devargs = dpdk_state[OVSInterface.Dpdk.DEVARGS] ++ dpdk_setting.props.n_rxq = dpdk_state[OVSInterface.Dpdk.RX_QUEUE] + + return dpdk_setting + +@@ -215,6 +216,7 @@ def get_interface_info(act_con): + if dpdk_setting: + info[OVSInterface.DPDK_CONFIG_SUBTREE] = { + OVSInterface.Dpdk.DEVARGS: dpdk_setting.props.devargs, ++ OVSInterface.Dpdk.RX_QUEUE: dpdk_setting.props.n_rxq, + } + + return info +diff --git a/libnmstate/schema.py b/libnmstate/schema.py +index 56a6c187..6bd5d54d 100644 +--- a/libnmstate/schema.py ++++ b/libnmstate/schema.py +@@ -300,6 +300,7 @@ class OVSInterface(OvsDB): + + class Dpdk: + DEVARGS = "devargs" ++ RX_QUEUE = "rx-queue" + + + class OVSBridge(Bridge, OvsDB): +-- +2.35.3 + diff --git a/SPECS/nmstate.spec b/SPECS/nmstate.spec index a62ae20..d619858 100644 --- a/SPECS/nmstate.spec +++ b/SPECS/nmstate.spec @@ -4,7 +4,7 @@ Name: nmstate Version: 2.0.0 -Release: 3%{?dist} +Release: 5%{?dist} Summary: Declarative network manager API License: LGPLv2+ URL: https://github.com/%{srcname}/%{srcname} @@ -12,6 +12,7 @@ Source0: %{url}/releases/download/v%{version}/%{srcname}-%{version}.tar.g Source1: %{url}/releases/download/v%{version}/%{srcname}-%{version}.tar.gz.asc Source2: nmstate.gpg Source3: nmstate-rust-vendor-%{version}.tar.xz +Patch0: BZ_2100471-ovs-dpdk-add-support-to-rx-queue-parameter.patch BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: gnupg2 @@ -83,11 +84,11 @@ This package contains the nmstate plugin for OVS database manipulation. gpg2 --import --import-options import-export,import-minimal %{SOURCE2} > ./gpgkey-mantainers.gpg gpgv2 --keyring ./gpgkey-mantainers.gpg %{SOURCE1} %{SOURCE0} %setup -q +%patch0 -p1 pushd rust # Source3 is vendored dependencies %cargo_prep -V 3 - # The cargo_prep will create `.cargo/config` which take precedence over # `.cargo/config.toml` shipped by upstream which fix the SONAME of cdylib. # To workaround that, merge upstream rustflags into cargo_prep created one. @@ -149,6 +150,12 @@ popd /sbin/ldconfig %changelog +* Fri Jul 22 2022 Fernando Fernandez Mancera - 2.0.0-5 +- Fix missing %patchN macro. RHBZ#2100471 + +* Fri Jul 08 2022 Fernando Fernandez Mancera - 2.0.0-4 +- Support OVS rx_queue. RHBZ#2100471 + * Wed Jun 15 2022 Fernando Fernandez Mancera - 2.0.0-3 - Rebuild in order to fix errata product listing. RHBZ#2097241