On 08/20/14 at 10:42am, Vivek Goyal wrote:
On Mon, Aug 18, 2014 at 04:34:53PM +0800, Baoquan He wrote:
> Previously for solving static route issues, all routes which go
> through a specific dev will be saved in 1st kernel, and then added
> in 2nd kernel. Because we use below search pattern, an exception
> will happen:
> /sbin/ip route show | grep -v default | grep "^[[:digit:]].*via.*
$_netdev"
>
> That exception is a corner case which happened when 2 machines connected
> directly by cable and the 2 network interfaces are configured in
> different network subnets. E.g there are 2 machines A and B:
>
> A:ens10 < ------ > B:ens9
>
> A:ens10 inet 192.168.100.111/24 scope global ens10
> route need be added in A:
> 192.168.110.0/24 dev ens10
>
> B:ens9 inet 192.168.110.222/24 scope global ens9
> route need be added in B
> 192.168.100.0/24 dev ens9
>
> Now if A want to dump to B, the route "192.168.110.0/24 dev ens10"
> has to be saved and added in 2nd kernel.
>
> So in this patch "ip route get to $target" command is executed, then
> an exact route can be got for going to that target. By this, static
> route works and the corner case can be fixed too.
>
Hi Bao,
Using "ip route get to" requires knowing the target. But that's little
different than bringing up an interface. There can be multiple static
routes going through an interface which lead to multiple targets.
I think this makes the whole mechanism less generic. I liked the previous
method better where if we bring an interface, all the static routes going
through that interface will come up too. (Instead of only one static
route coming up for the target).
So I would rather stick to the mechanism of determining all the routes
going through an interface and add the ones which are not present in
second kernel's routing table.
In fact, this issue has got out of the range of static route. In
previous implementation, all routes in 1st kernel which go through that
interface will be added to 2nd kernel. Among these routes, any routes
could be added, not only the static routes. Those manually added will be
added to 2nd kernel as long as it's an available route to target.
So now, could that be true that 2 targets are goint through 1 NIC, then
kdump_setup_netdev() will be called twice or 3 times?
Thanks
Vivek