From: John Fastabend <john.fastabend@gmail•com>
To: Amir Vadai <amir@vadai•me>, Jiri Pirko <jiri@resnulli•us>
Cc: "David S. Miller" <davem@davemloft•net>,
netdev@vger•kernel.org, Or Gerlitz <ogerlitz@mellanox•com>,
John Fastabend <john.r.fastabend@intel•com>,
Saeed Mahameed <saeedm@mellanox•com>,
Hadar Har-Zion <hadarh@mellanox•com>,
Jiri Pirko <jiri@mellanox•com>
Subject: Re: [PATCH net-next 6/8] net/mlx5e: Introduce tc offload support
Date: Tue, 01 Mar 2016 09:13:25 -0800 [thread overview]
Message-ID: <56D5CDB5.4090906@gmail.com> (raw)
In-Reply-To: <56d5c9bd.c13fc20a.046a.ffffe0ce@mx.google.com>
On 16-03-01 09:00 AM, Amir Vadai wrote:
> On Tue, Mar 01, 2016 at 03:52:08PM +0100, Jiri Pirko wrote:
>> Tue, Mar 01, 2016 at 03:24:48PM CET, amir@vadai•me wrote:
>>> Extend ndo_setup_tc() to support ingress tc offloading. Will be used by
>>> later patches to offload tc flower filter.
>>>
>>> Feature is off by default and could be enabled by issuing:
>>> # ethtool -K eth0 hw-tc-offload on
>>>
>>> Offloads flow table is dynamically created when first filter is
>>> added.
>>> Rules are saved in a hash table that is maintained by the consumer (for
>>> example - the flower offload in the next patch).
>>> When last filter is removed and no filters exist in the hash table, the
>>> offload flow table is destroyed.
>>
>> <snip>
>>
>>> @@ -1880,6 +1883,17 @@ static int mlx5e_setup_tc(struct net_device *netdev, u8 tc)
>>> static int mlx5e_ndo_setup_tc(struct net_device *dev, u32 handle,
>>> __be16 proto, struct tc_to_netdev *tc)
>>> {
>>> + struct mlx5e_priv *priv = netdev_priv(dev);
>>> +
>>> + if (TC_H_MAJ(handle) != TC_H_MAJ(TC_H_INGRESS))
>>> + goto mqprio;
>>> +
>>> + switch (tc->type) {
>>> + default:
>>> + return -EINVAL;
>>
>> -EOPNOTSUPP would be better here perhaps?
>>
>>
>>> + }
>>> +
>>> +mqprio:
>>> if (handle != TC_H_ROOT || tc->type != TC_SETUP_MQPRIO)
>>> return -EINVAL;
>>>
>>> @@ -1963,6 +1977,13 @@ static int mlx5e_set_features(struct net_device *netdev,
>>> mlx5e_disable_vlan_filter(priv);
>>> }
>>>
>>> + if ((changes & NETIF_F_HW_TC) && !(features & NETIF_F_HW_TC) &&
>>> + mlx5e_tc_num_filters(priv)) {
>>> + netdev_err(netdev,
>>> + "Active offloaded tc filters, can't turn hw_tc_offload off\n");
>>> + return -EINVAL;
>>
>> This should not fail I believe. Just disable it in hw. I would even toss
>> away the rules if necessary.
> It depends on the answer regarding your comment on the previous patch.
> If we have the rule in both SW and HW, and remove it from the HW it is
> ok (although, currently I don't understand why would anyone want in both
> places).
> If the rule is processed by HW only - turning off this flag, will
> disable the offloaded rules - it might be misleading, so I prefered not
> to allow it and print a message.
When we get the HW only mode we will need to also flush the hardware
representation in software as well as the hardware state.
next prev parent reply other threads:[~2016-03-01 17:13 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-01 14:24 [PATCH net-next 0/8] cls_flower hardware offload support Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 1/8] net/flower: Introduce " Amir Vadai
2016-03-01 14:47 ` Jiri Pirko
2016-03-01 16:49 ` Amir Vadai
2016-03-01 17:01 ` Jiri Pirko
2016-03-02 11:14 ` Or Gerlitz
2016-03-02 13:22 ` Jiri Pirko
2016-03-02 16:22 ` John Fastabend
2016-03-02 16:30 ` Jiri Pirko
2016-03-01 14:53 ` Jiri Pirko
2016-03-01 16:50 ` Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 2/8] net/flow_dissector: Make dissector_uses_key() and skb_flow_dissector_target() public Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 3/8] net/act_skbedit: Utility functions for mark action Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 4/8] net/mlx5_core: Set flow steering dest only for forward rules Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 5/8] net/mlx5e: Add a new priority for kernel flow tables Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 6/8] net/mlx5e: Introduce tc offload support Amir Vadai
2016-03-01 14:52 ` Jiri Pirko
2016-03-01 17:00 ` Amir Vadai
2016-03-01 17:13 ` John Fastabend [this message]
2016-03-02 15:53 ` Amir Vadai
2016-03-02 15:58 ` Jiri Pirko
2016-03-01 15:59 ` Saeed Mahameed
2016-03-01 17:07 ` Amir Vadai
2016-03-01 14:24 ` [PATCH net-next 7/8] net/mlx5e: Support offload cls_flower with drop action Amir Vadai
2016-03-01 14:55 ` Jiri Pirko
2016-03-01 16:50 ` Amir Vadai
2016-03-01 15:03 ` Jiri Pirko
2016-03-01 14:24 ` [PATCH net-next 8/8] net/mlx5e: Support offload cls_flower with sskbedit mark action Amir Vadai
2016-03-01 14:58 ` Jiri Pirko
2016-03-01 16:53 ` Amir Vadai
2016-03-01 17:18 ` [PATCH net-next 0/8] cls_flower hardware offload support John Fastabend
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56D5CDB5.4090906@gmail.com \
--to=john.fastabend@gmail$(echo .)com \
--cc=amir@vadai$(echo .)me \
--cc=davem@davemloft$(echo .)net \
--cc=hadarh@mellanox$(echo .)com \
--cc=jiri@mellanox$(echo .)com \
--cc=jiri@resnulli$(echo .)us \
--cc=john.r.fastabend@intel$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=ogerlitz@mellanox$(echo .)com \
--cc=saeedm@mellanox$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox