- 05 9月, 2008 15 次提交
-
-
由 Lennert Buytenhek 提交于
As all the infrastructure for multiple transmit queues already exists in the driver, this patch is entirely trivial. The individual transmit queues are still serialised by the driver's per-port private spinlock, but that will disappear (i.e. be replaced by the per-subqueue ->_xmit_lock) in a subsequent patch. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Delete a couple of unused and uninteresting interrupt source mask bits: - The receive resource underrun interrupt sources are uninteresting because if we are in out-of-memory mode, we are already dealing with the issue, and we don't need the hardware to remind us again that we are out of memory. - The LINK and PHY interrupt sources can be coalesced into one define, since we always use them together. - The transmit resource underrun interrupt source can be disabled since we never activate the head descriptor of a paged skb until the fragments are all activated, so transmit underrun during a packet should never happen. - The INT_EXT_TX_0 define is never used. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
There is no need to call netif_{stop,wake}_queue() when the link goes down/up, as the networking already takes care of this internally. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Currently, there are two different fields in the mv643xx_eth_platform_data struct that together describe the PHY address -- one field (phy_addr) has the address of the PHY, but if that address is zero, a second field (force_phy_addr) needs to be set to distinguish the actual address zero from a zero due to not having filled in the PHY address explicitly (which should mean 'use the default PHY address'). If we are a bit smarter about the encoding of the phy_addr field, we can avoid the need for a second field -- this patch does that. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Which top-level unit's SMI interface to use should be a property of the top-level unit, not of the individual ports. This patch moves the ->shared_smi pointer from the per-port platform data to the global platform data. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Simplify receive and transmit queue handling by requiring the set of queue numbers to be contiguous starting from zero. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Get rid of the mv643xx_eth-internal MV643XX_ETH_CHECKSUM_OFFLOAD_TX compile-time option. Using transmit checksumming is the sane default, and anyone wanting to disable it should use ethtool(8) instead of recompiling their kernels. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
By having the receive out-of-memory handling timer schedule the napi poll handler and then doing oom processing from the napi poll handler, all code that touches receive state moves to napi context, letting us get rid of all explicit locking in the receive paths since the only mutual exclusion we need anymore at that point is protection against reentering ourselves, which is provided by napi synchronisation. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Make napi unconditional on the receive side, so that we can get rid of all the locking and local interrupt disabling in the receive path. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
If the platform code has passed us the IRQ number of the mv643xx_eth top-level error interrupt, use the error interrupt to wait for SMI access completion instead of polling the SMI busy bit, since SMI bus accesses can take up to tens of milliseconds. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Since commit 81600eea ("mv643xx_eth: use auto phy polling for configuring (R)(G)MII interface"), mv643xx_eth no longer does SMI accesses from interrupt context. The only other callers that do SMI accesses all do them from process context, which means we can switch the PHY lock from a spinlock to a mutex, and get rid of the extra locking in some ethtool methods. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Get rid of the modulo operations that are currently used for computing successive TX/RX descriptor ring indexes. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Using IRQF_SAMPLE_RANDOM for the mv643xx_eth interrupt handler significantly increases interrupt processing overhead, so get rid of it. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
When tearing down a DMA mapping for a receive buffer, we should pass dma_unmap_single() the exact same address that dma_map_single() gave us when we originally set up the mapping. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
- 24 8月, 2008 6 次提交
-
-
由 Lennert Buytenhek 提交于
Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
The mv643xx_eth hardware ignores the lower three bits of the buffer size field in receive descriptors, causing the reception of full-sized packets to fail at some MTUs. Fix this by rounding the size of allocated receive buffers up to a multiple of eight bytes. While we are at it, add a bit of extra space to each receive buffer so that we can handle multiple vlan tags on ingress. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
When we are low on memory, the assumption that every descriptor in the receive ring will have an skbuff associated with it does not hold. rxq_process() was assuming that if the receive descriptor it is working on is not owned by the hardware, it can safely be processed and handed to the networking stack. But a descriptor in the receive ring not being owned by the hardware can also happen when we are low on memory and did not manage to refill the receive ring fully. This patch changes rxq_process()'s bailout condition from "the first receive descriptor to be processed is owned by the hardware" to "the first receive descriptor to be processed is owned by the hardware OR the number of valid receive descriptors in the ring is zero". Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Nicolas Pitre noted that mv643xx_eth_poll was incorrectly using non-IRQ-safe locks while checking whether to wake up the netdevice's transmit queue. Convert the locking to *_irq() variants, since we are running from softirq context where interrupts are enabled. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Commit 12e4ab79 ("mv643xx_eth: be more agressive about RX refill") changed the condition for the receive out-of-memory timer to be scheduled from "the receive ring is empty" to "the receive ring is not full". This can lead to a situation where the receive out-of-memory timer is pending because a previous rxq_refill() didn't manage to refill the receive ring entirely as a result of being out of memory, and rxq_refill() is then called again as a side effect of a packet receive interrupt, and that rxq_refill() call then again does not succeed to refill the entire receive ring with fresh empty skbuffs because we are still out of memory, and then tries to call add_timer() on the already scheduled out-of-memory timer. This patch fixes this issue by changing the add_timer() call in rxq_refill() to a mod_timer() call. If the OOM timer was not already scheduled, this will behave as before, whereas if it was already scheduled, this patch will push back its firing time a bit, which is safe because we've (unsuccessfully) attempted to refill the receive ring just before we do this. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
When a receive interrupt occurs, mv643xx_eth would first process the receive descriptors and then ACK the receive interrupt, instead of the other way round. This would leave a small race window between processing the last receive descriptor and clearing the receive interrupt status in which a new packet could come in, which would then 'rot' in the receive ring until the next receive interrupt would come in. Fix this by ACKing (clearing) the receive interrupt condition before processing the receive descriptors. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
- 24 7月, 2008 12 次提交
-
-
由 Lennert Buytenhek 提交于
Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Although mv643xx_eth has no hardware support for inserting a vlan tag by twiddling some bits in the TX descriptor, it does support hardware TX checksumming on packets where the IP header starts {a limited set of values other than 14} bytes into the packet. This patch sets mv643xx_eth's ->vlan_features to NETIF_F_SG | NETIF_F_IP_CSUM, which prevents the stack from checksumming vlan'ed packets in software, and if vlan tags are present on a transmitted packet, notifies the hardware of this fact by toggling the right bits in the TX descriptor. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
When there is a link status change (link or phy status interrupt), print a message notifying the user of the new link status. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
The mv643xx_eth hardware has a provision for polling the PHY's MII management registers to obtain the (R)(G)MII interface speed (10/100/1000) and duplex (half/full) and pause (off/symmetric) settings to use to talk to the PHY. The driver currently does not make use of this feature. Instead, whenever there is a link status change event, it reads the current link parameters from the PHY, and programs those parameters into the mv643xx_eth MAC by hand. This patch switches the mv643xx_eth driver to letting the MAC auto-determine the (R)(G)MII link parameters by PHY polling, if there is a PHY present. For PHYless ports (when e.g. the (R)(G)MII interface is connected to a hardware switch), we keep hardcoding the MII interface parameters. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Print the mv643xx_eth driver version on init to help debugging. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
Instead of hardcoding MII register addresses and values, use the symbolic constants defined in linux/mii.h. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
The mv643xx_eth driver is limiting DMA bursts to 32 bytes, while using the largest burst size (128 bytes) gives a couple percentage points performance improvement in throughput tests, and the docs say that the 128 byte default should not need to be changed, so use 128 byte bursts instead. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
The recommended sequence for waiting for the transmit path to clear after disabling all of the transmit queues is to wait for the TX_FIFO_EMPTY bit in the Port Status register to become set as well as the TX_IN_PROGRESS bit to clear. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
The maximum receive packet size field in the Port Serial Control register controls at what size received packets are flagged overlength in the receive descriptor, but it doesn't prevent overlength packets from being DMAd to memory and signaled to the host like other received packets. mv643xx_eth does not support receiving jumbo frames in 10/100 mode, but setting the packet threshold to larger than 1522 bytes in 10/100 mode won't cause breakage by itself. If we really want to enforce maximum packet size on the receiving end instead of on the sending end where it should be done, we can always just add a length check to the software receive handler instead of relying on the hardware to do the comparison for us. What's more, changing the maximum packet size field requires temporarily disabling the RX/TX paths. So once the link comes up in 10/100 Mb/s mode or 1000 Mb/s mode, we'd have to disable it again just to set the right maximum packet size field (1522 in 10/100 Mb/s mode or 9700 in 1000 Mb/s mode), just so that we can offload one comparison operation to hardware that we might as well do in software, assuming that we'd want to do it at all. Contrary to what the documentation suggests, there is no harm in just setting a 9700 byte maximum packet size in 10/100 mode, so use the maximum maximum packet size for all modes. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
The mv643xx_eth driver allows doing transmit reclaim from within the napi poll routine, but after doing reclaim, it would forget to check the free transmit descriptor count and wake up the transmit queue if the reclaim caused enough descriptors for a new packet to become available. This would cause the netdev watchdog to occasionally kick in during certain workloads with combined receive and transmit traffic. Fix this by adding a wakeup check identical to the one in the interrupt handler to the napi poll routine. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
When the ethernet link goes down while mv643xx_eth is transmitting data, transmit DMA can stop before all queued transmit descriptors have been processed. But even the descriptors that _have_ been processed might not be properly marked as done before the transmit DMA unit shuts down. Then when the link comes up again, the hardware transmit pointer might have advanced while not all previous packet descriptors have been marked as transmitted, causing software transmit reclaim to hang waiting for the hardware to finish transmitting a descriptor that it has already skipped. This patch forcibly reclaims all packets on the transmit ring on a link down interrupt, and then resyncs the hardware transmit pointer to what the software's idea of the first free descriptor is. Also, we need to prevent re-waking the transmit queue if we get a 'transmit done' interrupt at the same time as a 'link down' interrupt, which this patch does as well. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
由 Lennert Buytenhek 提交于
The previously merged TX hang erratum workaround ("mv643xx_eth: work around TX hang hardware issue") assumes that TX_END interrupts are delivered simultaneously with or after their corresponding TX interrupts, but this is not always true in practise. In particular, it appears that TX_END interrupts are issued as soon as descriptor fetch returns an invalid descriptor, which may happen before earlier descriptors have been fully transmitted and written back to memory as being done. This hardware behavior can lead to a situation where the current driver code mistakenly assumes that the MAC has given up transmitting before noticing the packets that it is in fact still currently working on, causing the driver to re-kick the transmit queue, which will only cause the MAC to re-fetch the invalid head descriptor, and generate another TX_END interrupt, et cetera, until the packets in the pipe finally finish transmitting and have their descriptors written back to memory, which will then finally break the loop. Fix this by having the erratum workaround not check the 'number of unfinished descriptor', but instead, to compare the software's idea of what the head descriptor pointer should be to the hardware's head descriptor pointer (which is updated on the same conditions as the TX_END interupt is generated on, i.e. possibly before all previous descriptors have been transmitted and written back). Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
-
- 23 7月, 2008 1 次提交
-
-
由 Lennert Buytenhek 提交于
Joseph Fannin <jfannin@gmail.com> and Takashi Iwai <tiwai@suse.de> noticed that commit 073a345c ("mv643xx_eth: clarify irq masking and unmasking") broke the mv643xx_eth build when NETPOLL is enabled, due to it not renaming one instance of INT_CAUSE_EXT in mv643xx_eth_netpoll(). This patch takes care of that instance as well. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Cc: Dale Farnsworth <dale@farnsworth.org> Cc: Joseph Fannin <jfannin@gmail.com> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
-
- 12 6月, 2008 6 次提交
-
-
由 Lennert Buytenhek 提交于
Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Acked-by: NDale Farnsworth <dale@farnsworth.org>
-
由 Lennert Buytenhek 提交于
On some boards, the mv643xx_eth MAC isn't connected to a PHY but directly (via the MII/GMII/RGMII interface) to another MAC-layer device. This patch allows specifying ->phy_addr = -1 to skip all PHY-related initialisation and run-time poking in that case. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Acked-by: NDale Farnsworth <dale@farnsworth.org>
-
由 Lennert Buytenhek 提交于
During OOM, instead of stopping RX refill when the rx desc ring is not empty, keep trying to refill the ring as long as it is not full instead. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Acked-by: NDale Farnsworth <dale@farnsworth.org>
-
由 Lennert Buytenhek 提交于
Some SoCs have the TX bandwidth control registers in a slightly different place. This patch detects that case at run time, and re-directs accesses to those registers to the proper place at run time if needed. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Acked-by: NDale Farnsworth <dale@farnsworth.org>
-
由 Lennert Buytenhek 提交于
Newer hardware has a 16-bit instead of a 14-bit RX coalescing count field in the SDMA_CONFIG register. This patch adds a run-time check for which of the two we have, and adjusts further writes to the rx coal count field accordingly. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Acked-by: NDale Farnsworth <dale@farnsworth.org>
-
由 Lennert Buytenhek 提交于
Under some conditions, the TXQ ('TX queue being served') bit can clear before all packets queued for that TX queue have been transmitted. This patch enables TXend interrupts, and uses those to re-kick TX queues that claim to be idle but still have queued descriptors from the interrupt handler. Signed-off-by: NLennert Buytenhek <buytenh@marvell.com> Acked-by: NDale Farnsworth <dale@farnsworth.org>
-