summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
Commit message (Collapse)AuthorAgeFilesLines
* cxgb4: Add control net_device for configuring PCIe VFHariprasad Shenai2016-08-151-18/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue: For instance, the current APIs assume a 1-to-1 mapping of Network Ports, Physical Functions and the SR-IOV Virtual Functions of those Physical Functions. This is not the case with our cards where any Virtual Function can be hooked up to any Port -- or any number of Ports the current Linux APIs also assume only 1 Network Interface/Port can be accessed per Virtual Function. Another issue is that these APIs assume that the Administrative Driver is attached to the Physical Function Associated with a Virtual Function. This is not the case with our card where all administration is performed by a Driver which is not attached to any of the Physical Functions which have SR-IOV PCI Capabilities. Another consequence of these assumptions is the inability to utilize all of the cards SR-IOV resources. For instance, our cards have SR-IOV Capabilities on Physical Functions 0..3 and the administrative Driver attaches to Physical Function 4. Each of the Physical Functions 0..3 can support up to 16 Virtual Functions. With the current Linux APIs, a 2-Port card would only be able to use the Virtual Functions on Physical Function 0..1 and not allow the Virtual Functions on Physical Functions 2..3 to be used since there are no Ports 2..3 on a 2-Port card. Fix: Since the control node is always the netdevice for all VF ACL commands. Created a dummy netdevice for each Physical Function from 0 to 3 through which one could control their VFs. The device won't be associated with any port, since it doesn't need to transmit/receive. Its purely used for VF management purpose only. The device will be registered only when VF for a particular PF is configured using PCI sysfs interface and unregistered while pci_disable_sriov() for the PF is called. Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: bfin_mac: Fix a few spelling fixesLABBE Corentin2016-08-141-4/+4
| | | | | | | | | This patch respell some word badly spelled. - Invidate instead of Invalidate - proble instead of probe Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: fix up a few missing hashtable.h conflict resolutionsJiri Kosina2016-08-133-7/+7
| | | | | | | | | | | There are a couple of leftover symbol conflicts caused by hashtable.h being included by netdevice.h; those were not caught as build failure (they're "only" a warning, but in fact real bugs). Fix those up. Fixes: e87a8f24c ("net: resolve symbol conflicts with generic hashtable.h") Reported-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Don't set RX_PACKET_DIS while initializingSunil Goutham2016-08-131-11/+7Star
| | | | | | | | | | Setting BGXX_SPUX_MISC_CONTROL::RX_PACKET_DIS is not needed as packet reception is anyway disabled by BGXX_CMRX_CONFIG::DATA_PKT_RX_EN. Also setting RX_PACKET_DIS causes a bogus remote fault condition which delays link detection. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Use netdev_rss_key_fill() helperSunil Goutham2016-08-131-7/+1Star
| | | | | | | | Use standard API to generate a random RSS hash key on every boot. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Configure tunnelling protocol parsingZyta Szpak2016-08-132-0/+34
| | | | | | | | This patch enables parsing of inner layers for tunnelled packets. Signed-off-by: Zyta Szpak <zr@semihalf.com> Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Use napi_consume_skb for bulk freeSunil Goutham2016-08-131-3/+5
| | | | | | | This patch enables bulk freeing on the Tx side. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Don't set mac address for secondary Qset VFsSunil Goutham2016-08-131-1/+1
| | | | | | | | Set MAC addresses only for primary VF's and don't for secondary VFs. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Reset RXQ HW stats when interface is brought downJerin Jacob2016-08-133-0/+87
| | | | | | | | | | | | When SQ/TXQ is reclaimed i.e reset it's stats also automatically reset by HW. This is not the case with RQ. Also VF doesn't have write access to statistics counter registers. Hence a new Mbox msg is introduced which supports resetting RQ, SQ and full Qset stats. Currently only RQ stats are being reset using this mbox message. Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Improvement for MBX interface debug messagesRadoslaw Biernacki2016-08-132-8/+16
| | | | | | | | | Adding debug messages in case of NACK for a mailbox message, also did small cleanups. Signed-off-by: Radoslaw Biernacki <rad@semihalf.com> Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Use skb_add_rx_frag() for split buffer Rx pktsSunil Goutham2016-08-131-18/+6Star
| | | | | | | | | | | Instead of a round about way of converting buffers to SKBs and combining them into a frag list, use standard skb_add_rx_frag() API to merge page fragments. This code is useful when incoming packets are of size more than RCV_FRAG_LEN which is currently set to 2048bytes. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Use netdev's name for naming VF's interruptsSunil Goutham2016-08-131-8/+12
| | | | | | | | | | This patch changes the way VF's irqs are visible in /proc/interrupts. Instead of VF id, logical interface's netdev name is used for IRQ naming and also all secondary VF's interrupts in multiqset config use primary VF's netdev name. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Support for 83xx mixed QLM/DLM configSunil Goutham2016-08-132-21/+26
| | | | | | | | | | | | 83xx has 4 BGX blocks and are enabled mixed QLM/DLM configs. BGX0/BGX1 are from QLM2/QLM3, BGX3 is DLM4 and BGX2 is split across DLM5 & DLM6. This patch adds support for BGX2's split config and also enables all 4 BGXs to be used. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Add support for 16 LMACs of 83xxSunil Goutham2016-08-132-17/+60
| | | | | | | | | | | | | 83xx will have 4 BGX blocks i.e 16 LMACs, to avoid changing the same with every platform, nicpf struct elements which track LMAC related info are now allocated runtime based on platform's max possible BGX count. Also fixed configuring min packet size for all LMAC's supported on a platform. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Add RGMII interface type supportSunil Goutham2016-08-136-33/+332
| | | | | | | | | | | | This patch adds RGX/RGMII interface type support to BGX driver. This type of interface is supported by 81xx SOC. CN81XX VNIC has 8 VFs and max possible LMAC interfaces are 9, hence RGMII interface will not work if all DLMs are in BGX mode and all 8 LMACs are enabled Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Add QSGMII interface type supportSunil Goutham2016-08-132-12/+54
| | | | | | | | | This patch adds support for QSGMII interface type to the BGX driver. This type of interface is supported by 81xx SOC. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Add 81xx support to BGX driverSunil Goutham2016-08-132-10/+113
| | | | | | | | | This patch adds support for BGX module on 81xx where a BGX can be split and have different LMACs configured in different modes. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Support for different LMAC types within BGXSunil Goutham2016-08-132-136/+98Star
| | | | | | | | | | | | | | | On 88xx all LMACs in a BGX will be in same mode but on 81xx BGX can be split as two and there can be LMACs configured in different modes. These changes move lmac_type, lane2serdes fields into per lmac struct from BGX struct. Got rid of qlm_mode field which has become redundant with these changes. And now no of valid LMACs is read from CSRs configured by low level firmware and figuring out the same based on QLM mode is discarded Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Enable mailbox interrupts on 81xx/83xxSunil Goutham2016-08-131-38/+50
| | | | | | | | | | 88xx has 128 VFs, 81xx has 8 VFs and 83xx will have 32VFs. Made changes to PF driver such that mailbox interrupt enable registers are configuired based on number of VFs HW supports. Also cleanedup mailbox irq handler registration code. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Enable CQE_RX desc's extension fieldsSunil Goutham2016-08-134-2/+27
| | | | | | | | | | | | Unlike 88xx, CQE_RX descriptor's tunnelling extension i.e CQE_RX2_S is always enabled on 81xx/83xx and HW does insert these fields into CQE_RX. As a result receive buffer addresses will now be present at 7th word of CQE_RX instead of 6th. Enable CQE_RX2_S on 88xx pass 2.x as well. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Set queue count based on number of CPUsSunil Goutham2016-08-134-12/+14
| | | | | | | | | | | 81xx has only 4 CPUs, so it doesn't make sense to initialize entire Qset i.e 8 queues by default. Made changes to queue initialization to init queues equal to number of CPUs or 8 queues whichever is lesser. Also this will be applicable to VMs with VNIC VF attached and having less VCPUs Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Add support for 81xx and 83xx chipsSunil Goutham2016-08-133-17/+73
| | | | | | | | This patch adds info on HW maximums of 81xx/83xx and also configures receive and transmit datapaths accordingly. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Add VNIC's PCI devid on future chipsSunil Goutham2016-08-132-3/+21
| | | | | | | | | This patch adds PCI device IDs of VNIC on newer chips and also registers VF driver with them. Device id remains same for all versions of chips but subsystem device id changes. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: thunderx: Moved HW capability info from macros to structureSunil Goutham2016-08-132-52/+85
| | | | | | | | | | Current driver has most of the HW maximums info like no of channels, traffic limiters, RSS indices e.t.c in the form of macros. These have been moved into a 'hw_info' structure so that support for VNIC on newer chips with different set of HW maximums can be added. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers: net: xgene: Fix backward compatibilityIyappan Subramanian2016-08-131-9/+9
| | | | | | | | This patch fixes the backward compatibility on handling phy_connect(), by iterating over the phy-handle, when new DT is used with older kernel. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers: net: xgene: Poll link status via GPIOIyappan Subramanian2016-08-134-0/+23
| | | | | | | | | | | | | When 10GbE SFP+ module is not plugged in or cable is not connected, the link status register does not report the proper state due to floating signal. This patch checks the module present status via an GPIO to determine whether to ignore the link status register and report link down. Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Tested-by: Fushen Chen <fchen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers: net: xgene: XFI PCS reset when link is downIyappan Subramanian2016-08-135-0/+54
| | | | | | | | | This patch fixes the link recovery issue, by doing PCS reset when the link is down. Signed-off-by: Fushen Chen <fchen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers: net: xgene: Change port init sequenceIyappan Subramanian2016-08-131-3/+2Star
| | | | | | | | | | This patch rearranges the port initialization sequence as recommended by hardware specification. This patch also removes, mac_init() call from xgene_enet_link_state(), as it was not required. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Tested-by: Fushen Chen <fchen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers: net: xgene: Fix RSS indirection table fieldsIyappan Subramanian2016-08-132-8/+19
| | | | | | | | | This patch fixes FPSel and NxtFPSel fields length to 5-bit value. Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Tested-by: Fushen Chen <fchen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers: net: xgene: Fix error deconstruction pathIyappan Subramanian2016-08-131-8/+19
| | | | | | | | | Since register_netdev() call in xgene_enet_probe() was moved down to the end, it doesn't properly handle errors that may occur, by deconstructing everything that was setup before the error occurred. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers: net: xgene: fix: Delete descriptor rings and buffer poolsIyappan Subramanian2016-08-131-5/+7
| | | | | | | | xgene_enet_init_hw() should delete any descriptor rings and buffer pools setup should le_ops->cle_init() return an error. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers: net: xgene: fix: Add dma_unmap_singleIyappan Subramanian2016-08-131-2/+12
| | | | | | | | In addition to xgene_enet_delete_bufpool() freeing skbs, their associated dma memory should also be unmapped. Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers: net: xgene: Fix compiler warningsIyappan Subramanian2016-08-131-4/+0Star
| | | | | | | | | | | | | | | | Fixed compiler warnings reported with -Wmaybe-uninitialized W=1, /drivers/net/ethernet/apm/xgene/xgene_enet_main.c: In function ‘xgene_enet_rx_frame’: ../drivers/net/ethernet/apm/xgene/xgene_enet_main.c:455:27: warning: variable ‘pdata’ set but not used [-Wunused-but-set-variable] struct xgene_enet_pdata *pdata; ^ ../drivers/net/ethernet/apm/xgene/xgene_enet_main.c: In function ‘xgene_enet_remove’: ../drivers/net/ethernet/apm/xgene/xgene_enet_main.c:1691:30: warning: variable ‘mac_ops’ set but not used [-Wunused-but-set-variable] const struct xgene_mac_ops *mac_ops; ^ Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: get timer configuration from adapterBert Kenward2016-08-135-33/+125
| | | | | | | | | On SFN8000 series adapters the MC provides a method to get the timer quantum and the maximum timer setting. We revert to the old values if the new call is unavailable. Signed-off-by: Bert Kenward <bkenward@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: set interrupt moderation via MCDIBert Kenward2016-08-139-62/+103
| | | | | | | | | | | SFN8000-series NICs require a new method of setting interrupt moderation, via MCDI. This is indicated by a workaround flag. This new MCDI command takes an explicit time value rather than a number of ticks. It therefore makes sense to also store the moderation values in terms of time, since that is what the ethtool interface is interested in. Signed-off-by: Bert Kenward <bkenward@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: use new performance based event queue initBert Kenward2016-08-131-12/+31
| | | | | | | | | Rather than explicitly specifying flags we can now specify a desired performance target to the firmware, ie higher throughput or lower latency. For now we use the default "auto" configuration. Signed-off-by: Bert Kenward <bkenward@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: retrieve second word of datapath capabilitiesBert Kenward2016-08-132-2/+11
| | | | | Signed-off-by: Bert Kenward <bkenward@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: allow asynchronous MCDI without completion functionBert Kenward2016-08-131-1/+4
| | | | | Signed-off-by: Bert Kenward <bkenward@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sfc: update MCDI protocol headersBert Kenward2016-08-131-15/+515
| | | | | Signed-off-by: Bert Kenward <bkenward@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: mediatek: enhance the locking using the lightweight onesSean Wang2016-08-131-11/+8Star
| | | | | | | | | | Since these critical sections protected by page_lock are all entered from the user context or bottom half context, they can be replaced with the spin_lock() or spin_lock_bh instead of spin_lock_irqsave(). Signed-off-by: Sean Wang <sean.wang@mediatek.com> Acked-by: John Crispin <john@phrozen.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)Netanel Belgazal2016-08-1317-0/+10542
| | | | | | | This is a driver for the ENA family of networking devices. Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: renesas: sh_eth: use new api ethtool_{get|set}_link_ksettingsPhilippe Reynes2016-08-111-9/+9
| | | | | | | | | The ethtool api {get|set}_settings is deprecated. We move this driver to new api {get|set}_link_ksettings. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Tested-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: renesas: sh_eth: use phydev from struct net_devicePhilippe Reynes2016-08-112-18/+12Star
| | | | | | | | | | | The private structure contain a pointer to phydev, but the structure net_device already contain such pointer. So we can remove the pointer phy_dev in the private structure, and update the driver to use the one contained in struct net_device. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Tested-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: macb: Add 64 bit addressing support for GEMHarini Katakam2016-08-112-11/+61
| | | | | | | | | | | | | | | This patch adds support for 64 bit addressing and BDs. -> Enable 64 bit addressing in DMACFG register. -> Set DMA mask when design config register shows support for 64 bit addr. -> Add new BD words for higher address when 64 bit DMA support is present. -> Add and update TBQPH and RBQPH for MSB of BD pointers. -> Change extraction and updation of buffer addresses to use 64 bit address. -> In gem_rx extract address in one place insted of two and use a separate flag for RXUSED. Signed-off-by: Harini Katakam <harinik@xilinx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* qed*: Add support for ethtool link_ksettings callbacks.Sudarsana Reddy Kalluru2016-08-114-84/+165
| | | | | | | | | | | | | This patch adds the driver implementation for ethtool link_ksettings callbacks. qed driver now defines/uses the qed specific masks for representing link capability values. qede driver maps these values to to new link modes defined by the kernel implementation of link_ksettings. Please consider applying this to 'net-next' branch. Signed-off-by: Sudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: ti: cpsw: move ale, cpts and drivers params under cpsw_commonIvan Khoronzhuk2016-08-111-129/+106Star
| | | | | | | | | | The ale, cpts, version, rx_packet_max, bus_freq, interrupt pacing parameters are common per net device that uses the same h/w. So, move them to common driver structure. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: ti: cpsw: move napi struct to cpsw_commonIvan Khoronzhuk2016-08-111-30/+22Star
| | | | | | | | | | The napi structs are common for both net devices in dual_emac mode, In order to not hold duplicate links to them, move to cpsw_common. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: ti: cpsw: move platform data and slaves info to cpsw_commonIvan Khoronzhuk2016-08-111-128/+137
| | | | | | | | | These data are common for net devs in dual_emac mode. No need to hold it for every priv instance, so move them under cpsw_common. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net; ethernet: ti: cpsw: move irq stuff under cpsw_commonIvan Khoronzhuk2016-08-111-36/+29Star
| | | | | | | | | | | | The irq data are common for net devs in dual_emac mode. So no need to hold these data in every priv struct, move them under cpsw_common. Also delete irq_num var, as after optimization it's not needed. Correct number of irqs to 2, as anyway, driver is using only 2, at least for now. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: ethernet: ti: cpsw: move cpdma resources to cpsw_commonIvan Khoronzhuk2016-08-111-49/+48Star
| | | | | | | | | | Every net device private struct holds links to shared cpdma resources. No need to save and every time synchronize these resources per net dev. So, move it to common driver struct. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>