From: Thierry Du Tre <thierry@dtsystems.be>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, Ben Greear <greearb@candelatech.com>
Subject: Re: [PATCH v2] VLAN, support ingress/egress priority map flushing
Date: Mon, 13 Mar 2017 21:33:52 +0100 [thread overview]
Message-ID: <48d6c820-db6c-8366-9372-a1dfe958cfc1@dtsystems.be> (raw)
In-Reply-To: <1489418918.28631.82.camel@edumazet-glaptop3.roam.corp.google.com>
On 13-03-17 16:28, Eric Dumazet wrote:
> On Mon, 2017-03-13 at 15:36 +0100, Thierry Du Tre wrote:
>
>> +void vlan_dev_flush_egress_priority(const struct net_device *dev)
>> +{
>> + struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
>> + struct vlan_priority_tci_mapping *mp;
>> + int i;
>> +
>> + for (i = 0; i < ARRAY_SIZE(vlan->egress_priority_map); i++) {
>> + while ((mp = vlan->egress_priority_map[i]) != NULL) {
>> + vlan->egress_priority_map[i] = mp->next;
>> + kfree(mp);
>> + }
>> + }
>> + vlan->nr_egress_mappings = 0;
>> +}
>
> Are you doing this on a live device ?
>
> Looks you'll need proper RCU support then.
>
> Otherwise, crashes will happen, say in egress_priority_map()
>
> smp_rmb() wont be enough if items can now be destroyed.
Yes, good point about the smp concurrency.
I wrongly assumed there was already some locking mechanism in place to
protect these structures.
Let me take a look at this and I'll come back with a new proposal.
prev parent reply other threads:[~2017-03-13 20:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-13 14:36 [PATCH v2] VLAN, support ingress/egress priority map flushing Thierry Du Tre
2017-03-13 15:28 ` Eric Dumazet
2017-03-13 20:33 ` Thierry Du Tre [this message]
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=48d6c820-db6c-8366-9372-a1dfe958cfc1@dtsystems.be \
--to=thierry@dtsystems.be \
--cc=eric.dumazet@gmail.com \
--cc=greearb@candelatech.com \
--cc=netdev@vger.kernel.org \
/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).