[ovs-dev] [PATCH/RFC] datapath: offload hooks
Simon Horman
simon.horman at netronome.com
Thu Oct 9 00:07:10 UTC 2014
On Tue, Oct 07, 2014 at 09:55:21PM -0700, Stephen Hemminger wrote:
> On Wed, 8 Oct 2014 09:40:51 +0900
> Simon Horman <simon.horman at netronome.com> wrote:
>
> > +
> > +struct ovs_offload_ops {
> > + /* Flow offload functions */
> > + /* Called when a flow entry is added to the flow table */
> > + void (*flow_new)(struct sw_flow *);
> > + /* Called when a flow entry is modified */
> > + void (*flow_set)(struct sw_flow *);
> > + /* Called when a flow entry is removed from the flow table */
> > + void (*flow_del)(struct sw_flow *);
> > + /* Called when flow stats are queried */
> > + void (*flow_stats_get)(const struct sw_flow *, struct ovs_flow_stats *,
> > + unsigned long *used, __be16 *tcp_flags);
> > + /* Called when flow stats are removed */
> > + void (*flow_stats_clear)(struct sw_flow *);
> > +
> > + /* Port offload functions */
> > + /* Called when a vport is added to the datapath */
> > + void (*vport_new)(struct sk_buff *, struct vport *,
> > + struct vport_parms *);
> > + /* Called when a vport is modified */
> > + void (*vport_set)(struct sk_buff *, struct vport *);
> > + /* Called when a vport is removed from the datapath */
> > + void (*vport_del)(struct sk_buff *, struct vport *);
> > + /* Called when vport stats are queried */
> > + void (*vport_stats_get)(struct vport *, struct ovs_vport_stats *);
> > + /* Called when vport stats are set */
> > + void (*vport_stats_set)(struct vport *, struct ovs_vport_stats *);
> > +
> > + /* Datapath offload functions */
> > + /* Called when the datapath is created */
> > + void (*dp_new)(struct datapath *);
> > + /* Called when the datapath is modified */
> > + void (*dp_set)(struct datapath *);
> > + /* Called when the datapath is removed */
> > + void (*dp_del)(struct datapath *);
> > + /* Called when the datapath stats are queried */
> > + void (*dp_stats_get)(struct datapath *, struct ovs_dp_stats *);
> > +};
>
> What about using netlink and netlink notifiers for event type stuff?
> Much easier to extend than all the _ops stuff and you can provide
> hook for people that want to do it in user space.
Hi Stephen,
thanks, that is not an avenue that I had previously considered,
though on that point I'm not speaking for others at Netronome.
I wonder if you could expand a little on which of the above you
consider event type stuff. From my point of view the hooks seem
to fall into two categories:
1. Hooks that are called to obtain information about the datapath.
That is the *stats* hooks.
2. Hooks that are called when reconfiguration occurs.
That is the non *stats* hooks.
It seems to me that both categories are typically driven by requests from
user-space.
More information about the dev
mailing list