From 891127776cd1270416d0db7be74ca9ff29a41370 Mon Sep 17 00:00:00 2001 From: Cheng Zhang Date: Fri, 5 Jan 2018 14:36:20 +0800 Subject: [PATCH] CP-25798: Add interface of SRIOV support Signed-off-by: Cheng Zhang --- network/network_interface.ml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/network/network_interface.ml b/network/network_interface.ml index 7fca40d2..e943393a 100644 --- a/network/network_interface.ml +++ b/network/network_interface.ml @@ -13,7 +13,6 @@ *) (** {2 Helper functions} *) - let service_name = "networkd" let queue_name = ref (Xcp_service.common_prefix ^ service_name) @@ -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