Skip to content

Commit

Permalink
Merge pull request #192 from xiewei20082008/sriov-weix
Browse files Browse the repository at this point in the history
Differentiate the sriov_result into three kinds.
  • Loading branch information
krizex committed Jan 22, 2018
2 parents 4f3a2ed + 9f1028a commit 73025f1
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions network/network_interface.ml
Original file line number Diff line number Diff line change
Expand Up @@ -322,21 +322,26 @@ module PVS_proxy = struct
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
type enable_action_result =
| Modprobe_successful_requires_reboot
| Disable_successful

type sriov_result =
| Ok of sriov_action_result
| Error of sriov_error
| Modprobe_successful
| Sysfs_successful

type enable_result =
| Ok of enable_action_result
| Error of string

type disable_result =
| Ok
| Error of string

type config_error =
| Config_vf_rate_not_supported
| Unknown of string

type config_result =
| Ok
| Error of config_error

module Sriov = struct

Expand All @@ -346,7 +351,7 @@ module Sriov = struct
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 = ""
external enable: debug_info -> name:iface -> enable_result = ""
external disable: debug_info -> name:iface -> disable_result = ""
external make_vf_config : debug_info -> pci_address:Xcp_pci.address -> vf_info:Sriov.sriov_pci_t -> config_result = ""
end

0 comments on commit 73025f1

Please sign in to comment.