1. 15 Feb, 2013 3 commits
  2. 14 Feb, 2013 3 commits
  3. 13 Feb, 2013 2 commits
    • Pravin B Shelar's avatar
      net: Fix possible wrong checksum generation. · c9af6db4
      Pravin B Shelar authored
      Patch cef401de
      
       (net: fix possible wrong checksum
      generation) fixed wrong checksum calculation but it broke TSO by
      defining new GSO type but not a netdev feature for that type.
      net_gso_ok() would not allow hardware checksum/segmentation
      offload of such packets without the feature.
      
      Following patch fixes TSO and wrong checksum. This patch uses
      same logic that Eric Dumazet used. Patch introduces new flag
      SKBTX_SHARED_FRAG if at least one frag can be modified by
      the user. but SKBTX_SHARED_FRAG flag is kept in skb shared
      info tx_flags rather than gso_type.
      
      tx_flags is better compared to gso_type since we can have skb with
      shared frag without gso packet. It does not link SHARED_FRAG to
      GSO, So there is no need to define netdev feature for this.
      Signed-off-by: default avatarPravin B Shelar <pshelar@nicira.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c9af6db4
    • Andrey Vagin's avatar
      tcp: adding a per-socket timestamp offset · ceaa1fef
      Andrey Vagin authored
      
      
      This functionality is used for restoring tcp sockets. A tcp timestamp
      depends on how long a system has been running, so it's differ for each
      host. The solution is to set a per-socket offset.
      
      A per-socket offset for a TIME_WAIT socket is inherited from a proper
      tcp socket.
      
      tcp_request_sock doesn't have a timestamp offset, because the repair
      mode for them are not implemented.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: James Morris <jmorris@namei.org>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Signed-off-by: default avatarAndrey Vagin <avagin@openvz.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ceaa1fef
  4. 12 Feb, 2013 2 commits
    • Mugunthan V N's avatar
      driver: net: ethernet: cpsw: dual emac interface implementation · d9ba8f9e
      Mugunthan V N authored
      
      
      The CPSW switch can act as Dual EMAC by segregating the switch ports
      using VLAN and port VLAN as per the TRM description in
      14.3.2.10.2 Dual Mac Mode
      
      Following CPSW components will be common for both the interfaces.
      * Interrupt source is common for both eth interfaces
      * Interrupt pacing is common for both interfaces
      * Hardware statistics is common for all the ports
      * CPDMA is common for both eth interface
      * CPTS is common for both the interface and it should not be enabled on
        both the interface as timestamping information doesn't contain port
        information.
      
      Constrains
      * Reserved VID of One port should not be used in other interface which will
        enable switching functionality
      * Same VID must not be used in both the interface which will enable switching
        functionality
      Signed-off-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d9ba8f9e
    • Neil Horman's avatar
      netpoll: Fix __netpoll_rcu_free so that it can hold the rtnl lock · 2cde6acd
      Neil Horman authored
      
      
      __netpoll_rcu_free is used to free netpoll structures when the rtnl_lock is
      already held.  The mechanism is used to asynchronously call __netpoll_cleanup
      outside of the holding of the rtnl_lock, so as to avoid deadlock.
      Unfortunately, __netpoll_cleanup modifies pointers (dev->np), which means the
      rtnl_lock must be held while calling it.  Further, it cannot be held, because
      rcu callbacks may be issued in softirq contexts, which cannot sleep.
      
      Fix this by converting the rcu callback to a work queue that is guaranteed to
      get scheduled in process context, so that we can hold the rtnl properly while
      calling __netpoll_cleanup
      
      Tested successfully by myself.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Cong Wang <amwang@redhat.com>
      CC: Eric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2cde6acd
  5. 11 Feb, 2013 3 commits
  6. 08 Feb, 2013 5 commits
  7. 06 Feb, 2013 5 commits
    • Eric Dumazet's avatar
      macvlan: add multicast filter · cd431e73
      Eric Dumazet authored
      
      
      Setting up IPv6 addresses on configurations with many macvlans
      is not really working, as many multicast messages are dropped.
      
      Add a multicast filter to macvlan to reduce the amount of cloned
      skbs and overhead.
      
      Successfully tested with 1024 macvlans on one ethernet device.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Ben Greear <greearb@candelatech.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cd431e73
    • Cong Wang's avatar
      net: adjust skb_gso_segment() for calling in rx path · 12b0004d
      Cong Wang authored
      
      
      skb_gso_segment() is almost always called in tx path,
      except for openvswitch. It calls this function when
      it receives the packet and tries to queue it to user-space.
      In this special case, the ->ip_summed check inside
      skb_gso_segment() is no longer true, as ->ip_summed value
      has different meanings on rx path.
      
      This patch adjusts skb_gso_segment() so that we can at least
      avoid such warnings on checksum.
      
      Cc: Jesse Gross <jesse@nicira.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarCong Wang <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      12b0004d
    • Flavio Leitner's avatar
      team: allow userspace to take control over carrier · e185483e
      Flavio Leitner authored
      
      
      Some modes don't require any special carrier handling so
      in these cases, the kernel can control the carrier as for
      any other interface.  However, some other modes, e.g. lacp,
      requires more than just that, so userspace needs to control
      the carrier itself.
      
      The daemon today is ready to control it, but the kernel
      still can change it based on events.
      
      This fix so that either kernel or userspace is controlling
      the carrier.
      Signed-off-by: default avatarFlavio Leitner <fbl@redhat.com>
      Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e185483e
    • Mugunthan V N's avatar
      drivers: net:ethernet: cpsw: add support for VLAN · 3b72c2fe
      Mugunthan V N authored
      
      
      adding support for VLAN interface for cpsw.
      
      CPSW VLAN Capability
      * Can filter VLAN packets in Hardware
      Signed-off-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b72c2fe
    • Neil Horman's avatar
      netpoll: protect napi_poll and poll_controller during dev_[open|close] · ca99ca14
      Neil Horman authored
      Ivan Vercera was recently backporting commit
      9c13cb8b
      
       to a RHEL kernel, and I noticed that,
      while this patch protects the tg3 driver from having its ndo_poll_controller
      routine called during device initalization, it does nothing for the driver
      during shutdown. I.e. it would be entirely possible to have the
      ndo_poll_controller method (or subsequently the ndo_poll) routine called for a
      driver in the netpoll path on CPU A while in parallel on CPU B, the ndo_close or
      ndo_open routine could be called.  Given that the two latter routines tend to
      initizlize and free many data structures that the former two rely on, the result
      can easily be data corruption or various other crashes.  Furthermore, it seems
      that this is potentially a problem with all net drivers that support netpoll,
      and so this should ideally be fixed in a common path.
      
      As Ben H Pointed out to me, we can't preform dev_open/dev_close in atomic
      context, so I've come up with this solution.  We can use a mutex to sleep in
      open/close paths and just do a mutex_trylock in the napi poll path and abandon
      the poll attempt if we're locked, as we'll just retry the poll on the next send
      anyway.
      
      I've tested this here by flooding netconsole with messages on a system whos nic
      driver I modfied to periodically return NETDEV_TX_BUSY, so that the netpoll tx
      workqueue would be forced to send frames and poll the device.  While this was
      going on I rapidly ifdown/up'ed the interface and watched for any problems.
      I've not found any.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      CC: Ivan Vecera <ivecera@redhat.com>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Ben Hutchings <bhutchings@solarflare.com>
      CC: Francois Romieu <romieu@fr.zoreil.com>
      CC: Eric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca99ca14
  8. 05 Feb, 2013 3 commits
  9. 01 Feb, 2013 2 commits
  10. 31 Jan, 2013 2 commits
  11. 30 Jan, 2013 4 commits
    • Bjørn Mork's avatar
      net: usbnet: prevent buggy devices from killing us · 70c37bf9
      Bjørn Mork authored
      
      
      A device sending 0 length frames as fast as it can has been
      observed killing the host system due to the resulting memory
      pressure.
      
      Temporarily disable RX skb allocation and URB submission when
      the current error ratio is high, preventing us from trying to
      allocate an infinite number of skbs.  Reenable as soon as we
      are finished processing the done queue, allowing the device
      to continue working after short error bursts.
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Acked-by: default avatarOliver Neukum <oneukum@suse.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      70c37bf9
    • Hauke Mehrtens's avatar
      bcma: add gpio_to_irq · 8f1ca268
      Hauke Mehrtens authored
      
      
      The old bcm47xx gpio code had support for gpio_to_irq, but the new
      code did not provide this function, but returned -ENXIO all the time.
      This patch adds the missing function.
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      8f1ca268
    • Hauke Mehrtens's avatar
      ssb: add gpio_to_irq · a6ca2e10
      Hauke Mehrtens authored
      
      
      The old bcm47xx gpio code had support for gpio_to_irq, but the new
      code did not provide this function, but returned -ENXIO all the time.
      This patch adds the missing function.
      
      arch/mips/bcm47xx/wgt634u.c calls gpio_to_irq() and got the correct irq
      number with the old gpio handling code. With this patch the code in
      wgt634u.c should work again. I do not have a wgt634u to test this.
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      a6ca2e10
    • Matt Fleming's avatar
      efi: Make 'efi_enabled' a function to query EFI facilities · 83e68189
      Matt Fleming authored
      Originally 'efi_enabled' indicated whether a kernel was booted from
      EFI firmware. Over time its semantics have changed, and it now
      indicates whether or not we are booted on an EFI machine with
      bit-native firmware, e.g. 64-bit kernel with 64-bit firmware.
      
      The immediate motivation for this patch is the bug report at,
      
          https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557
      
      which details how running a platform driver on an EFI machine that is
      designed to run under BIOS can cause the machine to become
      bricked. Also, the following report,
      
          https://bugzilla.kernel.org/show_bug.cgi?id=47121
      
      
      
      details how running said driver can also cause Machine Check
      Exceptions. Drivers need a new means of detecting whether they're
      running on an EFI machine, as sadly the expression,
      
          if (!efi_enabled)
      
      hasn't been a sufficient condition for quite some time.
      
      Users actually want to query 'efi_enabled' for different reasons -
      what they really want access to is the list of available EFI
      facilities.
      
      For instance, the x86 reboot code needs to know whether it can invoke
      the ResetSystem() function provided by the EFI runtime services, while
      the ACPI OSL code wants to know whether the EFI config tables were
      mapped successfully. There are also checks in some of the platform
      driver code to simply see if they're running on an EFI machine (which
      would make it a bad idea to do BIOS-y things).
      
      This patch is a prereq for the samsung-laptop fix patch.
      
      Cc: David Airlie <airlied@linux.ie>
      Cc: Corentin Chary <corentincj@iksaif.net>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Dave Jiang <dave.jiang@intel.com>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Peter Jones <pjones@redhat.com>
      Cc: Colin Ian King <colin.king@canonical.com>
      Cc: Steve Langasek <steve.langasek@canonical.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Konrad Rzeszutek Wilk <konrad@kernel.org>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      83e68189
  12. 29 Jan, 2013 1 commit
    • Jiri Pirko's avatar
      ipv4: introduce address lifetime · 5c766d64
      Jiri Pirko authored
      
      
      There are some usecase when lifetime of ipv4 addresses might be helpful.
      For example:
      1) initramfs networkmanager uses a DHCP daemon to learn network
      configuration parameters
      2) initramfs networkmanager addresses, routes and DNS configuration
      3) initramfs networkmanager is requested to stop
      4) initramfs networkmanager stops all daemons including dhclient
      5) there are addresses and routes configured but no daemon running. If
      the system doesn't start networkmanager for some reason, addresses and
      routes will be used forever, which violates RFC 2131.
      
      This patch is essentially a backport of ivp6 address lifetime mechanism
      for ipv4 addresses.
      
      Current "ip" tool supports this without any patch (since it does not
      distinguish between ipv4 and ipv6 addresses in this perspective.
      
      Also, this should be back-compatible with all current netlink users.
      Reported-by: default avatarPavel Šimerda <psimerda@redhat.com>
      Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5c766d64
  13. 28 Jan, 2013 4 commits
    • David J. Choi's avatar
      drivers/net/phy/micrel_phy: Add support for new PHYs · 7ab59dc1
      David J. Choi authored
      
      
      Summary of changes:
      .Newly added phys
      	-KSZ8081/KSZ8091, which has some phy ids.
      	-KSZ8061
      	-KSZ9031, which is Gigabit phy.
      	-KSZ886X, which has a switch function.
      	-KSZ8031, which has a same phy ids with KSZ8021.
      Signed-off-by: default avatarDavid J. Choi <david.choi@micrel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7ab59dc1
    • Cong Wang's avatar
      netpoll: add RCU annotation to npinfo field · 5fbee843
      Cong Wang authored
      
      
      dev->npinfo is protected by RCU.
      
      This fixes the following sparse warnings:
      
      net/core/netpoll.c:177:48: error: incompatible types in comparison expression (different address spaces)
      net/core/netpoll.c:200:35: error: incompatible types in comparison expression (different address spaces)
      net/core/netpoll.c:221:35: error: incompatible types in comparison expression (different address spaces)
      net/core/netpoll.c:327:18: error: incompatible types in comparison expression (different address spaces)
      
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarCong Wang <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5fbee843
    • Oliver Hartkopp's avatar
      can: rework skb reserved data handling · 2bf3440d
      Oliver Hartkopp authored
      
      
      Added accessor and skb_reserve helpers for struct can_skb_priv.
      Removed pointless skb_headroom() check.
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      CC: Marc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2bf3440d
    • Eric Dumazet's avatar
      net: fix possible wrong checksum generation · cef401de
      Eric Dumazet authored
      
      
      Pravin Shelar mentioned that GSO could potentially generate
      wrong TX checksum if skb has fragments that are overwritten
      by the user between the checksum computation and transmit.
      
      He suggested to linearize skbs but this extra copy can be
      avoided for normal tcp skbs cooked by tcp_sendmsg().
      
      This patch introduces a new SKB_GSO_SHARED_FRAG flag, set
      in skb_shinfo(skb)->gso_type if at least one frag can be
      modified by the user.
      
      Typical sources of such possible overwrites are {vm}splice(),
      sendfile(), and macvtap/tun/virtio_net drivers.
      
      Tested:
      
      $ netperf -H 7.7.8.84
      MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
      7.7.8.84 () port 0 AF_INET
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.00    3959.52
      
      $ netperf -H 7.7.8.84 -t TCP_SENDFILE
      TCP SENDFILE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.8.84 ()
      port 0 AF_INET
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.00    3216.80
      
      Performance of the SENDFILE is impacted by the extra allocation and
      copy, and because we use order-0 pages, while the TCP_STREAM uses
      bigger pages.
      Reported-by: default avatarPravin Shelar <pshelar@nicira.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cef401de
  14. 27 Jan, 2013 1 commit
    • Ashish Jangam's avatar
      mfd: da9052/53 lockup fix · 0a8c290a
      Ashish Jangam authored
      
      
      An issue has been reported where the PMIC either locks up or fails to
      respond following a system Reset. This could result in a second write
      in which the bus writes the current content of the write buffer to address
      of the last I2C access.
      
      The failure case is where this unwanted write transfers incorrect data to
      a critical register.
      
      This patch fixes this issue to by following any read or write with a dummy read
      to a safe register address. A safe register address is one where the contents
      will not affect the operation of the system.
      Signed-off-by: default avatarAshish Jangam <ashish.jangam@kpitcummins.com>
      Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
      0a8c290a