OSDN Git Service

geneve: configure MTU based on a lower device
authorAlexey Kodanev <alexey.kodanev@oracle.com>
Thu, 19 Apr 2018 12:42:32 +0000 (15:42 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Apr 2018 15:20:05 +0000 (11:20 -0400)
commitc40e89fd358e94a55d6c1475afbea17b5580f601
treed8bcd490b48b2f93f91f7da0e8e96ac7336958f3
parent321acc1c68c13ce113531a8bc3dc5d43814c4ae2
geneve: configure MTU based on a lower device

Currently, on a new link creation or when 'remote' address parameter
is updated, an MTU is not changed and always equals 1500. When a lower
device has a larger MTU, it might not be efficient, e.g. for UDP, and
requires the manual MTU adjustments to match the MTU of the lower
device.

This patch tries to automate this process, finds a lower device using
the 'remote' address parameter, then uses its MTU to tune GENEVE's MTU:
  * on a new link creation
  * when 'remote' parameter is changed

Also with this patch, the MTU from a user, on a new link creation, is
passed to geneve_change_mtu() where it is verified, and MTU adjustments
with a lower device is skipped in that case. Prior that change, it was
possible to set the invalid MTU values on a new link creation.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/geneve.c