aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sfc
AgeCommit message (Collapse)AuthorFilesLines
2013-11-14Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-armLinus Torvalds1-11/+1
Pull DMA mask updates from Russell King: "This series cleans up the handling of DMA masks in a lot of drivers, fixing some bugs as we go. Some of the more serious errors include: - drivers which only set their coherent DMA mask if the attempt to set the streaming mask fails. - drivers which test for a NULL dma mask pointer, and then set the dma mask pointer to a location in their module .data section - which will cause problems if the module is reloaded. To counter these, I have introduced two helper functions: - dma_set_mask_and_coherent() takes care of setting both the streaming and coherent masks at the same time, with the correct error handling as specified by the API. - dma_coerce_mask_and_coherent() which resolves the problem of drivers forcefully setting DMA masks. This is more a marker for future work to further clean these locations up - the code which creates the devices really should be initialising these, but to fix that in one go along with this change could potentially be very disruptive. The last thing this series does is prise away some of Linux's addition to "DMA addresses are physical addresses and RAM always starts at zero". We have ARM LPAE systems where all system memory is above 4GB physical, hence having DMA masks interpreted by (eg) the block layers as describing physical addresses in the range 0..DMAMASK fails on these platforms. Santosh Shilimkar addresses this in this series; the patches were copied to the appropriate people multiple times but were ignored. Fixing this also gets rid of some ARM weirdness in the setup of the max*pfn variables, and brings ARM into line with every other Linux architecture as far as those go" * 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm: (52 commits) ARM: 7805/1: mm: change max*pfn to include the physical offset of memory ARM: 7797/1: mmc: Use dma_max_pfn(dev) helper for bounce_limit calculations ARM: 7796/1: scsi: Use dma_max_pfn(dev) helper for bounce_limit calculations ARM: 7795/1: mm: dma-mapping: Add dma_max_pfn(dev) helper function ARM: 7794/1: block: Rename parameter dma_mask to max_addr for blk_queue_bounce_limit() ARM: DMA-API: better handing of DMA masks for coherent allocations ARM: 7857/1: dma: imx-sdma: setup dma mask DMA-API: firmware/google/gsmi.c: avoid direct access to DMA masks DMA-API: dcdbas: update DMA mask handing DMA-API: dma: edma.c: no need to explicitly initialize DMA masks DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks DMA-API: crypto: remove last references to 'static struct device *dev' DMA-API: crypto: fix ixp4xx crypto platform device support DMA-API: others: use dma_set_coherent_mask() DMA-API: staging: use dma_set_coherent_mask() DMA-API: usb: use new dma_coerce_mask_and_coherent() DMA-API: usb: use dma_set_coherent_mask() DMA-API: parport: parport_pc.c: use dma_coerce_mask_and_coherent() DMA-API: net: octeon: use dma_coerce_mask_and_coherent() DMA-API: net: nxp/lpc_eth: use dma_coerce_mask_and_coherent() ...
2013-10-31sfc: Fix DMA unmapping issue with firmware assisted TSOAlexandre Rames2-2/+8
When using firmware assisted TSO, we use a single DMA mapping for the linear area of a TSO skb. We still have to segment the super-packet and insert a descriptor containing the original headers before each segment of payload, so we can unmap the linear area only after the last segment is completed. The unmapping information for the linear area is therefore associated with the last header descriptor. We calculate the DMA address to unmap from using the map length and the invariant that the end of the DMA mapping matches the end of the data referenced by the last descriptor. But this invariant is broken when there is TCP payload in the linear area. Fix this by adding and using an explicit dma_offset field. Signed-off-by: Ben Hutchings <[email protected]>
2013-10-08Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller5-31/+151
Conflicts: include/linux/netdevice.h net/core/sock.c Trivial merge issues. Removal of "extern" for functions declaration in netdevice.h at the same time "const" was added to an argument. Two parallel line additions in net/core/sock.c Signed-off-by: David S. Miller <[email protected]>
2013-10-07sfc: Only bind to EF10 functions with the LinkCtrl and Trusted flagsBen Hutchings1-1/+17
Although we do not yet enable multiple PFs per port, it is possible that a board will be reconfigured to enable them while the driver has not yet been updated to fully support this. The most obvious problem is that multiple functions may try to set conflicting link settings. But we will also run into trouble if the firmware doesn't consider us fully trusted. So, abort probing unless both the LinkCtrl and Trusted flags are set for this function. Signed-off-by: Ben Hutchings <[email protected]>
2013-10-04sfc: Add PM and RXDP drop counters to ethtool statsEdward Cree2-0/+47
Recognise the new Packet Memory and RX Data Path counters. The following counters are added: rx_pm_{trunc,discard}_bb_overflow - burst buffer overflowed. This should not occur if BB correctly configured. rx_pm_{trunc,discard}_vfifo_full - not enough space in packet memory. May indicate RX performance problems. rx_pm_{trunc,discard}_qbb - dropped by 802.1Qbb early discard mechanism. Since Qbb is not supported at present, this should not occur. rx_pm_discard_mapping - 802.1p priority configured to be dropped. This should not occur in normal operation. rx_dp_q_disabled_packets - packet was to be delivered to a queue but queue is disabled. May indicate misconfiguration by the driver. rx_dp_di_dropped_packets - parser-dispatcher indicated that a packet should be dropped. rx_dp_streaming_packets - packet was sent to the RXDP streaming bus, ie. a filter directed the packet to the MCPU. rx_dp_emerg_{fetch,wait} - RX datapath had to wait for descriptors to be loaded. Indicates performance problems but not drops. These are only provided if the MC firmware has the PM_AND_RXDP_COUNTERS capability. Otherwise, mask them out. Signed-off-by: Ben Hutchings <[email protected]>
2013-10-04sfc: Add definitions for new stats counters and capability flagMatthew Slattery1-2/+54
Signed-off-by: Ben Hutchings <[email protected]>
2013-10-04sfc: Refactor EF10 stat mask code to allow for more conditional statsEdward Cree1-21/+28
Previously, efx_ef10_stat_mask returned a static const unsigned long[], which meant that each possible mask had to be declared statically with STAT_MASK_BITMAP. Since adding a condition would double the size of the decision tree, we now create the bitmask dynamically. To do this, we have two functions efx_ef10_raw_stat_mask, which returns a u64, and efx_ef10_get_stat_mask, which fills in an unsigned long * argument. Signed-off-by: Ben Hutchings <[email protected]>
2013-10-04sfc: Fix internal indices of ethtool stats for EF10Edward Cree1-6/+3
The indices in nic_data->stats need to match the EF10_STAT_whatever enum values. In efx_nic_update_stats, only mask; gaps are removed in efx_ef10_update_stats. Signed-off-by: Ben Hutchings <[email protected]>
2013-10-04sfc: Add rmb() between reading stats and generation count to ensure consistencyJon Cooper1-0/+1
Signed-off-by: Ben Hutchings <[email protected]>
2013-10-01Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-5/+5
Conflicts: drivers/net/ethernet/emulex/benet/be.h drivers/net/usb/qmi_wwan.c drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h include/net/netfilter/nf_conntrack_synproxy.h include/net/secure_seq.h The conflicts are of two varieties: 1) Conflicts with Joe Perches's 'extern' removal from header file function declarations. Usually it's an argument signature change or a function being added/removed. The resolutions are trivial. 2) Some overlapping changes in qmi_wwan.c and be.h, one commit adds a new value, another changes an existing value. That sort of thing. Signed-off-by: David S. Miller <[email protected]>
2013-09-24sfc: Remove extern from function prototypesJoe Perches6-249/+234
There are a mix of function prototypes with and without extern in the kernel sources. Standardize on not using extern for function prototypes. Function prototypes don't need to be written with extern. extern is assumed by the compiler. Its use is as unnecessary as using auto to declare automatic/local variables in a block. Signed-off-by: Joe Perches <[email protected]>
2013-09-21DMA-API: net: sfc/efx.c: replace dma_set_mask()+dma_set_coherent_mask() with ↵Russell King1-11/+1
new helper Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Acked-by: Ben Hutchings <[email protected]> Signed-off-by: Russell King <[email protected]>
2013-09-20sfc: Support ARFS for IPv6 flowsBen Hutchings1-28/+62
Extend efx_filter_rfs() to map TCP/IPv6 and UDP/IPv6 flows into efx_filter_spec. These are only supported on EF10; on Falcon and Siena they will be rejected by efx_farch_filter_from_gen_spec(). Signed-off-by: Ben Hutchings <[email protected]>
2013-09-20sfc: Use TX PIO for sufficiently small packetsJon Cooper4-0/+155
Sufficiently small linear packets can be copied into the PIO buffer with a single call to memcpy_toio(). Non-linear packets require an intermediate cache-line-sized buffer. [bwh: I wrote the first version of this, but Jon did the hard work to handle non-linear packets.] Signed-off-by: Ben Hutchings <[email protected]>
2013-09-20sfc: Introduce inline functions to simplify TX insertionBen Hutchings1-20/+33
Signed-off-by: Ben Hutchings <[email protected]>
2013-09-20sfc: Separate out queue-empty check from efx_nic_may_push_tx_desc()Ben Hutchings1-6/+22
Signed-off-by: Ben Hutchings <[email protected]>
2013-09-20sfc: Allocate and link PIO buffers; map them with write-combiningBen Hutchings6-3/+353
Try to allocate a segment of PIO buffer to each TX channel. If allocation fails, log an error but continue. PIO buffers must be mapped separately from the NIC registers, with write-combining enabled. Where the host page size is 4K, we could potentially map each VI's registers and PIO buffer separately. However, this would add significant complexity, and we also need to support architectures such as POWER which have a greater page size. So make a single contiguous write-combining mapping after the uncacheable mapping, aligned to the host page size, and link PIO buffers there. Where necessary, allocate additional VIs within the write-combining mapping purely for access to PIO buffers. Link all TX buffers to TX queues and the additional VIs in efx_ef10_dimension_resources() and in efx_ef10_init_nic() after an MC reboot. Signed-off-by: Ben Hutchings <[email protected]>
2013-09-20sfc: Implement firmware-assisted TSO for EF10Ben Hutchings1-52/+121
Segmentation remains in the driver, but we generate option descriptors describing the required packet editing rather than making our own copies. Reduce tso_state::ipv4_id to 16 bits, so it doesn't overflow into the TCP_FLAGS field of the option descriptor. Signed-off-by: Ben Hutchings <[email protected]>
2013-09-20sfc: Fold tso_get_head_fragment() into tso_start()Ben Hutchings1-31/+31
Signed-off-by: Ben Hutchings <[email protected]>
2013-09-20sfc: Add EF10 registers to register dumpBen Hutchings1-31/+42
There are very few readable registers, but we may as well report them. Signed-off-by: Ben Hutchings <[email protected]>
2013-09-20sfc: efx_ef10_filter_update_rx_scatter() can be staticFengguang Wu1-1/+1
Signed-off-by: Fengguang Wu <[email protected]> Signed-off-by: Ben Hutchings <[email protected]>
2013-09-20sfc: efx_ethtool_get_ts_info() can be staticFengguang Wu1-2/+2
Signed-off-by: Fengguang Wu <[email protected]> Signed-off-by: Ben Hutchings <[email protected]>
2013-09-20sfc: Increase MCDI status timeout to 250msDaniel Pieczko1-2/+2
The SFC9120 MC firmware often takes longer than 20ms to reboot and update the warm boot count in BIU_MC_SFT_STATUS_REG. A timeout of 250ms is very generous for an MC reboot. Signed-off-by: Ben Hutchings <[email protected]>
2013-09-20sfc: Wait for MC reboot to complete before scheduling driver resetDaniel Pieczko1-3/+3
Scheduling a reset following an MC reboot event before waiting for reboot to complete results in a race that can lead to a state where must_realloc_vis is false in efx_ef10_fini_dmaq() but the VIs have been destroyed during the MC reboot. To avoid MC errors when trying to remove VIs that do not exist, wait for the MC reboot to complete before scheduling the reset. Signed-off-by: Ben Hutchings <[email protected]>
2013-09-16Merge branch 'sfc-3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfcDavid S. Miller4-22/+43
Ben Hutchings says: ==================== Some bug fixes and future-proofing for the recently added SFC9120 support: 1. Minimal support for the 40G configuration. 2. Disable the incomplete PTP/hardware timestamping support. 3. Reset MAC stats properly after a firmware upgrade. 4. Re-check the datapath firmware capabilities after the controller is reset. ==================== Signed-off-by: David S. Miller <[email protected]>
2013-09-11sfc: Reinitialise and re-validate datapath caps after MC rebootBen Hutchings2-0/+13
After an MC reboot, the datapath may be running a different firmware variant and have different capabilities. It is critical that we know the current capabilities so that we can pass valid flags to MC_CMD_INIT_EVQ. Signed-off-by: Ben Hutchings <[email protected]>
2013-09-11sfc: Clean up validation of datapath capabilitiesBen Hutchings1-19/+22
Rename efx_ef10_init_capabilities() to the more specific efx_ef10_init_datapath_caps(). Stop accepting short responses to MC_CMD_GET_CAPABILITIES; we don't need to support pre-production firmware. Move the check for RX prefix support from efx_ef10_probe() into efx_ef10_init_datapath_caps() and use consistent error messages for missing TSO support and missing RX prefix support. Signed-off-by: Ben Hutchings <[email protected]>
2013-09-11sfc: Reset derived rx_bad_bytes statistic when EF10 MC is rebootedBen Hutchings1-0/+5
If the MC reboots then the stats it reports to us will have been reset. We need to reset ours to get efx_update_diff_stat() working properly. (This is a re-run of commit 876be083b669 'sfc: Reset driver's MAC stats after MC reboot seen'.) Signed-off-by: Ben Hutchings <[email protected]>
2013-09-11sfc: Disable PTP on EF10 until we're ready to handle inline RX timestampsBen Hutchings1-2/+0
Unlike Siena where timestamping is provided by a peripheral, EF10 delivers RX timestamps in the packet prefix. However the driver doesn't yet support this. We are also creating a PHC device for each EF10 function, even though the clock is really shared between all of them. Disable hardware PTP/timestamping support until it's complete. Signed-off-by: Ben Hutchings <[email protected]>
2013-09-05sfc: Minimal support for 40G link speedBen Hutchings2-1/+3
Accept and handle 40G link events. Accept ethtool link settings of speed == 40000 && duplex, and set the appropriate MCDI PHY capability. This does not include reporting of 40G media types, as those have not yet been assigned numbers in the MCDI protocol. Signed-off-by: Ben Hutchings <[email protected]>
2013-09-04sfc: check for allocation failureDan Carpenter1-0/+2
It upsets static analyzers when we don't check for allocation failure. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-08-31Merge branch 'for-davem' of ↵David S. Miller39-271/+4404
git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next Ben Hutchings says: ==================== 1. A little more refactoring. 2. Remove the unnecessary use of atomic_t that you pointed out. 3. Add support for starting or queueing firmware requests from atomic context. 4. Add hwmon support for additional sensors found on some new boards. 5. Add support for the EF10 controller architecture, the SFC9100 family and specifically the SFC9120 controller. ==================== Signed-off-by: David S. Miller <[email protected]>
2013-08-29drivers:net: Convert dma_alloc_coherent(...__GFP_ZERO) to dma_zalloc_coherentJoe Perches1-3/+2
__GFP_ZERO is an uncommon flag and perhaps is better not used. static inline dma_zalloc_coherent exists so convert the uses of dma_alloc_coherent with __GFP_ZERO to the more common kernel style with zalloc. Remove memset from the static inline dma_zalloc_coherent and add just one use of __GFP_ZERO instead. Trivially reduces the size of the existing uses of dma_zalloc_coherent. Realign arguments as appropriate. Signed-off-by: Joe Perches <[email protected]> Acked-by: Neil Horman <[email protected]> Acked-by: Jesse Brandeburg <[email protected]> Acked-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-08-29sfc: Update copyright bannersBen Hutchings34-62/+62
Update the dates for files that have been added to in 2012-2013. Drop the 'Solarstorm' brand name that's still lingering here. Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Add support for Solarflare SFC9100 familyBen Hutchings12-22/+3260
This adds support for the EF10 network controller architecture and the SFC9100 family, starting with SFC9120 'Farmingdale', and bumps the driver version to 4.0. New features in the SFC9100 family include: - Flexible allocation of internal resources to PCIe physical and virtual functions under firmware control - RX event merging to reduce DMA writes at high packet rates - Integrated RX timestamping - PIO buffers for lower TX latency - Firmware-driven data path that supports additional offload features and filter types - Delivery of packets between functions and to multiple recipients, allowing firmware to implement a vswitch - Multiple RX flow hash (RSS) contexts with their own hash keys and indirection tables - 40G MAC (single port only) ...not all of which are enabled in this initial driver or the initial firmware release. Much of the new code is by Jon Cooper. Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Make efx_mcdi_{init,fini}() call efx_mcdi_drv_attach()Ben Hutchings3-26/+34
This should be done during MCDI initialisation for any NIC. Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Allocate NVRAM partition ID range for PHY imagesMatthew Slattery1-0/+4
Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Add EF10 register and structure definitionsBen Hutchings2-5/+430
Also update comments and assertions in io.h: - EF10 does not have a general BIU collector and does not have the bug affecting TIMER_COMMAND_REG[0] on Falcon/Siena - The WPTR field moved within RX_DESC_UPD_REG and TX_DESC_UPD_REG. Adjust efx_writed_page() accordingly Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Extend struct efx_tx_buffer to allow pushing option descriptorsBen Hutchings3-2/+11
The TX path firmware for EF10 supports 'option descriptors' to control offloads and various other features. Add a flag and field for these in struct efx_tx_buffer, and don't treat them as DMA descriptors on completion. Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Use a global count of active queues instead of pending drainsAlexandre Rames3-13/+14
On EF10, the firmware will initiate a queue flush in certain error cases. We need to accept that flush events might appear at any time after a queue has been initialised, not just when we try to flush them. We can handle Falcon-architecture in just the same way. Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Prepare for RX scatter on EF10Jon Cooper3-8/+12
RX DMA scatter is always enabled on EF10. Adjust the common RX completion handling to allow for this. RX completion events on EF10 include the length used from a single descriptor, not the cumulative length used. Add a field to struct efx_rx_queue to hold the cumulative length. [bwh: Also fix a related comment] Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Initialise IRQ moderation for all NIC types from efx_init_eventq()Ben Hutchings2-3/+3
Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Allow efx_nic_type::dimension_resources to failBen Hutchings4-6/+12
Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Allow event queue initialisation to failJon Cooper4-28/+95
On EF10, event queue initialisation requires an MCDI request which may return failure. Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Document conditions for multicast replication vs filter replacementBen Hutchings2-7/+49
Add the efx_filter_is_mc_recip() function to decide whether a filter is for a multicast recipient and can coexist with other filters with the same match values. Update efx_filter_insert_filter() kernel-doc to explain the conditions for this. Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Implement asynchronous MCDI requestsBen Hutchings3-30/+291
This will allow use of MCDI from the data path, in particular for accelerated RFS. Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Remove unnecessary use of atomic_tBen Hutchings2-17/+13
We can set, get and compare-and-exchange without using atomic_t. Change efx_mcdi_iface::state to the enum type we really wanted it to be. Suggested-by: David Miller <[email protected]> Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Refactor efx_mcdi_rpc_start() and efx_mcdi_copyin()Ben Hutchings1-19/+30
Preparation for asynchronous MCDI requests. Signed-off-by: Ben Hutchings <[email protected]>
2013-08-29sfc: Add support for new board sensorsBen Hutchings1-30/+91
Add support for power and current sensors, which need to be named differently in sysfs. Power sensors also require values to be scaled between MCDI and sysfs, and have no minimum value. Add definitions of the power, current, fan, and additional temperature and voltage sensors found on SFA6902F, SFN7022F and SFN7122F. (Includes a bug fix from Andrew Jackson.) Signed-off-by: Ben Hutchings <[email protected]>
2013-08-27sfc: Use extended MC_CMD_SENSOR_INFO and MC_CMD_READ_SENSORSBen Hutchings1-44/+95
We need to use extended requests to read and get metadata for sensors numbered > 31. Signed-off-by: Ben Hutchings <[email protected]>