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

Commit 00829823 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller
Browse files

netdev: add more functions to netdevice ops



This patch moves neigh_setup and hard_start_xmit into the network device ops
structure. For bisection, fix all the previously converted drivers as well.
Bonding driver took the biggest hit on this.

Added a prefetch of the hard_start_xmit in the fast path to try and reduce
any impact this would have.

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6ab33d51
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1824,6 +1824,7 @@ static const struct net_device_ops cp_netdev_ops = {
	.ndo_set_multicast_list	= cp_set_rx_mode,
	.ndo_get_stats		= cp_get_stats,
	.ndo_do_ioctl		= cp_ioctl,
	.ndo_start_xmit		= cp_start_xmit,
	.ndo_tx_timeout		= cp_tx_timeout,
#if CP_VLAN_TAG_USED
	.ndo_vlan_rx_register	= cp_vlan_rx_register,
@@ -1949,7 +1950,6 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
	memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);

	dev->netdev_ops = &cp_netdev_ops;
	dev->hard_start_xmit = cp_start_xmit;
	netif_napi_add(dev, &cp->napi, cp_rx_poll, 16);
	dev->ethtool_ops = &cp_ethtool_ops;
	dev->watchdog_timeo = TX_TIMEOUT;
+1 −1
Original line number Diff line number Diff line
@@ -921,6 +921,7 @@ static const struct net_device_ops rtl8139_netdev_ops = {
	.ndo_stop		= rtl8139_close,
	.ndo_get_stats		= rtl8139_get_stats,
	.ndo_validate_addr	= eth_validate_addr,
	.ndo_start_xmit		= rtl8139_start_xmit,
	.ndo_set_multicast_list	= rtl8139_set_rx_mode,
	.ndo_do_ioctl		= netdev_ioctl,
	.ndo_tx_timeout		= rtl8139_tx_timeout,
@@ -992,7 +993,6 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
	dev->netdev_ops = &rtl8139_netdev_ops;
	dev->ethtool_ops = &rtl8139_ethtool_ops;
	dev->watchdog_timeo = TX_TIMEOUT;
	dev->hard_start_xmit = rtl8139_start_xmit;
	netif_napi_add(dev, &tp->napi, rtl8139_poll, 64);

	/* note: the hardware is not capable of sg/csum/highdma, however
+3 −1
Original line number Diff line number Diff line
@@ -455,10 +455,13 @@ static const struct net_device_ops ace_netdev_ops = {
	.ndo_stop		= ace_close,
	.ndo_tx_timeout		= ace_watchdog,
	.ndo_get_stats		= ace_get_stats,
	.ndo_start_xmit		= ace_start_xmit,
	.ndo_set_multicast_list	= ace_set_multicast_list,
	.ndo_set_mac_address	= ace_set_mac_addr,
	.ndo_change_mtu		= ace_change_mtu,
#if ACENIC_DO_VLAN
	.ndo_vlan_rx_register	= ace_vlan_rx_register,
#endif
};

static int __devinit acenic_probe_one(struct pci_dev *pdev,
@@ -489,7 +492,6 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev,
	dev->watchdog_timeo = 5*HZ;

	dev->netdev_ops = &ace_netdev_ops;
	dev->hard_start_xmit = &ace_start_xmit;
	SET_ETHTOOL_OPS(dev, &ace_ethtool_ops);

	/* we only display this string ONCE */
+2 −1
Original line number Diff line number Diff line
@@ -2256,6 +2256,7 @@ static void atl1e_shutdown(struct pci_dev *pdev)
static const struct net_device_ops atl1e_netdev_ops = {
	.ndo_open		= atl1e_open,
	.ndo_stop		= atl1e_close,
	.ndo_start_xmit		= atl1e_xmit_frame,
	.ndo_get_stats		= atl1e_get_stats,
	.ndo_set_multicast_list	= atl1e_set_multi,
	.ndo_validate_addr	= eth_validate_addr,
@@ -2277,7 +2278,7 @@ static int atl1e_init_netdev(struct net_device *netdev, struct pci_dev *pdev)

	netdev->irq  = pdev->irq;
	netdev->netdev_ops = &atl1e_netdev_ops;
	netdev->hard_start_xmit = atl1e_xmit_frame,

	netdev->watchdog_timeo = AT_TX_WATCHDOG;
	atl1e_set_ethtool_ops(netdev);

+2 −2
Original line number Diff line number Diff line
@@ -2883,6 +2883,7 @@ static void atl1_poll_controller(struct net_device *netdev)
static const struct net_device_ops atl1_netdev_ops = {
	.ndo_open		= atl1_open,
	.ndo_stop		= atl1_close,
	.ndo_start_xmit		= atl1_xmit_frame,
	.ndo_set_multicast_list	= atlx_set_multi,
	.ndo_validate_addr	= eth_validate_addr,
	.ndo_set_mac_address	= atl1_set_mac,
@@ -2983,7 +2984,6 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
	adapter->mii.reg_num_mask = 0x1f;

	netdev->netdev_ops = &atl1_netdev_ops;
	netdev->hard_start_xmit = &atl1_xmit_frame;
	netdev->watchdog_timeo = 5 * HZ;

	netdev->ethtool_ops = &atl1_ethtool_ops;
Loading