Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 0/4] rhashtable: Allow local locks to be used and tested
From: David Miller @ 2014-11-13 20:13 UTC (permalink / raw)
  To: herbert; +Cc: netdev, tgraf
In-Reply-To: <20141113101025.GA3728@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 13 Nov 2014 18:10:25 +0800

> This series moves mutex_is_held entirely under PROVE_LOCKING so
> there is zero foot print when we're not debugging.  More importantly
> it adds a parrent argument to mutex_is_held so that we can test
> local locks rather than global ones (e.g., per-namespace locks).

Series applied, thanks Herbert.

^ permalink raw reply

* Re: [PATCH net-next 0/7] mlx4: Flexible (asymmetric) allocation of EQs and MSI-X vectors
From: David Miller @ 2014-11-13 20:16 UTC (permalink / raw)
  To: ogerlitz; +Cc: netdev, matanb, amirv, jackm
In-Reply-To: <1415882733-3084-1-git-send-email-ogerlitz@mellanox.com>

From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Thu, 13 Nov 2014 14:45:26 +0200

> This series from Matan Barak is built as follows:
> 
> The 1st two patches fix small bugs w.r.t firmware spec. Next
> are two patches which do more re-factoring of the init/fini flow
> and a patch that adds support for the QUERY_FUNC firmware command,
> these are all pre-steps for the major patch of the series. In this
> patch (#6) we change the order of talking/querying the firmware
> and enabling SRIOV. This allows to remote worst-case assumption
> w.r.t the number of available MSI-X vectors and EQs per function.
> 
> The last patch easily enjoys this ordering change, to enable
> supports > 64 VFs over a firmware that allows for that.

Series applied, thank you.

^ permalink raw reply

* Re: [PATCH 16/16] rxrpc: Replace smp_read_barrier_depends() with lockless_dereference()
From: David Howells @ 2014-11-13 20:17 UTC (permalink / raw)
  To: Pranith Kumar
  Cc: dhowells, David S. Miller, Dan Carpenter,
	open list:NETWORKING [GENERAL], open list, paulmck
In-Reply-To: <1415906662-4576-17-git-send-email-bobby.prani@gmail.com>

Pranith Kumar <bobby.prani@gmail.com> wrote:

>  	     loop != call->acks_head || stop;
>  	     loop = (loop + 1) &  (call->acks_winsz - 1)
>  	     ) {
> -		p_txb = call->acks_window + loop;
> -		smp_read_barrier_depends();
> +		p_txb = lockless_dereference(call)->acks_window + loop;

Nack.  You've stuck an implicit barrier on a dereference that doesn't matter.
And similar for other hunks of this patch.

David

^ permalink raw reply

* Re: [PATCH net-next] rhashtable: Drop gfp_flags arg in insert/remove functions
From: David Miller @ 2014-11-13 20:18 UTC (permalink / raw)
  To: tgraf; +Cc: netdev, linux-kernel, ebiederm, eric.dumazet
In-Reply-To: <17c3262027e643a0826c6ac5dd2d14cda0822a0b.1415879747.git.tgraf@suug.ch>

From: Thomas Graf <tgraf@suug.ch>
Date: Thu, 13 Nov 2014 13:45:46 +0100

> Reallocation is only required for shrinking and expanding and both rely
> on a mutex for synchronization and callers of rhashtable_init() are in
> non atomic context. Therefore, no reason to continue passing allocation
> hints through the API.
> 
> Instead, use GFP_KERNEL and add __GFP_NOWARN | __GFP_NORETRY to allow
> for silent fall back to vzalloc() without the OOM killer jumping in as
> pointed out by Eric Dumazet and Eric W. Biederman.
> 
> Signed-off-by: Thomas Graf <tgraf@suug.ch>

Applied, thanks Thomas.

^ permalink raw reply

* Re: [PATCH net v3] vxlan: Do not reuse sockets for a different address family
From: David Miller @ 2014-11-13 20:20 UTC (permalink / raw)
  To: mleitner; +Cc: netdev, stephen, sergei.shtylyov
In-Reply-To: <54ab998424b7b06d892eec6df6a8ec38db3cb2bb.1415896616.git.mleitner@redhat.com>

From: Marcelo Ricardo Leitner <mleitner@redhat.com>
Date: Thu, 13 Nov 2014 14:43:08 -0200

> Currently, we only match against local port number in order to reuse
> socket. But if this new vxlan wants an IPv6 socket and a IPv4 one bound
> to that port, vxlan will reuse an IPv4 socket as IPv6 and a panic will
> follow. The following steps reproduce it:
> 
>    # ip link add vxlan6 type vxlan id 42 group 229.10.10.10 \
>        srcport 5000 6000 dev eth0
>    # ip link add vxlan7 type vxlan id 43 group ff0e::110 \
>        srcport 5000 6000 dev eth0
>    # ip link set vxlan6 up
>    # ip link set vxlan7 up
>    <panic>
 ...
> So address family must also match in order to reuse a socket.
> 
> Reported-by: Jean-Tsung Hsiao <jhsiao@redhat.com>
> Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>

Hey, this one actually compiles :-)

Applied and queued up for -stable, thanks!

^ permalink raw reply

* Re: [PATCH net-next] tcp: limit GSO packets to half cwnd
From: David Miller @ 2014-11-13 20:22 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, ncardwell, ycheng, nanditad
In-Reply-To: <1415900722.17262.22.camel@edumazet-glaptop2.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 13 Nov 2014 09:45:22 -0800

> From: Eric Dumazet <edumazet@google.com>
> 
> In DC world, GSO packets initially cooked by tcp_sendmsg() are usually
> big, as sk_pacing_rate is high.
> 
> When network is congested, cwnd can be smaller than the GSO packets
> found in socket write queue. tcp_write_xmit() splits GSO packets
> using the available cwnd, and we end up sending a single GSO packet,
> consuming all available cwnd.
> 
> With GRO aggregation on the receiver, we might handle a single GRO
> packet, sending back a single ACK.
> 
> 1) This single ACK might be lost
>    TLP or RTO are forced to attempt a retransmit.
> 2) This ACK releases a full cwnd, sender sends another big GSO packet,
>    in a ping pong mode.
> 
> This behavior does not fill the pipes in the best way, because of
> scheduling artifacts.
> 
> Make sure we always have at least two GSO packets in flight.
> 
> This allows us to safely increase GRO efficiency without risking
> spurious retransmits.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

This looks fantastic, applied, thanks Eric!

^ permalink raw reply

* Re: arm64 allmodconfig failures in nft_reject_bridge.c
From: David Miller @ 2014-11-13 20:23 UTC (permalink / raw)
  To: broonie
  Cc: pablo, linux, kaber, kadlec, stephen, linaro-kernel,
	kernel-build-reports, netfilter-devel, coreteam, bridge, netdev
In-Reply-To: <20141113194752.GQ3815@sirena.org.uk>

From: Mark Brown <broonie@kernel.org>
Date: Thu, 13 Nov 2014 19:47:52 +0000

> On Thu, Nov 13, 2014 at 02:35:13PM -0500, David Miller wrote:
> 
>> I hold changes in my tree for a week or more, because I want them to
>> "cook" there before they go to Linus.
> 
> Hrm.  Guess there must've been some other change in -next that pulled
> the header in implicitly here :(

-next pulls in my 'net' tree, so got the fix.

^ permalink raw reply

* [GIT] Networking
From: David Miller @ 2014-11-13 20:35 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


1) sunhme driver lacks DMA mapping error checks, based upon a report
   by Meelis Roos.

2) Fix memory leak in mvpp2 driver, from Sudip Mukherjee.

3) DMA memory allocation sizes are wrong in systemport ethernet
   driver, fix from Florian Fainelli.

4) Fix use after free in mac80211 defragmentation code, from Johannes
   Berg.

5) Some networking uapi headers missing from Kbuild file, from Stephen
   Hemminger.

6) TUN driver gets csum_start offset wrong when VLAN accel is enabled,
   and macvtap has a similar bug, from Herbert Xu.

7) Adjust several tunneling drivers to set dev->iflink after registry,
   because registry sets that to -1 overwriting whatever we did.  From
   Steffen Klassert.

8) Geneve forgets to set inner tunneling type, causing GSO
   segmentation to fail on some NICs.  From Jesse Gross.

9) Fix several locking bugs in stmmac driver, from Fabrice Gasnier and
   Giuseppe CAVALLARO.

10) Fix spurious timeouts with NewReno on low traffic connections, from
    Marcelo Leitner.

11) Fix descriptor updates in enic driver, from Govindarajulu Varadarajan.

12) PPP calls bpf_prog_create() with locks held, which isn't kosher.  Fix
    from Takashi Iwai.

13) Fix NULL deref in SCTP with malformed INIT packets, from Daniel
    Borkmann.

14) psock_fanout selftest accesses past the end of the mmap ring, fix
    from Shuah Khan.

15) Fix PTP timestamping for VLAN packets, from Richard Cochran.

16) netlink_unbind() calls in netlink pass wrong initial argument, from
    Hiroaki SHIMODA.

17) vxlan socket reuse accidently reuses a socket when the address family
    is different, so we have to explicitly check this, from Marcelo
    Lietner.

18) Fix missing include in nft_reject_bridge.c breaking the build on ppc
    and other architectures, from Guenter Roeck.

Please pull, thanks a lot.

The following changes since commit 9f935675d41aa51ebf929fc977cf530ff7d1a7fc:

  Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input (2014-10-31 19:51:11 -0700)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master

for you to fetch changes up to 19ca9fc1445b76b60d34148f7ff837b055f5dcf3:

  vxlan: Do not reuse sockets for a different address family (2014-11-13 15:19:59 -0500)

----------------------------------------------------------------
Alexander Kochetkov (2):
      net/smsc911x: Fix rare soft reset timeout issue due to PHY power-down mode
      net/smsc911x: Fix delays in the PHY enable/disable routines

Andrew Lunn (1):
      net: dsa: slave: Fix autoneg for phys on switch MDIO bus

Anish Bhatt (2):
      cxgb4 : Fix bug in DCB app deletion
      cxgb4 : dcb open-lldp interop fixes

Brian Hill (1):
      net: phy: Correctly handle MII ioctl which changes autonegotiation.

Charles Keepax (1):
      asix: Do full reset during ax88772_bind

Chen Gang (2):
      drivers: net: ethernet: xilinx: xilinx_emaclite: Compatible with 'xlnx, xps-ethernetlite-2.00.b' for QEMU using
      drivers: net: ethernet: xilinx: xilinx_emaclite: revert the original commit "1db3ddff1602edf2390b7667dcbaa0f71512e3ea"

Daniel Borkmann (3):
      net: sctp: fix NULL pointer dereference in af->from_addr_param on malformed packet
      net: sctp: fix memory leak in auth key management
      ixgbe: phy: fix uninitialized status in ixgbe_setup_phy_link_tnx

David S. Miller (10):
      sunhme: Add DMA mapping error checks.
      Merge branch 'systemport-net'
      Merge branch 'tun-net'
      Merge branch 'ipv6_tunnel_iflink_init'
      Merge branch 'xgene-net'
      Merge branch 'stmmac-net'
      Merge branch 'mlx5-net'
      Merge tag 'master-2014-11-04' of git://git.kernel.org/.../linville/wireless
      Merge branch 'cxgb4-net'
      Merge branch 'bcmgenet-net'

Edward Cree (1):
      sfc: don't BUG_ON efx->max_channels == 0 in probe

Eli Cohen (2):
      net/mlx5_core: Fix race in create EQ
      net/mlx5_core: Fix race on driver load

Emmanuel Grumbach (2):
      iwlwifi: mvm: initialize the cur_ucode upon boot
      iwlwifi: fix RFkill while calibrating

Enric Balletbo i Serra (1):
      smsc911x: power-up phydev before doing a software reset.

Eric Dumazet (1):
      ipv6: fix IPV6_PKTINFO with v4 mapped

Fabrice Gasnier (2):
      stmmac: fix stmmac_tx_avail should be called with TX locked
      stmmac: release tx lock, in case of dma mapping error.

Felix Fietkau (1):
      mac80211: flush keys for AP mode on ieee80211_do_stop

Florian Fainelli (4):
      net: systemport: fix DMA allocation/freeing sizes
      net: systemport: do not crash freeing an unitialized TX ring
      net: bcmgenet: connect and disconnect from the PHY state machine
      net: bcmgenet: apply MII configuration in bcmgenet_open()

Giuseppe CAVALLARO (3):
      stmmac: fix lock in stmmac_set_rx_mode
      stmmac: fix concurrency in eee initialization.
      stmmac: fix atomicity in pm routines

Govindarajulu Varadarajan (2):
      enic: handle error condition properly in enic_rq_indicate_buf
      enic: update desc properly in rx_copybreak

Gregory Fong (1):
      bridge: include in6.h in if_bridge.h for struct in6_addr

Guenter Roeck (1):
      netfilter: nft_reject_bridge: Fix powerpc build error

Hariprasad Shenai (3):
      cxgb4vf: Move fl_starv_thres into adapter->sge data structure
      cxgb4/cxgb4vf: For T5 use Packing and Padding Boundaries for SGE DMA transfers
      cxgb4vf: FL Starvation Threshold needs to be larger than the SGE's Egress Congestion Threshold

Herbert Xu (4):
      tun: Fix csum_start with VLAN acceleration
      tun: Fix TUN_PKT_STRIP setting
      macvtap: Fix csum_start when VLAN tags are present
      lib: rhashtable - Remove weird non-ASCII characters from comments

Hiroaki SHIMODA (1):
      netlink: Properly unbind in error conditions.

Iyappan Subramanian (3):
      dtb: xgene: fix: Backward compatibility with older firmware
      drivers: net: xgene: Backward compatibility with older firmware
      drivers: net: xgene: fix: Use separate resources

Jesse Gross (3):
      geneve: Set GSO type on transmit.
      geneve: Unregister pernet subsys on module unload.
      udptunnel: Add SKB_GSO_UDP_TUNNEL during gro_complete.

Johannes Berg (2):
      mac80211: properly flush delayed scan work on interface removal
      mac80211: fix use-after-free in defragmentation

John W. Linville (2):
      Merge tag 'iwlwifi-for-john-2014-11-03' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
      Merge tag 'mac80211-for-john-2014-11-04' of git://git.kernel.org/.../jberg/mac80211

Junjie Mao (1):
      mac80211_hwsim: release driver when ieee80211_register_hw fails

Karl Beldan (1):
      net: mv643xx_eth: reclaim TX skbs only when released by the HW

Linus Walleij (1):
      smc91x: retrieve IRQ and trigger flags in a modern way

Loganaden Velvindron (1):
      net: Add missing descriptions for fwmark_reflect for ipv4 and ipv6.

Lothar Waßmann (1):
      net: fec: fix regression on i.MX28 introduced by rx_copybreak support

Luciano Coelho (2):
      mac80211: use secondary channel offset IE also beacons during CSA
      mac80211: schedule the actual switch of the station before CSA count 0

Manish Chopra (1):
      netxen: Fix link event handling.

Marcelo Leitner (2):
      tcp: zero retrans_stamp if all retrans were acked
      vxlan: Do not reuse sockets for a different address family

Mugunthan V N (1):
      drivers: net: cpsw: remove cpsw_ale_stop from cpsw_ale_destroy

Nimrod Andy (1):
      net: fec: fix suspend broken on multiple MACs sillicons

Or Gerlitz (1):
      net/mlx4_en: Advertize encapsulation offloads features only when VXLAN tunnel is set

Rasmus Villemoes (1):
      include/linux/socket.h: Fix comment

Richard Cochran (1):
      net: ptp: fix time stamp matching logic for VLAN packets.

Ryo Munakata (1):
      net/9p: remove a comment about pref member which doesn't exist

Shuah Khan (1):
      selftests/net: psock_fanout seg faults in sock_fanout_read_ring()

Stefan Wahren (1):
      net: qualcomm: Fix dependency

Steffen Klassert (4):
      ip6_tunnel: Use ip6_tnl_dev_init as the ndo_init function.
      vti6: Use vti6_dev_init as the ndo_init function.
      sit: Use ipip6_tunnel_init as the ndo_init function.
      gre6: Move the setting of dev->iflink into the ndo_init functions.

Sudip Mukherjee (1):
      net: mvpp2: fix possible memory leak

Takashi Iwai (1):
      net: ppp: Don't call bpf_prog_create() in ppp_lock

stephen hemminger (1):
      uapi: add missing network related headers to kbuild

 Documentation/networking/ip-sysctl.txt               |  14 ++++++++
 arch/arm64/boot/dts/apm-storm.dtsi                   |  10 +++---
 drivers/net/ethernet/apm/xgene/xgene_enet_hw.c       |  18 +++++++++-
 drivers/net/ethernet/apm/xgene/xgene_enet_hw.h       |   4 +++
 drivers/net/ethernet/apm/xgene/xgene_enet_main.c     |  11 +++---
 drivers/net/ethernet/apm/xgene/xgene_enet_main.h     |   5 ++-
 drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c    |   7 +++-
 drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c    |   7 +++-
 drivers/net/ethernet/broadcom/bcmsysport.c           |  13 +++++--
 drivers/net/ethernet/broadcom/genet/bcmgenet.c       |  11 +++++-
 drivers/net/ethernet/broadcom/genet/bcmgenet.h       |   3 +-
 drivers/net/ethernet/broadcom/genet/bcmmii.c         |   9 ++---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c       |  31 +++++++++++------
 drivers/net/ethernet/chelsio/cxgb4/sge.c             |  30 ++++++++++++++--
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c           |  51 ++++++++++++++++++++++++----
 drivers/net/ethernet/chelsio/cxgb4/t4_regs.h         |  10 ++++++
 drivers/net/ethernet/chelsio/cxgb4vf/adapter.h       |   8 +++++
 drivers/net/ethernet/chelsio/cxgb4vf/sge.c           | 136 ++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
 drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h   |   2 ++
 drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c       |  28 ++++++++++++++-
 drivers/net/ethernet/cisco/enic/enic_main.c          |  20 +++++------
 drivers/net/ethernet/freescale/fec_main.c            |  39 ++++++++++++++-------
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c         |   4 +--
 drivers/net/ethernet/marvell/mv643xx_eth.c           |  18 +++++-----
 drivers/net/ethernet/marvell/mvpp2.c                 |  27 ++++++++++-----
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c       |  22 +++++++-----
 drivers/net/ethernet/mellanox/mlx5/core/eq.c         |   7 ++--
 drivers/net/ethernet/mellanox/mlx5/core/main.c       |   4 +--
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c |   3 +-
 drivers/net/ethernet/qualcomm/Kconfig                |   3 +-
 drivers/net/ethernet/sfc/ef10.c                      |   3 +-
 drivers/net/ethernet/smsc/smc91x.c                   |  20 ++++++-----
 drivers/net/ethernet/smsc/smsc911x.c                 |  61 +++++++++++++++++++++++++++------
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c    |  52 +++++++++++++++-------------
 drivers/net/ethernet/sun/sunhme.c                    |  62 ++++++++++++++++++++++++++++++---
 drivers/net/ethernet/ti/cpsw_ale.c                   |   1 -
 drivers/net/ethernet/ti/cpts.c                       |   2 +-
 drivers/net/macvtap.c                                |   2 ++
 drivers/net/phy/dp83640.c                            |   4 +--
 drivers/net/phy/phy.c                                |  36 +++++++++++++-------
 drivers/net/ppp/ppp_generic.c                        |  40 +++++++++++-----------
 drivers/net/tun.c                                    |  28 +++++++++------
 drivers/net/usb/asix_devices.c                       |  14 +-------
 drivers/net/vxlan.c                                  |  31 +++++++++++------
 drivers/net/wireless/iwlwifi/mvm/fw.c                |  10 +++++-
 drivers/net/wireless/iwlwifi/mvm/mac80211.c          |   1 +
 drivers/net/wireless/iwlwifi/mvm/mvm.h               |   1 +
 drivers/net/wireless/iwlwifi/mvm/ops.c               |  12 ++++++-
 drivers/net/wireless/iwlwifi/pcie/trans.c            |   4 +--
 drivers/net/wireless/mac80211_hwsim.c                |   4 ++-
 include/linux/socket.h                               |   2 +-
 include/net/9p/transport.h                           |   1 -
 include/net/udp_tunnel.h                             |   9 +++++
 include/uapi/linux/Kbuild                            |   4 +++
 include/uapi/linux/if_bridge.h                       |   1 +
 lib/rhashtable.c                                     |  10 +++---
 net/bridge/netfilter/nft_reject_bridge.c             |   1 +
 net/dsa/slave.c                                      |   7 ++--
 net/ipv4/fou.c                                       |   2 ++
 net/ipv4/geneve.c                                    |   3 ++
 net/ipv4/ip_sockglue.c                               |   2 +-
 net/ipv4/tcp_input.c                                 |  60 ++++++++++++++++----------------
 net/ipv6/ip6_gre.c                                   |   5 +--
 net/ipv6/ip6_tunnel.c                                |  10 +-----
 net/ipv6/ip6_vti.c                                   |  11 +-----
 net/ipv6/sit.c                                       |  15 ++++----
 net/mac80211/ibss.c                                  |   2 +-
 net/mac80211/ieee80211_i.h                           |   3 +-
 net/mac80211/iface.c                                 |  18 ++++++----
 net/mac80211/mesh.c                                  |   2 +-
 net/mac80211/mlme.c                                  |   5 +--
 net/mac80211/rx.c                                    |  14 ++++----
 net/mac80211/spectmgmt.c                             |  18 ++++------
 net/netlink/af_netlink.c                             |   5 +--
 net/sctp/auth.c                                      |   2 --
 net/sctp/sm_make_chunk.c                             |   3 ++
 tools/testing/selftests/net/psock_fanout.c           |   2 +-
 77 files changed, 784 insertions(+), 376 deletions(-)

^ permalink raw reply

* Re: [PATCH 16/16] rxrpc: Replace smp_read_barrier_depends() with lockless_dereference()
From: David Howells @ 2014-11-13 20:47 UTC (permalink / raw)
  To: Pranith Kumar
  Cc: dhowells, David S. Miller, Dan Carpenter,
	open list:NETWORKING [GENERAL], open list, paulmck
In-Reply-To: <1415906662-4576-17-git-send-email-bobby.prani@gmail.com>

Pranith Kumar <bobby.prani@gmail.com> wrote:

> Recently lockless_dereference() was added which can be used in place of
> hard-coding smp_read_barrier_depends(). The following PATCH makes the change.

Actually, the use of smp_read_barrier_depends() is wrong in circular
buffering.  See Documentation/circular-buffers.txt

David

^ permalink raw reply

* Re: linux-next: manual merge of the net-next tree with the net tree
From: David Miller @ 2014-11-13 21:14 UTC (permalink / raw)
  To: sfr; +Cc: netdev, linux-next, linux-kernel, hariprasad, alexander.h.duyck
In-Reply-To: <20141113113555.15117365@canb.auug.org.au>

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 13 Nov 2014 11:35:55 +1100

> Today's linux-next merge of the net-next tree got a conflict in
> drivers/net/ethernet/chelsio/cxgb4vf/sge.c between commit 65f6ecc93e7c
> ("cxgb4vf: Move fl_starv_thres into adapter->sge data structure") from
> the net tree and commit aa9cd31c3f3e ("cxgb4/cxgb4vf: Replace
> __skb_alloc_page with __dev_alloc_page") from the net-next tree.
> 
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).

This merge resolution looks perfect.

^ permalink raw reply

* Re: [PATCH] net: skb_fclone_busy() needs to detect orphaned skb
From: Eric Dumazet @ 2014-11-13 21:20 UTC (permalink / raw)
  To: Luis Henriques; +Cc: David Miller, netdev, Neal Cardwell, Joseph Salisbury
In-Reply-To: <20141113191502.GC7095@hercules>

On Thu, 2014-11-13 at 19:15 +0000, Luis Henriques wrote:
> Hi Eric,
> 
> On Thu, Oct 30, 2014 at 10:32:34AM -0700, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@google.com>
> > 
> > Some drivers are unable to perform TX completions in a bound time.
> > They instead call skb_orphan()
> > 
> > Problem is skb_fclone_busy() has to detect this case, otherwise
> > we block TCP retransmits and can freeze unlucky tcp sessions on
> > mostly idle hosts.
> > 
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > Fixes: 1f3279ae0c13 ("tcp: avoid retransmits of TCP packets hanging in host queues")
> > ---
> >  This is a stable candidate.
> >  This problem is known to hurt users of linux-3.16 kernels used by guests kernels.
> >  David, I can provide backports if you want.
> >  Thanks !
> > 
> 
> We got a bug report[0] where a backport for 3.16 was provided.  Since
> I couldn't find the original backport post, I'm not sure who's the
> actual author.  Could you please confirm if this backport is correct?
> (I'm copying the patch below).
> 
> [0] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1390604
> 
> Cheers,
> --
> Luís
> 
> 

Sure ! I provided this patch indeed, I am 'The Google engineer'
mentioned in this bug report ;)

Signed-off-by: Eric Dumazet <edumazet@google.com>


Thanks !

> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index 4e4932b5079b..a8794367cd20 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -2082,7 +2082,8 @@ static bool skb_still_in_host_queue(const struct sock *sk,
>  	const struct sk_buff *fclone = skb + 1;
>  
>  	if (unlikely(skb->fclone == SKB_FCLONE_ORIG &&
> -		     fclone->fclone == SKB_FCLONE_CLONE)) {
> +		     fclone->fclone == SKB_FCLONE_CLONE &&
> +		     fclone->sk == sk)) {
>  		NET_INC_STATS_BH(sock_net(sk),
>  				 LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES);
>  		return true;

^ permalink raw reply

* Fw: [Bug 88161] New: High traffic causes a lot of softirqs
From: Stephen Hemminger @ 2014-11-13 21:21 UTC (permalink / raw)
  To: netdev



Begin forwarded message:

Date: Thu, 13 Nov 2014 06:18:28 -0800
From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
To: "stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: [Bug 88161] New: High traffic causes a lot of softirqs


https://bugzilla.kernel.org/show_bug.cgi?id=88161

            Bug ID: 88161
           Summary: High traffic causes a lot of softirqs
           Product: Networking
           Version: 2.5
    Kernel Version: 3.17.2
          Hardware: Intel
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: high
          Priority: P1
         Component: Other
          Assignee: shemminger@linux-foundation.org
          Reporter: mike@zcentric.com
        Regression: No

I'm using packaged rpms by centos and elrepo with the same results and I can
replicate this on any server in our cluster. 

I have tried installing 

kernel-3.10.56-11.el6.centos.alt.x86_64

Also currently running

[root@web125-east.domain.com /var/www/html]# uname -a
Linux web125-east.domain.com 3.17.2-1.el6.elrepo.x86_64 #1 SMP Fri Oct 31
10:37:44 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

from the centosplus repo to solve a problem where 2.6 was locking up process
tree on high cpu and it fixed it but it introduced another issue where we have
a lot of softirq requests when under a lot of traffic load. 

Here is a powertop from a 2.6 series server

Summary: 42492.1 wakeups/second, 0.0 GPU ops/seconds, 0.0 VFS ops/sec and
2422.0% CPU use

                Usage Events/s Category Description
            22613 ms/s 23637.4    Process php-fpm: pool www
            716.9 ms/s 15783.2    Process nginx: worker process
             21.3 ms/s 1096.1    Process /usr/bin/java -Xms200m -Xmx2000m
-Xss256k -XX:MaxDirectMemorySize=516m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC
-Dage
              5.8 ms/s 674.4 Process /usr/sbin/gmond
            130.0 ms/s 494.5 Process /usr/bin/redis-server 127.0.0.1:6379
             73.2 ms/s 487.4 Process python /usr/bin/statsd-relay.py
              3.8 ms/s 82.7 Process java -Xmx6g -server -Dfile.encoding=utf-8
-XX:OnOutOfMemoryError=kill -9 %p -XX:+HeapDumpOnOutOfMemoryError -XX:HeapD
            212.4 ms/s 0.00 Interrupt [3] net_rx(softirq)


Here it is from 3.10


                Usage Events/s Category Description
             10.2 ms/s 1033.6    Timer hrtimer_wakeup
              3.3 ms/s 932.7 Process /usr/bin/java -Xms200m -Xmx2000m -Xss256k
            591.1 ms/s 624.3 Process php-fpm: pool www
             41.5 ms/s 724.0 Interrupt [3] net_rx(softirq)

Load pretty much just keeps crawling up to the 500's

There also is a lot of CPU usage from

  116 root 20 0 0 0 0 R 75.0 0.0 0:04.57 kworker/u66:0

Which from my understanding handles a lot of the acpi calls that softirq is
doing. 

I've tried many other 3.x kernels above 3.10 with the same results.. so I'm
wondering if this is a known issue

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply

* [PULL] vhost: cleanups and fixes
From: Michael S. Tsirkin @ 2014-11-13 21:22 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: kvm, mst, netdev, linux-kernel, virtualization, tgraf

The following changes since commit 206c5f60a3d902bc4b56dab2de3e88de5eb06108:

  Linux 3.18-rc4 (2014-11-09 14:55:29 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus

for you to fetch changes up to 65eca3a20264a8999570c269406196bd1ae23be7:

  virtio_console: move early VQ enablement (2014-11-13 09:53:26 +0200)

It seems like a good idea to merge this bugfix now, as it's clearly
a regression and several people complained.

----------------------------------------------------------------
virtio: bugfix for 3.18

This fixes a crash in virtio console
multi-channel mode that got introduced in -rc1.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
Cornelia Huck (1):
      virtio_console: move early VQ enablement

 drivers/char/virtio_console.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

^ permalink raw reply

* Re: [PATCH net-next 2/2] r8152: adjust rtl_start_rx
From: David Miller @ 2014-11-13 21:22 UTC (permalink / raw)
  To: hayeswang; +Cc: netdev, nic_swsd, linux-kernel, linux-usb
In-Reply-To: <20141112.223146.2221136950144767962.davem@davemloft.net>

From: David Miller <davem@davemloft.net>
Date: Wed, 12 Nov 2014 22:31:46 -0500 (EST)

> From: Hayes Wang <hayeswang@realtek.com>
> Date: Thu, 13 Nov 2014 02:31:14 +0000
> 
>> My last method which I mentioned yesterday is similar to
>> this one. The difference is that I would re-use the rx
>> buffers, so I have to add them to the list for re-submitting,
>> not alwayes allocate new one.
>> 
>> Although one rx buffer could contain many packets, I don't
>> think the whole size of the rx buffer is alwayes used.
>> Therefore, I re-use the rx buffers to avoid allocating
>> the 16K bytes rx buffer alwayes. This also makes sure that
>> I always have the buffers to submit without allocating new
>> one.
>> 
>> If you could accept this, I would modify this patch by
>> this way.
> 
> I'll reread your original patch and think some more about this.

What if even the first r8152_submit_rx() fails?  What ever will cause
any of these retries to trigger at all?

Second, why does your patch increment 'i' with 'i++;' in the error
break path?  You should mark the first failed entry as unallocated
with actual_length == 0 and place it on the rx_done queue.

^ permalink raw reply

* [PATCH 49/56] net/socket: support compiling out splice
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, David S. Miller, open list:NETWORKING [GENERAL],
	open list
In-Reply-To: <1415913813-362-1-git-send-email-pieter@boesman.nl>

Compile out splice support from socket when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 net/socket.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/socket.c b/net/socket.c
index 95ee7d8..5cb347a 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -155,8 +155,8 @@ static const struct file_operations socket_file_ops = {
 	.release =	sock_close,
 	.fasync =	sock_fasync,
 	.sendpage =	sock_sendpage,
-	.splice_write = generic_splice_sendpage,
-	.splice_read =	sock_splice_read,
+	SPLICE_WRITE_INIT(generic_splice_sendpage)
+	SPLICE_READ_INIT(sock_splice_read)
 };
 
 /*
@@ -881,7 +881,8 @@ static ssize_t sock_sendpage(struct file *file, struct page *page,
 	return kernel_sendpage(sock, page, offset, size, flags);
 }
 
-static ssize_t sock_splice_read(struct file *file, loff_t *ppos,
+static ssize_t __maybe_unused sock_splice_read(
+				struct file *file, loff_t *ppos,
 				struct pipe_inode_info *pipe, size_t len,
 				unsigned int flags)
 {
-- 
1.9.1

^ permalink raw reply related

* [PATCH 53/56] net/ipv6: support compiling out splice
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy,
	open list:NETWORKING [IPv4/..., open list
In-Reply-To: <1415913813-362-1-git-send-email-pieter@boesman.nl>

Compile out splice support from ipv6 networking when the splice-family of
syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is
undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 net/ipv6/af_inet6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 2daa3a1..3d17064 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -523,7 +523,7 @@ const struct proto_ops inet6_stream_ops = {
 	.recvmsg	   = inet_recvmsg,		/* ok		*/
 	.mmap		   = sock_no_mmap,
 	.sendpage	   = inet_sendpage,
-	.splice_read	   = tcp_splice_read,
+	SPLICE_READ_INIT(tcp_splice_read)
 #ifdef CONFIG_COMPAT
 	.compat_setsockopt = compat_sock_common_setsockopt,
 	.compat_getsockopt = compat_sock_common_getsockopt,
-- 
1.9.1

^ permalink raw reply related

* [PATCH 55/56] net/core: support compiling out splice
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, David S. Miller, Tom Herbert, Willem de Bruijn,
	Eric Dumazet, Daniel Borkmann, Florian Westphal,
	Michael S. Tsirkin, Vlad Yasevich, Paul Durrant, Thomas Graf,
	Herbert Xu, Jan Beulich, Miklos Szeredi, open list,
	open list:NETWORKING [GENERAL]
In-Reply-To: <1415913813-362-1-git-send-email-pieter@boesman.nl>

Compile out splice support from networking core when the splice-family of
syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is
undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 include/linux/skbuff.h | 2 ++
 net/core/skbuff.c      | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index abde271..5a67427 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2543,9 +2543,11 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len);
 int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len);
 __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to,
 			      int len, __wsum csum);
+#ifdef CONFIG_SYSCALL_SPLICE
 int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
 		    struct pipe_inode_info *pipe, unsigned int len,
 		    unsigned int flags);
+#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
 void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
 unsigned int skb_zerocopy_headlen(const struct sk_buff *from);
 int skb_zerocopy(struct sk_buff *to, struct sk_buff *from,
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 163b673..5610904 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1649,6 +1649,7 @@ fault:
 }
 EXPORT_SYMBOL(skb_copy_bits);
 
+#ifdef CONFIG_SYSCALL_SPLICE
 /*
  * Callback from splice_to_pipe(), if we need to release some pages
  * at the end of the spd in case we error'ed out in filling the pipe.
@@ -1851,6 +1852,7 @@ done:
 
 	return ret;
 }
+#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
 
 /**
  *	skb_store_bits - store bits from kernel buffer to skb
-- 
1.9.1

^ permalink raw reply related

* pull request: wireless 2014-11-13
From: John W. Linville @ 2014-11-13 21:28 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 17022 bytes --]

Dave,

Please pull this set of a few more wireless fixes intended for the
3.18 stream...

For the mac80211 bits, Johannes says:

"This has just one fix, for an issue with the CCMP decryption
that can cause a kernel crash. I'm not sure it's remotely
exploitable, but it's an important fix nonetheless."

For the iwlwifi bits, Emmanuel says:

"Two fixes here - we weren't updating mac80211 if a scan
was cut short by RFKILL which confused cfg80211. As a
result, the latter wouldn't allow to run another scan.
Liad fixes a small bug in the firmware dump."

On top of that...

Arend van Spriel corrects a channel width conversion that caused a
WARNING in brcmfmac.

Hauke Mehrtens avoids a NULL pointer dereference in b43.

Larry Finger hits a trio of rtlwifi bugs left over from recent
backporting from the Realtek vendor driver.

Miaoqing Pan fixes a clocking problem in ath9k that could affect
packet timestamps and such.

Stanislaw Gruszka addresses an payload alignment issue that has been
plaguing rt2x00.

Please let me know if there are problems!

John

---

The following changes since commit 0c9a67c8f1d2b71a89f66349362412e9bf6becab:

  Merge tag 'mac80211-for-john-2014-11-04' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211 (2014-11-04 15:56:33 -0500)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless.git tags/master-2014-11-11

for you to fetch changes up to 4e6ce4dc7ce71d0886908d55129d5d6482a27ff9:

  ath9k: Fix RTC_DERIVED_CLK usage (2014-11-11 16:24:18 -0500)

----------------------------------------------------------------
Arend van Spriel (1):
      brcmfmac: fix conversion of channel width 20MHZ_NOHT

Emmanuel Grumbach (1):
      iwlwifi: mvm: abort scan upon RFKILL

Hauke Mehrtens (1):
      b43: fix NULL pointer dereference in b43_phy_copy()

John W. Linville (2):
      Merge tag 'mac80211-for-john-2014-11-10' of git://git.kernel.org/.../jberg/mac80211
      Merge tag 'iwlwifi-for-john-2014-11-10' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes

Larry Finger (3):
      rtlwifi: Fix setting of tx descriptor for new trx flow
      rtlwifi: Fix errors in descriptor manipulation
      rtlwifi: rtl8192se: Fix connection problems

Liad Kaufman (1):
      iwlwifi: pcie: fix prph dump length

Miaoqing Pan (1):
      ath9k: Fix RTC_DERIVED_CLK usage

Ronald Wahl (1):
      mac80211: Fix regression that triggers a kernel BUG with CCMP

Stanislaw Gruszka (1):
      rt2x00: do not align payload on modern H/W

 drivers/net/wireless/ath/ath9k/ar9003_phy.c        | 13 ++++++
 drivers/net/wireless/ath/ath9k/hw.c                | 13 ------
 drivers/net/wireless/b43/phy_common.c              |  4 +-
 .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c  |  6 +++
 drivers/net/wireless/iwlwifi/mvm/scan.c            | 20 ++++-----
 drivers/net/wireless/iwlwifi/pcie/trans.c          |  3 +-
 drivers/net/wireless/rt2x00/rt2x00queue.c          | 50 ++++++----------------
 drivers/net/wireless/rtlwifi/pci.c                 | 19 +++++---
 drivers/net/wireless/rtlwifi/rtl8192se/hw.c        |  7 ++-
 drivers/net/wireless/rtlwifi/rtl8192se/phy.c       |  2 +
 drivers/net/wireless/rtlwifi/rtl8192se/sw.c        | 16 +++++++
 net/mac80211/aes_ccm.c                             |  3 ++
 12 files changed, 81 insertions(+), 75 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 697c4ae90af0..1e8ea5e4d4ca 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -664,6 +664,19 @@ static void ar9003_hw_override_ini(struct ath_hw *ah)
 		ah->enabled_cals |= TX_CL_CAL;
 	else
 		ah->enabled_cals &= ~TX_CL_CAL;
+
+	if (AR_SREV_9340(ah) || AR_SREV_9531(ah) || AR_SREV_9550(ah)) {
+		if (ah->is_clk_25mhz) {
+			REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x17c << 1);
+			REG_WRITE(ah, AR_SLP32_MODE, 0x0010f3d7);
+			REG_WRITE(ah, AR_SLP32_INC, 0x0001e7ae);
+		} else {
+			REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x261 << 1);
+			REG_WRITE(ah, AR_SLP32_MODE, 0x0010f400);
+			REG_WRITE(ah, AR_SLP32_INC, 0x0001e800);
+		}
+		udelay(100);
+	}
 }
 
 static void ar9003_hw_prog_ini(struct ath_hw *ah,
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 8be4b1453394..2ad605760e21 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -861,19 +861,6 @@ static void ath9k_hw_init_pll(struct ath_hw *ah,
 	udelay(RTC_PLL_SETTLE_DELAY);
 
 	REG_WRITE(ah, AR_RTC_SLEEP_CLK, AR_RTC_FORCE_DERIVED_CLK);
-
-	if (AR_SREV_9340(ah) || AR_SREV_9550(ah)) {
-		if (ah->is_clk_25mhz) {
-			REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x17c << 1);
-			REG_WRITE(ah, AR_SLP32_MODE, 0x0010f3d7);
-			REG_WRITE(ah,  AR_SLP32_INC, 0x0001e7ae);
-		} else {
-			REG_WRITE(ah, AR_RTC_DERIVED_CLK, 0x261 << 1);
-			REG_WRITE(ah, AR_SLP32_MODE, 0x0010f400);
-			REG_WRITE(ah,  AR_SLP32_INC, 0x0001e800);
-		}
-		udelay(100);
-	}
 }
 
 static void ath9k_hw_init_interrupt_masks(struct ath_hw *ah,
diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c
index 1dfc682a8055..ee27b06074e1 100644
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -300,9 +300,7 @@ void b43_phy_write(struct b43_wldev *dev, u16 reg, u16 value)
 
 void b43_phy_copy(struct b43_wldev *dev, u16 destreg, u16 srcreg)
 {
-	assert_mac_suspended(dev);
-	dev->phy.ops->phy_write(dev, destreg,
-		dev->phy.ops->phy_read(dev, srcreg));
+	b43_phy_write(dev, destreg, b43_phy_read(dev, srcreg));
 }
 
 void b43_phy_mask(struct b43_wldev *dev, u16 offset, u16 mask)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 28fa25b509db..39b45c038a93 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -299,6 +299,7 @@ static u16 chandef_to_chanspec(struct brcmu_d11inf *d11inf,
 	primary_offset = ch->center_freq1 - ch->chan->center_freq;
 	switch (ch->width) {
 	case NL80211_CHAN_WIDTH_20:
+	case NL80211_CHAN_WIDTH_20_NOHT:
 		ch_inf.bw = BRCMU_CHAN_BW_20;
 		WARN_ON(primary_offset != 0);
 		break;
@@ -323,6 +324,10 @@ static u16 chandef_to_chanspec(struct brcmu_d11inf *d11inf,
 				ch_inf.sb = BRCMU_CHAN_SB_LU;
 		}
 		break;
+	case NL80211_CHAN_WIDTH_80P80:
+	case NL80211_CHAN_WIDTH_160:
+	case NL80211_CHAN_WIDTH_5:
+	case NL80211_CHAN_WIDTH_10:
 	default:
 		WARN_ON_ONCE(1);
 	}
@@ -333,6 +338,7 @@ static u16 chandef_to_chanspec(struct brcmu_d11inf *d11inf,
 	case IEEE80211_BAND_5GHZ:
 		ch_inf.band = BRCMU_CHAN_BAND_5G;
 		break;
+	case IEEE80211_BAND_60GHZ:
 	default:
 		WARN_ON_ONCE(1);
 	}
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index b280d5d87127..7554f7053830 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -602,16 +602,6 @@ static int iwl_mvm_cancel_regular_scan(struct iwl_mvm *mvm)
 					       SCAN_COMPLETE_NOTIFICATION };
 	int ret;
 
-	if (mvm->scan_status == IWL_MVM_SCAN_NONE)
-		return 0;
-
-	if (iwl_mvm_is_radio_killed(mvm)) {
-		ieee80211_scan_completed(mvm->hw, true);
-		iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);
-		mvm->scan_status = IWL_MVM_SCAN_NONE;
-		return 0;
-	}
-
 	iwl_init_notification_wait(&mvm->notif_wait, &wait_scan_abort,
 				   scan_abort_notif,
 				   ARRAY_SIZE(scan_abort_notif),
@@ -1400,6 +1390,16 @@ int iwl_mvm_unified_sched_scan_lmac(struct iwl_mvm *mvm,
 
 int iwl_mvm_cancel_scan(struct iwl_mvm *mvm)
 {
+	if (mvm->scan_status == IWL_MVM_SCAN_NONE)
+		return 0;
+
+	if (iwl_mvm_is_radio_killed(mvm)) {
+		ieee80211_scan_completed(mvm->hw, true);
+		iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);
+		mvm->scan_status = IWL_MVM_SCAN_NONE;
+		return 0;
+	}
+
 	if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_LMAC_SCAN)
 		return iwl_mvm_scan_offload_stop(mvm, true);
 	return iwl_mvm_cancel_regular_scan(mvm);
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index 160c3ebc48d0..dd2f3f8baa9d 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -1894,8 +1894,7 @@ static u32 iwl_trans_pcie_dump_prph(struct iwl_trans *trans,
 		int reg;
 		__le32 *val;
 
-		prph_len += sizeof(*data) + sizeof(*prph) +
-			num_bytes_in_chunk;
+		prph_len += sizeof(**data) + sizeof(*prph) + num_bytes_in_chunk;
 
 		(*data)->type = cpu_to_le32(IWL_FW_ERROR_DUMP_PRPH);
 		(*data)->len = cpu_to_le32(sizeof(*prph) +
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 8e68f87ab13c..66ff36447b94 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -158,55 +158,29 @@ void rt2x00queue_align_frame(struct sk_buff *skb)
 	skb_trim(skb, frame_length);
 }
 
-void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length)
+/*
+ * H/W needs L2 padding between the header and the paylod if header size
+ * is not 4 bytes aligned.
+ */
+void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int hdr_len)
 {
-	unsigned int payload_length = skb->len - header_length;
-	unsigned int header_align = ALIGN_SIZE(skb, 0);
-	unsigned int payload_align = ALIGN_SIZE(skb, header_length);
-	unsigned int l2pad = payload_length ? L2PAD_SIZE(header_length) : 0;
+	unsigned int l2pad = (skb->len > hdr_len) ? L2PAD_SIZE(hdr_len) : 0;
 
-	/*
-	 * Adjust the header alignment if the payload needs to be moved more
-	 * than the header.
-	 */
-	if (payload_align > header_align)
-		header_align += 4;
-
-	/* There is nothing to do if no alignment is needed */
-	if (!header_align)
+	if (!l2pad)
 		return;
 
-	/* Reserve the amount of space needed in front of the frame */
-	skb_push(skb, header_align);
-
-	/*
-	 * Move the header.
-	 */
-	memmove(skb->data, skb->data + header_align, header_length);
-
-	/* Move the payload, if present and if required */
-	if (payload_length && payload_align)
-		memmove(skb->data + header_length + l2pad,
-			skb->data + header_length + l2pad + payload_align,
-			payload_length);
-
-	/* Trim the skb to the correct size */
-	skb_trim(skb, header_length + l2pad + payload_length);
+	skb_push(skb, l2pad);
+	memmove(skb->data, skb->data + l2pad, hdr_len);
 }
 
-void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int header_length)
+void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int hdr_len)
 {
-	/*
-	 * L2 padding is only present if the skb contains more than just the
-	 * IEEE 802.11 header.
-	 */
-	unsigned int l2pad = (skb->len > header_length) ?
-				L2PAD_SIZE(header_length) : 0;
+	unsigned int l2pad = (skb->len > hdr_len) ? L2PAD_SIZE(hdr_len) : 0;
 
 	if (!l2pad)
 		return;
 
-	memmove(skb->data + l2pad, skb->data, header_length);
+	memmove(skb->data + l2pad, skb->data, hdr_len);
 	skb_pull(skb, l2pad);
 }
 
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 25daa8715219..61f5d36eca6a 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -842,7 +842,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
 			break;
 		}
 		/* handle command packet here */
-		if (rtlpriv->cfg->ops->rx_command_packet(hw, stats, skb)) {
+		if (rtlpriv->cfg->ops->rx_command_packet &&
+		    rtlpriv->cfg->ops->rx_command_packet(hw, stats, skb)) {
 				dev_kfree_skb_any(skb);
 				goto end;
 		}
@@ -1127,9 +1128,14 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw)
 
 	__skb_queue_tail(&ring->queue, pskb);
 
-	rtlpriv->cfg->ops->set_desc(hw, (u8 *)pdesc, true, HW_DESC_OWN,
-				    &temp_one);
-
+	if (rtlpriv->use_new_trx_flow) {
+		temp_one = 4;
+		rtlpriv->cfg->ops->set_desc(hw, (u8 *)pbuffer_desc, true,
+					    HW_DESC_OWN, (u8 *)&temp_one);
+	} else {
+		rtlpriv->cfg->ops->set_desc(hw, (u8 *)pdesc, true, HW_DESC_OWN,
+					    &temp_one);
+	}
 	return;
 }
 
@@ -1370,9 +1376,9 @@ static void _rtl_pci_free_tx_ring(struct ieee80211_hw *hw,
 	ring->desc = NULL;
 	if (rtlpriv->use_new_trx_flow) {
 		pci_free_consistent(rtlpci->pdev,
-				    sizeof(*ring->desc) * ring->entries,
+				    sizeof(*ring->buffer_desc) * ring->entries,
 				    ring->buffer_desc, ring->buffer_desc_dma);
-		ring->desc = NULL;
+		ring->buffer_desc = NULL;
 	}
 }
 
@@ -1543,7 +1549,6 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
 							 true,
 							 HW_DESC_TXBUFF_ADDR),
 						 skb->len, PCI_DMA_TODEVICE);
-				ring->idx = (ring->idx + 1) % ring->entries;
 				kfree_skb(skb);
 				ring->idx = (ring->idx + 1) % ring->entries;
 			}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
index 00e067044c08..5761d5b49e39 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
@@ -1201,6 +1201,9 @@ static int _rtl92se_set_media_status(struct ieee80211_hw *hw,
 
 	}
 
+	if (type != NL80211_IFTYPE_AP &&
+	    rtlpriv->mac80211.link_state < MAC80211_LINKED)
+		bt_msr = rtl_read_byte(rtlpriv, MSR) & ~MSR_LINK_MASK;
 	rtl_write_byte(rtlpriv, (MSR), bt_msr);
 
 	temp = rtl_read_dword(rtlpriv, TCR);
@@ -1262,6 +1265,7 @@ void rtl92se_enable_interrupt(struct ieee80211_hw *hw)
 	rtl_write_dword(rtlpriv, INTA_MASK, rtlpci->irq_mask[0]);
 	/* Support Bit 32-37(Assign as Bit 0-5) interrupt setting now */
 	rtl_write_dword(rtlpriv, INTA_MASK + 4, rtlpci->irq_mask[1] & 0x3F);
+	rtlpci->irq_enabled = true;
 }
 
 void rtl92se_disable_interrupt(struct ieee80211_hw *hw)
@@ -1276,8 +1280,7 @@ void rtl92se_disable_interrupt(struct ieee80211_hw *hw)
 	rtlpci = rtl_pcidev(rtl_pcipriv(hw));
 	rtl_write_dword(rtlpriv, INTA_MASK, 0);
 	rtl_write_dword(rtlpriv, INTA_MASK + 4, 0);
-
-	synchronize_irq(rtlpci->pdev->irq);
+	rtlpci->irq_enabled = false;
 }
 
 static u8 _rtl92s_set_sysclk(struct ieee80211_hw *hw, u8 data)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/phy.c b/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
index 77c5b5f35244..4b4612fe2fdb 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
@@ -399,6 +399,8 @@ static bool _rtl92s_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 		case 2:
 			currentcmd = &postcommoncmd[*step];
 			break;
+		default:
+			return true;
 		}
 
 		if (currentcmd->cmdid == CMDID_END) {
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index aadba29c167a..fb003868bdef 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -236,6 +236,19 @@ static void rtl92s_deinit_sw_vars(struct ieee80211_hw *hw)
 	}
 }
 
+static bool rtl92se_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue,
+				      u16 index)
+{
+	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
+	struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue];
+	u8 *entry = (u8 *)(&ring->desc[ring->idx]);
+	u8 own = (u8)rtl92se_get_desc(entry, true, HW_DESC_OWN);
+
+	if (own)
+		return false;
+	return true;
+}
+
 static struct rtl_hal_ops rtl8192se_hal_ops = {
 	.init_sw_vars = rtl92s_init_sw_vars,
 	.deinit_sw_vars = rtl92s_deinit_sw_vars,
@@ -269,6 +282,7 @@ static struct rtl_hal_ops rtl8192se_hal_ops = {
 	.led_control = rtl92se_led_control,
 	.set_desc = rtl92se_set_desc,
 	.get_desc = rtl92se_get_desc,
+	.is_tx_desc_closed = rtl92se_is_tx_desc_closed,
 	.tx_polling = rtl92se_tx_polling,
 	.enable_hw_sec = rtl92se_enable_hw_security_config,
 	.set_key = rtl92se_set_key,
@@ -306,6 +320,8 @@ static struct rtl_hal_cfg rtl92se_hal_cfg = {
 	.maps[MAC_RCR_ACRC32] = RCR_ACRC32,
 	.maps[MAC_RCR_ACF] = RCR_ACF,
 	.maps[MAC_RCR_AAP] = RCR_AAP,
+	.maps[MAC_HIMR] = INTA_MASK,
+	.maps[MAC_HIMRE] = INTA_MASK + 4,
 
 	.maps[EFUSE_TEST] = REG_EFUSE_TEST,
 	.maps[EFUSE_CTRL] = REG_EFUSE_CTRL,
diff --git a/net/mac80211/aes_ccm.c b/net/mac80211/aes_ccm.c
index ec24378caaaf..09d9caaec591 100644
--- a/net/mac80211/aes_ccm.c
+++ b/net/mac80211/aes_ccm.c
@@ -53,6 +53,9 @@ int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
 		__aligned(__alignof__(struct aead_request));
 	struct aead_request *aead_req = (void *) aead_req_data;
 
+	if (data_len == 0)
+		return -EINVAL;
+
 	memset(aead_req, 0, sizeof(aead_req_data));
 
 	sg_init_one(&pt, data, data_len);
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related

* Re: [PATCH 2/3] r8169: Use load_acquire() and store_release() to reduce memory barrier overhead
From: Francois Romieu @ 2014-11-13 21:30 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: linux-arch, netdev, linux-kernel, mikey, tony.luck,
	mathieu.desnoyers, donald.c.skidmore, peterz, benh,
	heiko.carstens, oleg, will.deacon, davem, michael, matthew.vick,
	nic_swsd, geert, jeffrey.t.kirsher, fweisbec, schwidefsky, linux,
	paulmck, torvalds, mingo
In-Reply-To: <20141113192735.12579.22892.stgit@ahduyck-server>

Alexander Duyck <alexander.h.duyck@redhat.com> :
[...]
> In addition the r8169 uses a rmb() however I believe it is placed incorrectly
> as I assume it supposed to be ordering descriptor reads after the check for
> ownership.

Not exactly. It's a barrier against compiler optimization from 2004.
It should not matter.

However I disagree with the change below:

> @@ -7284,11 +7280,11 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
>  		struct RxDesc *desc = tp->RxDescArray + entry;
>  		u32 status;
>  
> -		rmb();
> -		status = le32_to_cpu(desc->opts1) & tp->opts1_mask;
> -
> +		status = cpu_to_le32(load_acquire(&desc->opts1));
>  		if (status & DescOwn)
>  			break;
> +
> +		status &= tp->opts1_mask;

-> tp->opts1_mask is not __le32 tainted.

Btw, should I consider the sketch above as a skeleton in my r8169 closet ?

           NIC                      CPU0                      CPU1
| CPU | NIC | CPU | CPU | 

                          | CPU | NIC | CPU | CPU |
                                         ^ tx_dirty

                                [start_xmit...

| CPU | CPU | CPU | CPU |
   (NIC did it's job)
                                                           [rtl_tx...
                          | ... | ... | NIC | NIC |
                                  (ring update)
                              (tx_dirty increases)

                                                     | CPU | CPU | ??? | ??? |
                                                           tx_dirty ?
                                                     reaping about-to-be-sent
                                                     buffers on some platforms ?
                                ...start_xmit]


-- 
Ueimor

^ permalink raw reply

* [PATCH 54/56] net/ipv4: support compiling out splice
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy,
	open list:NETWORKING [IPv4/..., open list
In-Reply-To: <1415913813-362-1-git-send-email-pieter@boesman.nl>

Compile out splice support from ipv4 networking when the splice-family of
syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is
undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 net/ipv4/af_inet.c | 2 +-
 net/ipv4/tcp.c     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index d156b3c..e025478 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -917,7 +917,7 @@ const struct proto_ops inet_stream_ops = {
 	.recvmsg	   = inet_recvmsg,
 	.mmap		   = sock_no_mmap,
 	.sendpage	   = inet_sendpage,
-	.splice_read	   = tcp_splice_read,
+	SPLICE_READ_INIT(tcp_splice_read)
 #ifdef CONFIG_COMPAT
 	.compat_setsockopt = compat_sock_common_setsockopt,
 	.compat_getsockopt = compat_sock_common_getsockopt,
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 541f26a..afc825f 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -686,6 +686,7 @@ static void tcp_push(struct sock *sk, int flags, int mss_now,
 	__tcp_push_pending_frames(sk, mss_now, nonagle);
 }
 
+#ifdef CONFIG_SYSCALL_SPLICE
 static int tcp_splice_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
 				unsigned int offset, size_t len)
 {
@@ -805,6 +806,7 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
 	return ret;
 }
 EXPORT_SYMBOL(tcp_splice_read);
+#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
 
 struct sk_buff *sk_stream_alloc_skb(struct sock *sk, int size, gfp_t gfp)
 {
-- 
1.9.1

^ permalink raw reply related

* Re: [PATCH 0/4] move pci_assivned_vfs() check (while disabling VFs) to pci sub-system
From: Don Dutile @ 2014-11-13 21:36 UTC (permalink / raw)
  To: Sathya Perla, Alex Williamson
  Cc: linux-pci@vger.kernel.org, netdev@vger.kernel.org,
	ariel.elior@qlogic.com, linux.nics@intel.com,
	shahed.shaikh@qlogic.com
In-Reply-To: <CF9D1877D81D214CB0CA0669EFAE020C68CD95E1@CMEXMB1.ad.emulex.com>

On 11/13/2014 02:04 AM, Sathya Perla wrote:
>> -----Original Message-----
>> From: Alex Williamson [mailto:alex.williamson@redhat.com]
>>
>> On Tue, 2014-11-11 at 14:09 -0500, Don Dutile wrote:
>>> On 11/10/2014 06:53 AM, Sathya Perla wrote:
>>>> A user must not be allowed to disable VFs while they are already assigned
>> to
>>>> a guest. This check is being made in each individual driver that
>> implements
>>>> the sriov_configure PCI method.
>>>> This patch-set fixes this code duplication by moving this check from
>>>> drivers to the sriov_nuvfs_store() routine just before invoking
>>>> sriov_configure() when num_vfs is equal to 0.
>>>>
>>>> Vasundhara Volam (4):
>>>>     pci: move pci_assivned_vfs() check while disabling VFs to pci
>>>>       sub-system
>>>>     bnx2x: remove pci_assigned_vfs() check while disabling VFs
>>>>     i40e: remove pci_assigned_vfs() check while disabling VFs
>>>>     qlcnic: remove pci_assigned_vfs() check while disabling VFs
>>>>
>>>>    drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c  |    2 +-
>>>>    drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |    7 +------
>>>>    .../net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c   |   10 ----------
>>>>    drivers/pci/pci-sysfs.c                            |    5 +++++
>>>>    4 files changed, 7 insertions(+), 17 deletions(-)
>>>>
>>> I have had a side conversation with Alex Williamson, VFIO author.
>>>
>>> VFIO is the upstream method that device-assignment is managed/handled
>> on kvm now.
>>> It does not set the PCI_DEV_FLAGS_ASSIGNED pci dev-flags, and thus,
>>> this check will not work when VFIO is used.
>>>
>>> This patch set will only work for the former, kvm-managed, device-
>> assignment method,
>>> which is currently being deprecated in qemu as well.
>>>
>>> So, yes, it works for kvm managed device-assignment, but not the
>>> newer, VFIO-based device-assignment.
>>>
>>> Note, also, that the pci_assigned_vfs() check in the drivers will
>>> always return 0 when VFIO is used for device assignment, so keeping
>>> these checks in the drivers doesn't do what they imply either.
>>>
>>> So, taking in the patch solves old, kvm-managed, device assignment,
>>> but a new method is needed when VFIO is involved.
>>>
>>> - Don
>>>
>>> ps -- Note: just adding the flag setting in vfio-pci does not necessarily
>>>         solve this problem.  VFIO does not know if a device is assigned to a
>> guest;
>>>         it only knows a caller of the ioctl requesting the device to be assigned
>>>         to vfio, and to be dma-mapped for a region of memory, has been
>> requested.
>>>         So, a new PF<->VF mechanism needs to be put in place to
>>>         determine the equivalent information.
>>
>> pps -- Note: testing pci_assivned_vfs() is racy, nothing prevents the flag
>> 	being added to a device between your check and removing the VF
>> device.
>> 	This is one of the reasons that vfio-pci doesn't use it and that this
>> 	interface should be discouraged in the kernel.
>
> Alex/Don, I agree with the points you've raised.
> But, I'd like to know whether you think this patch-set should be accepted or not.
> Even though this patch-set doesn't fix any of the pending issues raised here,
> it's a small step forward as it reduces the number of invocations of pci_assigned_vfs()
> check which is a good thing.
>
> thanks,
> -Sathya
>

IMO, it's only a fix for XEN.  Upstream has moved on to VFIO-based device assignment,
and these patches do not fix the issue.  They don't make it any worse, either,
but I don't want someone scanning the patch list thinking it's been fixed either.

So, it's ok (but racy, as it is today) for kvm-managed device-assignment & Xen
pci passthrough, but does zip for VFIO-based assignment.

We need a new api - maybe another/new state in sysfs, so userspace can set it
(like qemu &/or libvirt), as well as (xen) kernel ... and meeting non-racy condition(s).

^ permalink raw reply

* Re: [PATCH 16/16] rxrpc: Replace smp_read_barrier_depends() with lockless_dereference()
From: Pranith Kumar @ 2014-11-13 21:55 UTC (permalink / raw)
  To: David Howells
  Cc: David S. Miller, Dan Carpenter, open list:NETWORKING [GENERAL],
	open list, paulmck
In-Reply-To: <24601.1415911646@warthog.procyon.org.uk>

On 11/13/2014 03:47 PM, David Howells wrote:
> Pranith Kumar <bobby.prani@gmail.com> wrote:
> 
>> Recently lockless_dereference() was added which can be used in place of
>> hard-coding smp_read_barrier_depends(). The following PATCH makes the change.
> 
> Actually, the use of smp_read_barrier_depends() is wrong in circular
> buffering.  See Documentation/circular-buffers.txt
> 

OK. Should I send in a patch removing these barriers then?

--
Pranith

^ permalink raw reply

* Re: [PATCH] sh_eth: r8a779x: Enable automatically fetch receive descriptor
From: Sergei Shtylyov @ 2014-11-13 21:57 UTC (permalink / raw)
  To: Yoshihiro Kaneko, netdev
  Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh,
	Grant Likely
In-Reply-To: <1415861819-27812-1-git-send-email-ykaneko0929@gmail.com>

Hello.

On 11/13/2014 09:56 AM, Yoshihiro Kaneko wrote:

> From: Kouei Abe <kouei.abe.cp@renesas.com>

> HDMAC automatically fetches the receive descriptor and receives frames.
> Continuous reception of multiple frames is possible.

> Signed-off-by: Kouei Abe <kouei.abe.cp@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---

> This patch is based on net-next tree.

    This patch is not needed any more because of an earlier patch by Ben Dooks 
that set RMCR.RNC for all Ether devices.

>   drivers/net/ethernet/renesas/sh_eth.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index dbe8606..badb734 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -494,6 +494,7 @@ static struct sh_eth_cpu_data r8a779x_data = {
>   	.eesr_err_check	= EESR_TWB | EESR_TABT | EESR_RABT | EESR_RFE |
>   			  EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE |
>   			  EESR_ECI,
> +	.rmcr_value	= RMCR_RNC,

    Looks like you didn't even bother to compile.

WBR, Sergei


^ permalink raw reply

* Re: [PATCH] sh_eth: r8a779x: Enable automatically fetch receive descriptor
From: Sergei Shtylyov @ 2014-11-13 21:59 UTC (permalink / raw)
  To: David Miller, ykaneko0929
  Cc: netdev, horms, magnus.damm, linux-sh, grant.likely
In-Reply-To: <20141113.150311.1961794581032201784.davem@davemloft.net>

Hello.

On 11/13/2014 11:03 PM, David Miller wrote:

>> From: Kouei Abe <kouei.abe.cp@renesas.com>

>> HDMAC automatically fetches the receive descriptor and receives frames.
>> Continuous reception of multiple frames is possible.

>> Signed-off-by: Kouei Abe <kouei.abe.cp@renesas.com>
>> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>> ---
>>
>> This patch is based on net-next tree.
>
> This doesn't even compile, or, it depends upon another patch which you have
> not mentioned.

    This patch is just very outdated -- this issue has been fixed for all SoCs 
before.

> Because sh_eth_cpu_data does not have an rmcr_value field.

     Right, it was removed by the above mentioned patch (based on your 
feedback BTW ;-).

WBR, Sergei


^ permalink raw reply

* Re: [PATCH] sh_eth: Optimization for RX excess judgement
From: Sergei Shtylyov @ 2014-11-13 22:09 UTC (permalink / raw)
  To: Yoshihiro Kaneko, netdev
  Cc: David S. Miller, Simon Horman, Magnus Damm, linux-sh
In-Reply-To: <1415862031-27925-1-git-send-email-ykaneko0929@gmail.com>

Hello.

On 11/13/2014 10:00 AM, Yoshihiro Kaneko wrote:

> From: Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>

> Both of 'boguscnt' and 'quota' have nearly meaning as the condition of
> the reception loop.
> In order to cut down redundant processing, this patch changes excess judgement.

> Signed-off-by: Mitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---

> This patch is based on net tree.

    This is clearly 'net-next' material.

>   drivers/net/ethernet/renesas/sh_eth.c | 15 +++++++++------
>   1 file changed, 9 insertions(+), 6 deletions(-)

> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 60e9c2c..7d46326 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -1394,10 +1394,15 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
>
>   	int entry = mdp->cur_rx % mdp->num_rx_ring;
>   	int boguscnt = (mdp->dirty_rx + mdp->num_rx_ring) - mdp->cur_rx;
> +	int limit = boguscnt;
>   	struct sk_buff *skb;
>   	u16 pkt_len = 0;
>   	u32 desc_status;
>
> +	if (quota) {

    I don't see what's the point in checking -- quota is always non-NULL.

> +		boguscnt = min(boguscnt, *quota);
> +		limit = boguscnt;
> +	}
>   	rxdesc = &mdp->rx_ring[entry];
>   	while (!(rxdesc->status & cpu_to_edmac(mdp, RD_RACT))) {
>   		desc_status = edmac_to_cpu(mdp, rxdesc->status);
[...]
> @@ -1501,7 +1501,10 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
>   		sh_eth_write(ndev, EDRRR_R, EDRRR);
>   	}
>
> -	return *quota <= 0;
> +	if (quota)

    Again, seeing no sense in this check.

> +		*quota -= limit - (++boguscnt);
> +
> +	return (boguscnt <= 0);

    Parens not needed.

[...]

WBR, Sergei


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox