// Module included in the following assemblies:
//
// * networking/hardware_networks/configuring-interface-sysctl-sriov-device.adoc

:_mod-docs-content-type: PROCEDURE
[id="nw-setting-all-sysctls-flag-node-policy-bonded_{context}"]
= Setting all sysctl flag on nodes with bonded SR-IOV network devices

[role="_abstract"]
The SR-IOV Network Operator adds the `SriovNetworkNodePolicy.sriovnetwork.openshift.io` custom resource definition (CRD) to {product-title}. You can configure an SR-IOV network device by creating a `SriovNetworkNodePolicy` custom resource (CR).

[NOTE]
====
When applying the configuration specified in a SriovNetworkNodePolicy object, the SR-IOV Operator might drain the nodes, and in some cases, reboot nodes.

It might take several minutes for a configuration change to apply.
====

Follow this procedure to create a `SriovNetworkNodePolicy` custom resource (CR).

.Procedure

. Create an `SriovNetworkNodePolicy` custom resource (CR). Save the following YAML as the file `policyallflags-sriov-node-network.yaml`. Replace `policyallflags` with the name for the configuration.
+
[source,yaml]
----
apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetworkNodePolicy
metadata:
  name: policyallflags
  namespace: openshift-sriov-network-operator
spec:
  resourceName: policyallflags
  nodeSelector:
    node.alpha.kubernetes-incubator.io/nfd-network-sriov.capable = `true`
  priority: 10
  numVfs: 5
  nicSelector:
    pfNames: ["ens1f0"]
  deviceType: "netdevice"
  isRdma: false
----
+
--
* `<name>` specifies the name for the custom resource object.
* `<namespace>` specifies the namespace where the SR-IOV Network Operator is installed.
* `<resourceName>` specifies the resource name of the SR-IOV network device plugin. You can create multiple SR-IOV network node policies for a resource name.
* `<nodeSelector>` specifies the node selector for the nodes to configure. Only SR-IOV network devices on the selected nodes are configured. The SR-IOV Container Network Interface (CNI) plugin and device plugin are deployed on selected nodes only.
* `<priority>` is optional. The priority is an integer value between `0` and `99`. A smaller value receives higher priority. For example, a priority of `10` is a higher priority than `99`. The default value is `99`.
* `<numVfs>` specifies the number of virtual functions (VFs) to create for the SR-IOV physical network device. For an Intel network interface controller (NIC), the number of VFs cannot be larger than the total VFs supported by the device. For a Mellanox NIC, the number of VFs cannot be larger than `127`.
* `<nicSelector>` identifies the device for the Operator to configure. You do not have to specify values for all the parameters. It is recommended to identify the network device with enough precision to avoid selecting a device unintentionally. If you specify `rootDevices`, you must also specify a value for `vendor`, `deviceID`, or `pfNames`. If you specify both `pfNames` and `rootDevices` at the same time, ensure that they refer to the same device. If you specify a value for `netFilter`, then you do not need to specify any other parameter because a network ID is unique.
* `<pfNames>` is optional. An array of one or more physical function (PF) names for the device.
* `<deviceType>` is optional. The driver type for the virtual functions. The only allowed value is `netdevice`. For a Mellanox NIC to work in DPDK mode on bare-metal nodes, set `isRdma` to `true`.
* `<isRdma>` is optional. Configures whether to enable remote direct memory access (RDMA) mode. The default value is `false`. If the `isRdma` parameter is set to `true`, you can continue to use the RDMA-enabled VF as a normal network device. A device can be used in either mode. Set `isRdma` to `true` and additionally set `needVhostNet` to `true` to configure a Mellanox NIC for use with Fast Data Path DPDK applications.
--
+
[NOTE]
====
The `vfio-pci` driver type is not supported.
====
+
. Create the `SriovNetworkNodePolicy` object:
+
[source,terminal]
----
$ oc create -f policyallflags-sriov-node-network.yaml
----
+
After applying the configuration update, all the pods in sriov-network-operator namespace change to the `Running` status.
+
. To verify that the SR-IOV network device is configured, enter the following command. Replace `<node_name>` with the name of a node with the SR-IOV network device that you just configured. Expected output shows `Succeeded`
+
[source,terminal]
----
$ oc get sriovnetworknodestates -n openshift-sriov-network-operator <node_name> -o jsonpath='{.status.syncStatus}'
----
