struct hmap xports; /* Indexed by ofp_port. */
char *name; /* Name used in log messages. */
+ struct dpif *dpif; /* Datapath interface. */
struct mac_learning *ml; /* Mac learning handle. */
struct mbridge *mbridge; /* Mirroring. */
struct dpif_sflow *sflow; /* SFlow handle, or null. */
void
xlate_ofproto_set(struct ofproto_dpif *ofproto, const char *name,
- const struct mac_learning *ml, struct stp *stp,
- const struct mbridge *mbridge,
+ struct dpif *dpif, const struct mac_learning *ml,
+ struct stp *stp, const struct mbridge *mbridge,
const struct dpif_sflow *sflow,
const struct dpif_ipfix *ipfix, enum ofp_config_flags frag,
bool forward_bpdu, bool has_in_band, bool has_netflow)
free(xbridge->name);
xbridge->name = xstrdup(name);
+ xbridge->dpif = dpif;
xbridge->forward_bpdu = forward_bpdu;
xbridge->has_in_band = has_in_band;
xbridge->has_netflow = has_netflow;
struct skb_priority_to_dscp *pdscp;
uint32_t skb_priority;
- if (ofproto_dpif_queue_to_priority(xport->xbridge->ofproto,
- qdscp_list[i].queue,
- &skb_priority)) {
+ if (dpif_queue_to_priority(xport->xbridge->dpif, qdscp_list[i].queue,
+ &skb_priority)) {
continue;
}
const size_t cookie_size)
{
size_t sample_offset, actions_offset;
+ odp_port_t odp_port;
int cookie_offset;
+ uint32_t pid;
sample_offset = nl_msg_start_nested(odp_actions, OVS_ACTION_ATTR_SAMPLE);
nl_msg_put_u32(odp_actions, OVS_SAMPLE_ATTR_PROBABILITY, probability);
actions_offset = nl_msg_start_nested(odp_actions, OVS_SAMPLE_ATTR_ACTIONS);
- cookie_offset = put_userspace_action(xbridge->ofproto, odp_actions, flow,
- cookie, cookie_size);
+
+ odp_port = ofp_port_to_odp_port(xbridge, flow->in_port.ofp_port);
+ pid = dpif_port_get_pid(xbridge->dpif, odp_port);
+ cookie_offset = odp_put_userspace_action(pid, cookie, cookie_size, odp_actions);
nl_msg_end_nested(odp_actions, actions_offset);
nl_msg_end_nested(odp_actions, sample_offset);
int error;
/* Translate queue to priority. */
- error = ofproto_dpif_queue_to_priority(ctx->xbridge->ofproto, queue_id,
- &priority);
+ error = dpif_queue_to_priority(ctx->xbridge->dpif, queue_id, &priority);
if (error) {
/* Fall back to ordinary output action. */
xlate_output_action(ctx, enqueue->port, 0, false);
{
uint32_t skb_priority;
- if (!ofproto_dpif_queue_to_priority(ctx->xbridge->ofproto, queue_id,
- &skb_priority)) {
+ if (!dpif_queue_to_priority(ctx->xbridge->dpif, queue_id, &skb_priority)) {
ctx->xin->flow.skb_priority = skb_priority;
} else {
/* Couldn't translate queue to a priority. Nothing to do. A warning
struct bfd;
struct bond;
+struct dpif;
struct lacp;
struct dpif_ipfix;
struct dpif_sflow;
};
void xlate_ofproto_set(struct ofproto_dpif *, const char *name,
- const struct mac_learning *, struct stp *,
- const struct mbridge *, const struct dpif_sflow *,
- const struct dpif_ipfix *, enum ofp_config_flags,
- bool forward_bpdu, bool has_in_band, bool has_netflow);
+ struct dpif *, const struct mac_learning *,
+ struct stp *, const struct mbridge *,
+ const struct dpif_sflow *, const struct dpif_ipfix *,
+ enum ofp_config_flags, bool forward_bpdu,
+ bool has_in_band, bool has_netflow);
void xlate_remove_ofproto(struct ofproto_dpif *);
void xlate_bundle_set(struct ofproto_dpif *, struct ofbundle *,
continue;
}
- xlate_ofproto_set(ofproto, ofproto->up.name, ofproto->ml,
+ xlate_ofproto_set(ofproto, ofproto->up.name,
+ ofproto->backer->dpif, ofproto->ml,
ofproto->stp, ofproto->mbridge,
ofproto->sflow, ofproto->ipfix,
ofproto->up.frag_handling,
}
}
\f
-int
-ofproto_dpif_queue_to_priority(const struct ofproto_dpif *ofproto,
- uint32_t queue_id, uint32_t *priority)
-{
- return dpif_queue_to_priority(ofproto->backer->dpif, queue_id, priority);
-}
-
static int
set_queues(struct ofport *ofport_, const struct ofproto_port_queue *qdscp,
size_t n_qdscp)
ODPP_NONE);
odp_put_userspace_action(pid, &cookie, sizeof cookie.slow_path, &buf);
} else {
- put_userspace_action(ofproto, &buf, flow, &cookie,
- sizeof cookie.slow_path);
+ odp_port_t odp_port;
+ uint32_t pid;
+
+ odp_port = ofp_port_to_odp_port(ofproto, flow->in_port.ofp_port);
+ pid = dpif_port_get_pid(ofproto->backer->dpif, odp_port);
+ odp_put_userspace_action(pid, &cookie, sizeof cookie.slow_path, &buf);
}
*actionsp = buf.data;
*actions_lenp = buf.size;
}
-
-size_t
-put_userspace_action(const struct ofproto_dpif *ofproto,
- struct ofpbuf *odp_actions,
- const struct flow *flow,
- const union user_action_cookie *cookie,
- const size_t cookie_size)
-{
- uint32_t pid;
-
- pid = dpif_port_get_pid(ofproto->backer->dpif,
- ofp_port_to_odp_port(ofproto,
- flow->in_port.ofp_port));
-
- return odp_put_userspace_action(pid, cookie, cookie_size, odp_actions);
-}
\f
static bool
set_frag_handling(struct ofproto *ofproto_,
void rule_credit_stats(struct rule_dpif *, const struct dpif_flow_stats *);
-size_t put_userspace_action(const struct ofproto_dpif *,
- struct ofpbuf *odp_actions, const struct flow *,
- const union user_action_cookie *,
- const size_t cookie_size);
-
bool ofproto_has_vlan_splinters(const struct ofproto_dpif *);
ofp_port_t vsp_realdev_to_vlandev(const struct ofproto_dpif *,
ofp_port_t realdev_ofp_port,
ovs_be16 vlan_tci);
-int ofproto_dpif_queue_to_priority(const struct ofproto_dpif *,
- uint32_t queue_id, uint32_t *priority);
-
void ofproto_dpif_send_packet_in(struct ofproto_dpif *,
struct ofputil_packet_in *pin);
void ofproto_dpif_flow_mod(struct ofproto_dpif *, struct ofputil_flow_mod *);