1. 12 7月, 2016 9 次提交
    • X
      sctp: implement prsctp RTX policy · 01aadb3a
      Xin Long 提交于
      prsctp RTX policy is a policy to abandon chunks when they are
      retransmitted beyond the max count.
      
      This patch uses sent_count to count how many times one chunk has
      been sent, and prsctp_param is the max rtx count, which is from
      sinfo->sinfo_timetolive in sctp_set_prsctp_policy(). So similar
      to TTL policy, if RTX policy is enabled, msg->expire_at won't
      work.
      
      Then in sctp_chunk_abandoned, this patch checks if chunk->sent_count
      is bigger than chunk->prsctp_param to abandon this chunk.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      01aadb3a
    • X
      sctp: implement prsctp TTL policy · a6c2f792
      Xin Long 提交于
      prsctp TTL policy is a policy to abandon chunks when they expire
      at the specific time in local stack. It's similar with expires_at
      in struct sctp_datamsg.
      
      This patch uses sinfo->sinfo_timetolive to set the specific time for
      TTL policy. sinfo->sinfo_timetolive is also used for msg->expires_at.
      So if prsctp_enable or TTL policy is not enabled, msg->expires_at
      still works as before.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a6c2f792
    • X
      sctp: add SCTP_PR_ASSOC_STATUS on sctp sockopt · 826d253d
      Xin Long 提交于
      This patch adds SCTP_PR_ASSOC_STATUS to sctp sockopt, which is used
      to dump the prsctp statistics info from the asoc. The prsctp statistics
      includes abandoned_sent/unsent from the asoc. abandoned_sent is the
      count of the packets we drop packets from retransmit/transmited queue,
      and abandoned_unsent is the count of the packets we drop from out_queue
      according to the policy.
      
      Note: another option for prsctp statistics dump described in rfc is
      SCTP_PR_STREAM_STATUS, which is used to dump the prsctp statistics
      info from each stream. But by now, linux doesn't yet have per stream
      statistics info, it needs rfc6525 to be implemented. As the prsctp
      statistics for each stream has to be based on per stream statistics,
      we will delay it until rfc6525 is done in linux.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      826d253d
    • X
      sctp: add SCTP_DEFAULT_PRINFO into sctp sockopt · f959fb44
      Xin Long 提交于
      This patch adds SCTP_DEFAULT_PRINFO to sctp sockopt. It is used
      to set/get sctp Partially Reliable Policies' default params,
      which includes 3 policies (ttl, rtx, prio) and their values.
      
      Still, if we set policy params in sndinfo, we will use the params
      of sndinfo against chunks, instead of the default params.
      
      In this patch, we will use 5-8bit of sp/asoc->default_flags
      to store prsctp policies, and reuse asoc->default_timetolive
      to store their values. It means if we enable and set prsctp
      policy, prior ttl timeout in sctp will not work any more.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f959fb44
    • X
      sctp: add SCTP_PR_SUPPORTED on sctp sockopt · 28aa4c26
      Xin Long 提交于
      According to section 4.5 of rfc7496, prsctp_enable should be per asoc.
      We will add prsctp_enable to both asoc and ep, and replace the places
      where it used net.sctp->prsctp_enable with asoc->prsctp_enable.
      
      ep->prsctp_enable will be initialized with net.sctp->prsctp_enable, and
      asoc->prsctp_enable will be initialized with ep->prsctp_enable. We can
      also modify it's value through sockopt SCTP_PR_SUPPORTED.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      28aa4c26
    • P
      Revert "net: ethernet: bcmgenet: use phy_ethtool_{get|set}_link_ksettings" · bac65c4b
      Philippe Reynes 提交于
      This reverts commit 4386f566 ("net: ethernet: bcmgenet: use
      phy_ethtool_{get|set}_link_ksettings")
      
      This patch is wrong, the function phy_ethtool_{get|set}_link_ksettings
      don't check if the device is running, but the driver bcmgenet need this
      check.
      
      The function {get|set}_settings need to access the mdio bus, and this
      bus may only be used when the device is running. Otherwise, the clock
      is disable and a mdio access will fail.
      Signed-off-by: NPhilippe Reynes <tremyfr@gmail.com>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bac65c4b
    • D
      Merge branch 'b53-nsp-switch' · ddeec083
      David S. Miller 提交于
      Florian Fainelli says:
      
      ====================
      net: dsa: b53: Add Broadcom NSP switch support
      
      This patch series updates the B53 driver to support Broadcom's Northstar Plus
      Soc integrated switch.
      
      Unlike the version of the core present in BCM5301x/Northstar, we cannot read the
      full chip id of the switch, so we need to get the information about our switch
      id from Device Tree.
      
      Other than that, this is a regular Broadcom Ethernet switch which is register
      compatible for all practical purposes with the existing switch driver.
      
      Since DSA requires a working CPU Ethernet MAC driver this depends on Jon
      Mason's AMAC/BGMAC driver changes to support NSP. Board specific changes depend
      on patches present in Broadcom's ARM SoC branches and will be posted in a short
      while.
      ====================
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ddeec083
    • F
      net: dsa: b53: Add support for BCM585xx/586xx/88312 integrated switch · 991a36bb
      Florian Fainelli 提交于
      Update the SRAB, core driver and binding document to support the
      BCM585xx/586xx/88312 integrated switch (Northstar Plus SoCs family).
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      991a36bb
    • F
      net: dsa: b53: Allow SRAB driver to specify platform data · fefae690
      Florian Fainelli 提交于
      For Northstart Plus SoCs, we cannot detect the switch because only the
      revision information is provied in the Management page, instead, rely on
      Device Tree to tell us the chip id, and pass it down using the
      b53_platform_data structure.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fefae690
  2. 11 7月, 2016 1 次提交
  3. 10 7月, 2016 19 次提交
  4. 09 7月, 2016 8 次提交
    • M
      sctp: fix panic when sending auth chunks · f1533cce
      Marcelo Ricardo Leitner 提交于
      When we introduced GSO support, if using auth the auth chunk was being
      left queued on the packet even after the final segment was generated.
      Later on sctp_transmit_packet it calls sctp_packet_reset, which zeroed
      the packet len while not accounting for this left-over. This caused more
      space to be used the next packet due to the chunk still being queued,
      but space which wasn't allocated as its size wasn't accounted.
      
      The fix is to only queue it back when we know that we are going to
      generate another segment.
      
      Fixes: 90017acc ("sctp: Add GSO support")
      Signed-off-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f1533cce
    • D
      bnxt: fix a condition · 09a7636a
      Dan Carpenter 提交于
      This code generates as static checker warning because htons(ETH_P_IPV6)
      is always true.  From the context it looks like the && was intended to
      be !=.
      
      Fixes: 94758f8d ('bnxt_en: Add GRO logic for BCM5731X chips.')
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      09a7636a
    • A
      bpf: introduce bpf_get_current_task() helper · 606274c5
      Alexei Starovoitov 提交于
      over time there were multiple requests to access different data
      structures and fields of task_struct current, so finally add
      the helper to access 'current' as-is. Tracing bpf programs will do
      the rest of walking the pointers via bpf_probe_read().
      Note that current can be null and bpf program has to deal it with,
      but even dumb passing null into bpf_probe_read() is still safe.
      Suggested-by: NBrendan Gregg <brendan.d.gregg@gmail.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      606274c5
    • V
      net: dsa: initialize the routing table · d390238c
      Vivien Didelot 提交于
      The routing table of every switch in a tree is currently initialized to
      all zeros. This is an issue since 0 is a valid port number.
      
      Add a DSA_RTABLE_NONE=-1 constant to initialize the signed values of the
      routing table pointing to other switches.
      
      This fixes the device mapping of the mv88e6xxx driver where the port
      pointing to the switch itself and to non-existent switches was wrongly
      configured to be 0. It is now set to the expected 0xf value.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d390238c
    • C
      tun: Don't assume type tun in tun_device_event · 86dfb4ac
      Craig Gallek 提交于
      The referenced change added a netlink notifier for processing
      device queue size events.  These events are fired for all devices
      but the registered callback assumed they only occurred for tun
      devices.  This fix adds a check (borrowed from macvtap.c) to discard
      non-tun device events.
      
      For reference, this fixes the following splat:
      [   71.505935] BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
      [   71.513870] IP: [<ffffffff8153c1a0>] tun_device_event+0x110/0x340
      [   71.519906] PGD 3f41f56067 PUD 3f264b7067 PMD 0
      [   71.524497] Oops: 0002 [#1] SMP DEBUG_PAGEALLOC
      [   71.529374] gsmi: Log Shutdown Reason 0x03
      [   71.533417] Modules linked in:[   71.533826] mlx4_en: eth1: Link Up
      
      [   71.539616]  bonding w1_therm wire cdc_acm ehci_pci ehci_hcd mlx4_en ib_uverbs mlx4_ib ib_core mlx4_core
      [   71.549282] CPU: 12 PID: 7915 Comm: set.ixion-haswe Not tainted 4.7.0-dbx-DEV #8
      [   71.556586] Hardware name: Intel Grantley,Wellsburg/Ixion_IT_15, BIOS 2.58.0 05/03/2016
      [   71.564495] task: ffff887f00bb20c0 ti: ffff887f00798000 task.ti: ffff887f00798000
      [   71.571894] RIP: 0010:[<ffffffff8153c1a0>]  [<ffffffff8153c1a0>] tun_device_event+0x110/0x340
      [   71.580327] RSP: 0018:ffff887f0079bbd8  EFLAGS: 00010202
      [   71.585576] RAX: fffffffffffffae8 RBX: ffff887ef6d03378 RCX: 0000000000000000
      [   71.592624] RDX: 0000000000000000 RSI: 0000000000000028 RDI: 0000000000000000
      [   71.599675] RBP: ffff887f0079bc48 R08: 0000000000000000 R09: 0000000000000001
      [   71.606730] R10: 0000000000000004 R11: 0000000000000000 R12: 0000000000000010
      [   71.613780] R13: 0000000000000000 R14: 0000000000000001 R15: ffff887f0079bd00
      [   71.620832] FS:  00007f5cdc581700(0000) GS:ffff883f7f700000(0000) knlGS:0000000000000000
      [   71.628826] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   71.634500] CR2: 0000000000000010 CR3: 0000003f3eb62000 CR4: 00000000001406e0
      [   71.641549] Stack:
      [   71.643533]  ffff887f0079bc08 0000000000000246 000000000000001e ffff887ef6d00000
      [   71.650871]  ffff887f0079bd00 0000000000000000 0000000000000000 ffffffff00000000
      [   71.658210]  ffff887f0079bc48 ffffffff81d24070 00000000fffffff9 ffffffff81cec7a0
      [   71.665549] Call Trace:
      [   71.667975]  [<ffffffff810eeb0d>] notifier_call_chain+0x5d/0x80
      [   71.673823]  [<ffffffff816365d0>] ? show_tx_maxrate+0x30/0x30
      [   71.679502]  [<ffffffff810eeb3e>] __raw_notifier_call_chain+0xe/0x10
      [   71.685778]  [<ffffffff810eeb56>] raw_notifier_call_chain+0x16/0x20
      [   71.691976]  [<ffffffff8160eb30>] call_netdevice_notifiers_info+0x40/0x70
      [   71.698681]  [<ffffffff8160ec36>] call_netdevice_notifiers+0x16/0x20
      [   71.704956]  [<ffffffff81636636>] change_tx_queue_len+0x66/0x90
      [   71.710807]  [<ffffffff816381ef>] netdev_store.isra.5+0xbf/0xd0
      [   71.716658]  [<ffffffff81638350>] tx_queue_len_store+0x50/0x60
      [   71.722431]  [<ffffffff814a6798>] dev_attr_store+0x18/0x30
      [   71.727857]  [<ffffffff812ea3ff>] sysfs_kf_write+0x4f/0x70
      [   71.733274]  [<ffffffff812e9507>] kernfs_fop_write+0x147/0x1d0
      [   71.739045]  [<ffffffff81134a4f>] ? rcu_read_lock_sched_held+0x8f/0xa0
      [   71.745499]  [<ffffffff8125a108>] __vfs_write+0x28/0x120
      [   71.750748]  [<ffffffff8111b137>] ? percpu_down_read+0x57/0x90
      [   71.756516]  [<ffffffff8125d7d8>] ? __sb_start_write+0xc8/0xe0
      [   71.762278]  [<ffffffff8125d7d8>] ? __sb_start_write+0xc8/0xe0
      [   71.768038]  [<ffffffff8125bd5e>] vfs_write+0xbe/0x1b0
      [   71.773113]  [<ffffffff8125c092>] SyS_write+0x52/0xa0
      [   71.778110]  [<ffffffff817528e5>] entry_SYSCALL_64_fastpath+0x18/0xa8
      [   71.784472] Code: 45 31 f6 48 8b 93 78 33 00 00 48 81 c3 78 33 00 00 48 39 d3 48 8d 82 e8 fa ff ff 74 25 48 8d b0 40 05 00 00 49 63 d6 41 83 c6 01 <49> 89 34 d4 48 8b 90 18 05 00 00 48 39 d3 48 8d 82 e8 fa ff ff
      [   71.803655] RIP  [<ffffffff8153c1a0>] tun_device_event+0x110/0x340
      [   71.809769]  RSP <ffff887f0079bbd8>
      [   71.813213] CR2: 0000000000000010
      [   71.816512] ---[ end trace 4db6449606319f73 ]---
      
      Fixes: 1576d986 ("tun: switch to use skb array for tx")
      Signed-off-by: NCraig Gallek <kraig@google.com>
      Acked-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      86dfb4ac
    • D
      Merge tag 'rxrpc-rewrite-20160706' of... · cc3baecb
      David S. Miller 提交于
      Merge tag 'rxrpc-rewrite-20160706' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
      
      David Howells says:
      
      ====================
      rxrpc: Improve conn/call lookup and fix call number generation [ver #3]
      
      I've fixed a couple of patch descriptions and excised the patch that
      duplicated the connections list for reconsideration at a later date.
      
      For reference, the excised patch is sitting on the rxrpc-experimental
      branch of my git tree, based on top of the rxrpc-rewrite branch.  Diffing
      it against yesterday's tag shows no differences.
      
      Would you prefer the patch set to be emailed afresh instead of a git-pull
      request?
      
      David
      ---
      Here's the next part of the AF_RXRPC rewrite.  The two main purposes of
      this set are to fix the call number handling and to make use of RCU when
      looking up the connection or call to pass a received packet to.
      
      Important changes in this set include:
      
       (1) Avoidance of placing stack data into SG lists in rxkad so that kernel
           stacks can become vmalloc'd (Herbert Xu).
      
       (2) Calls cease pinning the connection they used as soon as possible,
           which allows the connection to be discarded sooner and allows the call
           channel on that connection to be reused earlier.
      
       (3) Make each call channel on a connection have a separate and independent
           call number space rather than having a shared number space for the
           connection.  Call numbers should increment monotonically per channel
           on the client, and the server should ignore a call with a lower call
           number for that channel than the latest it has seen.  The RESPONSE
           packet sets the minimum values of each call ID counter on a
           connection.
      
       (4) Look up calls by indexing the channel array on a connection rather
           than by keeping calls in an rbtree on that connection.  Also look up
           calls using the channel array rather than using a hashtable.
      
           The call hashtable can then be removed.
      
       (5) Call terminal statuses are cached in the channel array for the last
           call.  It is assumed that if we the server have seen call N, then the
           client no longer cares about call N-1 on the same channel.
      
           This will allow retransmission of the terminal status in future
           without the need to keep the rxrpc_call struct around.
      
       (6) Peer lookups are moved out of common connection handling code and into
           service connection handling code as client connections (a) must point
           to a peer before they can be used and (b) are looked up by a
           machine-unique connection ID directly, so we only need to look up the
           peer first if we're going to deal with a service call.
      
       (7) The reference count on a connection is held elevated by 1 whilst it is
           alive (ie. idle unused connections have a refcount of 1).  The reaper
           will attempt to change the refcount from 1->0 and skip if this cannot
           be done, whilst look ups only increment the refcount if it's non-zero.
      
           This makes the implementation of RCU lookups easier as we don't have
           to get a ref on the connection or a lock on the connection list to
           prevent a connection being reaped whilst we're contemplating queueing
           a packet that initiates a new service call upon it.
      
           If we need to get a connection, but there's a dead connection in the
           tree, we use rb_replace_node() to replace the dead one with a new one.
      
       (8) Use a seqlock to validate the walk over the service connection rbtree
           attached to a peer when it's being walked in RCU mode.
      
       (9) Make the incoming call/connection packet handling code use RCU mode
           and locks and make it only take a reference if the call/connection
           gets queued on a workqueue.
      
      The intention is that the next set will introduce the connection lifetime
      management and capacity limits to prevent clients from overloading the
      server.
      
      There are some fixes too:
      
       (1) Verifying that a packet coming in to a client connection came from the
           expected source.
      
       (2) Fix handling of connection failure in client call creation where we
           don't reinitialise the list linkage block and a second attempt to
           unlink the failed connection oopses and also we don't set the state
           correctly, which causes an assertion failure.
      
       (3) New service calls were being added to the socket's accept queue under
           the wrong lock.
      
      Changes:
      
       (V2) In rxrpc_find_service_conn_rcu() initialised the sequence number to 0.
      
            Fixed the RCU handling in conn_service.c by introducing and using
            rb_replace_node_rcu() as an RCU-safe alternative in
            rxrpc_publish_service_conn().
      
            Modified and used rcu_dereference_raw() to avoid RCU sparse warnings
            in rxrpc_find_service_conn_rcu().
      
            Added in some missing RCU dereference wrappers.  It seems to be
            necessary to turn on CONFIG_PROVE_RCU_REPEATEDLY as well as
            CONFIG_SPARSE_RCU_POINTER to get the static __rcu annotation checking
            to happen.
      
            Fixed some other sparse warnings, including a missing ntohs() in
            jumbo packet processing.
      
       (V3) Fixed some commit descriptions.
      
            Excised the patch that duplicated the connection list to separate out
            the procfs list for reconsideration at a later date.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cc3baecb
    • K
      netvsc: Use the new in-place consumption APIs in the rx path · 99a50bb1
      K. Y. Srinivasan 提交于
      Use the new APIs for eliminating a copy on the receive path. These new APIs also
      help in minimizing the number of memory barriers we end up issuing (in the
      ringbuffer code) since we can better control when we want to expose the ring
      state to the host.
      
      The patch is being resent to address earlier email issues.
      Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99a50bb1
    • F
      hfsc: reduce hfsc_sched to 14 cachelines · bba7eb5d
      Florian Westphal 提交于
      hfsc_sched is huge (size: 920, cachelines: 15), but we can get it to 14
      cachelines by placing level after filter_cnt (covering 4 byte hole) and
      reducing period/nactive/flags to u32 (period is just a counter,
      incremented when class becomes active -- 2**32 is plenty for this
      purpose, also, long is only 32bit wide on 32bit platforms anyway).
      
      cl_vtperiod is exported to userspace via tc_hfsc_stats, but its period
      member is already u32, so no precision is lost there either.
      
      Cc: Michal Soltys <soltys@ziu.info>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bba7eb5d
  5. 07 7月, 2016 3 次提交