summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'listener-sock-const'David S. Miller2015-09-2524-106/+149
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eric Dumazet says: ==================== dccp/tcp: constify listener sock Another patch bomb to prepare lockless TCP/DCCP LISTEN handling. SYNACK retransmits are built and sent without listener socket being locked. Soon, initial SYNACK packets will have same property. This series makes sure we did not something wrong with this model, by adding a const qualifier in all the paths taken from synack building and transmit, for IPv4/IPv6 and TCP/dccp. The only potential problem was the rewrite of ecn bits for connections with DCTCP as congestion module, but this was a very minor one. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * inet: constify inet_rtx_syn_ack() sock argumentEric Dumazet2015-09-252-2/+2
| | | | | | | | | | | | | | | | | | SYNACK packets are sent on behalf on unlocked listeners or fastopen sockets. Mark socket as const to catch future changes that might break the assumption. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp/dccp: constify rtx_synack() and friendsEric Dumazet2015-09-255-5/+5
| | | | | | | | | | | | | | | | This is done to make sure we do not change listener socket while sending SYNACK packets while socket lock is not held. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * dccp: constify dccp_make_response() socket argumentEric Dumazet2015-09-252-7/+12
| | | | | | | | | | | | | | | | | | | | | | Like tcp_make_synack() the only time we might change the socket is when calling sock_wmalloc(), which is using atomic operation to update sk->sk_wmem_alloc Also use MAX_DCCP_HEADER as both IPv4/IPv6 use this value for max_header. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: constify tcp_v{4|6}_send_synack() socket argumentEric Dumazet2015-09-253-3/+3
| | | | | | | | | | | | | | | | This documents fact that listener lock might not be held at the time SYNACK are sent. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * ipv6: constify ip6_xmit() sock argumentEric Dumazet2015-09-253-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | This is to document that socket lock might not be held at this point. skb_set_owner_w() and ipv6_local_error() are using proper atomic ops or spinlocks, so we promote the socket to non const when calling them. netfilter hooks should never assume socket lock is held, we also promote the socket to non const. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: constify tcp_make_synack() socket argumentEric Dumazet2015-09-252-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | listener socket is not locked when tcp_make_synack() is called. We better make sure no field is written. There is one exception : Since SYNACK packets are attached to the listener at this moment (or SYN_RECV child in case of Fast Open), sock_wmalloc() needs to update sk->sk_wmem_alloc, but this is done using atomic operations so this is safe. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: remove tcp_ecn_make_synack() socket argumentEric Dumazet2015-09-252-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SYNACK packets might be sent without holding socket lock. For DCTCP/ECN sake, we should call INET_ECN_xmit() while socket lock is owned, and only when we init/change congestion control. This also fixies a bug if congestion module is changed from dctcp to another one on a listener : we now clear ECN bits properly. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: remove tcp_synack_options() socket argumentEric Dumazet2015-09-251-8/+7
| | | | | | | | | | | | | | We do not use the socket in this function. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * ip: constify ip_build_and_send_pkt() socket argumentEric Dumazet2015-09-252-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | This function is used to build and send SYNACK packets, possibly on behalf of unlocked listener socket. Make sure we did not miss a write by making this socket const. We no longer can use ip_select_ident() and have to either set iph->id to 0 or directly call __ip_select_ident() Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: md5: constify tcp_md5_do_lookup() socket argumentEric Dumazet2015-09-253-10/+10
| | | | | | | | | | | | | | | | | | When TCP new listener is done, these functions will be called without socket lock being held. Make sure they don't change anything. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * inet: constify ip_dont_fragment() argumentsEric Dumazet2015-09-251-3/+5
| | | | | | | | | | | | | | ip_dont_fragment() can accept const socket and dst Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * ipv6: constify inet6_csk_route_req() socket argumentEric Dumazet2015-09-252-2/+2
| | | | | | | | | | | | | | | | socket is not modified, make it const so that callers can do the same if they need. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * ipv6: constify ip6_dst_lookup_{flow|tail}() sock argumentsEric Dumazet2015-09-252-3/+3
| | | | | | | | | | | | | | | | | | | | ip6_dst_lookup_flow() and ip6_dst_lookup_tail() do not touch socket, lets add a const qualifier. This will permit the same change in inet6_csk_route_req() Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * inet: constify inet_csk_route_req() socket argumentEric Dumazet2015-09-252-2/+2
| | | | | | | | | | | | | | | | This is used by TCP listener core, and listener socket shall not be modified by inet_csk_route_req(). Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * inet: constify ip_route_output_flow() socket argumentEric Dumazet2015-09-254-9/+10
| | | | | | | | | | | | | | | | | | | | Very soon, TCP stack might call inet_csk_route_req(), which calls inet_csk_route_req() with an unlocked listener socket, so we need to make sure ip_route_output_flow() is not trying to change any field from its socket argument. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: constify tcp_openreq_init_rwin()Eric Dumazet2015-09-252-11/+20
| | | | | | | | | | | | | | | | | | Soon, listener socket wont be locked when tcp_openreq_init_rwin() is called. We need to read socket fields once, as their value could change under us. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: constify listener socket in tcp_v[46]_init_req()Eric Dumazet2015-09-253-6/+9
|/ | | | | | | | | Soon, listener socket spinlock will no longer be held, add const arguments to tcp_v[46]_init_req() to make clear these functions can not mess socket fields. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: remove unused argument of __netdev_find_adj()Michal Kubeček2015-09-251-8/+7
| | | | | | | | The __netdev_find_adj() helper does not use its first argument, only the device to find and list to walk through. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'l2tp-module-autoloading'David S. Miller2015-09-257-5/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stephen Hemminger says: ==================== l2tp: module autoloading With L2TP it was necessary to manually load modules which is a nuisance and not required with other tunneling protocols. This set of patches adds the aliases and module load hook to get rid of the necessity of modprobing. ==================== Acked-By: James Chapman <jchapman@katalix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * l2tp: remove references to modprobe in documentationstephen hemminger2015-09-251-5/+2
| | | | | | | | | | | | | | | | No longer need explicit modprobe's and update to use ip instead of deprecated ifconfig command. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
| * l2tp: auto load IP modulesstephen hemminger2015-09-252-0/+2
| | | | | | | | | | | | | | | | | | When creating a IP encapsulated tunnel the necessary l2tp module should be loaded. It already works for UDP encapsulation, it just doesn't work for direct IP encap. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
| * l2tp: auto load type modulesstephen hemminger2015-09-254-0/+12
|/ | | | | | | | | | | | It should not be necessary to do explicit module loading when configuring L2TP. Modules should be loaded as needed instead (as is done already with netlink and other tunnel types). This patch adds a new module alias type and code to load the sub module on demand. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: dsa: Set a "dsa" device_typeFlorian Fainelli2015-09-251-0/+5
| | | | | | | | | | Provide a device_type information for slave network devices created by DSA, this is useful for user-space application to easily locate/search for devices of a specific kind. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'switchdev-transaction-item-queue'David S. Miller2015-09-255-227/+296
|\ | | | | | | | | | | | | | | | | | | | | Jiri Pirko says: ==================== switchdev: transaction item queue and cleanup ==================== Acked-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * switchdev: reduce transaction phase enum down to a booleanJiri Pirko2015-09-252-12/+7
| | | | | | | | | | | | | | Now, since we have only 2 values for transaction phase, just use bool. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * dsa: use prepare/commit switchdev transaction helpersJiri Pirko2015-09-251-10/+5
| | | | | | | | | | | | | | The enum is going to disappear, use the helpers instead. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * switchdev: remove "ABORT" transaction phaseJiri Pirko2015-09-252-9/+2
| | | | | | | | | | | | | | | | No longer used by drivers, as transaction queue with item destructors takes care of abort phase internally in switchdev code. So kill it. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * switchdev: remove "NONE" transaction phaseJiri Pirko2015-09-251-1/+0
| | | | | | | | | | | | | | Shouldn't have been there in the first place. Now it is unused, kill it. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * rocker: use switchdev transaction queue for allocated memoryJiri Pirko2015-09-251-46/+7
| | | | | | | | | | | | | | | | Benefit from previously introduced transaction item queue infrastructure and remove rocker specific transaction memory management. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * rocker: push struct switchdev_trans down through rocker codeJiri Pirko2015-09-251-237/+225
| | | | | | | | | | | | | | | | | | | | There will be needed to have switchdev_trans available down in the call chain, so propagate it instead of trans phase enum. This enum will be removed anyway. Also, use prepare/commit phase check helpers to get information about current phase of transaction. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * switchdev: add switchdev_trans_ph_prepare/commit helpersJiri Pirko2015-09-251-0/+10
| | | | | | | | | | | | | | | | Add helpers which should be used int attr_set/obj_add switchdev ops to check the phase of transaction. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * switchdev: move transaction phase enum under transaction structureJiri Pirko2015-09-254-24/+26
| | | | | | | | | | | | | | | | Before it disappears completely, move transaction phase enum under transaction structure and make attr/obj structures a bit cleaner. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * switchdev: introduce transaction item queue for attr_set and obj_addJiri Pirko2015-09-255-20/+146
| | | | | | | | | | | | | | | | | | | | | | Now, the memory allocation in prepare/commit state is done separatelly in each driver (rocker). Introduce the similar mechanism in generic switchdev code, in form of queue. That can be used not only for memory allocations, but also for different items. Abort item destruction is handled as well. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * switchdev: rename "trans" to "trans_ph".Jiri Pirko2015-09-254-204/+204
|/ | | | | | | | This is temporary, name "trans" will be used for something else and "trans_ph" will eventually disappear. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2015-09-2511-278/+855
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2015-09-23 This series contains updates to ixgbe only. Mark provides all the changes in this series, first clears the destination location for I2C data initially so that the received data will not be corrupted by previous attempts. Then reduced the pauses/delays in the PHY detection when no SFP is present by reducing the number of retires, once an SFP is detected, the "normal" number of retries in PHY detection will be used. Added support for X55EM_x SFP+ dual-speed, and fixed 1G and 10G link stability for X550EM_x by configuring the CS4227 correctly by moving code to ixgbe_setup_mac_link_sfp_x550em(). Added functionality to reset CS4227, since on some platforms the CS4227 does not initialize properly. Next reduces the SFP polling rate, due to when an SFP is not present, the I2C timeouts that result are very costly. So prevent the SFP polling from being done more than once every two seconds. Added support for I2C bus MUX. Fixed the setting of RDRXCTL register which should fall through X540 and 82599, not 82598. In addition, added small packet padding support in X550 by setting RDRXCTL.PSP when the driver is in SRIOV mode. Fixed a known hardware issue where the PCI transactions pending bit sticks high when there are pending transactions, so workaround the issue by wait and then continue with our reset flow. Added a new device ID for X550EM device with SFPs. Provided a fix with the DCA setup, which was suggested by Alex Duyck <aduyck@mirantis.com>, by making it so that we always set the relaxed ordering bits related to the DCA registers even if DCA is not enbaled. Then moves the configuration out of the ixgbe_down() and into ixgbe_configure() before enabling the transmit and receive rings. This ensures that DCA is configured correctly before starting the processing of packets. Fixed VM-to-VM loopback mode which requires that FCRTH be set, but the datasheets did not specify what the value should be. It has now been determined that the correct value should be RXPBSIZE - (24*1024). ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * ixgbe: Advance version to 4.2.1Mark Rustad2015-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | With the addition of X550em_x SFP+ support, the driver is now functionally equivalent to what will be the 4.2.1 driver when released, so change the version to match. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: X540 thermal warning interrupt not a GPIMark Rustad2015-09-241-3/+0
| | | | | | | | | | | | | | | | | | The X540 thermal interrupt (IXGBE_EIMS_TS) is not an SDP, so it doesn't need to be enabled in ixgbe_setup_gpie(). In fact the value is simply not for the GPIE register at all. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: Fix FCRTH value in VM-to-VM loopback modeMark Rustad2015-09-242-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | The 82599 and X540 datasheets require that FCRTH be "set" for Tx switching (VM-to-VM loopback) but it did not previously specify what the value should be set to. It has now been determined that the correct value is RXPBSIZE - (24*1024). This setting is also required for later devices. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: Only clear adapter_stopped if ixgbe_setup_fc succeededMark Rustad2015-09-241-3/+3
| | | | | | | | | | | | | | | | A logic error here results in the adapter_stopped flag only being cleared when ixgbe_setup_fc returns an error. Correct the logic. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: Correct several flaws with with DCA setupMark Rustad2015-09-241-14/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change does two things. First, it makes it so that we always set the relaxed ordering bits related to the DCA registers even if DCA is not enabled. Second, it moves the configuration out of the ixgbe_down function and into the ixgbe_configure function before enabling the Rx and Tx rings. This ensures that DCA is configured correctly before starting to process packets. Thanks to Alex Duyck for this fix. CC: Alex Duyck <aduyck@mirantis.com> Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: Add new X550EM SFP+ device IDMark Rustad2015-09-241-0/+1
| | | | | | | | | | | | | | | | Add new device ID for X550EM device with SFPs. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: Update ixgbe_disable_pcie_master flow for X550*Mark Rustad2015-09-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | This patch skips the PCI transactions pending check in ixgbe_disable_pcie_master. This is done to addresses a known HW issue where the PCI transactions pending bit sticks high when there are pending transactions. HW engineering instructed to workaround this issue by wait and then continue with our reset flow. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: Add small packet padding support for X550Mark Rustad2015-09-242-0/+4
| | | | | | | | | | | | | | | | | | This patch sets RDRXCTL.PSP when the driver is in SRIOV mode which enables padding of small packets. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: Correct setting of RDRXCTL register for X550* devicesMark Rustad2015-09-241-2/+2
| | | | | | | | | | | | | | | | | | Setting the X550* RDRXCTL register should fall through into X540 and 82599, not 82598. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: Correct error path in semaphore handlingMark Rustad2015-09-241-0/+5
| | | | | | | | | | | | | | | | The timeout path is supposed to release the semaphore, so do that. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: Add I2C bus mux supportMark Rustad2015-09-243-39/+122
| | | | | | | | | | | | | | | | | | | | | | Take control of an I2C mux that selects which SFP is attached to the I2C bus. The control of the mux is captured in the taking and releasing of the related semaphore. Because only port 1 can control the mux, port 1 always leaves the mux set to select port 0. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: Limit SFP polling rateMark Rustad2015-09-242-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce the frequency of polling for SFP modules. Because the service task sometimes runs at high rates, we can poll for SFPs too often. When an SFP is not present, the I2C timeouts that result are very costly. So, prevent SFP polling from being done more than once every two seconds. To reduce latency, the poll time is cleared in a couple of cases to permit the next service task execution to poll the SFP module. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: Allow SFP+ on more than 82598 and 82599Mark Rustad2015-09-241-1/+1
| | | | | | | | | | | | | | | | | | Since SFP+ can be used with some X550 devices, permit them to be detected. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
| * ixgbe: Add logic to reset CS4227 when neededMark Rustad2015-09-242-1/+293
| | | | | | | | | | | | | | | | | | On some hardware platforms, the CS4227 does not initialize properly. Detect those cases and reset it appropriately. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>