Skip to content

Commit

Permalink
CP-25798: Add interface of SRIOV support
Browse files Browse the repository at this point in the history
Signed-off-by: Cheng Zhang <cheng.zhang@citrix.com>
  • Loading branch information
cheng-z authored and krizex committed Jan 11, 2018
1 parent 7b7fac1 commit 8911277
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion network/network_interface.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*)

(** {2 Helper functions} *)

let service_name = "networkd"
let queue_name = ref (Xcp_service.common_prefix ^ service_name)

Expand Down Expand Up @@ -321,3 +320,32 @@ module PVS_proxy = struct
external configure_site : debug_info -> PVS_proxy.t -> unit = ""
external remove_site : debug_info -> string -> unit = ""
end

type sriov_error =
| Device_not_found
| Bus_out_of_range
| Not_enough_mmio_resources
| Unknown of string

type sriov_action_result =
| Sysfs_successful
| Modprobe_successful
| Modprobe_successful_requires_reboot
| Disable_successful

type sriov_result =
| Ok of sriov_action_result
| Error of sriov_error

module Sriov = struct

type sriov_pci_t = {
mac: string option;
vlan: int64 option;
rate: int64 option;
}

external enable: debug_info -> name:iface -> sriov_result = ""
external disable: debug_info -> name:iface -> sriov_result = ""
external make_vf_config : debug_info -> pci_address:Xcp_pci.address -> vf_info:Sriov.sriov_pci_t -> unit = ""
end

0 comments on commit 8911277

Please sign in to comment.