mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 09:58:01 +00:00
datapath-windows: Increase the maximum size of port name.
In userspace, port name sizes are restricted to IFNAMSIZ which is defined to IF_NAME_SIZE in: C:\Program Files (x86)\Windows Kits\8.1\Include\shared\netioapi.h In the kernel, since IFNAMSIZ was not available, we previously defined a value of 16 for the kernel. This is restrictive for Openstack integration where we use UUID as the name. In this patch, we make the kernel code also use the same value as the userspace. Also updated is the OVS.psm1 powershell script which now allows friendly names to be upto 48 bytes. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Eitan Eliahu <eliahue@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
parent
30ffab6392
commit
a2ab813b43
@ -18,8 +18,7 @@ s,<linux/types\.h>,"Types.h",
|
|||||||
|
|
||||||
# Add ETH_ADDR_LEN macro to avoid including userspace packet.h
|
# Add ETH_ADDR_LEN macro to avoid including userspace packet.h
|
||||||
s,#include <linux/if_ether\.h>,\n#ifndef ETH_ADDR_LEN \
|
s,#include <linux/if_ether\.h>,\n#ifndef ETH_ADDR_LEN \
|
||||||
#define ETH_ADDR_LEN 6 \n#endif \
|
#define ETH_ADDR_LEN 6 \n#endif,
|
||||||
\n#ifndef IFNAMSIZ \n#define IFNAMSIZ 16 \n#endif,
|
|
||||||
|
|
||||||
# Use OVS's own ETH_ADDR_LEN instead of Linux-specific ETH_ALEN.
|
# Use OVS's own ETH_ADDR_LEN instead of Linux-specific ETH_ALEN.
|
||||||
s/ETH_ALEN/ETH_ADDR_LEN/
|
s/ETH_ALEN/ETH_ADDR_LEN/
|
||||||
|
@ -108,8 +108,6 @@ enum ovs_win_netdev_cmd {
|
|||||||
OVS_WIN_NETDEV_CMD_GET, /* information about the netdev. */
|
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
|
* 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
|
* network device attributes of a vport that are not specific to OVS, such as
|
||||||
@ -146,12 +144,11 @@ enum ovs_win_netdev_attr {
|
|||||||
OVS_WIN_NETDEV_ATTR_IF_FLAGS, /* Interface flags o the vport. */
|
OVS_WIN_NETDEV_ATTR_IF_FLAGS, /* Interface flags o the vport. */
|
||||||
__OVS_WIN_NETDEV_ATTR_MAX
|
__OVS_WIN_NETDEV_ATTR_MAX
|
||||||
};
|
};
|
||||||
|
#define OVS_WIN_NETDEV_ATTR_MAX (__OVS_WIN_NETDEV_ATTR_MAX - 1)
|
||||||
|
|
||||||
#define OVS_WIN_NETDEV_IFF_UP (1 << 0)
|
#define OVS_WIN_NETDEV_IFF_UP (1 << 0)
|
||||||
#define OVS_WIN_NETDEV_IFF_PROMISC (1 << 1)
|
#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 struct ovs_dp_stats OVS_DP_STATS;
|
||||||
typedef enum ovs_vport_type OVS_VPORT_TYPE;
|
typedef enum ovs_vport_type OVS_VPORT_TYPE;
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
#ifndef __OVS_PUB_H_
|
#ifndef __OVS_PUB_H_
|
||||||
#define __OVS_PUB_H_ 1
|
#define __OVS_PUB_H_ 1
|
||||||
|
|
||||||
|
#include <netioapi.h>
|
||||||
|
#define IFNAMSIZ IF_NAMESIZE
|
||||||
#include "../ovsext/Netlink/Netlink.h"
|
#include "../ovsext/Netlink/Netlink.h"
|
||||||
|
|
||||||
#define OVS_DRIVER_MAJOR_VER 1
|
#define OVS_DRIVER_MAJOR_VER 1
|
||||||
@ -132,9 +134,7 @@ typedef struct _OVS_VERSION {
|
|||||||
uint8_t mnrDrvVer;
|
uint8_t mnrDrvVer;
|
||||||
} OVS_VERSION, *POVS_VERSION;
|
} OVS_VERSION, *POVS_VERSION;
|
||||||
|
|
||||||
|
#define OVS_MAX_PORT_NAME_LENGTH IFNAMSIZ
|
||||||
|
|
||||||
#define OVS_MAX_PORT_NAME_LENGTH 32
|
|
||||||
|
|
||||||
typedef struct _OVS_VPORT_GET {
|
typedef struct _OVS_VPORT_GET {
|
||||||
uint32_t dpNo;
|
uint32_t dpNo;
|
||||||
|
@ -29,7 +29,7 @@ function Set-VMNetworkAdapterOVSPort
|
|||||||
[Microsoft.HyperV.PowerShell.VMNetworkAdapter]$VMNetworkAdapter,
|
[Microsoft.HyperV.PowerShell.VMNetworkAdapter]$VMNetworkAdapter,
|
||||||
|
|
||||||
[parameter(Mandatory=$true)]
|
[parameter(Mandatory=$true)]
|
||||||
[ValidateLength(1, 16)]
|
[ValidateLength(1, 48)]
|
||||||
[string]$OVSPortName
|
[string]$OVSPortName
|
||||||
)
|
)
|
||||||
process
|
process
|
||||||
@ -73,7 +73,7 @@ function Get-VMNetworkAdapterByOVSPort
|
|||||||
(
|
(
|
||||||
|
|
||||||
[parameter(Mandatory=$true)]
|
[parameter(Mandatory=$true)]
|
||||||
[ValidateLength(1, 16)]
|
[ValidateLength(1, 48)]
|
||||||
[string]$OVSPortName
|
[string]$OVSPortName
|
||||||
)
|
)
|
||||||
process
|
process
|
||||||
@ -94,7 +94,7 @@ function Get-VMByOVSPort
|
|||||||
param
|
param
|
||||||
(
|
(
|
||||||
[parameter(Mandatory=$true)]
|
[parameter(Mandatory=$true)]
|
||||||
[ValidateLength(1, 16)]
|
[ValidateLength(1, 48)]
|
||||||
[string]$OVSPortName
|
[string]$OVSPortName
|
||||||
)
|
)
|
||||||
process
|
process
|
||||||
|
Loading…
x
Reference in New Issue
Block a user