Commit e66e257a authored by Jay Vosburgh's avatar Jay Vosburgh Committed by David S. Miller

veth: Add updating of trans_start

Since commit 21a75f09 ("bonding: Fix ARP monitor validation"),
the bonding ARP / ND link monitors depend on the trans_start time to
determine link availability.  NETIF_F_LLTX drivers must update trans_start
directly, which veth does not do.  This prevents use of the ARP or ND link
monitors with veth interfaces in a bond.

	Resolve this by having veth_xmit update the trans_start time.
Reported-by: default avatarJonathan Toppins <jtoppins@redhat.com>
Tested-by: default avatarJonathan Toppins <jtoppins@redhat.com>
Signed-off-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
Fixes: 21a75f09 ("bonding: Fix ARP monitor validation")
Link: https://lore.kernel.org/netdev/b2fd4147-8f50-bebd-963a-1a3e8d1d9715@redhat.com/Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cc26c266
...@@ -312,6 +312,7 @@ static bool veth_skb_is_eligible_for_gro(const struct net_device *dev, ...@@ -312,6 +312,7 @@ static bool veth_skb_is_eligible_for_gro(const struct net_device *dev,
static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct veth_priv *rcv_priv, *priv = netdev_priv(dev); struct veth_priv *rcv_priv, *priv = netdev_priv(dev);
struct netdev_queue *queue = NULL;
struct veth_rq *rq = NULL; struct veth_rq *rq = NULL;
struct net_device *rcv; struct net_device *rcv;
int length = skb->len; int length = skb->len;
...@@ -329,6 +330,7 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -329,6 +330,7 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
rxq = skb_get_queue_mapping(skb); rxq = skb_get_queue_mapping(skb);
if (rxq < rcv->real_num_rx_queues) { if (rxq < rcv->real_num_rx_queues) {
rq = &rcv_priv->rq[rxq]; rq = &rcv_priv->rq[rxq];
queue = netdev_get_tx_queue(dev, rxq);
/* The napi pointer is available when an XDP program is /* The napi pointer is available when an XDP program is
* attached or when GRO is enabled * attached or when GRO is enabled
...@@ -340,6 +342,8 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -340,6 +342,8 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
skb_tx_timestamp(skb); skb_tx_timestamp(skb);
if (likely(veth_forward_skb(rcv, skb, rq, use_napi) == NET_RX_SUCCESS)) { if (likely(veth_forward_skb(rcv, skb, rq, use_napi) == NET_RX_SUCCESS)) {
if (queue)
txq_trans_cond_update(queue);
if (!use_napi) if (!use_napi)
dev_lstats_add(dev, length); dev_lstats_add(dev, length);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment