Skip to content

Commit

Permalink
hosts(pve-c3758): optimize ovs-dpdk startup sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
xddxdd committed Jan 9, 2025
1 parent 3d99f50 commit 8109ebb
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions hosts/pve-c3758/openvswitch-dpdk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,23 @@ in
ovs-vsctl set Bridge br0 rstp_enable=true || true
''
+ (builtins.concatStringsSep "\n" (
lib.mapAttrsToList (n: v: ''
ovs-vsctl --may-exist add-port br0 ${n} || true
ovs-vsctl set Interface ${n} type=dpdk \
options:dpdk-devargs=${v} \
mtu_request=9000 \
options:n_rxq=4 \
options:rx-steering=rss+lacp \
|| true
'') interfaces
lib.mapAttrsToList (
n: v:
''
ovs-vsctl --may-exist add-port br0 ${n} || true
''
+ (lib.optionalString (n == "dpdk-08000") ''
ovs-vsctl set port dpdk-08000 tag=201 || true
'')
+ ''
ovs-vsctl set Interface ${n} type=dpdk \
options:dpdk-devargs=${v} \
mtu_request=9000 \
options:n_rxq=4 \
options:rx-steering=rss+lacp \
|| true
''
) interfaces
))
+ (lib.concatMapStringsSep "\n" (i: ''
ovs-vsctl --may-exist add-port br0 vhost${i} || true
Expand All @@ -74,10 +82,7 @@ in
options:vhost-server-path=/run/ovs-vhost${i}.sock \
mtu_request=9000 \
|| true
'') (builtins.map builtins.toString (lib.range 0 9)))
+ ''
ovs-vsctl set port dpdk-08000 tag=201 || true
'';
'') (builtins.map builtins.toString (lib.range 0 9)));
};

systemd.services.ovs-vswitchd = {
Expand Down

0 comments on commit 8109ebb

Please sign in to comment.