Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d659fcb authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'kill_trans_start'



Florian Westphal says:

====================
net: remove trans_start from struct net_device

We currently have two instances for trans_start, once in
net_device and once in netdev_queue.

This series removes trans_start from net_device.
Updates to dev->trans_start are replaced with updates to netdev queue 0.

This series is compile-tested only.
Replacement is done in 3 steps:

1. Replace read-accesses:
  x = dev->trans_start

  gets replaced by
  x = dev_trans_start(dev)

2. Replace write accesses:
  dev->trans_start = jiffies;

  gets replaced with new helper:
  netif_trans_update(dev);

3. This helper is then changed to set
   netdev_get_tx_queue(dev, 0)->trans_start
   instead of dev->trans_start.

After this dev->trans_start can be removed.

It should be noted that after this series several instances
of netif_trans_update() are useless (if they occur in
.ndo_start_xmit and driver doesn't set LLTX flag -- stack already
did an update).

Comments welcome.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a6e5472d 9b36627a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
	if (len == skb->len) {
		dev->stats.tx_packets++;
		dev->stats.tx_bytes += skb->len;
		dev->trans_start = jiffies;
		netif_trans_update(dev);
		netif_start_queue(dev);

		/* this is normally done in the interrupt when tx finishes */
@@ -252,7 +252,7 @@ static void uml_net_set_multicast_list(struct net_device *dev)

static void uml_net_tx_timeout(struct net_device *dev)
{
	dev->trans_start = jiffies;
	netif_trans_update(dev);
	netif_wake_queue(dev);
}

+1 −1
Original line number Diff line number Diff line
@@ -428,7 +428,7 @@ static int iss_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
	if (len == skb->len) {
		lp->stats.tx_packets++;
		lp->stats.tx_bytes += skb->len;
		dev->trans_start = jiffies;
		netif_trans_update(dev);
		netif_start_queue(dev);

		/* this is normally done in the interrupt when tx finishes */
+2 −2
Original line number Diff line number Diff line
@@ -3969,7 +3969,7 @@ static netdev_tx_t hdlcdev_xmit(struct sk_buff *skb,
	dev_kfree_skb(skb);

	/* save start time for transmit timeout detection */
	dev->trans_start = jiffies;
	netif_trans_update(dev);

	/* start hardware transmitter if necessary */
	spin_lock_irqsave(&info->lock, flags);
@@ -4032,7 +4032,7 @@ static int hdlcdev_open(struct net_device *dev)
	tty_kref_put(tty);

	/* enable network layer transmit */
	dev->trans_start = jiffies;
	netif_trans_update(dev);
	netif_start_queue(dev);

	/* inform generic HDLC layer of current DCD status */
+1 −1
Original line number Diff line number Diff line
@@ -1023,7 +1023,7 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask)

	spin_unlock_irqrestore(&dev->lock, flags);

	dev->netdev->trans_start = jiffies;
	netif_trans_update(dev->netdev);
 out:
	if (free)
		fwnet_free_ptask(ptask);
+1 −1
Original line number Diff line number Diff line
@@ -682,7 +682,7 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
		nes_write32(nesdev->regs+NES_WQE_ALLOC,
				(wqe_count << 24) | (1 << 23) | nesvnic->nic.qp_id);

	netdev->trans_start = jiffies;
	netif_trans_update(netdev);

	return NETDEV_TX_OK;
}
Loading