summaryrefslogtreecommitdiffstats
path: root/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
* xilinx: Use time_before_eq()Manuel Schölling2014-05-223-3/+3
| | | | | | | | To be future-proof and for better readability the time comparisons are modified to use time_before_eq() instead of plain, error-prone math. Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* micrel: Use time_before_eq()Manuel Schölling2014-05-221-1/+1
| | | | | | | | To be future-proof and for better readability the time comparisons are modified to use time_before_eq() instead of plain, error-prone math. Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* qlogic: Use time_before()Manuel Schölling2014-05-221-5/+5
| | | | | | | | To be future-proof and for better readability the time comparisons are modified to use time_before() instead of plain, error-prone math. Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* bonding: remove NULL verification from bond_get_bond_by_slave()Veaceslav Falico2014-05-221-2/+0Star
| | | | | | | | | | Every caller relies on the result being the actual bond, so this verification just masks the real problem. CC: Jay Vosburgh <j.vosburgh@gmail.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bonding: populate essential new_slave->bond/dev earlyVeaceslav Falico2014-05-221-2/+2
| | | | | | | | | | | | | | | The new bond_free_slave() needs new_slave->bond to verify if additional structures were allocated, so populate it early so that, in case of failure in bond_enslave(), we would be able to get it. Also populate the new_slave->dev field, as it's too one of the most needed things to assign early. CC: Jay Vosburgh <j.vosburgh@gmail.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@gmail.com> Acked-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: phy: make of_set_phy_supported work with genphy driverSascha Hauer2014-05-221-1/+35
| | | | | | | | | | | | | | | | of_set_phy_supported allows overwiting hardware capabilities of a phy with values from the devicetree. of_set_phy_supported is called right after phy_device_register in the assumption that phy_probe is called from phy_device_register and the features of the phy are already initialized. For the genphy driver this is not true, here phy_probe is called later during phy_connect time. phy_probe will then overwrite all settings done from of_set_phy_supported Fix this by moving of_set_phy_supported to the core phy code and calling it from phy_probe. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: phy: genphy: Allow overwriting featuresSascha Hauer2014-05-221-6/+5Star
| | | | | | | | | | | | | | of_set_phy_supported allows overwiting hardware capabilities of a phy with values from the devicetree. This does not work with the genphy driver though because the genphys config_init function will overwrite all values adjusted by of_set_phy_supported. Fix this by initialising the genphy features in the phy_driver struct and in config_init just limit the features to the ones the hardware can actually support. The resulting features are a subset of the devicetree specified features and the hardware features. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge tag 'linux-can-next-for-3.16-20140521' of ↵David S. Miller2014-05-221-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://gitorious.org/linux-can/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2014-05-19 this is a pull request of a single patch for net-next/master. It fixes a use after free(), which slipped into to gs_usb driver. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * can: gs_usb: gs_destroy_candev(): fix use after freeMarc Kleine-Budde2014-05-211-1/+1
| | | | | | | | | | | | | | This patch fixes a use after free of "dev" in gs_destroy_candev(). Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* | net: davinci_emac: fix oops caused by uninitialized ndev->devSekhar Nori2014-05-221-4/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e194312854edc22a2faf1931b3c0608fe20cb969 (drivers: net: davinci_cpdma: Convert kzalloc() to devm_kzalloc()) triggered a bug in emac_probe() wherein dev member of net_device is used for devres allocations even before it is initialized. This patch fixes that by using the struct device in platform_device instead. While at it, use &pdev->dev consistently for console messages instead of using ndev->dev for just one case and remove an unnecessary line continuation. Reported-by: Kevin Hilman <khilman@linaro.org> Helped-by: George Cherian <george.cherian@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Acked-by: Mugunthan V N <mugunthanvnm@ti.com> Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Tested-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* | ucc_geth: use the new fixed PHY helpersFlorian Fainelli2014-05-221-3/+11
| | | | | | | | | | | | | | | | | | | | | | of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | gianfar: use the new fixed PHY helpersFlorian Fainelli2014-05-221-3/+11
| | | | | | | | | | | | | | | | | | | | | | of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | fs_enet: use the new fixed PHY helpersFlorian Fainelli2014-05-221-7/+10
| | | | | | | | | | | | | | | | | | | | | | of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: systemport: use the new fixed PHY helpersFlorian Fainelli2014-05-222-2/+16
| | | | | | | | | | | | | | | | | | | | | | of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: bcmgenet: use the new fixed PHY helpersFlorian Fainelli2014-05-221-8/+13
| | | | | | | | | | | | | | | | | | | | | | of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | teaming: fix vlan_features computingMichal Kubeček2014-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __team_compute_features() uses netdev_increment_features() to combine vlan_features of slaves into vlan_features of the team. As netdev_increment_features() only adds most features and we start with TEAM_VLAN_FEATURES, we can end up with features none of the slaves provided. Initialize vlan_features only with the flags which are both in TEAM_VLAN_FEATURES and NETIF_F_ALL_FOR_ALL. Right now there is no such feature so that we actually initialize vlan_features with zero but stating it explicitely will make the code more future proof. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
* | bonding: fix vlan_features computingMichal Kubeček2014-05-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bond_compute_features() uses netdev_increment_features() to combine vlan_features of slaves into vlan_features of the bond. As netdev_increment_features() only adds most features and we start with BOND_VLAN_FEATURES, we can end up with features none of the slaves provided. If there is at least one slave, initialize vlan_features only with the flags in NETIF_F_ALL_FOR_ALL. Right now there is none in BOND_VLAN_FEATURES but stating it explicitely will make the code more future proof. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: fec: correct the MDIO clock sourceNimrod Andy2014-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | Since imx serials FEC/ENET MDIO clock source is internal ipg clock, and "ahb" clock is defined as FEC/ENET bus clock, so the patch just correct the fec driver MDIO clock source. Signed-off-by: Fugang Duan <B38611@freescale.com> Acked-by: Frank Li <frank.li@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: fec: optimize the clock management to save powerNimrod Andy2014-05-221-64/+56Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add below clock management to save fec power: - After probe, disable all clocks incluing ipg, ahb, enet_out, ptp clock. - Open ethx interface enable necessary clocks. Close ethx interface disable all clocks. The patch also encapsulates the all enet clocks enable/disable to .fec_enet_clk_enable(), which can reduce the repetitional code in driver. Signed-off-by: Fugang Duan <B38611@freescale.com> Acked-by: Frank Li <Frank.li@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: mv643xx_eth: Implement software TSOEzequiel Garcia2014-05-221-4/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the TSO helper API has been introduced, this commit makes use of it to add support for software TSO in this driver. This feature allows to improve outbound throughput performance significantly. Running iperf tests shows a 30% improvement, tested on a Kirkwood Openblocks A6 board. $ ethtool -K eth0 tso off $ iperf -c 192.168.0.45 -t 3 ------------------------------------------------------------ Client connecting to 192.168.0.45, TCP port 5001 TCP window size: 43.8 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.0.159 port 46389 connected with 192.168.0.45 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0- 3.0 sec 217 MBytes 607 Mbits/sec $ ethtool -K eth0 tso on $ iperf -c 192.168.0.45 -t 3 ------------------------------------------------------------ Client connecting to 192.168.0.45, TCP port 5001 TCP window size: 43.8 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.0.159 port 46390 connected with 192.168.0.45 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0- 3.0 sec 336 MBytes 938 Mbits/sec This commit is just an example of the usage of the TSO API, it works fine but needs some more work. In particular, the descriptor unmapping path must avoid unmapping the TSO headers. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: mv643xx_eth: Use dma_map_single() to map the skb fragmentsEzequiel Garcia2014-05-221-12/+6Star
| | | | | | | | | | | | | | | | | | Using dma_map_single() instead of skb_frag_dma_map() allows to unmap all the descriptors using dma_unmap_single(). This change allows to introduce software TSO in a less intrusive way. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: mv643xx_eth: Factorize feature settingEzequiel Garcia2014-05-221-3/+5
| | | | | | | | | | | | | | | | In order to ease the addition of new features, let's factorize the feature list. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: mv643xx_eth: Avoid setting the initial TCP checksumEzequiel Garcia2014-05-221-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | As specified in the datasheet, the driver can set the "L4Chk_Mode" flag (bit 10) in the Tx descriptor command/status to specify that a frame is not IP fragmented and that the controller is in charge of generating the TCP/IP checksum. This must be used together with the "GL4chk" flag (bit 17). These two flags allow to avoid setting the initial TCP checksum in the l4i_chk field of the Tx descriptor, which is needed to support software TSO. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: mv643xx_eth: Factorize initial checksum and command preparationEzequiel Garcia2014-05-221-48/+65
| | | | | | | | | | | | | | | | Make the code more readable by moving the initial checksum setup and the command/status preparation to its own function. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: mvneta: Implement software TSOEzequiel Garcia2014-05-221-1/+152
| | | | | | | | | | | | | | | | | | | | | | | | Now that the TSO helper API has been introduced, this commit makes use of it to implement the TSO in this driver. Using iperf to test and vmstat to check the CPU usage, shows a substantial CPU usage drop when TSO is on (~15% vs. ~25%). HTTP-based tests performed by Willy Tarreau have shown performance improvements. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: mvneta: Clean mvneta_tx() sk_buff handlingEzequiel Garcia2014-05-221-8/+7Star
| | | | | | | | | | | | | | | | | | | | | | Rework mvneta_tx() so that the code that performs the final handling before a sk_buff is transmitted is done only if the numbers of fragments processed if positive. This is preparation work to add the support for software TSO. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: mvneta: Factorize feature settingEzequiel Garcia2014-05-221-2/+2
| | | | | | | | | | | | | | | | In order to ease the addition of new features, let's factorize the feature list. Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'master' of ↵David S. Miller2014-05-2226-146/+179
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates This series contains updates to i40e and i40evf. Shannon makes minor changes to the AdminQ interface to bring it up to date. Removes the hard coding of stats struct size in ethtool, in prep for adding data fields which are configuration dependent. Catherine removes some unused and unneeded PCI bus defines. Jesse fixes the copyright headers and finishes up the removal of the PTP Tx work functionality which allows us to rely on the Tx timesync interrupt. Mitch provides a number of fixes and cleanups for i40e/i40evf based on suggestions from Ben Hutchings. First is to use a macro parameter for ethtool stats instead of just assuming that a valid netdev variable exists. Second is not to tell ethtool that the VF can do 10GbaseT, when it really has no idea what its link speed is, so set the supported value to 0 instead. Make the ethtool_ops structure constant since it is extremely unlikely to change at runtime. Ethtool consistently reports 0 values for our ITR settings because we never actually use them, so fix this by setting the default values to the specified default values. Greg avoids a compile error by wrapping the call to i40e_alloc_vfs() in CONFIG_PCI_IOV because the function itself is wrapped in the same conditional compile block. Alexander Gordeev updates the driver to use the new pci_enable_msi_range() and pci_enable_msix_range() or pci_enable_msi_exact() and pci_enable_msix_exact(). Jean Sacren provides a fix where the wrong error code was being passed to i40e_open(). ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * | i40e: fix passing wrong error code to i40e_open()Jean Sacren2014-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit 6c167f582ea9 ("i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open()") introduced a new function i40e_vsi_open() with the regression by a typo. Due to the commit, the wrong error code would be passed to i40e_open(). Fix this error in i40e_vsi_open() by turning the macro into a negative value so that i40e_open() could return the pertinent error code correctly. Fixes: 6c167f582ea9 ("i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open()") Signed-off-by: Jean Sacren <sakiwit@gmail.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40evf: Use pci_enable_msix_range() instead of pci_enable_msix()Alexander Gordeev2014-05-211-20/+11Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As result of deprecation of MSI-X/MSI enablement functions pci_enable_msix() and pci_enable_msi_block() all drivers using these two interfaces need to be updated to use the new pci_enable_msi_range() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces. Cc: Jesse Brandeburg <jesse.brandeburg@intel.com> Cc: linux-pci@vger.kernel.org Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40e: Check PCI_IOV config to avoid compile errorGreg Rose2014-05-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The call to i40e_alloc_vfs needs to be wrapped in CONFIG_PCI_IOV because the function itself is wrapped in the same conditional compile block. Change-ID: I663c5f1b85e5cfba0b36da8966f7db1a034f408b Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40e: remove Tx work for ptpJesse Brandeburg2014-05-212-2/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous removal of the PTP Tx work functionality was incomplete as noted by Jake Keller. This removal allows us to rely on the Tx timesync interrupt. CC: Jacob Keller <jacob.e.keller@intel.com> Change-ID: Id4faaf275a3688053ebbf07bef08072f9fd11aa9 Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40e: Don't disable SR-IOV when VFs are assignedMitch Williams2014-05-211-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When VFs are assigned to active VMs and we disable SR-IOV out from under them, bad things happen. Currently, the VM does not crash, but the VFs lose all resources and have no way to get them back. Add an additional check for when the user is disabling through sysfs, and add a comment to clarify why we check twice. Change-ID: Icad78eef516e4e1e4a87874d59132bc3baa058d4 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40e: remove hardcode of stats struct size in ethtoolShannon Nelson2014-05-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Base the queue stats length on the queue stats struct rather than assuming it is 2 fields. This is in prep for adding data fields which are configuration dependent. Change-ID: I937f471f389d2e0f8cec733960c5d9a06b14f3ec Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40e/i40evf: control auto ITR through ethtoolMitch Williams2014-05-212-70/+52Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For all of our supported kernels, ethtool allows us to directly control adaptive ITR instead of just faking it with an ITR value. Support this capability so that user knows explicitly when ITR is being controlled dynamically. Suggested by Ben Hutchings. CC: Ben Hutchings <ben@decadent.org.uk> Change-ID: Iae6b79c5db767a63d22ecd9a9c24acaff02a096e Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40e/i40evf: set proper default for ITR registersMitch Williams2014-05-212-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ethtool consistently reports 0 values for our ITR settings because we never actually set them. Fix this by setting the default values to the specified default values. Change-ID: I2832406a66f7140f2b1230945d6ff6cbf77467c8 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40evf: make ethtool_ops constMitch Williams2014-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Const-ify the ethtool_ops structure, as it is extremely unlikely to change at runtime. Suggested by Ben Hutchings. CC: Ben Hutchings <ben@decadent.org.uk> Change-ID: I1ccb1b7c3ea801cc934447599a35910e7c93d321 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40evf: don't lie to ethtoolMitch Williams2014-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't tell ethtool that the VF can do 10GbaseT, when it really has no idea what its link speed is. Set the supported values to 0 instead. Suggested by Ben Hutchings. CC: Ben Hutchings <ben@decadent.org.uk> Change-ID: Iceb0d8af68fe5d8dc13224366979ba701ba89c39 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40evf: Use macro param for ethtool statsMitch Williams2014-05-211-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a macro parameter for ethtool stats instead of just assuming that a valid netdev variable exists. Suggested by Ben Hutchings. CC: Ben Hutchings <ben@decadent.org.uk> Change-ID: I66681698573c1549f95fdea310149d8a7e96a60f Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40e: add required includeMitch Williams2014-05-212-4/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | On some architectures, this header must be explicitly included. Change-ID: I4bc2eb0531956a7b676489f79d347d55cfe12421 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40evf: Fix the headers and update copyright year.Jesse Brandeburg2014-05-2120-14/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding the appropriate GNU General Public License header and update copyright year to 2014. Change-ID: I769dd2d37d70350afd0c8727ae2859c0fd340361 Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40evf: Remove unused definesCatherine Sullivan2014-05-211-9/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | Remove the defines for PCI bus info that are never used. Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * | i40evf: Update AdminQ interfaceShannon Nelson2014-05-211-14/+8Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Minor changes to the AdminQ interface to bring it up-to-date. Change-ID: Ie31a4cc4911b2d9d3b7f9af2e56fb0ae674f6345 Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Signed-off-by: Kevin Scott <kevin.c.scott@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* | | wimax/i2400m: make return of 0 explicitJulia Lawall2014-05-211-5/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Delete unnecessary local variable whose value is always 0 and that hides the fact that the result is always 0. A simplified version of the semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r exists@ local idexpression ret; expression e; position p; @@ -ret = 0; ... when != ret = e return - ret + 0 ; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | enic: Add support for adaptive interrupt coalescingSujith Sankar2014-05-214-6/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for adaptive interrupt coalescing. For small pkts with low pkt rate, we can decrease the coalescing interrupt dynamically which decreases the latency. This however increases the cpu utilization. Based on testing with different coal intr and pkt rate we came up with a table(mod_table) with rx_rate and coalescing interrupt value where we get low latency without significant increase in cpu. mod_table table stores the coalescing timer percentage value for different throughputs. Function enic_calc_int_moderation() calculates the desired coalescing intr timer value. This function is called in driver rx napi_poll. The actual value is set by enic_set_int_moderation() which is called when napi_poll is complete. i.e when we unmask the rx intr. Adaptive coal intr is support only when driver is using msix intr. Because intr is not shared. Struct mod_range is used to store only the default adaptive coalescing intr value. Adaptive coal intr calue is calculated by timer = range_start + ((rx_coal->range_end - range_start) * mod_table[index].range_percent / 100); rx_coal->range_end is the rx-usecs-high value set using ethtool. range_start is rx-usecs-low, set using ethtool, if rx_small_pkt_bytes_cnt is greater than 2 * rx_large_pkt_bytes_cnt. i.e small pkts are dominant. Else its rx-usecs-low + 3. Cc: Christian Benvenuti <benve@cisco.com> Cc: Neel Patel <neepatel@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | vxge: Use time_before()Manuel Schölling2014-05-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | To be future-proof and for better readability the time comparisons are modified to use time_before() instead of plain, error-prone math. Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | ieee802154: Introduce the use of the managed version of kzallocHimangi Saraogi2014-05-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves data allocated using kzalloc to managed data allocated using devm_kzalloc and cleans now unnecessary kfrees in probe and remove functions. An explicit linux/device.h include is added to make sure the devm_*() routine declarations are unambiguously available. The following Coccinelle semantic patch was used for making the change: @platform@ identifier p, probefn, removefn; @@ struct platform_driver p = { .probe = probefn, .remove = removefn, }; @prb@ identifier platform.probefn, pdev; expression e, e1, e2; @@ probefn(struct platform_device *pdev, ...) { <+... - e = kzalloc(e1, e2) + e = devm_kzalloc(&pdev->dev, e1, e2) ... ?-kfree(e); ...+> } @rem depends on prb@ identifier platform.removefn; expression e; @@ removefn(...) { <... - kfree(e); ...> } Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | net-tun: restructure tun_do_read for better sleep/wakeup efficiencyXi Wang2014-05-211-38/+16Star
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tun_do_read always adds current thread to wait queue, even if a packet is ready to read. This is inefficient because both sleeper and waker want to acquire the wait queue spin lock when packet rate is high. We restructure the read function and use common kernel networking routines to handle receive, sleep and wakeup. With the change available packets are checked first before the reading thread is added to the wait queue. Ran performance tests with the following configuration: - my packet generator -> tap1 -> br0 -> tap0 -> my packet consumer - sender pinned to one core and receiver pinned to another core - sender send small UDP packets (64 bytes total) as fast as it can - sandy bridge cores - throughput are receiver side goodput numbers The results are baseline: 731k pkts/sec, cpu utilization at 1.50 cpus changed: 783k pkts/sec, cpu utilization at 1.53 cpus The performance difference is largely determined by packet rate and inter-cpu communication cost. For example, if the sender and receiver are pinned to different cpu sockets, the results are baseline: 558k pkts/sec, cpu utilization at 1.71 cpus changed: 690k pkts/sec, cpu utilization at 1.67 cpus Co-authored-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Xi Wang <xii@google.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge tag 'linux-can-next-for-3.16-20140519' of ↵David S. Miller2014-05-2112-31/+1982
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://gitorious.org/linux-can/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2014-05-19 this is a pull request of 13 patches for net-next/master. A patch by Dan Carpenter fixes a coccinelle warning in the mcp251x driver. Jean Delvare contributes three patches to tightening the Kconfig dependencies for some drivers. Then come three patches by Pavel Machek that improve the c_can driver support on the socfpga platform. Sergei Shtylyov's patch brings support for the CAN hardware found on Renesas R-Car CAN controllers. Four patches by Oliver Hartkopp, the first cleans up the guard macros in the CAN headers the other three improve the EFF frame filtering. Maximilian Schneider's patch adds support for the GS_USB CAN devices. Signed-off-by: David S. Miller <davem@davemloft.net>
| * | can: gs_usb: Added support for the GS_USB CAN devicesMaximilian Schneider2014-05-193-0/+980
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Geschwister Schneider Family of devices are galvanically isolated USB2.0 to CAN2.0A/B adapters. Currently two form factors are available, a tethered dongle in a rugged enclosure, and mini-pci-e card. Signed-off-by: Maximilian Schneider <max@schneidersoft.net> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>