# Re: \[patch net-next 19/19\] mlxsw: spectrum: Implement TC flower offload

- From: Jiri Pirko \<jiri@resnulli.us\>
- Date: 2017-02-03 07:38:15 
- List: netdev
- Page: https://ratatoskr.run/netdev/2017/02/11043490
- Thread: https://ratatoskr.run/netdev/2017/02/11043291/t.md

```text
Thu, Feb 02, 2017 at 10:37:23PM CET, f.fainelli@gmail.com wrote:
>On 02/02/2017 07:12 AM, Jiri Pirko wrote:
>> From: Jiri Pirko <redacted>
>> 
>> Extend the existing setup_tc ndo call and allow to offload cls_flower
>> rules. Only limited set of dissector keys and actions are supported now.
>> Use previously introduced ACL infrastructure to offload cls_flower rules
>> to be processed in the HW.
>> 
>> Signed-off-by: Jiri Pirko <redacted>
>> Reviewed-by: Ido Schimmel <redacted>
>> ---
>
>> +	tcf_exts_to_list(exts, &actions);
>> +	list_for_each_entry(a, &actions, list) {
>> +		if (is_tcf_gact_shot(a)) {
>> +			err = mlxsw_sp_acl_rulei_act_drop(rulei);
>> +			if (err)
>> +				return err;
>> +		} else if (is_tcf_mirred_egress_redirect(a)) {
>> +			int ifindex = tcf_mirred_ifindex(a);
>> +			struct net_device *out_dev;
>> +
>> +			out_dev = __dev_get_by_index(dev_net(dev), ifindex);
>> +			if (out_dev == dev)
>> +				out_dev = NULL;
>
>You are not checking here that out_dev has the same netdev_ops pointer
>(unlike the matchall case), is that expected?

This is done later on in mlxsw_sp_acl_rulei_act_fwd.
```
