From: Florian Fainelli <f.fainelli@gmail.com>
To: Scott Feldman <sfeldma@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>, Netdev <netdev@vger.kernel.org>,
Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: Weird DHCP related problems with net-next
Date: Wed, 10 Jun 2015 15:04:03 -0700 [thread overview]
Message-ID: <5578B453.5080602@gmail.com> (raw)
In-Reply-To: <CAE4R7bB_J6eJ2CiLLHUkuhmGMPLA4dmhv_8kZeZjkLz5=tsQBg@mail.gmail.com>
On 10/06/15 14:44, Scott Feldman wrote:
> On Tue, Jun 9, 2015 at 5:12 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
>
>
>> I see the problem now, DSA does not implement a port_obj_add callback,
>> so when net/ipv4/fib_trie.c::switchdev_fib_ipv4_add() gets to call
>> switchdev_port_obj_add, we return -EOPNOTSUPP, and take the error path
>> in fib_table_insert thus not inserting the route for this interface.
>
> Yup, that's the problem.
>
>> Now when I restart the DHCP client, we end-up inserting the default
>> route which is correct, still figuring out what is different here,
>> probably the deletion of the routes by the DHCP client script first is
>> the different condition.
>
> After the first failure, ipv4.fib_offload_disabled is set, so the next
> time switchdev_fib_ipv4_add() just returns 0 and the route is
> installed. That explains the one-off behavior.
>
>> At any rate, since switchdev_fib_ipv4_add() returns something that make
>> us take an error path in the fib_trie, something like this seems to fix
>> it for me but I am not well versed enough into the IPv4 routing code to
>> be 100% confident this is the right fix. Also, there are other callers
>> of switchdev_port_obj_add() but a quick look seems to make them safe as
>> they are only called for "offloading" capable hardware.
>
> Your fix looks good to me. The other users of
> switchdev_port_obj_add() want to return -EOPNOTSUPP to user, so it's
> just this one case for IPv4 fib insert/del where we'll want to treat
> no support silently. Are you going to resend as patch for net-next,
> or should I?
I would prefer if you submitted it since you explained how things are
working and now everything makes sense. I will be happy to test it and
provide the magic tags ;)
--
Florian
prev parent reply other threads:[~2015-06-10 22:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-09 18:54 Weird DHCP related problems with net-next Florian Fainelli
2015-06-09 19:22 ` Andrew Lunn
2015-06-09 20:31 ` Florian Fainelli
2015-06-09 21:42 ` Andrew Lunn
2015-06-10 0:12 ` Florian Fainelli
2015-06-10 21:44 ` Scott Feldman
2015-06-10 22:04 ` Florian Fainelli [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=5578B453.5080602@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=sfeldma@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).