#include "odp-util.h"
#include "ofpbuf.h"
#include "packets.h"
+#include "dp-packet.h"
#include "poll-loop.h"
#include "seq.h"
#include "match.h"
static void
update_recirc_rules(struct bond *bond)
+ OVS_REQ_WRLOCK(rwlock)
{
struct match match;
struct bond_pr_rule_op *pr_op, *next_op;
* See bond_should_send_learning_packets() for description of usage. The
* caller should send the composed packet on the port associated with
* port_aux and takes ownership of the returned ofpbuf. */
-struct ofpbuf *
+struct dp_packet *
bond_compose_learning_packet(struct bond *bond,
const uint8_t eth_src[ETH_ADDR_LEN],
uint16_t vlan, void **port_aux)
{
struct bond_slave *slave;
- struct ofpbuf *packet;
+ struct dp_packet *packet;
struct flow flow;
ovs_rwlock_rdlock(&rwlock);
memcpy(flow.dl_src, eth_src, ETH_ADDR_LEN);
slave = choose_output_slave(bond, &flow, NULL, vlan);
- packet = ofpbuf_new(0);
+ packet = dp_packet_new(0);
compose_rarp(packet, eth_src);
if (vlan) {
eth_push_vlan(packet, htons(ETH_TYPE_VLAN), htons(vlan));
}
}
-void
-bond_update_post_recirc_rules(struct bond* bond, const bool force)
+static void
+bond_update_post_recirc_rules__(struct bond* bond, const bool force)
+ OVS_REQ_WRLOCK(rwlock)
{
struct bond_entry *e;
bool update_rules = force; /* Always update rules if caller forces it. */
update_recirc_rules(bond);
}
}
+
+void
+bond_update_post_recirc_rules(struct bond* bond, const bool force)
+{
+ ovs_rwlock_wrlock(&rwlock);
+ bond_update_post_recirc_rules__(bond, force);
+ ovs_rwlock_unlock(&rwlock);
+}
\f
/* Rebalancing. */
}
if (use_recirc && rebalanced) {
- bond_update_post_recirc_rules(bond,true);
+ bond_update_post_recirc_rules__(bond,true);
}
done: