Subject: Re: [RFC net-next 2/9] net/switchdev: Introduce hardware offload support

From: John Fastabend <[email-masked]>
Date: Mon, 01 Feb 2016 01:26:06 -0800

On 16-02-01 12:34 AM, Amir Vadai wrote:
> Extend the switchdev API with new operations: switchdev_port_flow_add()
> and switchdev_port_flow_del().
> It allows the user to add/del a hardware offloaded flow classification
> and actions.
> For every new flow object a cookie is supplied. This cookie will be
> used later on to identify the flow when removed.
> 
> In order to make the API as flexible as possible, flow_dissector is
> being used to describe the flow classifier.
> 
> Every new flow object is consists of a flow_dissector+key+mask to
> describe the classifier and a switchdev_obj_port_flow_act to describe
> the actions and their attributes.
> 
> object is passed to the lower layer driver to be pushed into the
> hardware.
> 
> Signed-off-by: Amir Vadai <[email-masked]>
> ---

+Scott

[...]

> +struct switchdev_obj_port_flow {
> +	struct switchdev_obj obj;
> +
> +	unsigned long cookie;
> +	struct flow_dissector *dissector; /* Dissector for mask and keys */
> +	void *mask; /* Flow keys mask */
> +	void *key;  /* Flow keys */

The heavy use of void* here and below seems questionable to me. If your
going to consume flow keys/mask define them.

> +	struct switchdev_obj_port_flow_act *actions;
> +};

[...]