diff options
author | Markus Kowalewski <markus.kowalewski@gmail.com> | 2020-02-28 10:06:37 +0100 |
---|---|---|
committer | Markus Kowalewski <markus.kowalewski@gmail.com> | 2020-03-12 22:32:44 +0100 |
commit | 2c7f8d56dce12ae9f890d627766764c36f371b06 (patch) | |
tree | dfba4f316ca2c3ac9ef3e193fce33a79a9efb2e2 /nixos/modules/services/networking/rxe.nix | |
parent | 505bccfdc7afbd6844b1a65bffadf6208032d5d5 (diff) | |
download | nixpkgs-2c7f8d56dce12ae9f890d627766764c36f371b06.tar nixpkgs-2c7f8d56dce12ae9f890d627766764c36f371b06.tar.gz nixpkgs-2c7f8d56dce12ae9f890d627766764c36f371b06.tar.bz2 nixpkgs-2c7f8d56dce12ae9f890d627766764c36f371b06.tar.lz nixpkgs-2c7f8d56dce12ae9f890d627766764c36f371b06.tar.xz nixpkgs-2c7f8d56dce12ae9f890d627766764c36f371b06.tar.zst nixpkgs-2c7f8d56dce12ae9f890d627766764c36f371b06.zip |
nixos/rxe: use iproute instead of rdma-core
The rdma-core packages dropped rxe_cfg in favour of iproute's rdma utility (see https://github.com/linux-rdma/rdma-core/pull/678/files)
Diffstat (limited to 'nixos/modules/services/networking/rxe.nix')
-rw-r--r-- | nixos/modules/services/networking/rxe.nix | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/nixos/modules/services/networking/rxe.nix b/nixos/modules/services/networking/rxe.nix index a6a069ec50c..fbec62728c0 100644 --- a/nixos/modules/services/networking/rxe.nix +++ b/nixos/modules/services/networking/rxe.nix @@ -5,20 +5,6 @@ with lib; let cfg = config.networking.rxe; - runRxeCmd = cmd: ifcs: - concatStrings ( map (x: "${pkgs.rdma-core}/bin/rxe_cfg -n ${cmd} ${x};") ifcs); - - startScript = pkgs.writeShellScriptBin "rxe-start" '' - ${pkgs.rdma-core}/bin/rxe_cfg -n start - ${runRxeCmd "add" cfg.interfaces} - ${pkgs.rdma-core}/bin/rxe_cfg - ''; - - stopScript = pkgs.writeShellScriptBin "rxe-stop" '' - ${runRxeCmd "remove" cfg.interfaces } - ${pkgs.rdma-core}/bin/rxe_cfg -n stop - ''; - in { ###### interface @@ -31,9 +17,8 @@ in { example = [ "eth0" ]; description = '' Enable RDMA on the listed interfaces. The corresponding virtual - RDMA interfaces will be named rxe0 ... rxeN where the ordering - will be as they are named in the list. UDP port 4791 must be - open on the respective ethernet interfaces. + RDMA interfaces will be named rxe_<interface>. + UDP port 4791 must be open on the respective ethernet interfaces. ''; }; }; @@ -44,7 +29,6 @@ in { config = mkIf cfg.enable { systemd.services.rxe = { - path = with pkgs; [ kmod rdma-core ]; description = "RoCE interfaces"; wantedBy = [ "multi-user.target" ]; @@ -54,8 +38,13 @@ in { serviceConfig = { Type = "oneshot"; RemainAfterExit = true; - ExecStart = "${startScript}/bin/rxe-start"; - ExecStop = "${stopScript}/bin/rxe-stop"; + ExecStart = map ( x: + "${pkgs.iproute}/bin/rdma link add rxe_${x} type rxe netdev ${x}" + ) cfg.interfaces; + + ExecStop = map ( x: + "${pkgs.iproute}/bin/rdma link delete rxe_${x}" + ) cfg.interfaces; }; }; }; |