Skip to content

Commit

Permalink
openvswitch: Warn over-mtu packets only if iface is UP.
Browse files Browse the repository at this point in the history
It is not unusual to have the bridge port down. Sometimes
it has the old MTU, which is fine since it's not being used.

However, the kernel spams the log with a warning message
when a packet is going to be sent over such port. Fix that
by warning only if the interface is UP.

Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
fleitner authored and davem330 committed Mar 16, 2021
1 parent 01035bc commit ebfbc46
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions net/openvswitch/vport.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,12 @@ void ovs_vport_send(struct vport *vport, struct sk_buff *skb, u8 mac_proto)

if (unlikely(packet_length(skb, vport->dev) > mtu &&
!skb_is_gso(skb))) {
net_warn_ratelimited("%s: dropped over-mtu packet: %d > %d\n",
vport->dev->name,
packet_length(skb, vport->dev), mtu);
vport->dev->stats.tx_errors++;
if (vport->dev->flags & IFF_UP)
net_warn_ratelimited("%s: dropped over-mtu packet: "
"%d > %d\n", vport->dev->name,
packet_length(skb, vport->dev),
mtu);
goto drop;
}

Expand Down

0 comments on commit ebfbc46

Please sign in to comment.