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

Commit 3bda2418 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  [PATCH] spidernet: rework tx queue handling
  [PATCH] spidernet: bug fix for init code
  [PATCH] sky2: NAPI poll fix
  [NET] ethtool: fix oops by testing correct struct member
  e1000: bump version to 7.1.9-k4
  e1000: fix panic on large frame receive when mtu=default
  e1000: remove CRC bytes from measured packet length
  e1000: Redo netpoll fix to address community concerns
parents f5beec49 bdd01503
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -110,6 +110,9 @@ struct e1000_adapter;
#define E1000_MIN_RXD                       80
#define E1000_MAX_82544_RXD               4096

/* this is the size past which hardware will drop packets when setting LPE=0 */
#define MAXIMUM_ETHERNET_VLAN_SIZE 1522

/* Supported Rx Buffer Sizes */
#define E1000_RXBUFFER_128   128    /* Used for packet split */
#define E1000_RXBUFFER_256   256    /* Used for packet split */
+26 −26
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
#else
#define DRIVERNAPI "-NAPI"
#endif
#define DRV_VERSION "7.1.9-k2"DRIVERNAPI
#define DRV_VERSION "7.1.9-k4"DRIVERNAPI
char e1000_driver_version[] = DRV_VERSION;
static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";

@@ -1068,7 +1068,7 @@ e1000_sw_init(struct e1000_adapter *adapter)

	pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);

	adapter->rx_buffer_len = MAXIMUM_ETHERNET_FRAME_SIZE;
	adapter->rx_buffer_len = MAXIMUM_ETHERNET_VLAN_SIZE;
	adapter->rx_ps_bsize0 = E1000_RXBUFFER_128;
	hw->max_frame_size = netdev->mtu +
			     ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
@@ -3148,7 +3148,6 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu)
		adapter->rx_buffer_len = E1000_RXBUFFER_16384;

	/* adjust allocation if LPE protects us, and we aren't using SBP */
#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
	if (!adapter->hw.tbi_compatibility_on &&
	    ((max_frame == MAXIMUM_ETHERNET_FRAME_SIZE) ||
	     (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE)))
@@ -3387,8 +3386,8 @@ e1000_intr(int irq, void *data, struct pt_regs *regs)
		E1000_WRITE_REG(hw, IMC, ~0);
		E1000_WRITE_FLUSH(hw);
	}
	if (likely(netif_rx_schedule_prep(&adapter->polling_netdev[0])))
		__netif_rx_schedule(&adapter->polling_netdev[0]);
	if (likely(netif_rx_schedule_prep(netdev)))
		__netif_rx_schedule(netdev);
	else
		e1000_irq_enable(adapter);
#else
@@ -3431,21 +3430,15 @@ e1000_clean(struct net_device *poll_dev, int *budget)
{
	struct e1000_adapter *adapter;
	int work_to_do = min(*budget, poll_dev->quota);
	int tx_cleaned = 0, i = 0, work_done = 0;
	int tx_cleaned = 0, work_done = 0;

	/* Must NOT use netdev_priv macro here. */
	adapter = poll_dev->priv;

	/* Keep link state information with original netdev */
	if (!netif_carrier_ok(adapter->netdev))
	if (!netif_carrier_ok(poll_dev))
		goto quit_polling;

	while (poll_dev != &adapter->polling_netdev[i]) {
		i++;
		BUG_ON(i == adapter->num_rx_queues);
	}

	if (likely(adapter->num_tx_queues == 1)) {
	/* e1000_clean is called per-cpu.  This lock protects
	 * tx_ring[0] from being cleaned by multiple cpus
	 * simultaneously.  A failure obtaining the lock means
@@ -3455,10 +3448,8 @@ e1000_clean(struct net_device *poll_dev, int *budget)
		                                &adapter->tx_ring[0]);
		spin_unlock(&adapter->tx_queue_lock);
	}
	} else
		tx_cleaned = e1000_clean_tx_irq(adapter, &adapter->tx_ring[i]);

	adapter->clean_rx(adapter, &adapter->rx_ring[i],
	adapter->clean_rx(adapter, &adapter->rx_ring[0],
	                  &work_done, work_to_do);

	*budget -= work_done;
@@ -3466,7 +3457,7 @@ e1000_clean(struct net_device *poll_dev, int *budget)

	/* If no Tx and not enough Rx work done, exit the polling mode */
	if ((!tx_cleaned && (work_done == 0)) ||
	   !netif_running(adapter->netdev)) {
	   !netif_running(poll_dev)) {
quit_polling:
		netif_rx_complete(poll_dev);
		e1000_irq_enable(adapter);
@@ -3681,6 +3672,9 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,

		length = le16_to_cpu(rx_desc->length);

		/* adjust length to remove Ethernet CRC */
		length -= 4;

		if (unlikely(!(status & E1000_RXD_STAT_EOP))) {
			/* All receives must fit into a single buffer */
			E1000_DBG("%s: Receive packet consumed multiple"
@@ -3885,8 +3879,9 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
			pci_dma_sync_single_for_device(pdev,
				ps_page_dma->ps_page_dma[0],
				PAGE_SIZE, PCI_DMA_FROMDEVICE);
			/* remove the CRC */
			l1 -= 4;
			skb_put(skb, l1);
			length += l1;
			goto copydone;
		} /* if */
		}
@@ -3905,6 +3900,10 @@ e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
			skb->truesize += length;
		}

		/* strip the ethernet crc, problem is we're using pages now so
		 * this whole operation can get a little cpu intensive */
		pskb_trim(skb, skb->len - 4);

copydone:
		e1000_rx_checksum(adapter, staterr,
				  le16_to_cpu(rx_desc->wb.lower.hi_dword.csum_ip.csum), skb);
@@ -4752,6 +4751,7 @@ static void
e1000_netpoll(struct net_device *netdev)
{
	struct e1000_adapter *adapter = netdev_priv(netdev);

	disable_irq(adapter->pdev->irq);
	e1000_intr(adapter->pdev->irq, netdev, NULL);
	e1000_clean_tx_irq(adapter, adapter->tx_ring);
+2 −5
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@
#include "sky2.h"

#define DRV_NAME		"sky2"
#define DRV_VERSION		"1.4"
#define DRV_VERSION		"1.5"
#define PFX			DRV_NAME " "

/*
@@ -2204,9 +2204,6 @@ static int sky2_poll(struct net_device *dev0, int *budget)
	int work_done = 0;
	u32 status = sky2_read32(hw, B0_Y2_SP_EISR);

	if (!~status)
		goto out;

	if (status & Y2_IS_HW_ERR)
		sky2_hw_intr(hw);

@@ -2243,7 +2240,7 @@ static int sky2_poll(struct net_device *dev0, int *budget)

	if (sky2_more_work(hw))
		return 1;
out:

	netif_rx_complete(dev0);

	sky2_read32(hw, B0_Y2_SP_LISR);
+254 −326

File changed.

Preview size limit exceeded, changes collapsed.

+21 −52
Original line number Diff line number Diff line
@@ -208,7 +208,10 @@ extern char spider_net_driver_name[];
#define SPIDER_NET_DMA_RX_VALUE		0x80000000
#define SPIDER_NET_DMA_RX_FEND_VALUE	0x00030003
/* to set TX_DMA_EN */
#define SPIDER_NET_DMA_TX_VALUE		0x80000000
#define SPIDER_NET_TX_DMA_EN		0x80000000
#define SPIDER_NET_GDTDCEIDIS		0x00000002
#define SPIDER_NET_DMA_TX_VALUE		SPIDER_NET_TX_DMA_EN | \
					SPIDER_NET_GDTDCEIDIS
#define SPIDER_NET_DMA_TX_FEND_VALUE	0x00030003

/* SPIDER_NET_UA_DESCR_VALUE is OR'ed with the unicast address */
@@ -332,52 +335,20 @@ enum spider_net_int2_status {
#define SPIDER_NET_GPREXEC			0x80000000
#define SPIDER_NET_GPRDAT_MASK			0x0000ffff

/* descriptor bits
 *
 * 1010					descriptor ready
 *     0				descr in middle of chain
 *      000				fixed to 0
 *
 *         0				no interrupt on completion
 *          000				fixed to 0
 *             1			no ipsec processing
 *              1			last descriptor for this frame
 *               00			no checksum
 *               10			tcp checksum
 *               11			udp checksum
 *
 *                 00			fixed to 0
 *                   0			fixed to 0
 *                    0			no interrupt on response errors
 *                     0		no interrupt on invalid descr
 *                      0		no interrupt on dma process termination
 *                       0		no interrupt on descr chain end
 *                        0		no interrupt on descr complete
 *
 *                         000		fixed to 0
 *                            0		response error interrupt status
 *                             0	invalid descr status
 *                              0	dma termination status
 *                               0	descr chain end status
 *                                0	descr complete status */
#define SPIDER_NET_DMAC_CMDSTAT_NOCS	0xa00c0000
#define SPIDER_NET_DMAC_CMDSTAT_TCPCS	0xa00e0000
#define SPIDER_NET_DMAC_CMDSTAT_UDPCS	0xa00f0000
#define SPIDER_NET_DESCR_IND_PROC_SHIFT	28
#define SPIDER_NET_DESCR_IND_PROC_MASKO	0x0fffffff

/* descr ready, descr is in middle of chain, get interrupt on completion */
#define SPIDER_NET_DMAC_RX_CARDOWNED	0xa0800000

enum spider_net_descr_status {
	SPIDER_NET_DESCR_COMPLETE		= 0x00, /* used in rx and tx */
	SPIDER_NET_DESCR_RESPONSE_ERROR		= 0x01, /* used in rx and tx */
	SPIDER_NET_DESCR_PROTECTION_ERROR	= 0x02, /* used in rx and tx */
	SPIDER_NET_DESCR_FRAME_END		= 0x04, /* used in rx */
	SPIDER_NET_DESCR_FORCE_END		= 0x05, /* used in rx and tx */
	SPIDER_NET_DESCR_CARDOWNED		= 0x0a, /* used in rx and tx */
	SPIDER_NET_DESCR_NOT_IN_USE /* any other value */
};
#define SPIDER_NET_DMAC_NOINTR_COMPLETE		0x00800000
#define SPIDER_NET_DMAC_NOCS			0x00040000
#define SPIDER_NET_DMAC_TCP			0x00020000
#define SPIDER_NET_DMAC_UDP			0x00030000
#define SPIDER_NET_TXDCEST			0x08000000

#define SPIDER_NET_DESCR_IND_PROC_MASK		0xF0000000
#define SPIDER_NET_DESCR_COMPLETE		0x00000000 /* used in rx and tx */
#define SPIDER_NET_DESCR_RESPONSE_ERROR		0x10000000 /* used in rx and tx */
#define SPIDER_NET_DESCR_PROTECTION_ERROR	0x20000000 /* used in rx and tx */
#define SPIDER_NET_DESCR_FRAME_END		0x40000000 /* used in rx */
#define SPIDER_NET_DESCR_FORCE_END		0x50000000 /* used in rx and tx */
#define SPIDER_NET_DESCR_CARDOWNED		0xA0000000 /* used in rx and tx */
#define SPIDER_NET_DESCR_NOT_IN_USE		0xF0000000

struct spider_net_descr {
	/* as defined by the hardware */
@@ -398,7 +369,7 @@ struct spider_net_descr {
} __attribute__((aligned(32)));

struct spider_net_descr_chain {
	/* we walk from tail to head */
	spinlock_t lock;
	struct spider_net_descr *head;
	struct spider_net_descr *tail;
};
@@ -453,8 +424,6 @@ struct spider_net_card {

	struct spider_net_descr_chain tx_chain;
	struct spider_net_descr_chain rx_chain;
	atomic_t rx_chain_refill;
	atomic_t tx_chain_release;

	struct net_device_stats netdev_stats;

Loading