On 12/31/2017 05:46 PM, David Ahern wrote: > On 12/31/17 3:52 AM, Arkadi Sharshevsky wrote: >>> [1] This is allowed by the current patch set and perhaps it should not be: >>> >>> $ ip ro ls vrf vrf1101 >>> unreachable default metric 8192 >>> 11.2.51.0/24 dev swp1s0.51 proto kernel scope link src 11.2.51.1 offload >>> 11.3.51.0/24 dev swp1s1.51 proto kernel scope link src 11.3.51.1 offload >>> 11.4.51.0/24 dev swp1s2.51 proto kernel scope link src 11.4.51.1 offload >>> 11.5.51.0/24 dev swp1s3.51 proto kernel scope link src 11.5.51.1 offload >>> 11.6.51.0/24 dev swp3s0.51 proto kernel scope link src 11.6.51.1 offload >>> 11.7.51.0/24 dev swp3s1.51 proto kernel scope link src 11.7.51.1 offload >>> 11.8.51.0/24 dev swp3s2.51 proto kernel scope link src 11.8.51.1 offload >>> 11.9.51.0/24 dev swp3s3.51 proto kernel scope link src 11.9.51.1 offload >>> >>> $ devlink resource set pci/0000:03:00.0 path /kvd/linear size 0 >> >> This line actually did nothing, because size zero is not acceptable >> see patch 6. This is pure userpsace problem that error is not shown. > > Then perhaps you have a kernel side bug. After the reload I get this: > > $ devlink resource show pci/0000:03:00.0 > pci/0000:03:00.0: > name kvd size 245760 size_valid true > resources: > name linear size 0 occ 0 > name hash_double size 60416 > name hash_single size 87040 >
Actually no bug here, the linear can be zero. This implies no nexthop routes. The adj table uses it as you can see. > >> >> You can verify it by dumping the resources and see that there is no >> pending change (only size and not size_new). >> >>> $ devlink reload pci/0000:03:00.0 >>> $ ip ro ls vrf vrf1101 >>> unreachable default metric 8192 >>> >> >> So you just performed full reload of the driver which includes >> unregistration of all the netdevs and full init. KVD update requires >> full teardown of the driver. > > you are right, I forgot to do a networking reload. Because of the above > (0 was actually taken) all kinds of errors are spewed on 'ifreload -av' > and there is no change to the ro ls: > > $ ip ro ls vrf vrf1101 > unreachable default metric 8192 > >> >> The system will not get back to the same state after reloading, >> It's should be done on init. But it doesn't have to be like this >> this, each driver provides his own reload devlink op implementation >> so in our case full blown reset is required. >> >> >>> [2] Same exact result for setting hash_double to 0: >>> $ ip ro ls vrf vrf1101 >>> unreachable default metric 8192 >>> 11.2.51.0/24 dev swp1s0.51 proto kernel scope link src 11.2.51.1 offload >>> 11.3.51.0/24 dev swp1s1.51 proto kernel scope link src 11.3.51.1 offload >>> 11.4.51.0/24 dev swp1s2.51 proto kernel scope link src 11.4.51.1 offload >>> 11.5.51.0/24 dev swp1s3.51 proto kernel scope link src 11.5.51.1 offload >>> 11.6.51.0/24 dev swp3s0.51 proto kernel scope link src 11.6.51.1 offload >>> 11.7.51.0/24 dev swp3s1.51 proto kernel scope link src 11.7.51.1 offload >>> 11.8.51.0/24 dev swp3s2.51 proto kernel scope link src 11.8.51.1 offload >>> 11.9.51.0/24 dev swp3s3.51 proto kernel scope link src 11.9.51.1 offload >>> >>> $ devlink resource set pci/0000:03:00.0 path /kvd/hash_double size 0 > > On this command you are correct, 0 is not taken: > $ devlink resource set pci/0000:03:00.0 path /kvd/hash_double size 0 > $ devlink resource show pci/0000:03:00.0 > pci/0000:03:00.0: > name kvd size 245760 size_valid true > resources: > name linear size 0 occ 0 > name hash_double size 60416 > name hash_single size 87040 > > but the 'set' command did not fail with a proper extack based error > message, so consider this another a bug report. > Yeah, this is a bug, but a userspace one. I actually sniffed the nl messages with nlmon and saw the extended ack packet with the required string.