From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH/RFC] datapath: offload hooks Date: Tue, 7 Oct 2014 21:55:21 -0700 Message-ID: <20141007215521.493233d2@urahara> References: <1412728851-32534-1-git-send-email-simon.horman@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@openvswitch.org, netdev@vger.kernel.org, Pravin Shelar , Jesse Gross , Jiri Pirko , Thomas Graf , John Fastabend , Scott Feldman , Roopa Prabhu , Alexi Starovoitov , Florian Fainelli , Jamal Hadi Salim , Bert van Leeuwen To: Simon Horman Return-path: Received: from mail-pd0-f169.google.com ([209.85.192.169]:63200 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754539AbaJHEzh (ORCPT ); Wed, 8 Oct 2014 00:55:37 -0400 Received: by mail-pd0-f169.google.com with SMTP id w10so6249892pde.14 for ; Tue, 07 Oct 2014 21:55:36 -0700 (PDT) In-Reply-To: <1412728851-32534-1-git-send-email-simon.horman@netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 8 Oct 2014 09:40:51 +0900 Simon Horman 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.