- Apr 24, 2015
-
-
Rafał Miłecki authored
After d75b1ade ("net: less interrupt masking in NAPI") polling function has to return whole budget when it wants NAPI to call it again. Signed-off-by:
Rafał Miłecki <zajec5@gmail.com> Cc: Felix Fietkau <nbd@openwrt.org> Fixes: eb64e292 ("bgmac: leave interrupts disabled as long as there is work to do") Acked-by:
Felix Fietkau <nbd@openwrt.org> Signed-off-by:
Eric Dumazet <edumazet@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Apr 22, 2015
-
-
Yuval Mintz authored
On some feature changes, driver employes an inner-reload flow where it resets the function and re-configures it with the new required set of parameters. Such a flow proves fatal to any VF since those were not intended to be used while HW is being reset underneath, causing them [at best] to lose all connectivity. This changes driver behavior to fail all configuration changes [e.g., mtu change] requested of the driver in case VFs are active. Signed-off-by:
Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by:
Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Apr 15, 2015
-
-
Eric Dumazet authored
Commit 9a2620c8 ("bnx2x: prevent WARN during driver unload") switched the napi/busy_lock locking mechanism from spin_lock() into spin_lock_bh(), breaking inter-operability with netconsole, as netpoll disables interrupts prior to calling our napi mechanism. This switches the driver into using atomic assignments instead of the spinlock mechanisms previously employed. Based on initial patch from Yuval Mintz & Ariel Elior I basically added softirq starvation avoidance, and mixture of atomic operations, plain writes and barriers. Note this slightly reduces the overhead for this driver when no busy_poll sockets are in use. Fixes: 9a2620c8 ("bnx2x: prevent WARN during driver unload") Signed-off-by:
Eric Dumazet <edumazet@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Apr 14, 2015
-
-
Felix Fietkau authored
The ring size is always known at compile time, so make the code a bit more efficient Signed-off-by:
Felix Fietkau <nbd@openwrt.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Felix Fietkau authored
The driver needs to inform the hardware about the first invalid (not yet filled) rx slot, by writing its DMA descriptor pointer offset to the BGMAC_DMA_RX_INDEX register. This register was set to a value exceeding the rx ring size, effectively allowing the hardware constant access to the full ring, regardless of which slots are initialized. To fix this issue, always mark the last filled rx slot as invalid. Signed-off-by:
Felix Fietkau <nbd@openwrt.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Felix Fietkau authored
Instead of allocating buffers at device init time and initializing descriptors at device open, do both at the same time (during open). Free all buffers when closing the device. Signed-off-by:
Felix Fietkau <nbd@openwrt.org> Acked-by:
Rafał Miłecki <zajec5@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Felix Fietkau authored
Limiting it to 511 looks like a failed attempt at leaving one descriptor empty to allow the hardware to stop processing a buffer that has not been prepared yet. However, this doesn't work because this affects the total ring size as well Signed-off-by:
Felix Fietkau <nbd@openwrt.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Felix Fietkau authored
In very rare cases, the MAC can catch an internal buffer that is bigger than it's supposed to be. Instead of crashing the kernel, simply pass the buffer back to the hardware Signed-off-by:
Felix Fietkau <nbd@openwrt.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Felix Fietkau authored
Allocate a new buffer before processing the completed one. If allocation fails, reuse the old buffer. Signed-off-by:
Felix Fietkau <nbd@openwrt.org> Acked-by:
Rafał Miłecki <zajec5@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Felix Fietkau authored
A packet buffer offset of 30 bytes is inefficient, because the first 2 bytes end up in a different cacheline. Signed-off-by:
Felix Fietkau <nbd@openwrt.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Felix Fietkau authored
Always poll rx and tx during NAPI poll instead of relying on the status of the first interrupt. This prevents bgmac_poll from leaving unfinished work around until the next IRQ. In my tests this makes bridging/routing throughput under heavy load more stable and ensures that no new IRQs arrive as long as bgmac_poll uses up the entire budget. Signed-off-by:
Felix Fietkau <nbd@openwrt.org> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Felix Fietkau authored
Keep incrementing ring->start and ring->end instead of pointing it to the actual ring slot entry. This simplifies the calculation of the number of free slots. Signed-off-by:
Felix Fietkau <nbd@openwrt.org> Acked-by:
Rafał Miłecki <zajec5@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Apr 01, 2015
-
-
Petri Gynther authored
Currently, MoCA fixed PHYs are always in link-up state, regardless of whether the link is actually up or not. Add code to properly detect MoCA link state changes and to reflect the new state in MoCA fixed PHY. Only GENET V3 and V4 MACs are capable of detecting MoCA link state changes. The code works as follows: 1. GENET MAC detects MoCA link state change and issues UMAC_IRQ_LINK_UP or UMAC_IRQ_LINK_DOWN interrupt. 2. Link up/down interrupt is processed in bcmgenet_irq_task(), which calls phy_mac_interrupt(). 3. phy_mac_interrupt() updates the fixed PHY phydev->link and kicks the PHY state machine. 4. PHY state machine proceeds to read the fixed PHY link status register. 5. When the fixed PHY link status register is being read, the new function bcmgenet_fixed_phy_link_update() gets called. It copies the fixed PHY phydev->link value to the fixed PHY status->link. 6. PHY state machine receives the new link state of the fixed PHY. 7. MoCA fixed PHY link state now correctly reflects the real MoCA hardware link state. Signed-off-by:
Petri Gynther <pgynther@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Yuval Mintz authored
When IOMM-vtd is active, once main kernel crashes unfinished DMAE transactions will be blocked, putting the HW in an error state which will cause further transactions to timeout. Current employed logic uses wrong macros, causing the first function to be the only function that cleanups that error state during its probe/load. This patch allows all the functions to successfully re-load in kdump kernel. Signed-off-by:
Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by:
Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Yuval Mintz authored
When running in a kdump kernel, it's very likely that due to sync. loss with management firmware the first PCI function to probe and reach the previous unload flow would decide it can reset the chip and continue onward. While doing so, it will only close its own Rx port. On a 4-port device where 2nd port on engine is a 1g-port, the 2nd port would allow ingress traffic after the chip is reset [assuming it was active on the first kernel]. This would later cause a HW attention. This changes driver flow to close both ports' 1g capabilities during the previous driver unload flow prior to the chip reset. Signed-off-by:
Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by:
Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Rafał Miłecki authored
There are two reasons for having this header in the common place: 1) Simplifying drivers that read NVRAM entries. We will be able to safely call bcm47xx_nvram_* functions without #ifdef-s. 2) Getting NVRAM driver out of MIPS arch code. This is needed to support BCM5301X arch which also requires this NVRAM driver. Patch for that will follow once we get is reviewed. Signed-off-by:
Rafał Miłecki <zajec5@gmail.com> Acked-by:
Hauke Mehrtens <hauke@hauke-m.de> Cc: linux-mips@linux-mips.org Cc: Arnd Bergmann <arnd@arndb.de> Cc: Paul Walmsley <paul@pwsan.com> Cc: linux-soc@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/8619/ Signed-off-by:
Ralf Baechle <ralf@linux-mips.org>
-
- Mar 31, 2015
-
-
Richard Cochran authored
This patch changes the driver to use ns_to_timespec64() instead of open coding the same logic. Compile tested only. Signed-off-by:
Richard Cochran <richardcochran@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Richard Cochran authored
This patch changes the driver to use ns_to_timespec64() and timespec64_to_ns() instead of open coding the same logic. Compile tested only. Signed-off-by:
Richard Cochran <richardcochran@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Petri Gynther authored
On phy_mac_interrupt() call, the new_link parameter should be 0 or 1. Signed-off-by:
Petri Gynther <pgynther@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Petri Gynther authored
Add #define UMAC_IRQ_LINK_EVENT to simplify link event handling code. Signed-off-by:
Petri Gynther <pgynther@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Petri Gynther authored
If bcmgenet_init_dma() fails, it cleans up after itself. Rx and Tx DMAs are off, and NAPI instances haven't been netif_napi_add()'ed. Therefore, we need to skip calling bcmgenet_fini_dma() on the error handling path. bcmgenet_resume() already does this correctly. Signed-off-by:
Petri Gynther <pgynther@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Petri Gynther authored
bcmgenet_fini_dma() is the only caller of __bcmgenet_fini_dma(). Move __bcmgenet_fini_dma() code inside bcmgenet_fini_dma(). Signed-off-by:
Petri Gynther <pgynther@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Petri Gynther authored
Add #define for UMAC_IRQ_RXDMA_DONE and UMAC_IRQ_TXDMA_DONE in order to simplify the code that handles Rx and Tx default queue interrupts. Signed-off-by:
Petri Gynther <pgynther@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Joe Perches authored
Use bool constants as the return values instead of 1 and 0. Signed-off-by:
Joe Perches <joe@perches.com> Acked-by:
Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Yuval Mintz authored
It's possible that due to errors [either on PCI or on device itself] registers reads would fail, returning all-Fs. This adds a check as early as possible so that driver will not read junk values and make incorrect probe decisions according to them; instead, gracefully fail the probe. Signed-off-by:
Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by:
Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Yaniv Rosner authored
Number of link changes are now being stored in shared memory [by all possible link owners], for management use [as well as possible debug information for dumps]. Signed-off-by:
Yaniv Rosner <Yaniv.Rosner@qlogic.com> Signed-off-by:
Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by:
Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Yaniv Rosner authored
Enable controlling Post2, coeff, IPreDriver and IFir according to NVRAM setup. Signed-off-by:
Yaniv Rosner <Yaniv.Rosner@qlogic.com> Signed-off-by:
Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by:
Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Richard Cochran authored
The device appears to use a 64 bit nanoseconds register, and so with this patch the driver should be ready for the year 2038. Compile tested only. Signed-off-by:
Richard Cochran <richardcochran@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Richard Cochran authored
This driver's clock is implemented using a timecounter, and so with this patch the driver is ready for the year 2038. Compile tested only. Signed-off-by:
Richard Cochran <richardcochran@gmail.com> Acked-by:
Sony Chacko <sony.chacko@qlogic.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Mar 29, 2015
-
-
Toshiaki Makita authored
To allow drivers to handle the features check for multiple tags, move the check to ndo_features_check(). As no drivers currently handle multiple tagged TSO, introduce dflt_features_check() and call it if the driver does not have ndo_features_check(). Signed-off-by:
Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Mar 27, 2015
-
-
Petri Gynther authored
Add support for multiple Rx queues: 1. Add NAPI context per Rx queue 2. Modify Rx interrupt and Rx NAPI code to handle multiple Rx queues Signed-off-by:
Petri Gynther <pgynther@google.com> Reviewed-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Petri Gynther authored
Introduce new bcmgenet functions to handle the NAPI calls to: netif_napi_add() napi_enable() napi_disable() netif_napi_del() Signed-off-by:
Petri Gynther <pgynther@google.com> Reviewed-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Petri Gynther authored
Introduce new bcmgenet functions to handle the NAPI calls to: netif_napi_add() napi_enable() napi_disable() netif_napi_del() Signed-off-by:
Petri Gynther <pgynther@google.com> Reviewed-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Petri Gynther authored
Use more meaningful variable names int0_enable and int1_enable when enabling bcmgenet interrupts. For Rx default queue interrupts, use: UMAC_IRQ_RXDMA_BDONE | UMAC_IRQ_RXDMA_PDONE For Tx default queue interrupts, use: UMAC_IRQ_TXDMA_BDONE | UMAC_IRQ_TXDMA_PDONE Signed-off-by:
Petri Gynther <pgynther@google.com> Reviewed-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Petri Gynther authored
Do the two kcalloc() calls first, before proceeding into Rx/Tx DMA init. Makes the error case handling much simpler. Signed-off-by:
Petri Gynther <pgynther@google.com> Reviewed-by:
Florian Fainelli <f.fainelli@gmail.com> Reviewed-by:
Jaedon Shin <jaedon.shin@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Petri Gynther authored
Remove unnecessary function parameter priv. Use ring->priv instead. Signed-off-by:
Petri Gynther <pgynther@google.com> Reviewed-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Petri Gynther authored
Remove unused priv->int0_mask and priv->int1_mask. Signed-off-by:
Petri Gynther <pgynther@google.com> Reviewed-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
- Mar 24, 2015
-
-
Yuval Mintz authored
Statistics' state-machine in bnx2x driver must be synced with various driver flows, but its current locking scheme manages to be wasteful [using 2 locks + additional local variable] and prone to race-conditions at the same time, as the state-machine and 'action' are being accessed under different locks. In addition, current 'safe exec' isn't in fact safe, since the only guarantee it gives is that DMA transactions are over, but ramrods might still be running. This patch cleans up said logic, leaving us with a single lock for the entire flow and removing the possible races. Changes from v2: - Switched into mutex locking from semaphore locking. - Release locks on error flows. Changes from v1: Failure to acquire lock fails flow instead of printing a warning and allowing access to the critical section. Signed-off-by:
Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by:
Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Florian Fainelli authored
In case the interface is not used, power down the integrated GPHY during suspend. Similarly to bcmgenet_open(), bcmgenet_resume() powers on the GPHY prior to any UniMAC activity. Signed-off-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-
Florian Fainelli authored
Power up the GPHY while we are bringing-up the network interface, and conversely, upon bring down, power the GPHY down. In order to avoid creating hardware hazards, make sure that the GPHY gets powered on during bcmgenet_open() prior to the UniMAC being reset as the UniMAC may start creating activity towards the GPHY if we reverse the steps. Signed-off-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
-