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

Commit 1d39ed56 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Jeff Garzik
Browse files

remove NETIF_F_TSO ifdefery



Remove the NETIF_F_TSO #ifdef-ery in drivers/net; this was
for old-old-2.4 compat (even current 2.4 has NETIF_F_TSO)
but it's time to get rid of it by now.

Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 6d24998f
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -39,12 +39,10 @@
#include <linux/if_vlan.h>
#define BCM_VLAN 1
#endif
#ifdef NETIF_F_TSO
#include <net/ip.h>
#include <net/tcp.h>
#include <net/checksum.h>
#define BCM_TSO 1
#endif
#include <linux/workqueue.h>
#include <linux/crc32.h>
#include <linux/prefetch.h>
@@ -1728,7 +1726,7 @@ bnx2_tx_int(struct bnx2 *bp)

		tx_buf = &bp->tx_buf_ring[sw_ring_cons];
		skb = tx_buf->skb;
#ifdef BCM_TSO

		/* partial BD completions possible with TSO packets */
		if (skb_is_gso(skb)) {
			u16 last_idx, last_ring_idx;
@@ -1744,7 +1742,7 @@ bnx2_tx_int(struct bnx2 *bp)
				break;
			}
		}
#endif

		pci_unmap_single(bp->pdev, pci_unmap_addr(tx_buf, mapping),
			skb_headlen(skb), PCI_DMA_TODEVICE);

@@ -4514,7 +4512,6 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
		vlan_tag_flags |=
			(TX_BD_FLAGS_VLAN_TAG | (vlan_tx_tag_get(skb) << 16));
	}
#ifdef BCM_TSO
	if ((mss = skb_shinfo(skb)->gso_size) &&
		(skb->len > (bp->dev->mtu + ETH_HLEN))) {
		u32 tcp_opt_len, ip_tcp_len;
@@ -4547,7 +4544,6 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
		}
	}
	else
#endif
	{
		mss = 0;
	}
@@ -5544,10 +5540,8 @@ static const struct ethtool_ops bnx2_ethtool_ops = {
	.set_tx_csum		= ethtool_op_set_tx_csum,
	.get_sg			= ethtool_op_get_sg,
	.set_sg			= ethtool_op_set_sg,
#ifdef BCM_TSO
	.get_tso		= ethtool_op_get_tso,
	.set_tso		= bnx2_set_tso,
#endif
	.self_test_count	= bnx2_self_test_count,
	.self_test		= bnx2_self_test,
	.get_strings		= bnx2_get_strings,
@@ -6104,9 +6098,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
#ifdef BCM_VLAN
	dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
#endif
#ifdef BCM_TSO
	dev->features |= NETIF_F_TSO | NETIF_F_TSO_ECN;
#endif

	netif_carrier_off(bp->dev);

+0 −6
Original line number Diff line number Diff line
@@ -59,17 +59,13 @@
#include <linux/capability.h>
#include <linux/in.h>
#include <linux/ip.h>
#ifdef NETIF_F_TSO6
#include <linux/ipv6.h>
#endif
#include <linux/tcp.h>
#include <linux/udp.h>
#include <net/pkt_sched.h>
#include <linux/list.h>
#include <linux/reboot.h>
#ifdef NETIF_F_TSO
#include <net/checksum.h>
#endif
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/if_vlan.h>
@@ -347,9 +343,7 @@ struct e1000_adapter {
	boolean_t have_msi;
#endif
	/* to not mess up cache alignment, always add to the bottom */
#ifdef NETIF_F_TSO
	boolean_t tso_force;
#endif
	boolean_t smart_power_down;	/* phy smart power down */
	boolean_t quad_port_a;
	unsigned long flags;
+0 −6
Original line number Diff line number Diff line
@@ -338,7 +338,6 @@ e1000_set_tx_csum(struct net_device *netdev, uint32_t data)
	return 0;
}

#ifdef NETIF_F_TSO
static int
e1000_set_tso(struct net_device *netdev, uint32_t data)
{
@@ -352,18 +351,15 @@ e1000_set_tso(struct net_device *netdev, uint32_t data)
	else
		netdev->features &= ~NETIF_F_TSO;

#ifdef NETIF_F_TSO6
	if (data)
		netdev->features |= NETIF_F_TSO6;
	else
		netdev->features &= ~NETIF_F_TSO6;
#endif

	DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled");
	adapter->tso_force = TRUE;
	return 0;
}
#endif /* NETIF_F_TSO */

static uint32_t
e1000_get_msglevel(struct net_device *netdev)
@@ -1971,10 +1967,8 @@ static const struct ethtool_ops e1000_ethtool_ops = {
	.set_tx_csum            = e1000_set_tx_csum,
	.get_sg                 = ethtool_op_get_sg,
	.set_sg                 = ethtool_op_set_sg,
#ifdef NETIF_F_TSO
	.get_tso                = ethtool_op_get_tso,
	.set_tso                = e1000_set_tso,
#endif
	.self_test_count        = e1000_diag_test_count,
	.self_test              = e1000_diag_test,
	.get_strings            = e1000_get_strings,
+0 −26
Original line number Diff line number Diff line
@@ -990,16 +990,12 @@ e1000_probe(struct pci_dev *pdev,
			netdev->features &= ~NETIF_F_HW_VLAN_FILTER;
	}

#ifdef NETIF_F_TSO
	if ((adapter->hw.mac_type >= e1000_82544) &&
	   (adapter->hw.mac_type != e1000_82547))
		netdev->features |= NETIF_F_TSO;

#ifdef NETIF_F_TSO6
	if (adapter->hw.mac_type > e1000_82547_rev_2)
		netdev->features |= NETIF_F_TSO6;
#endif
#endif
	if (pci_using_dac)
		netdev->features |= NETIF_F_HIGHDMA;

@@ -2626,7 +2622,6 @@ e1000_watchdog(unsigned long data)
				E1000_WRITE_REG(&adapter->hw, TARC0, tarc0);
			}

#ifdef NETIF_F_TSO
			/* disable TSO for pcie and 10/100 speeds, to avoid
			 * some hardware issues */
			if (!adapter->tso_force &&
@@ -2637,22 +2632,17 @@ e1000_watchdog(unsigned long data)
					DPRINTK(PROBE,INFO,
				        "10/100 speed: disabling TSO\n");
					netdev->features &= ~NETIF_F_TSO;
#ifdef NETIF_F_TSO6
					netdev->features &= ~NETIF_F_TSO6;
#endif
					break;
				case SPEED_1000:
					netdev->features |= NETIF_F_TSO;
#ifdef NETIF_F_TSO6
					netdev->features |= NETIF_F_TSO6;
#endif
					break;
				default:
					/* oops */
					break;
				}
			}
#endif

			/* enable transmits in the hardware, need to do this
			 * after setting TARC0 */
@@ -2882,7 +2872,6 @@ static int
e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
          struct sk_buff *skb)
{
#ifdef NETIF_F_TSO
	struct e1000_context_desc *context_desc;
	struct e1000_buffer *buffer_info;
	unsigned int i;
@@ -2911,7 +2900,6 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
						   0);
			cmd_length = E1000_TXD_CMD_IP;
			ipcse = skb->h.raw - skb->data - 1;
#ifdef NETIF_F_TSO6
		} else if (skb->protocol == htons(ETH_P_IPV6)) {
			skb->nh.ipv6h->payload_len = 0;
			skb->h.th->check =
@@ -2921,7 +2909,6 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
						 IPPROTO_TCP,
						 0);
			ipcse = 0;
#endif
		}
		ipcss = skb->nh.raw - skb->data;
		ipcso = (void *)&(skb->nh.iph->check) - (void *)skb->data;
@@ -2954,8 +2941,6 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,

		return TRUE;
	}
#endif

	return FALSE;
}

@@ -3013,7 +2998,6 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
	while (len) {
		buffer_info = &tx_ring->buffer_info[i];
		size = min(len, max_per_txd);
#ifdef NETIF_F_TSO
		/* Workaround for Controller erratum --
		 * descriptor for non-tso packet in a linear SKB that follows a
		 * tso gets written back prematurely before the data is fully
@@ -3028,7 +3012,6 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
		 * in TSO mode.  Append 4-byte sentinel desc */
		if (unlikely(mss && !nr_frags && size == len && size > 8))
			size -= 4;
#endif
		/* work-around for errata 10 and it applies
		 * to all controllers in PCI-X mode
		 * The fix is to make sure that the first descriptor of a
@@ -3070,12 +3053,10 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
		while (len) {
			buffer_info = &tx_ring->buffer_info[i];
			size = min(len, max_per_txd);
#ifdef NETIF_F_TSO
			/* Workaround for premature desc write-backs
			 * in TSO mode.  Append 4-byte sentinel desc */
			if (unlikely(mss && f == (nr_frags-1) && size == len && size > 8))
				size -= 4;
#endif
			/* Workaround for potential 82544 hang in PCI-X.
			 * Avoid terminating buffers within evenly-aligned
			 * dwords. */
@@ -3300,7 +3281,6 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
	if (adapter->hw.mac_type >= e1000_82571)
		max_per_txd = 8192;

#ifdef NETIF_F_TSO
	mss = skb_shinfo(skb)->gso_size;
	/* The controller does a simple calculation to
	 * make sure there is enough room in the FIFO before
@@ -3354,16 +3334,10 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
	if ((mss) || (skb->ip_summed == CHECKSUM_PARTIAL))
		count++;
	count++;
#else
	if (skb->ip_summed == CHECKSUM_PARTIAL)
		count++;
#endif

#ifdef NETIF_F_TSO
	/* Controller Erratum workaround */
	if (!skb->data_len && tx_ring->last_tx_tso && !skb_is_gso(skb))
		count++;
#endif

	count += TXD_USE_COUNT(len, max_txd_pwr);

+1 −5
Original line number Diff line number Diff line
@@ -1576,11 +1576,9 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev)

	np->tx_skbuff[nr] = skb;

#ifdef NETIF_F_TSO
	if (skb_is_gso(skb))
		tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->gso_size << NV_TX2_TSO_SHIFT);
	else
#endif
		tx_flags_extra = skb->ip_summed == CHECKSUM_PARTIAL ?
			 NV_TX2_CHECKSUM_L3 | NV_TX2_CHECKSUM_L4 : 0;

@@ -4475,9 +4473,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
		np->rx_csum = 1;
		np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK;
		dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;
#ifdef NETIF_F_TSO
		dev->features |= NETIF_F_TSO;
#endif
 	}

	np->vlanctl_bits = 0;
Loading