1. 02 Sep, 2014 8 commits
    • Giuseppe CAVALLARO's avatar
      stmmac: fix the rx csum feature · d2afb5bd
      Giuseppe CAVALLARO authored
      For new GMACs it is possible to turn-on/off the COE.
      In the current driver, when disabled the Rx-checksum
      via ethtool, the tool reported that csum was disabled
      but the HW continued to set the IPC. Indeed this is
      because the fix_features allows this. So the patch
      fixes this problem by adding the set_features.
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d2afb5bd
    • David S. Miller's avatar
      Merge branch 'amd-xgbe-net' · 8a3cf39b
      David S. Miller authored
      Tom Lendacky says:
      
      ====================
      amd-xgbe: AMD XGBE driver fixes 2014-08-29
      
      The following series of patches includes fixes to the driver.
      
      - Tx hardware queue flushing support dependent on hardware version
      - Incorrect reported fifo size
      - Proper mmd select in XPCS debugfs support
      - Proper queue count for configuring Tx flow control
      
      This patch series is based on net.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8a3cf39b
    • Lendacky, Thomas's avatar
      amd-xgbe: Use the Tx queue count for Tx flow control support · 9fc69aff
      Lendacky, Thomas authored
      When configuring Tx flow control the Rx queue count was used instead of
      the Tx queue count for looping through the Tx hardware queues. Fix the
      code to use the Tx queue count.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9fc69aff
    • Lendacky, Thomas's avatar
      amd-xgbe: Fix the xpcs mmd debugfs support · 625c8e4a
      Lendacky, Thomas authored
      The debugfs support for the xpcs registers did not properly use the
      specified mmd (xpcs_mmd entry) which resulted in the default mmd
      value always being used.  Update the debugfs support to generate the
      proper mmd register value.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      625c8e4a
    • Lendacky, Thomas's avatar
      amd-xgbe: Reported fifo size from hardware is not correct · f076f453
      Lendacky, Thomas authored
      The fifo size reported by the hardware is not correct. Add support
      to limit the reported size to what is actually present.  Also, fix
      the argument types used in the fifo size calculation function.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f076f453
    • Lendacky, Thomas's avatar
      amd-xgbe: Check for Tx hardware queue flushing support · a9a4a2d9
      Lendacky, Thomas authored
      The flushing of the Tx hardware queues is only supported at a certain
      level of the hardware.  Retrieve the current version of the hardware
      and use that to determine if flushing is supported.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a9a4a2d9
    • Geert Uytterhoeven's avatar
      drivers: net: NET_XGENE should depend on HAS_DMA · e148e1bf
      Geert Uytterhoeven authored
      If NO_DMA=y:
      
      drivers/built-in.o: In function `xgene_enet_delete_ring':
      xgene_enet_main.c:(.text+0x28755a): undefined reference to `dma_free_coherent'
      drivers/built-in.o: In function `xgene_enet_setup_tx_desc':
      xgene_enet_main.c:(.text+0x287774): undefined reference to `dma_map_single'
      xgene_enet_main.c:(.text+0x287780): undefined reference to `dma_mapping_error'
      drivers/built-in.o: In function `xgene_enet_tx_completion':
      xgene_enet_main.c:(.text+0x2878e6): undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `xgene_enet_refill_bufpool':
      xgene_enet_main.c:(.text+0x2879d4): undefined reference to `dma_map_single'
      xgene_enet_main.c:(.text+0x2879e0): undefined reference to `dma_mapping_error'
      drivers/built-in.o: In function `xgene_enet_rx_frame':
      xgene_enet_main.c:(.text+0x287aaa): undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `xgene_enet_free_desc_ring':
      xgene_enet_main.c:(.text+0x287f98): undefined reference to `dma_free_coherent'
      drivers/built-in.o: In function `xgene_enet_create_desc_ring':
      xgene_enet_main.c:(.text+0x28808e): undefined reference to `dma_alloc_coherent'
      drivers/built-in.o: In function `xgene_enet_probe':
      xgene_enet_main.c:(.text+0x2883d4): undefined reference to `dma_set_mask'
      xgene_enet_main.c:(.text+0x2883ec): undefined reference to `dma_supported'
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e148e1bf
    • David S. Miller's avatar
      Merge tag 'master-2014-08-25' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless · 377655fe
      David S. Miller authored
      John W. Linville says:
      
      ====================
      pull request: wireless 2014-08-28
      
      Please pull this batch of fixes intended for the 3.17 stream.
      
      For the Bluetooth/6LowPAN/802.15.4 bits, Johan says:
      
      'It contains a connection reference counting fix for LE where a
      connection might stay up even though it should get disconnected.
      
      The other 802.15.4 6LoWPAN related patches were sent to the bluetooth
      tree by Alexander Aring and described as follows by him:
      
      "
      these patches contains patches for the bluetooth branch.
      
      This series includes memory leak fixes and an errno value fix.
      Also there are two patches for sending and receiving 1280 6LoWPAN
      packets, which makes the IEEE 802.15.4 6LoWPAN stack more RFC
      compliant.
      "'
      
      Along with that...
      
      Alexey Khoroshilov fixes a use-after-free bug on at76c50x-usb.
      
      Hauke Mehrtens adds a PCI ID to bcma.
      
      Himangi Saraogi fixes a silly "A || A" test in rtlwifi.
      
      Larry Finger adds a device ID to rtl8192cu.
      
      Maks Naumov fixes a strncmp argument in ath9k.
      
      Álvaro Fernández Rojas adds a PCI ID to ssb.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      377655fe
  2. 01 Sep, 2014 5 commits
  3. 30 Aug, 2014 9 commits
    • Daniel Borkmann's avatar
      net: sctp: fix ABI mismatch through sctp_assoc_to_state helper · 38ab1fa9
      Daniel Borkmann authored
      Since SCTP day 1, that is, 19b55a2af145 ("Initial commit") from lksctp
      tree, the official <netinet/sctp.h> header carries a copy of enum
      sctp_sstat_state that looks like (compared to the current in-kernel
      enumeration):
      
        User definition:                     Kernel definition:
      
        enum sctp_sstat_state {              typedef enum {
          SCTP_EMPTY             = 0,          <removed>
          SCTP_CLOSED            = 1,          SCTP_STATE_CLOSED            = 0,
          SCTP_COOKIE_WAIT       = 2,          SCTP_STATE_COOKIE_WAIT       = 1,
          SCTP_COOKIE_ECHOED     = 3,          SCTP_STATE_COOKIE_ECHOED     = 2,
          SCTP_ESTABLISHED       = 4,          SCTP_STATE_ESTABLISHED       = 3,
          SCTP_SHUTDOWN_PENDING  = 5,          SCTP_STATE_SHUTDOWN_PENDING  = 4,
          SCTP_SHUTDOWN_SENT     = 6,          SCTP_STATE_SHUTDOWN_SENT     = 5,
          SCTP_SHUTDOWN_RECEIVED = 7,          SCTP_STATE_SHUTDOWN_RECEIVED = 6,
          SCTP_SHUTDOWN_ACK_SENT = 8,          SCTP_STATE_SHUTDOWN_ACK_SENT = 7,
        };                                   } sctp_state_t;
      
      This header was later on also placed into the uapi, so that user space
      programs can compile without having <netinet/sctp.h>, but the shipped
      with <linux/sctp.h> instead.
      
      While RFC6458 under 8.2.1.Association Status (SCTP_STATUS) says that
      sstat_state can range from SCTP_CLOSED to SCTP_SHUTDOWN_ACK_SENT, we
      nevertheless have a what it appears to be dummy SCTP_EMPTY state from
      the very early days.
      
      While it seems to do just nothing, commit 0b8f9e25 ("sctp: remove
      completely unsed EMPTY state") did the right thing and removed this dead
      code. That however, causes an off-by-one when the user asks the SCTP
      stack via SCTP_STATUS API and checks for the current socket state thus
      yielding possibly undefined behaviour in applications as they expect
      the kernel to tell the right thing.
      
      The enumeration had to be changed however as based on the current socket
      state, we access a function pointer lookup-table through this. Therefore,
      I think the best way to deal with this is just to add a helper function
      sctp_assoc_to_state() to encapsulate the off-by-one quirk.
      Reported-by: default avatarTristan Su <sooqing@gmail.com>
      Fixes: 0b8f9e25 ("sctp: remove completely unsed EMPTY state")
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      38ab1fa9
    • Eric Dumazet's avatar
      net: attempt a single high order allocation · d9b2938a
      Eric Dumazet authored
      In commit ed98df33 ("net: use __GFP_NORETRY for high order
      allocations") we tried to address one issue caused by order-3
      allocations.
      
      We still observe high latencies and system overhead in situations where
      compaction is not successful.
      
      Instead of trying order-3, order-2, and order-1, do a single order-3
      best effort and immediately fallback to plain order-0.
      
      This mimics slub strategy to fallback to slab min order if the high
      order allocation used for performance failed.
      
      Order-3 allocations give a performance boost only if they can be done
      without recurring and expensive memory scan.
      
      Quoting David :
      
      The page allocator relies on synchronous (sync light) memory compaction
      after direct reclaim for allocations that don't retry and deferred
      compaction doesn't work with this strategy because the allocation order
      is always decreasing from the previous failed attempt.
      
      This means sync light compaction will always be encountered if memory
      cannot be defragmented or reclaimed several times during the
      skb_page_frag_refill() iteration.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d9b2938a
    • David S. Miller's avatar
      Merge branch 'mlx4-net' · bcc73547
      David S. Miller authored
      Or Gerlitz says:
      
      ====================
      Setup mlx4 user space Ethernet QPs to properly handle VXLAN
      
      This short series fixes the mlx4 driver setting of user space Ethernet QPs
      (e.g those opened by DPDK applications) such that they will properly handle
      VXLAN traffic/offloads
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bcc73547
    • Or Gerlitz's avatar
      mlx4: Set user-space raw Ethernet QPs to properly handle VXLAN traffic · d2fce8a9
      Or Gerlitz authored
      Raw Ethernet QPs opened from user-space lack the proper setup to
      recieve/handle VXLAN traffic when VXLAN offloads are enabled.
      
      Fix that by adding a tunnel steering rule on top of the normal unicast
      steering rule and set the tunnel_type field in the QP context.
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d2fce8a9
    • Or Gerlitz's avatar
      net/mlx4: Move the tunnel steering helper function to mlx4_core · b95089d0
      Or Gerlitz authored
      Move the function which we use to set VXLAN DMFS (flow-steering) rules
      from mlx4_en to mlx4_core. This refactoring will allow the mlx4_ib driver
      to call the helper for the use case of user-space RAW Ethernet QPs, such
      that they can serve VXLAN traffic too.
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b95089d0
    • Giuseppe CAVALLARO's avatar
      stmmac: fix dma api misuse · 362b37be
      Giuseppe CAVALLARO authored
      Enabling DMA_API_DEBUG, warnings are reported at runtime
      because the device driver frees DMA memory with wrong functions
      and it does not call dma_mapping_error after mapping dma memory.
      
      The first problem is fixed by of introducing a flag that helps us
      keeping track which mapping technique was used, so that we can use
      the right API for unmap.
      This approach was inspired by the e1000 driver, which uses a similar
      technique.
      Signed-off-by: default avatarAndre Draszik <andre.draszik@st.com>
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Reviewed-by: default avatarDenis Kirjanov <kda@linux-powerpc.org>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      362b37be
    • Giuseppe CAVALLARO's avatar
      stmmac: ptp: fix the reference clock · 5566401f
      Giuseppe CAVALLARO authored
      The PTP reference clock, used for setting the addend in the Timestamp Addend
      Register, was erroneously hard-coded (as reported in the databook just as
      example).
      
      The patch removes the macro named: STMMAC_SYSCLOCK and allows to use a
      reference clock (clk_ptp_ref_i) that can be passed from the platform.
      
      If not passed, the main driver clock will be used as default; note that
      this can be fine on some platforms.
      
      Note that, prior this patch, using the old STMMAC_SYSCLOCK on some platforms,
      as side effect, the ptp clock can move faster/slower than the system clock.
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5566401f
    • Giuseppe CAVALLARO's avatar
      stmmac: fix tipo on mmc crc error · 2b78d348
      Giuseppe CAVALLARO authored
      This patch is to fix a typo on mmc rx crc error when reported by ethtool.
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b78d348
    • Giuseppe CAVALLARO's avatar
      stmmac: prevent false carrier sense detection · b1dee479
      Giuseppe CAVALLARO authored
      This patch is to w/a a problem that happens on some boxes when run at 10Mbps
      Half duplex mode.
      
      During the transmission the CSR signal is asserted for some time and the frames
      aborted because of carrier sense error.
      This is reported by MMC HW counter: txcarrier signal.
      This actually is a false carrier so the frames are good and there is no reason
      to ask for dropping them.
      
      This patch so disables the Carrier Sense During Transmission
      and this means that the MAC transmitter ignore the CRS signal
      during frame transmission in Half-Duplex mode.
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Acked-by: default avatarVince Bridgers <vbridgers2013@gmail.com>
      Acked-by: default avatarLey Foon Tan <lftan@altera.com>
      Acked-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b1dee479
  4. 27 Aug, 2014 1 commit
  5. 26 Aug, 2014 16 commits
    • David S. Miller's avatar
      mvneta: Add missing if_vlan.h include. · 2d39d120
      David S. Miller authored
      drivers/net/ethernet/marvell/mvneta.c: In function 'mvneta_skb_tx_csum':
      drivers/net/ethernet/marvell/mvneta.c:1374:3: error: implicit declaration of function 'vlan_get_protocol' [-Werror=implicit-function-declaration]
         __be16 l3_proto = vlan_get_protocol(skb);
         ^
      Reporeted-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d39d120
    • Wei Liu's avatar
      xen-netback: move netif_napi_add before binding interrupt · e24f8191
      Wei Liu authored
      Interrupt is enabled when bind_interdomain_evtchn_to_irqhandler returns.
      If there's interrupt pending interrupt handler is invoked.
      
      NAPI needs to be initialised before binding interrupt otherwise the
      interrupt handler will try to scheduling a NAPI instance that is not
      initialised yet, resulting in kernel OOPS.
      
      This fixes a regression introduced in ea2c5e13 ("xen-netback: move NAPI
      add/remove calls").
      
      Ideally function calls to create kthreads should also be moved before
      binding but I intent to fix this regression with minimal changes and
      refactor the code with another patch.
      Reported-by: default avatarThomas Leonard <talex5@gmail.com>
      Signed-off-by: default avatarWei Liu <wei.liu2@citrix.com>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e24f8191
    • David S. Miller's avatar
      Merge branch 'tso_fix' · 8dbb200f
      David S. Miller authored
      Vladislav Yasevich says:
      
      ====================
      Fix TSO and checksum issues with non-accelerated vlan traffic.
      
      I've recently ran across something rather interesting when testing vlans
      from inside VMs.  In some scenarios I was getting awfull thruput.
      Some debugging uncovered a very scary packet corruption.  I was
      seeing packets that had original TSO length as IP total length
      and their ip checksum was 0.  This was with e1000e driver.
      
      A bit more debugging uncovered an assumption made by that driver
      that skb->protocol will contain l3 protocol information.  This
      was not the case in my setup since I manually turned off vlan
      tx acceleration for the device.  This caused the driver to not
      initialize the tso information correctly and resulted in
      corrupt TSO frames on the wire.
      
      I decided to do some auditing of the usage of skb->protocols
      in the drivers.  Out of all the drivers, the included 8 appear
      to be effected.  They all allow user to control vlan acceleration
      settings, all support TSO on vlan devices, and all use
      skb->protocol to decide how to encode TSO information.  Some
      also have similar problems when initializing hw checksum information.
      On such device, it is simple enough to reproduce the issue.
      Simply turn off TX VLAN acceleration on the device, create a vlan,
      and run you favorite network performance tool.
      
      There is 1 driver I ran across that I belive will trigger a BUG
      in the system when used with vlans.  That driver is tile/tilepro.c
      I have not changed it in this patch set and would hope that
      the maintainer has time to look at it.
      
      V2: Fix i40ev using the wrong function name.  Full build.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8dbb200f
    • Vlad Yasevich's avatar
      qlge: Fix TSO for non-accelerated vlan traffic · 1ee1cfe7
      Vlad Yasevich authored
      This device claims TSO support for vlans.  It also allows a user to
      control vlan acceleration offloading.  As such, it is possible to turn
      off vlan acceleration and configure a vlan which will continue to send
      TSO traffic.
      
      In such situation the packet passed down the the device will contain
      a vlan header and skb->protocol will be set to ETH_P_8021Q.
      The device assumes that skb->protocol contains network protocol
      value and uses that value to set up TSO information.
      This results in corrupted frames sent on the wire.
      
      This patch extracts the protocol value correctly by using a
      vlan_get_protocol() helper and corrects corrupt TSO frames.
      
      CC: Shahed Shaikh <shahed.shaikh@qlogic.com>
      CC: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
      CC: Ron Mercer <ron.mercer@qlogic.com>
      CC: linux-driver@qlogic.com
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Acked-by: default avatarShahed Shaikh <shahed.shaikh@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1ee1cfe7
    • Vlad Yasevich's avatar
      mvneta: Fix TSO and checksum for non-acceleration vlan traffic · 817dbfa5
      Vlad Yasevich authored
      This driver doesn't appear to support vlan acceleration at
      all.  However, it does claim to support TSO and IP checksums
      for vlan devices.  Thus any configured vlan device would
      end up passing down partial checksums or TSO frames.
      
      The driver also uses the value from skb->protocol to
      determine TSO and checksum offload information, but assumes
      that skb->protocol holds the l3 protocol information.
      As a result, vlan traffic with partial checksums or TSO
      will fail those checks and TSO will not happen.
      
      Fix this by using vlan_get_protocol() helper.
      
      CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      817dbfa5
    • Vlad Yasevich's avatar
      i40evf: Fix TSO and hw checksums for non-accelerated vlan packets. · a12c4158
      Vlad Yasevich authored
      This device claims TSO and checksum support for vlans.  It also
      allows a user to control vlan acceleration offloading.  As such,
      it is possible to turn off vlan acceleration and configure a vlan
      which will continue to support TSO and hw checksums.
      
      In such situation the packet passed down the the device will contain
      a vlan header and skb->protocol will be set to ETH_P_8021Q.
      The device assumes that skb->protocol contains network protocol
      value and uses that value to set up TSO and checksum information.
      This results in corrupted frames sent on the wire.
      
      This patch extract the protocol value correctly and corrects TSO
      and checksums for non-accelerated traffic.
      
      Fix this by using vlan_get_protocol() helper.
      
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      CC: Jesse Brandeburg <jesse.brandeburg@intel.com>
      CC: Bruce Allan <bruce.w.allan@intel.com>
      CC: Carolyn Wyborny <carolyn.wyborny@intel.com>
      CC: Don Skidmore <donald.c.skidmore@intel.com>
      CC: Greg Rose <gregory.v.rose@intel.com>
      CC: Alex Duyck <alexander.h.duyck@intel.com>
      CC: John Ronciak <john.ronciak@intel.com>
      CC: Mitch Williams <mitch.a.williams@intel.com>
      CC: Linux NICS <linux.nics@intel.com>
      CC: e1000-devel@lists.sourceforge.net
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a12c4158
    • Vlad Yasevich's avatar
      i40e: Fix TSO and hw checksums for non-accelerated vlan packets. · 3d34dd03
      Vlad Yasevich authored
      This device claims TSO and checksum support for vlans.  It also
      allows a user to control vlan acceleration offloading.  As such,
      it is possible to turn off vlan acceleration and configure a vlan
      which will continue to support TSO and hw checksums.
      
      In such situation the packet passed down the the device will contain
      a vlan header and skb->protocol will be set to ETH_P_8021Q.
      The device assumes that skb->protocol contains network protocol
      value and uses that value to set up TSO and checksum information.
      This results in corrupted frames sent on the wire.
      
      This patch extract the protocol value correctly and corrects TSO
      and checksums for non-accelerated traffic.
      
      Fix this by using vlan_get_protocol() helper.
      
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      CC: Jesse Brandeburg <jesse.brandeburg@intel.com>
      CC: Bruce Allan <bruce.w.allan@intel.com>
      CC: Carolyn Wyborny <carolyn.wyborny@intel.com>
      CC: Don Skidmore <donald.c.skidmore@intel.com>
      CC: Greg Rose <gregory.v.rose@intel.com>
      CC: Alex Duyck <alexander.h.duyck@intel.com>
      CC: John Ronciak <john.ronciak@intel.com>
      CC: Mitch Williams <mitch.a.williams@intel.com>
      CC: Linux NICS <linux.nics@intel.com>
      CC: e1000-devel@lists.sourceforge.net
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d34dd03
    • Vlad Yasevich's avatar
      ehea: Fix TSO and hw checksums with non-accelerated vlan packets. · be1d1486
      Vlad Yasevich authored
      The driver claims that it can do TSO and IP checksums on vlan
      devices and also allows user to control vlan acceleration offloading.
      This makes it possible to push traffic to this driver that has TSO or
      partial checksums set, but also have a non-accelearted vlan
      header.  In this case, the driver will fail to correctly
      identify such traffic and will not correctly perform
      segmentation and checksum calculation.
      
      Fix this by using vlan_get_protocol() helper instead of
      assuming skb->protocol always has this information.
      
      CC: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      be1d1486
    • Vlad Yasevich's avatar
      bna: Support TSO and partial checksum with non-accelerated vlans. · 1c53730a
      Vlad Yasevich authored
      This device claims TSO and checksum support for vlans.  It also
      allows a user to control vlan acceleration offloading.  As such,
      it is possible to turn off vlan acceleration and configure a vlan
      which will continue to support TSO.
      
      In such situation the packet passed down the the device will contain
      a vlan header and skb->protocol will be set to ETH_P_8021Q.
      The device assumes that skb->protocol contains network protocol
      value and uses that value to set up TSO information.  This results
      in corrupted frames sent on the wire.
      
      This patch extract the protocol value correctly and corrects TSO
      and checksums for non-accelerated traffic.
      
      CC: Rasesh Mody <rmody@brocade.com>
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c53730a
    • Vlad Yasevich's avatar
      e1000: Fix TSO for non-accelerated vlan traffic · 06f4d033
      Vlad Yasevich authored
      This device claims TSO and checksum support for vlans.  It also
      allows a user to control vlan acceleration offloading.  As such,
      it is possible to turn off vlan acceleration and configure a vlan
      which will continue to support TSO.
      
      In such situation the packet passed down the the device will contain
      a vlan header and skb->protocol will be set to ETH_P_8021Q.
      The device assumes that skb->protocol contains network protocol
      value and uses that value to set up TSO and checksum information.
      This will results in corrupted frames sent on the wire.
      
      This patch extract the protocol value correctly and corrects TSO
      for non-accelerated traffic.
      
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      CC: Jesse Brandeburg <jesse.brandeburg@intel.com>
      CC: Bruce Allan <bruce.w.allan@intel.com>
      CC: Carolyn Wyborny <carolyn.wyborny@intel.com>
      CC: Don Skidmore <donald.c.skidmore@intel.com>
      CC: Greg Rose <gregory.v.rose@intel.com>
      CC: Alex Duyck <alexander.h.duyck@intel.com>
      CC: John Ronciak <john.ronciak@intel.com>
      CC: Mitch Williams <mitch.a.williams@intel.com>
      CC: Linux NICS <linux.nics@intel.com>
      CC: e1000-devel@lists.sourceforge.net
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06f4d033
    • Vlad Yasevich's avatar
      e1000e: Fix TSO with non-accelerated vlans · 47ccd1ed
      Vlad Yasevich authored
      This device claims  TSO support for vlans.  It also allows a
      user to control vlan acceleration offloading.  As such, it is
      possible to turn off vlan acceleration and configure a vlan
      which will continue to support TSO.
      
      In such situation the packet passed down the the device will contain
      a vlan header and skb->protocol will be set to ETH_P_8021Q.
      The device assumes that skb->protocol contains network protocol
      value and uses that value to set up TSO information.  This results
      in corrupted frames sent on the wire.  Corruptions include
      incorrect IP total length and invalid IP checksum.
      
      This patch extract the protocol value correctly and corrects TSO
      for non-accelerated traffic.
      
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      CC: Jesse Brandeburg <jesse.brandeburg@intel.com>
      CC: Bruce Allan <bruce.w.allan@intel.com>
      CC: Carolyn Wyborny <carolyn.wyborny@intel.com>
      CC: Don Skidmore <donald.c.skidmore@intel.com>
      CC: Greg Rose <gregory.v.rose@intel.com>
      CC: Alex Duyck <alexander.h.duyck@intel.com>
      CC: John Ronciak <john.ronciak@intel.com>
      CC: Mitch Williams <mitch.a.williams@intel.com>
      CC: Linux NICS <linux.nics@intel.com>
      CC: e1000-devel@lists.sourceforge.net
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      47ccd1ed
    • Jonas Jensen's avatar
      net: moxa: continue loop on skb allocation failure · 2b7890e7
      Jonas Jensen authored
      If netdev_alloc_skb_ip_align() fails, subsequent code will
      try to dereference an invalid pointer.
      
      Continue to next descriptor on error.
      
      While we're at it,
      
      1. eliminate the chance of an endless loop, replace the main
         loop with while(rx < budget)
      
      2. use napi_complete() and remove the explicit napi_gro_flush()
      Signed-off-by: default avatarJonas Jensen <jonas.jensen@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b7890e7
    • Jonas Jensen's avatar
      net: moxa: synchronize DMA memory · 777fbc31
      Jonas Jensen authored
      DMA memory should be synchronized before data is passed
      to/from controller.
      
      Add dma_sync_single_for_cpu(.., DMA_FROM_DEVICE) to RX path
      and dma_sync_single_for_device(.., DMA_TO_DEVICE) to TX path.
      Signed-off-by: default avatarJonas Jensen <jonas.jensen@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      777fbc31
    • Jonas Jensen's avatar
      net: moxa: replace build_skb() with netdev_alloc_skb_ip_align() / memcpy() · 9fe1b3bc
      Jonas Jensen authored
      build_skb() is used to make skbs out of existing RX ring memory
      which is bad because the RX ring is allocated only once, on probe.
      Memory corruption occur because said memory is reclaimed, i.e.
      __kfree_skb() (and eventually put_page()).
      
      Replace build_skb() with netdev_alloc_skb_ip_align() and use memcpy().
      
      Remove SKB_DATA_ALIGN() from RX buffer size while we're at it.
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=69041Signed-off-by: default avatarJonas Jensen <jonas.jensen@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9fe1b3bc
    • Jonas Jensen's avatar
      net: moxa: clear DESC1 on ndo_start_xmit() · b853f319
      Jonas Jensen authored
      TX buffer length is not cleared on ndo_start_xmit().
      Failing to do so can bug/hang the controller and
      cause TX interrupts to stop altogether.
      
      Remove the readl() and compute a new value for DESC1.
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=69031Signed-off-by: default avatarJonas Jensen <jonas.jensen@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b853f319
    • Michal Kubeček's avatar
      net: fix checksum features handling in netif_skb_features() · db115037
      Michal Kubeček authored
      This is follow-up to
      
        da08143b ("vlan: more careful checksum features handling")
      
      which introduced more careful feature intersection in vlan code,
      taking into account that HW_CSUM should be considered superset
      of IP_CSUM/IPV6_CSUM. The same is needed in netif_skb_features()
      in order to avoid offloading mismatch warning when vlan is
      created on top of a bond consisting of slaves supporting IP/IPv6
      checksumming but not vlan Tx offloading.
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      db115037
  6. 25 Aug, 2014 1 commit