Subject: Re: [patch net-next RFC v3 10/10] openvswitch: add support for datapath hardware offload

From: John Fastabend <[email-masked]>
Date: Thu, 24 Apr 2014 07:54:19 -0700

On 04/17/2014 05:15 AM, Jiri Pirko wrote:
> Benefit from the possibility to work with flows in switch devices and
> use the swdev api to offload flow datapath.
>
> Signed-off-by: Jiri Pirko <[email-masked]>
> ---

[...]

>
> @@ -840,13 +841,15 @@ static int ovs_flow_cmd_new_or_set(struct sk_buff *skb, struct genl_info *info)
>   		flow->flow.key = masked_key;
>   		flow->flow.unmasked_key = key;
>   		rcu_assign_pointer(flow->sf_acts, acts);
> +		acts = NULL;
>
>   		/* Put flow in bucket. */
>   		error = ovs_flow_tbl_insert(&dp->table, flow, &mask);
> -		if (error) {
> -			acts = NULL;
> +		if (error)
>   			goto err_flow_free;
> -		}
> +		error = ovs_hw_flow_insert(dp, flow, flow->sf_acts);
> +		if (error)
> +			goto err_flow_tbl_remove;
>
>   		reply = ovs_flow_cmd_build_info(flow, dp, info, OVS_FLOW_CMD_NEW);
>   	} else {

Hi Jiri,

If I read this correctly it looks like you do a insert into software
flow tables and then an insert into the hardware flow tables. Into
all lowerdevs. Let me know if I got this wrong.

This might break on some rules (an insert tag for example) and also
underutilize the switch resources by pushing rules into the switch that
we really only need in software tables or maybe only on some set of
ports.

I think we need to allow applications direct access to the flow table
via netlink so I can write my policy in user space and not require
OVS. If OVS wants to support a mode where it does this automagically
it can support it in userspace and the kernel side does not need to
change.

Thanks,
John

-- 
John Fastabend         Intel Corporation