2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-15 14:17:18 +00:00
Commit Graph

15 Commits

Author SHA1 Message Date
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
Dennis Flynn
14691214d1 auto-attach: Support latest version of auto-attach LLDP TLVs
The following enhancements to the auto-attach feature are provided

- Support recent modifications to the AA element discovery TLV
- Support recent Avaya Organizationally Unique ID (OUI) change.
  (This will change to IEEE assigned OUI once AA standard has been ratified)
- Remove some Avaya specific #defines

The primary purpose of this commit is to catch up with the latest changes made
to the auto attach TLVs as the Auto Attach feature progresses through the
802.1Q IEEE standards committee. Most notably this includes some minor rework
of the AA element discovery TLV and a recent change to the Avaya OUI value.

Signed-off-by: Dennis Flynn <drflynn@avaya.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-23 13:28:53 -07:00
Ben Pfaff
6db3f8b065 lldp: Use ETH_ADDR_FMT.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:32 -08:00
Ben Pfaff
f94d6e7804 lldp: Remove excessive parentheses.
The OVS style is to usually avoid parentheses in cases like these where
they just make expressions harder to read.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:32 -08:00
Ben Pfaff
f856318e14 lldp: Miscellaneous coding style fixes.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:13 -08:00
Ben Pfaff
1acaf4ac8f lldpd-structs: Fix type of c_id member.
This member is typically an Ethernet address so the appropriate type is
uint8_t, not char.  This eliminates a couple of casts.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:22:12 -08:00
Ben Pfaff
32590179d4 lldp-structs: Fix use of list of struct lldpd_mgmt.
A list of some type should have type "struct ovs_list", not some other
type that encapsulates it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:29 -08:00
Ben Pfaff
854560f8dc lldp-structs: Fix use of list of lldpd_aa_isid_vlan_maps_tlv.
A list of some type should have type "struct ovs_list", not some other
type that encapsulates it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:29 -08:00
Ben Pfaff
02c842eb74 lldp: Change representation of ISID to uint32_t.
It's a lot more straightforward to deal with integer values as integers
instead of arrays of bytes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:29 -08:00
Ben Pfaff
8a42c2d675 lldp: Declare "bool" variables as type "bool".
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:28 -08:00
Ben Pfaff
02d593b194 lldp: Use "bool" for boolean variables.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:28 -08:00
Ben Pfaff
cc84196628 lldp: Use x*alloc() functions instead of writing them out in-place.
Also use flexible array member instead of array of length 1 in
struct lldpd_frame.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:27 -08:00
Ben Pfaff
22736f59c1 lldp: Get rid of POKE macros in favor of inline functions.
The POKE macros previously used here don't match the style usually used in
OVS and they require the user to know exactly how many bytes to reserve.
This commit replaces them by easier-to-use inline functions that take
advantage of the ofpbuf interface.

Also removes a few PEEK macros that weren't used anywhere.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:27 -08:00
Dennis Flynn
0477baa93b auto-attach: Add auto-attach support to ofproto layer
Signed-off-by: Ludovic Beliveau <ludovic.beliveau@windriver.com>
Signed-off-by: Dennis Flynn <drflynn@avaya.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:26 -08:00
Dennis Flynn
be53a5c447 auto-attach: Initial support for Auto-Attach standard
This commit provides the initial delivery of support for the Auto-Attach
standard to Open vSwitch. This standard describes a compact method of using
IEEE 802.1AB Link Layer Discovery Protocol (LLDP) with a IEEE 802.1aq Shortest
Path Bridging (SPB) network to automatically attach network devices not
supporting IEEE 802.1ah to individual services in a SPB network. Specifically
this commit adds base LLDP support to OVS along with the LLDP extension
required to support Auto-Attach.

The base LLDP code within this commit is adapted from the open source LLDPD
project headed by Vincent Bernat. This base code is augmented with OVS specific
logic which integrates LLDP into OVS and which extends LLDP to support
Auto-Attach. The required build system changes are provided to include this new
Auto-Attach feature.

This is the first of a series of commits. Subsequent commits will be provided
to complete the task of adding Auto-Attach to OVS.

Signed-off-by: Ludovic Beliveau <ludovic.beliveau@windriver.com>
Signed-off-by: Dennis Flynn <drflynn@avaya.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2015-03-03 16:19:26 -08:00