From: Vlad Buslov <vladbu@mellanox.com>
To: Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>
Cc: Vlad Buslov <vladbu@mellanox.com>,
Edward Cree <ecree@solarflare.com>, Jiri Pirko <jiri@resnulli.us>,
Pablo Neira Ayuso <pablo@netfilter.org>,
David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Andy Gospodarek <andy@greyhouse.net>,
Jakub Kicinski <jakub.kicinski@netronome.com>,
Michael Chan <michael.chan@broadcom.com>,
Vishal Kulkarni <vishal@chelsio.com>,
Lucas Bates <lucasb@mojatatu.com>
Subject: Re: [RFC PATCH v2 net-next 0/3] flow_offload: Re-add per-action statistics
Date: Wed, 22 May 2019 15:08:26 +0000 [thread overview]
Message-ID: <vbfblzuedcq.fsf@mellanox.com> (raw)
In-Reply-To: <vbfef4slz5k.fsf@mellanox.com>
On Tue 21 May 2019 at 16:23, Vlad Buslov <vladbu@mellanox.com> wrote:
> On Tue 21 May 2019 at 15:46, Jamal Hadi Salim <jhs@mojatatu.com> wrote:
>> On 2019-05-20 5:12 p.m., Jamal Hadi Salim wrote:
>>> On 2019-05-20 2:36 p.m., Edward Cree wrote:
>>>> On 20/05/2019 17:29, Jamal Hadi Salim wrote:
>>
>>> Ok, so the "get" does it. Will try to reproduce when i get some
>>> cycles. Meantime CCing Cong and Vlad.
>>>
>>
>>
>> I have reproduced it in a simpler setup. See attached. Vlad this is
>> likely from your changes. Sorry no cycles to dig more.
>
> Jamal, thanks for minimizing the reproduction. I'll look into it.
>
>> Lucas, can we add this to the testcases?
>>
>>
>> cheers,
>> jamal
>>
>> sudo tc qdisc del dev lo ingress
>> sudo tc qdisc add dev lo ingress
>>
>> sudo tc filter add dev lo parent ffff: protocol ip prio 8 u32 \
>> match ip dst 127.0.0.8/32 flowid 1:10 \
>> action vlan push id 100 protocol 802.1q \
>> action drop index 104
>>
>> sudo tc filter add dev lo parent ffff: protocol ip prio 8 u32 \
>> match ip dst 127.0.0.10/32 flowid 1:10 \
>> action vlan push id 101 protocol 802.1q \
>> action drop index 104
>>
>> #
>> sudo tc -s filter ls dev lo parent ffff: protocol ip
>>
>> #this will now delete action gact index 104(drop) from display
>> sudo tc -s actions get action drop index 104
>>
>> sudo tc -s filter ls dev lo parent ffff: protocol ip
>>
>> #But you can still see it if you do this:
>> sudo tc -s actions get action drop index 104
It seems that culprit in this case is tc_action->order field. It is used
as nla attrtype when dumping actions. Initially it is set according to
ordering of actions of filter that creates them. However, it is
overwritten in tca_action_gd() each time action is dumped through action
API (according to action position in tb array) and when new filter is
attached to shared action (according to action order on the filter).
With this we have another way to reproduce the bug:
sudo tc qdisc add dev lo ingress
#shared action is the first action (order 1)
sudo tc filter add dev lo parent ffff: protocol ip prio 8 u32 \
match ip dst 127.0.0.8/32 flowid 1:10 \
action drop index 104 \
action vlan push id 100 protocol 802.1q
#shared action is the the second action (order 2)
sudo tc filter add dev lo parent ffff: protocol ip prio 8 u32 \
match ip dst 127.0.0.10/32 flowid 1:10 \
action vlan push id 101 protocol 802.1q \
action drop index 104
# Now action is only visible on one filter
sudo tc -s filter ls dev lo parent ffff: protocol ip
The usage of tc_action->order is inherently incorrect for shared actions
and I don't really understand the reason for using it in first place.
I'm sending RFC patch that fixes the issue by just using action position
in tb array for attrtype instead of order field, and it seems to solve
both issues for me. Please check it out to verify that I'm not breaking
something. Also, please advise on "fixes" tag since this problem doesn't
seem to be directly caused by my act API refactoring.
next prev parent reply other threads:[~2019-05-22 15:08 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-15 19:39 [RFC PATCH v2 net-next 0/3] flow_offload: Re-add per-action statistics Edward Cree
2019-05-15 19:42 ` [RFC PATCH v2 net-next 1/3] flow_offload: copy tcfa_index into flow_action_entry Edward Cree
2019-05-18 20:30 ` Jamal Hadi Salim
2019-05-15 19:42 ` [RFC PATCH v2 net-next 2/3] flow_offload: restore ability to collect separate stats per action Edward Cree
2019-05-18 20:35 ` Jamal Hadi Salim
2019-05-20 15:46 ` Edward Cree
2019-05-20 15:55 ` Jamal Hadi Salim
2019-05-15 19:42 ` [RFC PATCH v2 net-next 3/3] flow_offload: include linux/kernel.h from flow_offload.h Edward Cree
2019-05-17 15:27 ` [RFC PATCH v2 net-next 0/3] flow_offload: Re-add per-action statistics Edward Cree
2019-05-17 17:14 ` Edward Cree
2019-05-18 20:39 ` Jamal Hadi Salim
2019-05-20 15:26 ` Edward Cree
2019-05-20 15:38 ` Jamal Hadi Salim
2019-05-20 16:10 ` Edward Cree
2019-05-20 16:29 ` Jamal Hadi Salim
2019-05-20 16:32 ` Jamal Hadi Salim
2019-05-20 17:58 ` Edward Cree
2019-05-20 18:36 ` Edward Cree
2019-05-20 21:12 ` Jamal Hadi Salim
2019-05-21 12:46 ` Jamal Hadi Salim
2019-05-21 13:23 ` Vlad Buslov
2019-05-22 15:08 ` Vlad Buslov [this message]
2019-05-22 15:13 ` [RFC PATCH net-next] net: sched: don't use tc_action->order during action dump Vlad Buslov
2019-05-22 17:24 ` [RFC PATCH v2 net-next 0/3] flow_offload: Re-add per-action statistics Jamal Hadi Salim
2019-05-22 17:49 ` Vlad Buslov
2019-05-22 18:23 ` Jamal Hadi Salim
2019-05-22 18:26 ` Jamal Hadi Salim
2019-05-19 0:22 ` Pablo Neira Ayuso
2019-05-20 15:37 ` Edward Cree
2019-05-20 15:40 ` Jamal Hadi Salim
2019-05-20 15:44 ` Pablo Neira Ayuso
2019-05-18 20:30 ` Jamal Hadi Salim
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=vbfblzuedcq.fsf@mellanox.com \
--to=vladbu@mellanox.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=ecree@solarflare.com \
--cc=jakub.kicinski@netronome.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=lucasb@mojatatu.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=vishal@chelsio.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).