Skip to content

Commit

Permalink
ofproto: Reorganize in preparation for direct dpdk upcalls.
Browse files Browse the repository at this point in the history
This patch reorganizes ofproto-dpif in preparation for future patches
which allow direct upcall processing from dpif-netdev.  The main goals
are to share as much code as possible between the dpif-linux and
dpif-netdev upcall paths.  Additionally, to avoid confusing the
dpif-netdev fast path, the packet processing path should treat packets
and struct flow's as const.

Signed-off-by: Ethan Jackson <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
ejj committed Aug 14, 2014
1 parent ba8561c commit cc37735
Show file tree
Hide file tree
Showing 10 changed files with 437 additions and 353 deletions.
8 changes: 4 additions & 4 deletions ofproto/ofproto-dpif-ipfix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ ipfix_cache_update(struct dpif_ipfix_exporter *exporter,

static void
ipfix_cache_entry_init(struct ipfix_flow_cache_entry *entry,
struct ofpbuf *packet, const struct flow *flow,
const struct ofpbuf *packet, const struct flow *flow,
uint64_t packet_delta_count, uint32_t obs_domain_id,
uint32_t obs_point_id)
{
Expand Down Expand Up @@ -1284,7 +1284,7 @@ ipfix_send_data_msg(struct dpif_ipfix_exporter *exporter,

static void
dpif_ipfix_sample(struct dpif_ipfix_exporter *exporter,
struct ofpbuf *packet, const struct flow *flow,
const struct ofpbuf *packet, const struct flow *flow,
uint64_t packet_delta_count, uint32_t obs_domain_id,
uint32_t obs_point_id)
{
Expand All @@ -1298,7 +1298,7 @@ dpif_ipfix_sample(struct dpif_ipfix_exporter *exporter,
}

void
dpif_ipfix_bridge_sample(struct dpif_ipfix *di, struct ofpbuf *packet,
dpif_ipfix_bridge_sample(struct dpif_ipfix *di, const struct ofpbuf *packet,
const struct flow *flow) OVS_EXCLUDED(mutex)
{
uint64_t packet_delta_count;
Expand All @@ -1315,7 +1315,7 @@ dpif_ipfix_bridge_sample(struct dpif_ipfix *di, struct ofpbuf *packet,
}

void
dpif_ipfix_flow_sample(struct dpif_ipfix *di, struct ofpbuf *packet,
dpif_ipfix_flow_sample(struct dpif_ipfix *di, const struct ofpbuf *packet,
const struct flow *flow, uint32_t collector_set_id,
uint16_t probability, uint32_t obs_domain_id,
uint32_t obs_point_id) OVS_EXCLUDED(mutex)
Expand Down
4 changes: 2 additions & 2 deletions ofproto/ofproto-dpif-ipfix.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ void dpif_ipfix_set_options(
const struct ofproto_ipfix_bridge_exporter_options *,
const struct ofproto_ipfix_flow_exporter_options *, size_t);

void dpif_ipfix_bridge_sample(struct dpif_ipfix *, struct ofpbuf *,
void dpif_ipfix_bridge_sample(struct dpif_ipfix *, const struct ofpbuf *,
const struct flow *);
void dpif_ipfix_flow_sample(struct dpif_ipfix *, struct ofpbuf *,
void dpif_ipfix_flow_sample(struct dpif_ipfix *, const struct ofpbuf *,
const struct flow *, uint32_t, uint16_t, uint32_t,
uint32_t);

Expand Down
2 changes: 1 addition & 1 deletion ofproto/ofproto-dpif-sflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ dpif_sflow_odp_port_to_ifindex(const struct dpif_sflow *ds,
}

void
dpif_sflow_received(struct dpif_sflow *ds, struct ofpbuf *packet,
dpif_sflow_received(struct dpif_sflow *ds, const struct ofpbuf *packet,
const struct flow *flow, odp_port_t odp_in_port,
const union user_action_cookie *cookie)
OVS_EXCLUDED(mutex)
Expand Down
6 changes: 2 additions & 4 deletions ofproto/ofproto-dpif-sflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ void dpif_sflow_del_port(struct dpif_sflow *, odp_port_t odp_port);
void dpif_sflow_run(struct dpif_sflow *);
void dpif_sflow_wait(struct dpif_sflow *);

void dpif_sflow_received(struct dpif_sflow *,
struct ofpbuf *,
const struct flow *,
odp_port_t odp_port,
void dpif_sflow_received(struct dpif_sflow *, const struct ofpbuf *,
const struct flow *, odp_port_t odp_port,
const union user_action_cookie *);

int dpif_sflow_odp_port_to_ifindex(const struct dpif_sflow *,
Expand Down
Loading

0 comments on commit cc37735

Please sign in to comment.