summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* net/caif/caif_socket.c: remove unnecessary null test before ↵Fabian Frederick2014-07-021-2/+1
| | | | | | | | | | | | | debugfs_remove_recursive based on checkpatch: "debugfs_remove_recursive(NULL) is safe this check is probably not required" Cc: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no> Cc: "David S. Miller" <davem@davemloft.net> Cc: netdev@vger.kernel.org Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c: remove unnecessary null ↵Fabian Frederick2014-07-021-2/+1
| | | | | | | | | | | | test before debugfs_remove_recursive Fix checkpatch warning: "WARNING: debugfs_remove_recursive(NULL) is safe this check is probably not required" Cc: Hariprasad S <hariprasad@chelsio.com> Cc: netdev@vger.kernel.org Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: David S. Miller <davem@davemloft.net>
* inet: move ipv6only in sock_commonEric Dumazet2014-07-018-18/+18
| | | | | | | | | | | | | | | | | When an UDP application switches from AF_INET to AF_INET6 sockets, we have a small performance degradation for IPv4 communications because of extra cache line misses to access ipv6only information. This can also be noticed for TCP listeners, as ipv6_only_sock() is also used from __inet_lookup_listener()->compute_score() This is magnified when SO_REUSEPORT is used. Move ipv6only into struct sock_common so that it is available at no extra cost in lookups. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2014-07-0115-113/+200
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2014-07-01 This series contains updates to i40e, i40evf, igb and ixgbe. Shannon adds the Base Address High and Low to the admin queue structure to simplify the logic in the configuration routines. Also adds code to clear all queues and interrupts to help clean up after a PXE or other early boot activity. Kevin fixes mask assignment value since -1 cannot be used for unsigned integer types. Mitch fixes an issue where in some circumstances the reply from the PF would come back before we were able to properly modify the admin queue pending and required flags. This would mess up the flags and put the driver in an indeterminate state, so fix this by simply setting the flags before sending the request to the admin queue. Also changes the branding string for i40evf to reduce confusion and to match up with our other marketing materials. Kamil adds a new variable defining admin send queue (ASQ) command write back timeout to allow for dynamic modification of this timeout. Anjali fix a bug in the flow director filter replay logic, so that we call a replay after a sideband reset correctly. Jesse adds code to initialize all members of the context descriptor to prevent possible stale data. Christopher fixes i40e to prevent writing to reserved bits, since the queue index is only 0-127. Jacob removes the unneeded header export.h from the i40e PTP code. Fixes ixgbe PTP code where the PPS signal was not correct, as it generates a one half HZ clock signal, it only generates one level change per second. To generate a full clock, we need two level changes per second. Todd provides a fix for igb to bring up link when the PHY has powered up, which was reported by Jeff Westfahl. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * ixgbe: change PTP NSECS_PER_SEC to IXGBE_PTP_PPS_HALF_SECONDJacob Keller2014-07-011-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | The PPS signal is not correct, as it generates a one half HZ clock signal, as it only generates one level change per second. To generate a full clock, we need two level changes per second. Also, change the name of the #define, in order to prevent confusion between it and NSEC_PER_SEC which is not guaranteed to be a 64bit value. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * igb: bring link up when PHY is powered upTodd Fujinaka2014-07-011-0/+2
| | | | | | | | | | | | | | | | | | Call igb_setup_link() when the PHY is powered up. Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com> Reported-by: Jeff Westfahl <jeff.westfahl@ni.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e/i40evf: Bump i40e to 0.4.19 and i40evf to 0.9.38Catherine Sullivan2014-07-012-2/+2
| | | | | | | | | | | | | | | | Bump versions. Change-ID: Id5082d7c3995fbddd22b3e303d804c86fcd240a3 Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40evf: change branding stringMitch Williams2014-07-011-1/+1
| | | | | | | | | | | | | | | | | | Add a slash to the branding string to reduce confusion and match up with our other marketing materials. Change-ID: I8229e8c3e43083b7a29c859a250f8d2d4dc46b9e Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e: remove linux/export.h header from i40e_ptp.cJacob Keller2014-07-011-1/+0
| | | | | | | | | | | | | | | | We don't need the export.h header so we can just go ahead and remove it. Change-ID: I9057396b141ee449d8299409081358b9270a7c4d Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e: limit GLLAN_TXPRE_QDIS to QINDX 0-127Christopher Pau2014-07-011-1/+3
| | | | | | | | | | | | | | | | Prevent writing to reserved bits, queue index is 0-127 Change-ID: Ic923e1c92012a265983414acd8f547c4bdac2e34 Signed-off-by: Christopher Pau <christopher.pau@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e/i40evf: initialize context descriptorJesse Brandeburg2014-07-012-0/+2
| | | | | | | | | | | | | | | | | | Driver needs to initialize all members of context descriptor. Stale data is possible otherwise. Change-ID: Idc6b53af45583509da42d5ec0824cbaf78aee64f Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e: FD filter replay logic bug fixAnjali Singhai Jain2014-07-011-4/+6
| | | | | | | | | | | | | | | | | | | | | | With the auto_disable flags added there was a bug that was causing the replay logic to not work correctly. This patch fixes the issue so that we call a replay after a sideband reset correctly. Change-ID: I005fe1ac361188ee5b19517a83c922038cba1b00 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e/i40evf: add ASQ write back timeout variable to AQ structureKamil Krawczyk2014-06-304-2/+10
| | | | | | | | | | | | | | | | | | | | Add new variable defining ASQ command write back timeout to allow for dynamic modification of this timeout. Initialize it on AQ initialize routine with default value, vary it on device ID. Change-ID: I5c9908f9d7c5455634353b694a986d6f146d1b9d Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40evf: set flags before sending messageMitch Williams2014-06-301-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some circumstances, the firmware could beat us to the punch, and the reply from the PF would come back before we were able to properly modify the aq_pending and aq_required flags. This would mess up the flags and put the driver in an indeterminate state, much like Schrödinger's cat. However, unlike the cat, the driver is definitely dead. To fix this, simply set the flags before sending the request to the AQ. This way, it won't matter if the interrupt comes back too soon. Change-ID: I9784655e475675ebcb3140cc7f36f4a96aaadce5 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e: Correct mask assignment valueKevin Scott2014-06-301-2/+2
| | | | | | | | | | | | | | | | Make mask value of all 1s. Value of -1 can't be used for u32 type. Change-ID: I49d58b77639939fe7447a229dbf1f4a1bf7419ce Signed-off-by: Kevin Scott <kevin.c.scott@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e: clear all queues and interruptsShannon Nelson2014-06-303-0/+95
| | | | | | | | | | | | | | | | | | | | Per a recent HW designer comment, this code is for ripping through the queues and interrupts to fully disable them on driver init, specifically to help clean up after a PXE or other early boot activity. Change-ID: I32ed452021a1c2b06dace1969976f882a37b9741 Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e/i40evf: clear aq bah-bal on shutdownShannon Nelson2014-06-302-0/+8
| | | | | | | | | | | | | | | | | | Clear the AQ BAH and BAL registers on a clean shutdown to help make sure all is tidy when the driver is done. Change-ID: I393e92680247daa52a8e00bab183213672d73578 Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * i40e/i40evf: Add base address registers to aq structShannon Nelson2014-06-304-76/+44
| | | | | | | | | | | | | | | | | | Add the Base Address High and Low to the admin queue struct to simplify another bit of "which context" logic in the config routines. Change-ID: Iae195a7da3baffc1a9d522119e1e2b427068ad07 Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* | bonding: allow to add vlans on top of empty bondJiri Pirko2014-07-011-13/+0
| | | | | | | | | | | | | | | | | | This limitation maybe had some reason in the past, but now there is not one -> removing this. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Veaceslav Falico <vfalico@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'cxgb4-next'David S. Miller2014-07-017-189/+288
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hariprasad Shenai says: ==================== cxgb4: Fix for PCI passthrough and some Misc. fixes This patch series fixes probe failure in VM when PF is exposed through PCI Passthrough. Adds support to use firmware interface to get BAR0 value. Replace the backdoor mechanism to access the HW memory with PCIe Window method which fixes memory I/O. Also adds device ID of few more adapters for cxgb4 and cxgb4vf driver. The patches series is created against 'net-next' tree. And includes patches on cxgb4, cxgb4vf and iw_cxgb4 driver. Since this patch-series contains mainly cxgb4 related changes, we would like to request this patch series to get merged via David Miller's 'net-next' tree. We have included all the maintainers of respective drivers. Kindly review the change and let us know in case of any review comments. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * | cxgb4vf: Adds device ID for few more Chelsio T4 AdaptersHariprasad Shenai2014-07-011-0/+9
| | | | | | | | | | | | | | | Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | cxgb4: Adds device ID for few more Chelsio T4 AdaptersHariprasad Shenai2014-07-011-0/+20
| | | | | | | | | | | | | | | Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | cxgb4: Replaced the backdoor mechanism to access the HW memory with PCIe ↵Hariprasad Shenai2014-07-014-172/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Window method Rip out a bunch of redundant PCI-E Memory Window Read/Write routines, collapse the more general purpose routines into a single routine thereby eliminating the need for a large stack frame (and extra data copying) in the outer routine, change everything to use the improved routine t4_memory_rw. Based on origninal work by Casey Leedom <leedom@chelsio.com> and Steve Wise <swise@opengridcomputing.com> Signed-off-by: Casey Leedom <leedom@chelsio.com> Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | cxgb4: Use FW interface to get BAR0 valueHariprasad Shenai2014-07-014-8/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the firmware interface to get the BAR0 value since we really don't want to use the PCI-E Configuration Space Backdoor access which is owned by the firmware. Set up PCI-E Memory Window registers using the true values programmed into BAR registers. When the PF4 "Master Function" is exported to a Virtual Machine, the values returned by pci_resource_start() will be for the synthetic PCI-E Configuration Space and not the real addresses. But we need to program the PCI-E Memory Window address decoders with the real addresses that we're going to be using in order to have accesses through the Memory Windows work. Based on origninal work by Casey Leedom <leedom@chelsio.com> Signed-off-by: Casey Leedom <leedom@chelsio.com> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | rdma/cxgb4: Fixes cxgb4 probe failure in VM when PF is exposed through PCI ↵Hariprasad Shenai2014-07-013-9/+13
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passthrough Change logic which determines our Physical Function at PCI Probe time. Now we read the PL_WHOAMI register and get the Physical Function. Pass Physical Function to Upper Layer Drivers in lld_info structure in the new field "pf" added to lld_info. This is useful for the cases where the PF, say PF4, is attached to a Virtual Machine via some form of "PCI Pass Through" technology and the PCI Function shows up as PF0 in the VM. Based on original work by Casey Leedom <leedom@chelsio.com> Signed-off-by: Casey Leedom <leedom@chelsio.com> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'dp83640-next'David S. Miller2014-07-012-17/+31
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stefan Sørensen says: ==================== dp83640: Increase support perout pins This patch series increases the number of periodic output pins supported on the dp83640 to 7, and allows for reprogramming the calibration pin. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * | ptp: Allow reassigning calibration pin functionStefan Sørensen2014-07-011-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ptp pin function programming does not allow calibration pin to change function. This is problematic on hardware that uses the default calibration pin for other purposes. Removing this limitation does not impact calibration if userspace does not reprogram the calibration pin. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | dp83640: Get calibration pin with ptp_find_pinStefan Sørensen2014-07-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | For consistency, use the ptp_find_pin function to get the calibration pin, not gpio_tab. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | dp83640: Verify calibration pin assignmentStefan Sørensen2014-07-011-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | This constraints the pin assignment to not allow the calibration function to be reassigned and only allow reassigning the calibratin pin if only one phy is connected. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | dp83640: Increase supported perout pins to 7Stefan Sørensen2014-07-011-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | This patch increases the number of supported periodic output pins from 1 to 7. The last pin is reserved for sync. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | dp83640: Program pulsewidth2 values of perout triggers 0 and 1Stefan Sørensen2014-07-011-0/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Periodic output triggers 0 and 1 of the dp83640 has a programmable duty-cycle which is controlled by the Pulsewidth2 field of the trigger data register. This field is not documented in the datasheet, but it is described in the "PHYTER Software Development Guide" section 3.1.4.1. Failing to set the field can result in unstable/no trigger output. Add programming of the Pulsewidth2 field, setting it to the same value as the Pulsewidth field for a 50% duty cycle. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'bnx2x-next'David S. Miller2014-07-018-90/+424
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Yuval Mintz says: ==================== bnx2x: Enhancement patch series This patch series introduces the ability to propagate link parameters to VFs as well as control the VF link via hypervisor. In addition, it contains 2 small improvements [one IOV-related and the other improves performance on machines with short cache lines]. Please consider applying these patches to `net-next'. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * | bnx2x: Fail probe of VFs using an old incompatible driverYuval Mintz2014-07-012-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are linux distributions where the inbox bnx2x driver contains SRIOV support but doesn't contain the changes introduced in b9871bcf "bnx2x: VF RSS support - PF side". A VF in a VM running that distribution over a new hypervisor will access incorrect addresses when trying to transmit packets, causing an attention in the hypervisor and making that VF inactive until FLRed. The driver in the VM has to ne upgraded [no real way to overcome this], but due to the HW attention currently arising upgrading the driver in the VM would not suffice [since the VF needs also be FLRed if the previous driver was already loaded]. This patch causes the PF to fail the acquire message from a VF running an old problematic driver; The VF will then gracefully fail it's probe preventing the HW attention [and allow clean upgrade of driver in VM]. 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>
| * | bnx2x: enlarge minimal alignemnt of data offsetDmitry Kravkov2014-07-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This improves the performance of driver on machine with L1_CACHE_SHIFT of at most 32 bytes [HW was planned for 64-byte aligned fastpath data]. Signed-off-by: Dmitry Kravkov <Dmitry.Kravkov@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>
| * | bnx2x: VF can report link speedDmitry Kravkov2014-07-018-88/+366
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now VFs were oblvious to the actual configured link parameters. This patch does 2 things: 1. It enables a PF to inform its VF using the bulletin board of the link configured, and allows the VF to present that information. 2. It adds support of `ndo_set_vf_link_state', allowing the hypervisor to set the VF link state. Signed-off-by: Dmitry Kravkov <Dmitry.Kravkov@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>
* | Merge branch 'pktgen'David S. Miller2014-07-012-55/+83
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jesper Dangaard Brouer says: ==================== Optimizing pktgen for single CPU performance This series focus on optimizing "pktgen" for single CPU performance. V2-series: - Removed some patches - Doc real reason for TX ring buffer filling up NIC tuning for pktgen: http://netoptimizer.blogspot.dk/2014/06/pktgen-for-network-overload-testing.html General overload setup according to: http://netoptimizer.blogspot.dk/2014/04/basic-tuning-for-network-overload.html Hardware: System: CPU E5-2630 NIC: Intel ixgbe/82599 chip Testing done with net-next git tree on top of commit 6623b41944 ("Merge branch 'master' of...jkirsher/net-next") Pktgen script exercising race condition: https://github.com/netoptimizer/network-testing/blob/master/pktgen/unit_test01_race_add_rem_device_loop.sh Tool for measuring LOCK overhead: https://github.com/netoptimizer/network-testing/blob/master/src/overhead_cmpxchg.c ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * | pktgen: RCU-ify "if_list" to remove lock in next_to_run()Jesper Dangaard Brouer2014-07-011-49/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The if_lock()/if_unlock() in next_to_run() adds a significant overhead, because its called for every packet in busy loop of pktgen_thread_worker(). (Thomas Graf originally pointed me at this lock problem). Removing these two "LOCK" operations should in theory save us approx 16ns (8ns x 2), as illustrated below we do save 16ns when removing the locks and introducing RCU protection. Performance data with CLONE_SKB==100000, TX-size=512, rx-usecs=30: (single CPU performance, ixgbe 10Gbit/s, E5-2630) * Prev : 5684009 pps --> 175.93ns (1/5684009*10^9) * RCU-fix: 6272204 pps --> 159.43ns (1/6272204*10^9) * Diff : +588195 pps --> -16.50ns To understand this RCU patch, I describe the pktgen thread model below. In pktgen there is several kernel threads, but there is only one CPU running each kernel thread. Communication with the kernel threads are done through some thread control flags. This allow the thread to change data structures at a know synchronization point, see main thread func pktgen_thread_worker(). Userspace changes are communicated through proc-file writes. There are three types of changes, general control changes "pgctrl" (func:pgctrl_write), thread changes "kpktgend_X" (func:pktgen_thread_write), and interface config changes "etcX@N" (func:pktgen_if_write). Userspace "pgctrl" and "thread" changes are synchronized via the mutex pktgen_thread_lock, thus only a single userspace instance can run. The mutex is taken while the packet generator is running, by pgctrl "start". Thus e.g. "add_device" cannot be invoked when pktgen is running/started. All "pgctrl" and all "thread" changes, except thread "add_device", communicate via the thread control flags. The main problem is the exception "add_device", that modifies threads "if_list" directly. Fortunately "add_device" cannot be invoked while pktgen is running. But there exists a race between "rem_device_all" and "add_device" (which normally don't occur, because "rem_device_all" waits 125ms before returning). Background'ing "rem_device_all" and running "add_device" immediately allow the race to occur. The race affects the threads (list of devices) "if_list". The if_lock is used for protecting this "if_list". Other readers are given lock-free access to the list under RCU read sections. Note, interface config changes (via proc) can occur while pktgen is running, which worries me a bit. I'm assuming proc_remove() takes appropriate locks, to assure no writers exists after proc_remove() finish. I've been running a script exercising the race condition (leading me to fix the proc_remove order), without any issues. The script also exercises concurrent proc writes, while the interface config is getting removed. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Reviewed-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | pktgen: avoid expensive set_current_state() call in loopJesper Dangaard Brouer2014-07-011-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid calling set_current_state() inside the busy-loop in pktgen_thread_worker(). In case of pkt_dev->delay, then it is still used/enabled in pktgen_xmit() via the spin() call. The set_current_state(TASK_INTERRUPTIBLE) uses a xchg, which implicit is LOCK prefixed. I've measured the asm LOCK operation to take approx 8ns on this E5-2630 CPU. Performance increase corrolate with this measurement. Performance data with CLONE_SKB==100000, rx-usecs=30: (single CPU performance, ixgbe 10Gbit/s, E5-2630) * Prev: 5454050 pps --> 183.35ns (1/5454050*10^9) * Now: 5684009 pps --> 175.93ns (1/5684009*10^9) * Diff: +229959 pps --> -7.42ns Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | pktgen: document tuning for max NIC performanceJesper Dangaard Brouer2014-07-011-0/+28
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using pktgen I'm seeing the ixgbe driver "push-back", due TX ring running full. Thus, the TX ring is artificially limiting pktgen. (Diagnose via "ethtool -S", look for "tx_restart_queue" or "tx_busy" counters.) Using ixgbe, the real reason behind the TX ring running full, is due to TX ring not being cleaned up fast enough. The ixgbe driver combines TX+RX ring cleanups, and the cleanup interval is affected by the ethtool --coalesce setting of parameter "rx-usecs". Do not increase the default NIC TX ring buffer or default cleanup interval. Instead simply document that pktgen needs special NIC tuning for maximum packet per sec performance. Performance results with pktgen with clone_skb=100000. TX ring size 512 (default), adjusting "rx-usecs": (Single CPU performance, E5-2630, ixgbe) - 3935002 pps - rx-usecs: 1 (irqs: 9346) - 5132350 pps - rx-usecs: 10 (irqs: 99157) - 5375111 pps - rx-usecs: 20 (irqs: 50154) - 5454050 pps - rx-usecs: 30 (irqs: 33872) - 5496320 pps - rx-usecs: 40 (irqs: 26197) - 5502510 pps - rx-usecs: 50 (irqs: 21527) TX ring size adjusting (ethtool -G), "rx-usecs==1" (default): - 3935002 pps - tx-size: 512 - 5354401 pps - tx-size: 768 - 5356847 pps - tx-size: 1024 - 5327595 pps - tx-size: 1536 - 5356779 pps - tx-size: 2048 - 5353438 pps - tx-size: 4096 Notice after commit 6f25cd47d (pktgen: fix xmit test for BQL enabled devices) pktgen uses netif_xmit_frozen_or_drv_stopped() and ignores the BQL "stack" pause (QUEUE_STATE_STACK_XOFF) flag. This allow us to put more pressure on the TX ring buffers. It is the ixgbe_maybe_stop_tx() call that stops the transmits, and pktgen respecting this in the call to netif_xmit_frozen_or_drv_stopped(txq). Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | openvswitch: introduce rtnl ops stubJiri Pirko2014-07-013-1/+26
| | | | | | | | | | | | | | | | This stub now allows userspace to see IFLA_INFO_KIND for ovs master and IFLA_INFO_SLAVE_KIND for slave. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
* | rtnetlink: allow to register ops without ops->setup setJiri Pirko2014-07-012-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | So far, it is assumed that ops->setup is filled up. But there might be case that ops might make sense even without ->setup. In that case, forbid to newlink and dellink. This allows to register simple rtnl link ops containing only ->kind. That allows consistent way of passing device kind (either device-kind or slave-kind) to userspace. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: fix some typos in commentYing Xue2014-07-012-4/+4
| | | | | | | | | | | | | | | | | | | | | | In commit 371121057607e3127e19b3fa094330181b5b031e("net: QDISC_STATE_RUNNING dont need atomic bit ops") the __QDISC_STATE_RUNNING is renamed to __QDISC___STATE_RUNNING, but the old names existing in comment are not replaced with the new name completely. Signed-off-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | ipv6: Allow accepting RA from local IP addresses.Ben Greear2014-07-017-8/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can be used in virtual networking applications, and may have other uses as well. The option is disabled by default. A specific use case is setting up virtual routers, bridges, and hosts on a single OS without the use of network namespaces or virtual machines. With proper use of ip rules, routing tables, veth interface pairs and/or other virtual interfaces, and applications that can bind to interfaces and/or IP addresses, it is possibly to create one or more virtual routers with multiple hosts attached. The host interfaces can act as IPv6 systems, with radvd running on the ports in the virtual routers. With the option provided in this patch enabled, those hosts can now properly obtain IPv6 addresses from the radvd. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | ipv6: Add more debugging around accept-ra logic.Ben Greear2014-07-011-8/+43
|/ | | | | | | | | This is disabled by default, just like similar debug info already in this module. But, makes it easier to find out why RA is not being accepted when debugging strange behaviour. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* tcp: tcp_conn_request: fix build error when IPv6 is disabledOctavian Purdila2014-06-291-1/+3
| | | | | | | | | | | | Fixes build error introduced by commit 1fb6f159fd21c64 (tcp: add tcp_conn_request): net/ipv4/tcp_input.c: In function 'pr_drop_req': net/ipv4/tcp_input.c:5889:130: error: 'struct sock_common' has no member named 'skc_v6_daddr' Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'tcp_conn_request_unification'David S. Miller2014-06-2711-331/+306
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Octavian Purdila says: ==================== tcp: remove code duplication in tcp_v[46]_conn_request This patch series unifies the TCPv4 and TCPv6 connection request flow in a single new function (tcp_conn_request). The first 3 patches are small cleanups and fixes found during the code merge process. The next patches add new methods in tcp_request_sock_ops to abstract the IPv4/IPv6 operations and keep the TCP connection request flow common. To identify potential performance issues this patch has been tested by measuring the connection per second rate with nginx and a httperf like client (to allow for concurrent connection requests - 256 CC were used during testing) using the loopback interface. A dual-core i5 Ivy Bridge processor was used and each process was bounded to a different core to make results consistent. Results for IPv4, unit is connections per second, higher is better, 20 measurements have been collected: before after min 27917 27962 max 28262 28366 avg 28094.1 28212.75 stdev 87.35 97.26 Results for IPv6, unit is connections per second, higher is better, 20 measurements have been collected: before after min 24813 24877 max 25029 25119 avg 24935.5 25017 stdev 64.13 62.93 Changes since v1: * add benchmarking datapoints * fix a few issues in the last patch (IPv6 related) ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: add tcp_conn_requestOctavian Purdila2014-06-274-244/+155
| | | | | | | | | | | | | | | | Create tcp_conn_request and remove most of the code from tcp_v4_conn_request and tcp_v6_conn_request. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: add queue_add_hash to tcp_request_sock_opsOctavian Purdila2014-06-273-2/+6
| | | | | | | | | | | | | | | | Add queue_add_hash member to tcp_request_sock_ops so that we can later unify tcp_v4_conn_request and tcp_v6_conn_request. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: add mss_clamp to tcp_request_sock_opsOctavian Purdila2014-06-273-2/+6
| | | | | | | | | | | | | | | | Add mss_clamp member to tcp_request_sock_ops so that we can later unify tcp_v4_conn_request and tcp_v6_conn_request. Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: unify tcp_v4_rtx_synack and tcp_v6_rtx_synackOctavian Purdila2014-06-274-27/+19
| | | | | | | | | | Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>