From: David Ahern <dsa@cumulusnetworks.com>
To: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Cc: steffen.klassert@secunet.com, netdev@vger.kernel.org
Subject: Re: [PATCH ipsec-next] xfrm: Use VRF master index if output device is enslaved
Date: Wed, 19 Aug 2015 11:35:55 -0700 [thread overview]
Message-ID: <55D4CC8B.1080306@cumulusnetworks.com> (raw)
In-Reply-To: <0723F8F1-7349-45FF-BE9C-D2667DA28E0A@cumulusnetworks.com>
On 8/19/15 5:47 AM, Nikolay Aleksandrov wrote:
>
>> On Aug 18, 2015, at 6:54 PM, David Ahern <dsa@cumulusnetworks.com> wrote:
>>
>> Directs route lookups to VRF table. Compiles out if NET_VRF is not
>> enabled. With this patch able to successfully bring up ipsec tunnels
>> in VRFs, even with duplicate network configuration (IPv4 tested).
>>
>> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
>> ---
>> net/ipv4/xfrm4_policy.c | 7 +++++--
>> net/ipv6/xfrm6_policy.c | 7 +++++--
>> 2 files changed, 10 insertions(+), 4 deletions(-)
>
> I think you should use the new vrf_master_index() helper that acquires rcu because
> it looks possible to call ->decode_session() without rcu read lock, e.g. in the hold_timer
> function xfrm_policy_queue_process(), though I haven’t tested it and might be missing
> something. :-)
I was digging into code paths yesterday. Today I added WARN_ON and seems
like the rcu_read_lock is held:
if (skb_dst(skb)) {
WARN_ON(!rcu_read_lock_held() && !rcu_read_lock_bh_held());
oif = vrf_master_ifindex_rcu(skb_dst(skb)->dev) ?
: skb_dst(skb)->dev->ifindex;
pr_info("_decode_session: oif %d skb_dst(skb)->dev->ifindex %d\n", oif,
skb_dst(skb)->dev->ifindex);
}
I get the printk, but not the WARN_ON splat.
next prev parent reply other threads:[~2015-08-19 18:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-18 15:54 [PATCH ipsec-next] xfrm: Use VRF master index if output device is enslaved David Ahern
2015-08-19 12:47 ` Nikolay Aleksandrov
2015-08-19 18:35 ` David Ahern [this message]
2015-08-19 20:36 ` Steffen Klassert
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=55D4CC8B.1080306@cumulusnetworks.com \
--to=dsa@cumulusnetworks.com \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=steffen.klassert@secunet.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.