summaryrefslogtreecommitdiff
path: root/datapath-windows/include
diff options
context:
space:
mode:
authorNithin Raju <nithin@vmware.com>2014-10-06 13:07:17 -0700
committerBen Pfaff <blp@nicira.com>2014-10-06 15:35:56 -0700
commitc409f89e6755074fc5c6a94f11aebbb7d3d64b52 (patch)
tree2e7f88c7252babf816691d87c63bb6ca0366e9db /datapath-windows/include
parent1ce4551c8c158e465734e26589d8444477cd5218 (diff)
downloadopenvswitch-c409f89e6755074fc5c6a94f11aebbb7d3d64b52.tar.gz
OvsDpInterfaceExt.h: add support for netlink family for netdev
In this patch, we define netlink family, attributes and commands for query the 'network device' information of VPORTs, such as MTU, Link status, etc. I considered adding the netdev command to the OVS_WIN_CONTROL_FAMILY itself, but the netdev attributes are not compatible with the existing attributes for the events. I also considered adding new attributes to the VPORT family, but we'll have to extend the standard datapath interface for that. In this patch, we fix the definition of 'OVS_WIN_CONTROL_ATTR_MAX' as well. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/include')
-rw-r--r--datapath-windows/include/OvsDpInterfaceExt.h60
1 files changed, 59 insertions, 1 deletions
diff --git a/datapath-windows/include/OvsDpInterfaceExt.h b/datapath-windows/include/OvsDpInterfaceExt.h
index e1c186ffc..e9faecc3d 100644
--- a/datapath-windows/include/OvsDpInterfaceExt.h
+++ b/datapath-windows/include/OvsDpInterfaceExt.h
@@ -59,6 +59,7 @@
#define OVS_WIN_NL_PACKET_FAMILY_ID (NLMSG_MIN_TYPE + 3)
#define OVS_WIN_NL_VPORT_FAMILY_ID (NLMSG_MIN_TYPE + 4)
#define OVS_WIN_NL_FLOW_FAMILY_ID (NLMSG_MIN_TYPE + 5)
+#define OVS_WIN_NL_NETDEV_FAMILY_ID (NLMSG_MIN_TYPE + 6)
#define OVS_WIN_NL_INVALID_MCGRP_ID 0
#define OVS_WIN_NL_MCGRP_START_ID 100
@@ -71,7 +72,6 @@
#define OVS_WIN_CONTROL_FAMILY "ovs_win_control"
#define OVS_WIN_CONTROL_MCGROUP "ovs_win_control"
#define OVS_WIN_CONTROL_VERSION 1
-#define OVS_WIN_CONTROL_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1)
/* Commands available under the OVS_WIN_CONTROL_FAMILY. */
enum ovs_win_control_cmd {
@@ -87,7 +87,65 @@ enum ovs_win_control_cmd {
enum ovs_nl_mcast_attr {
OVS_NL_ATTR_MCAST_GRP, /* (UINT32) Join an MC group */
OVS_NL_ATTR_MCAST_JOIN, /* (UINT8) 1/0 - Join/Unjoin */
+ __OVS_NL_ATTR_CTRL_MAX
};
+#define OVS_WIN_CONTROL_ATTR_MAX (__OVS_NL_ATTR_CTRL_MAX - 1)
+
+/*
+ * Netdev family of commands specific to Windows.
+ */
+#define OVS_WIN_NETDEV_FAMILY "ovs_win_netdev"
+#define OVS_WIN_NETDEV_MCGROUP "ovs_win_netdev"
+#define OVS_WIN_NETDEV_VERSION 1
+
+enum ovs_win_netdev_cmd {
+ OVS_WIN_NETDEV_CMD_UNSPEC,
+ OVS_WIN_NETDEV_CMD_GET, /* information about the netdev. */
+};
+
+#define OVS_WIN_NETDEV_ATTR_MAX (__OVS_WIN_NETDEV_ATTR_MAX - 1)
+
+/**
+ * For every vport on the datapath, there is a corresponding netdev. General
+ * network device attributes of a vport that are not specific to OVS, such as
+ * MTU are represented using a netdev. For convenience, some of the vport
+ * attributes are also included as netdev attributes.
+ *
+ * enum ovs_win_netdev_attr - attributes for %OVS_WIN_NETDEV_* commands.
+ * @OVS_WIN_NETDEV_ATTR_PORT_NO: 32-bit port number of the vport within the
+ * datapath.
+ * @OVS_WIN_NETDEV_ATTR_TYPE: 32-bit %OVS_VPORT_TYPE_* constant describing
+ * the type of vport.
+ * @OVS_WIN_NETDEV_ATTR_NAME: Name of vport. Maximum length %IFNAMSIZ-1 bytes
+ * plus a null terminator.
+ * @OVS_WIN_NETDEV_ATTR_MAC_ADDR: MAC address of the vport. %ETH_ADDR_LEN bytes
+ * long.
+ * @OVS_WIN_NETDEV_ATTR_MTU : 32-bit MTU of the vport.
+ * @OVS_WIN_NETDEV_ATTR_IF_FLAGS: 32-bit %OVS_WIN_NETDEV_IFF_* interface flags
+ * of the vport.
+ *
+ * These attributes follow the &struct ovs_header within the Generic Netlink
+ * payload for %OVS_WIN_NETDEV_* commands.
+ *
+ * For all requests, if %OVS_WIN_NETDEV_ATTR_NAME is specified then it is used
+ * to look up the netdev to operate on; dp_idx from the &struct
+ * ovs_header is not relevant for the look up.
+ */
+enum ovs_win_netdev_attr {
+ OVS_WIN_NETDEV_ATTR_UNSPEC,
+ OVS_WIN_NETDEV_ATTR_PORT_NO, /* u32 port number within datapath. */
+ OVS_WIN_NETDEV_ATTR_TYPE, /* u32 OVS_NETDEV_TYPE_* constant. */
+ OVS_WIN_NETDEV_ATTR_NAME, /* string name, up to IFNAMSIZ bytes long. */
+ OVS_WIN_NETDEV_ATTR_MAC_ADDR, /* MAC address of the vport. */
+ OVS_WIN_NETDEV_ATTR_MTU, /* MTU of the vport. */
+ OVS_WIN_NETDEV_ATTR_IF_FLAGS, /* Interface flags o the vport. */
+ __OVS_WIN_NETDEV_ATTR_MAX
+};
+
+#define OVS_WIN_NETDEV_IFF_UP (1 << 0)
+#define OVS_WIN_NETDEV_IFF_PROMISC (1 << 1)
+
+#define OVS_WIN_NETDEV_ATTR_MAX (__OVS_WIN_NETDEV_ATTR_MAX - 1)
typedef struct ovs_dp_stats OVS_DP_STATS;
typedef enum ovs_vport_type OVS_VPORT_TYPE;