summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif-monitor.h
Commit message (Collapse)AuthorAgeFilesLines
* userspace: Define and use struct eth_addr.Jarno Rajahalme2015-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* auto-attach: Add auto-attach support to ofproto layerDennis Flynn2015-03-031-1/+2
| | | | | | 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>
* ofproto-dpif-monitor: Fix deadlock.Alex Wang2014-05-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 6b59b543 (ovs-thread: Use fair (but nonrecursive) rwlocks on glibc.) changed the rwlocks to nonrecursive, writer-biased lock. It also made the following deadlock possible. Assume BFD is used on both end of a link. Consider the following events: 1. Handler at one end received the BFD control packet with POLL flag set while holding the read lock of 'xlate_rwlock'. Since a BFD control packet with FINAL flag set should be sent back immediately, it calls the ofproto_dpif_monitor_port_send_soon(), in which, it tries to grab the 'monitor_mutex'. 2. The main thread needs to configure the ofproto-dpif-xlate module. It tries to grab the write lock of 'xlate_rwlock' and is blocked by event 1. 3. The monitor thread, after acquired the 'monitor_mutex', wants to acquire the read lock of 'xlate_rwlock'. Since the rwlock is now writer-biased, the attempt of acquiring read lock in event 3 will be blocked by event 2. This will subsequently cause the block of event 1, since monitor thread is holding the 'monitor_mutex'. So the deadlock happens. This commit resolves the above issue by removing the requirement of acquiring 'monitor_mutex' in ofproto_dpif_monitor_port_send_soon(). Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lib/flow: Add miniflow accessors and miniflow_get_tcp_flags().Jarno Rajahalme2014-04-181-0/+1
| | | | | | | | | | | | | | Add inlined generic accessors for miniflow integer type fields, and a new miniflow_get_tcp_flags() usinge these. These will be used in a later patch. Some definitions also used in lib/packets.h had to be moved there to resolve circular include dependencies. Similarly, some inline functions using struct flow are now in lib/flow.h. IMO this is cleaner, since now the lib/flow.h need not be included from lib/packets.h. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Reviewed-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
* bfd: Send FINAL immediately after receiving POLL.Alex Wang2013-12-201-0/+3
| | | | | | | | | | | | Commit 307464a11 (ofproto-dpif-monitor: Use heap to order the mport wakeup time.) makes bfd only send packet at specified periodic instant. This fails to meet the RFC5880 requirement, which requires bfd send FINAL immediately after receiving POLL. This commit fixes the above issue by scheduling bfd to send FINAL within 100 ms after receiving POLL. Signed-off-by: Alex Wang <alexw@nicira.com>
* ofproto-dpif-monitor: Run ofproto-dpif-monitor in a thread.Alex Wang2013-10-161-4/+0
| | | | | | | | | | | | | This commit moves the ofproto-dpif-monitor module into a dedicated thread. This helps eliminate the burden of main thread having to wake up very frequently for periodic interface monitoring (bfd, cfm). Thusly, this commit greatly increases the number of bfd/cfm sessions that can be supported by ovs. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* ofproto-dpif-monitor: Add ofproto-dpif-monitor module.Alex Wang2013-10-081-0/+34
This commit adds a new module ofproto-dpif-monitor in ofproto directory. This module is in charge of executing the periodic functions of monitoring code (e.g. bfd and cfm). Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>