Skip to contentSkip to conversation

vlan/macvlan 02/02: propagate transmission state to upper layers

PATCH Patrick McHardy 2 participants 3 messages Nov 10, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

commit 21fb413b55abb4665e057b884c289bb780f41b3c

Author: Patrick McHardy <[email protected]>
Date:   Tue Nov 10 16:55:50 2009 +0100

vlan/macvlan: propagate transmission state to upper layers

Both vlan and macvlan devices usually don't use a qdisc and immediately queue packets to the underlying device. Propagate transmission state of the underlying device to the upper layers so they can react on congestion and/or inform the sending process.

drivers/net/macvlan.c +1 -1
index d7dba3f..271aa7e 100644
@@ -202,7 +202,7 @@ static netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
 	} else
 		txq->tx_dropped++;
 
-	return NETDEV_TX_OK;
+	return ret;
 }
 
 static int macvlan_hard_header(struct sk_buff *skb, struct net_device *dev,
net/8021q/vlan_dev.c +2 -2
index 790fd55..9159659 100644
@@ -332,7 +332,7 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb,
 	} else
 		txq->tx_dropped++;
 
-	return NETDEV_TX_OK;
+	return ret;
 }
 
 static netdev_tx_t vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb,
@@ -358,7 +358,7 @@ static netdev_tx_t vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb,
 	} else
 		txq->tx_dropped++;
 
-	return NETDEV_TX_OK;
+	return ret;
 }
 
 static int vlan_dev_change_mtu(struct net_device *dev, int new_mtu)
#1 lore raw
Quoted 8 lines · On Tue, 10 Nov 2009 17:14:24 +0100 Patrick McHardy <[email protected]> wrote:

vlan/macvlan: propagate transmission state to upper layers

Both vlan and macvlan devices usually don't use a qdisc and immediately queue packets to the underlying device. Propagate transmission state of the underlying device to the upper layers so they can react on congestion and/or inform the sending process.

Bridging and bonding have same issue, but the solution is more difficult.

#2 lore raw
Quoted 10 lines · Stephen Hemminger
Quoted 7 lines · On Tue, 10 Nov 2009 17:14:24 +0100 Patrick McHardy <[email protected]> wrote:

vlan/macvlan: propagate transmission state to upper layers

Both vlan and macvlan devices usually don't use a qdisc and immediately queue packets to the underlying device. Propagate transmission state of the underlying device to the upper layers so they can react on congestion and/or inform the sending process.

Quoted 4 lines
Quoted 1 line

Bridging and bonding have same issue, but the solution is more difficult.

Yes, in both cases the packet might be sent out on multiple interfaces, so its not really clear which state we should propagate. I guess it would make sense to indicate an error if transmission on *all* interfaces fail, but I'm not sure about the other cases.