2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-24 10:58:04 +00:00

11 Commits

Author SHA1 Message Date
Nithin Raju
ef901b35ba netdev-windows: Fix typo in call to memcpy().
This fixes a build error introduced by commit 74ff3298c (userspace:
Define and use struct eth_addr.)

Signed-off-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-08-31 13:02:26 -07:00
Jarno Rajahalme
74ff3298c8 userspace: Define and use struct eth_addr.
Define struct eth_addr and use it instead of a uint8_t array for all
ethernet addresses in OVS userspace.  The struct is always the right
size, and it can be assigned without an explicit memcpy, which makes
code more readable.

"struct eth_addr" is a good type name for this as many utility
functions are already named accordingly.

struct eth_addr can be accessed as bytes as well as ovs_be16's, which
makes the struct 16-bit aligned.  All use seems to be 16-bit aligned,
so some algorithms on the ethernet addresses can be made a bit more
efficient making use of this fact.

As the struct fits into a register (in 64-bit systems) we pass it by
value when possible.

This patch also changes the few uses of Linux specific ETH_ALEN to
OVS's own ETH_ADDR_LEN, and removes the OFP_ETH_ALEN, as it is no
longer needed.

This work stemmed from a desire to make all struct flow members
assignable for unrelated exploration purposes.  However, I think this
might be a nice code readability improvement by itself.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
2015-08-28 14:55:11 -07:00
Alin Serdean
694ebbc85e netdev-windows: Add ARP lookup and next hop functionality.
This patch implements two functionalities needed for an active manager:
1. ARP lookup
2. Next hop

The first uses the Windows GetIpNetTable() function:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365956%28v=vs.85%29.aspx

The second one uses GetAdaptersAddresses() function:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365915%28v=vs.85%29.aspx

Both API's are found in the Iphlpapi library. We need to add this library when compiling.

Documentation and appveyor config has been updated to match the use of the new library.

Tested using opendaylight.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/63
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-05-26 18:52:14 -07:00
Gurucharan Shetty
0c87e03dff netdev-windows: Fix broken compilation.
Commit 6fd6ed71cb9f(ofpbuf: Simplify ofpbuf API.) removed ofpbuf_size
and ofpbuf_data. They still had reference from netdev-windows. Fix them.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2015-03-05 09:29:51 -08:00
Thomas Graf
e6211adce4 lib: Move vlog.h to <openvswitch/vlog.h>
A new function vlog_insert_module() is introduced to avoid using
list_insert() from the vlog.h header.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:19 +01:00
Nithin Raju
ee4dac3bb6 netdev-windows: Fix bugs in flag update and MAC address copy functions.
The .update_flags function in netdev-windows was dummy. But we need to
return the existing flags for link status to be shown as up in the
confdb.

There was a bug in copying the MAC address.

We fix these two issues in this patch.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Co-Authored-by: Ankur Sharma <ankursharma@vmware.com>
Signed-off-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>
2014-10-28 10:46:07 -07:00
Wang Sheng-Hui
3bd0fd39eb Use magic ETH_ADDR_LEN instead of 6 for Ethernet address length.
ETH_ADDR_LEN is defined in lib/packets.h, valued 6.
Use this macro instead of magic number 6 to represent the length
of eth mac address.

Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-10-22 08:46:52 -07:00
Ankur Sharma
6cac056e1d datapath-windows: netdev-windows fixes for vswitchd bringup.
Added the handlers for update_flags and set_etheraddr.
These handlers were needed for vswitchd bringup on windows
platform.

Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-10-17 13:59:09 -07:00
Nithin Raju
0bfecde16d lib/netdev-windows.c: nuke the init function.
The init function is not allowed to call into the kernel datapath
while running unit tests since the kernel datapath is not loaded.
Instead of making the function dummy, it is better to not have it
at all.

Reported-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2014-10-08 13:30:45 -07:00
Nithin Raju
3e648bc5f2 netdev-windows: add code to query netdev information
Primary goals of netdev-windows.c are:
1) To query the 'network device' information of a vport such as MTU, etc.
2) Monitor changes to the 'network device' information such as link
status.

In this change, we implement only #1. #2 can also be implemented, but it
does not seem to be required for the purposes of implement
'ovs-dpctl.exe show'.

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>
2014-10-06 15:38:22 -07:00
Nithin Raju
078eedf4f7 netdev-windows: New module.
In this patch, we add a lib/netdev-windows.c which mostly contains stub
code and in subsequent patches, would use the netlink interface to query
netdev information for a vport.

The code implements netdev functionality for "internal" and "system"
types of vports.

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>
2014-10-06 15:38:22 -07:00