* [PATCH net-next] net: vrf: set operstate and mtu at link create
@ 2016-06-02 4:16 David Ahern
2016-06-02 22:15 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: David Ahern @ 2016-06-02 4:16 UTC (permalink / raw)
To: netdev; +Cc: David Ahern
The VRF device exists to define L3 domains and guide FIB lookups. As
such its operstate is not relevant. Seeing 'state UNKNOWN' in the
output of 'ip link show' can be confusing, so set operstate at link
create.
Similarly, the MTU for a VRF device is not used; any fragmentation
of the payload is done on the output path based on the real egress
device. An MTU of 1500 on the VRF device while enslaved devices
have a higher MTU can lead to confusion. Since the VRF MTU is not
relevant set to 64k similar to what is done for loopback.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
drivers/net/vrf.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 965e5e9bb3d3..1d9583c5929e 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -687,6 +687,12 @@ static int vrf_dev_init(struct net_device *dev)
dev->flags = IFF_MASTER | IFF_NOARP;
+ /* MTU is irrelevant for VRF device; set to 64k similar to lo */
+ dev->mtu = 64 * 1024;
+
+ /* similarly, oper state is irrelevant; set to up to avoid confusion */
+ dev->operstate = IF_OPER_UP;
+
return 0;
out_rth:
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: vrf: set operstate and mtu at link create
2016-06-02 4:16 [PATCH net-next] net: vrf: set operstate and mtu at link create David Ahern
@ 2016-06-02 22:15 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-06-02 22:15 UTC (permalink / raw)
To: dsa; +Cc: netdev
From: David Ahern <dsa@cumulusnetworks.com>
Date: Wed, 1 Jun 2016 21:16:39 -0700
> The VRF device exists to define L3 domains and guide FIB lookups. As
> such its operstate is not relevant. Seeing 'state UNKNOWN' in the
> output of 'ip link show' can be confusing, so set operstate at link
> create.
>
> Similarly, the MTU for a VRF device is not used; any fragmentation
> of the payload is done on the output path based on the real egress
> device. An MTU of 1500 on the VRF device while enslaved devices
> have a higher MTU can lead to confusion. Since the VRF MTU is not
> relevant set to 64k similar to what is done for loopback.
>
> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-02 22:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-02 4:16 [PATCH net-next] net: vrf: set operstate and mtu at link create David Ahern
2016-06-02 22:15 ` David Miller
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).