1. 05 Feb, 2015 4 commits
    • Jon Paul Maloy's avatar
      tipc: separate link starting event from link timeout event · af9946fd
      Jon Paul Maloy authored
      When a new link instance is created, it is trigged to start by
      sending it a TIPC_STARTING_EVT, whereafter a regular link
      reset is applied to it.
      
      The starting event is codewise treated as a timeout event, and prompts
      a link RESET message to be sent to the peer node, carrying a link
      session identifier. The later link_reset() call nudges this session
      identifier, whereafter all subsequent RESET messages will be sent out
      with the new identifier. The latter session number overrides the former,
      causing the peer to unconditionally accept it irrespective of its
      current working state.
      
      We don't think that this causes any problem, but it is not in accordance
      with the protocol spec, and may cause confusion when debugging TIPC
      sessions.
      
      To avoid this, we make the starting event distinct from the
      subsequent timeout events, by not allowing the former to send
      out any RESET message. This eliminates the described problem.
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      af9946fd
    • Jon Paul Maloy's avatar
      tipc: eliminate race during node creation · b45db71b
      Jon Paul Maloy authored
      Instances of struct node are created in the function tipc_disc_rcv()
      under the assumption that there is no race between received discovery
      messages arriving from the same node. This assumption is wrong.
      When we use more than one bearer, it is possible that discovery
      messages from the same node arrive at the same moment, resulting in
      creation of two instances of struct tipc_node. This may later cause
      confusion during link establishment, and may result in one of the links
      never becoming activated.
      
      We fix this by making lookup and potential creation of nodes atomic.
      Instead of first looking up the node, and in case of failure, create it,
      we now start with looking up the node inside node_link_create(), and
      return a reference to that one if found. Otherwise, we go ahead and
      create the node as we did before.
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b45db71b
    • Jon Paul Maloy's avatar
      tipc: avoid stale link after aborted failover · 7d24dcdb
      Jon Paul Maloy authored
      During link failover it may happen that the remaining link goes
      down while it is still in the process of taking over traffic
      from a previously failed link. When this happens, we currently
      abort the failover procedure and reset the first failed link to
      non-failover mode, so that it will be ready to re-establish
      contact with its peer when it comes available.
      
      However, if the first link goes down because its bearer was manually
      disabled, it is not enough to reset it; it must also be deleted;
      which is supposed to happen when the failover procedure is finished.
      Otherwise it will remain a zombie link: attached to the owner node
      structure, in mode LINK_STOPPED, and permanently blocking any re-
      establishing of the link to the peer via the interface in question.
      
      We fix this by amending the failover abort procedure. Apart from
      resetting the link to non-failover state, we test if the link is
      also in LINK_STOPPED mode. If so, we delete it, using the conditional
      tipc_link_delete() function introduced in the previous commit.
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d24dcdb
    • Jon Paul Maloy's avatar
      tipc: add reference count to struct tipc_link · 2d72d495
      Jon Paul Maloy authored
      When a bearer is disabled, all pertaining links will be reset and
      deleted. However, if there is a second active link towards a killed
      link's destination, the delete has to be postponed until the failover
      is finished. During this interval, we currently put the link in zombie
      mode, i.e., we take it out of traffic, delete its timer, but leave it
      attached to the owner node structure until all missing packets have
      been received.  When this is done, we detach the link from its node
      and delete it, assuming that the synchronous timer deletion that was
      initiated earlier in a different thread has finished.
      
      This is unsafe, as the failover may finish before del_timer_sync()
      has returned in the other thread.
      
      We fix this by adding an atomic reference counter of type kref in
      struct tipc_link. The counter keeps track of the references kept
      to the link by the owner node and the timer. We then do a conditional
      delete, based on the reference counter, both after the failover has
      been finished and when the timer expires, if applicable. Whoever
      comes last, will actually delete the link. This approach also implies
      that we can make the deletion of the timer asynchronous.
      Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d72d495
  2. 04 Feb, 2015 14 commits
  3. 03 Feb, 2015 19 commits
    • Mika Westerberg's avatar
      net: rfkill: Add Broadcom BCM2E40 bluetooth ACPI ID · 79044f60
      Mika Westerberg authored
      This is yet another Broadcom bluetooth chip with ACPI ID BCM2E40.
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      79044f60
    • Johan Hedberg's avatar
      Bluetooth: Fix potential NULL dereference · 88d9077c
      Johan Hedberg authored
      The bnep_get_device function may be triggered by an ioctl just after a
      connection has gone down. In such a case the respective L2CAP chan->conn
      pointer will get set to NULL (by l2cap_chan_del). This patch adds a
      missing NULL check for this case in the bnep_get_device() function.
      Reported-by: default avatarPatrik Flykt <patrik.flykt@linux.intel.com>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      88d9077c
    • Matej Dubovy's avatar
      Bluetooth: btusb: Add support for Lite-On (04ca) Broadcom based, BCM43142 · 8f0c304c
      Matej Dubovy authored
      Please add support for sub BT chip on the combo card
      Broadcom 43142A0 (in Lenovo E145), 04ca:2007
      
      /sys/kernel/debug/usb/devices
      
      T:  Bus=05 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  3 Spd=12   MxCh= 0
      D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=04ca ProdID=2007 Rev= 1.12
      S:  Manufacturer=Broadcom Corp
      S:  Product=BCM43142A0
      S:  SerialNumber=28E347EC73BD
      C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
      
      Firmware for 04ca:2007 can be extracted from the latest Lenovo E145
      Bluetooth driver for Windows (driver is however described as BCM20702
      but contains also firwmare for BCM43142).
      Search for BCM43142A0_001.001.011.0122.0153.hex within hex files, then
      it must be converted using hex2hcd utility. Rename file to
      BCM43142A0-04ca-2007.hcd, then move to /lib/firmware/brcm/.
      Signed-off-by: default avatarMatej Dubovy <matej.dubovy@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Cc: stable@vger.kernel.org
      8f0c304c
    • Markus Elfring's avatar
      net: sctp: Deletion of an unnecessary check before the function call "kfree" · 7d37d0c1
      Markus Elfring authored
      The kfree() function tests whether its argument is NULL and then
      returns immediately. Thus the test around the call is not needed.
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
      Acked-By: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d37d0c1
    • David S. Miller's avatar
      Merge branch 'udpv6_lockless_send' · 193cdc4a
      David S. Miller authored
      Vladislav Yasevich says:
      
      ====================
      ipv6: Add lockless UDP send path
      
      This series introduces a lockless UDPv6 send path similar to
      what Herbert Xu did for IPv4 a while ago.
      
      There are some difference from IPv4.  IPv6 caching for flow
      label is a bit different, as well as it requires another cork
      cork structure that holds the IPv6 ancillary data.
      
      Please take a look.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      193cdc4a
    • Vlad Yasevich's avatar
      ipv6: Allow for partial checksums on non-ufo packets · 32dce968
      Vlad Yasevich authored
      Currntly, if we are not doing UFO on the packet, all UDP
      packets will start with CHECKSUM_NONE and thus perform full
      checksum computations in software even if device support
      IPv6 checksum offloading.
      
      Let's start start with CHECKSUM_PARTIAL if the device
      supports it and we are sending only a single packet at
      or below mtu size.
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      32dce968
    • Vlad Yasevich's avatar
      udpv6: Add lockless sendmsg() support · 03485f2a
      Vlad Yasevich authored
      This commit adds the same functionaliy to IPv6 that
      commit 903ab86d
      Author: Herbert Xu <herbert@gondor.apana.org.au>
      Date:   Tue Mar 1 02:36:48 2011 +0000
      
          udp: Add lockless transmit path
      
      added to IPv4.
      
      UDP transmit path can now run without a socket lock,
      thus allowing multiple threads to send to a single socket
      more efficiently.
      This is only used when corking/MSG_MORE is not used.
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      03485f2a
    • Vlad Yasevich's avatar
      ipv6: Introduce udpv6_send_skb() · d39d938c
      Vlad Yasevich authored
      Now that we can individually construct IPv6 skbs to send, add a
      udpv6_send_skb() function to populate the udp header and send the
      skb.  This allows udp_v6_push_pending_frames() to re-use this
      function as well as enables us to add lockless sendmsg() support.
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d39d938c
    • Vlad Yasevich's avatar
      ipv6: introduce ipv6_make_skb · 6422398c
      Vlad Yasevich authored
      This commit is very similar to
      commit 1c32c5ad
      Author: Herbert Xu <herbert@gondor.apana.org.au>
      Date:   Tue Mar 1 02:36:47 2011 +0000
      
          inet: Add ip_make_skb and ip_finish_skb
      
      It adds IPv6 version of the helpers ip6_make_skb and ip6_finish_skb.
      
      The job of ip6_make_skb is to collect messages into an ipv6 packet
      and poplulate ipv6 eader.  The job of ip6_finish_skb is to transmit
      the generated skb.  Together they replicated the job of
      ip6_push_pending_frames() while also provide the capability to be
      called independently.  This will be needed to add lockless UDP sendmsg
      support.
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6422398c
    • Vlad Yasevich's avatar
      ipv6: Append sending data to arbitrary queue · 0bbe84a6
      Vlad Yasevich authored
      Add the ability to append data to arbitrary queue.  This
      will be needed later to implement lockless UDP sends.
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0bbe84a6
    • Vlad Yasevich's avatar
      ipv6: pull cork initialization into its own function. · 366e41d9
      Vlad Yasevich authored
      Pull IPv6 cork initialization into its own function that
      can be re-used.  IPv6 specific cork data did not have an
      explicit data structure.  This patch creats eone so that
      just ipv6 cork data can be as arguemts.  Also, since
      IPv6 tries to save the flow label into inet_cork_full
      tructure, pass the full cork.
      
      Adjust ip6_cork_release() to take cork data structures.
      Signed-off-by: default avatarVladislav Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      366e41d9
    • Anish Bhatt's avatar
      cxgb4 : Improve IEEE DCBx support, other minor open-lldp fixes · ba0c39cb
      Anish Bhatt authored
      * Add support for IEEE ets & pfc api.
      * Fix bug that resulted in incorrect bandwidth percentage being returned for
        CEE peers
      * Convert pfc enabled info from firmware format to what dcbnl expects before
        returning
      Signed-off-by: default avatarAnish Bhatt <anish@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ba0c39cb
    • Arnd Bergmann's avatar
      net/tulip: don't warn about unknown ARM architecture · 98830dd0
      Arnd Bergmann authored
      ARM has 32-byte cache lines, which according to the comment in
      the init registers function seems to work best with the default
      value of 0x4800 that is also used on sparc and parisc.
      
      This adds ARM to the same list, to use that default but no
      longer warn about it.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarGrant Grundler <grundler@parisc-linux.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      98830dd0
    • Arnd Bergmann's avatar
      net: hip04: add missing MODULE_LICENSE · 4c0c46be
      Arnd Bergmann authored
      The hip04 ethernet driver causes a new compile-time warning
      when built as a loadable module:
      
      WARNING: modpost: missing MODULE_LICENSE() in drivers/net/ethernet/hisilicon/hip04_eth.o
      see include/linux/module.h for more information
      
      This adds the license as "GPL", which matches the header of the file.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarDing Tianhong <dingtianhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4c0c46be
    • Florian Westphal's avatar
      net: dctcp: loosen requirement to assert ECT(0) during 3WHS · 843c2fdf
      Florian Westphal authored
      One deployment requirement of DCTCP is to be able to run
      in a DC setting along with TCP traffic. As Glenn Judd's
      NSDI'15 paper "Attaining the Promise and Avoiding the Pitfalls
      of TCP in the Datacenter" [1] (tba) explains, one way to
      solve this on switch side is to split DCTCP and TCP traffic
      in two queues per switch port based on the DSCP: one queue
      soley intended for DCTCP traffic and one for non-DCTCP traffic.
      
      For the DCTCP queue, there's the marking threshold K as
      explained in commit e3118e83 ("net: tcp: add DCTCP congestion
      control algorithm") for RED marking ECT(0) packets with CE.
      For the non-DCTCP queue, there's f.e. a classic tail drop queue.
      As already explained in e3118e83, running DCTCP at scale
      when not marking SYN/SYN-ACK packets with ECT(0) has severe
      consequences as for non-ECT(0) packets, traversing the RED
      marking DCTCP queue will result in a severe reduction of
      connection probability.
      
      This is due to the DCTCP queue being dominated by ECT(0) traffic
      and switches handle non-ECT traffic in the RED marking queue
      after passing K as drops, where K is usually a low watermark
      in order to leave enough tailroom for bursts. Splitting DCTCP
      traffic among several queues (ECN and non-ECN queue) is being
      considered a terrible idea in the network community as it
      splits single flows across multiple network paths.
      
      Therefore, commit e3118e83 implements this on Linux as
      ECT(0) marked traffic, as we argue that marking all packets
      of a DCTCP flow is the only viable solution and also doesn't
      speak against the draft.
      
      However, recently, a DCTCP implementation for FreeBSD hit also
      their mainline kernel [2]. In order to let them play well
      together with Linux' DCTCP, we would need to loosen the
      requirement that ECT(0) has to be asserted during the 3WHS as
      not implemented in FreeBSD. This simplifies the ECN test and
      lets DCTCP work together with FreeBSD.
      
      Joint work with Daniel Borkmann.
      
        [1] https://www.usenix.org/conference/nsdi15/technical-sessions/presentation/judd
        [2] https://github.com/freebsd/freebsd/commit/8ad879445281027858a7fa706d13e458095b595fSigned-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Cc: Glenn Judd <glenn.judd@morganstanley.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      843c2fdf
    • David S. Miller's avatar
      Merge branch 'net-timestamp' · 69422416
      David S. Miller authored
      Willem de Bruijn says:
      
      ====================
      net-timestamp: blinding
      
      Changes
        (v2 -> v3)
        - rebase only: v2 did not make it to patchwork / netdev
        (v1 -> v2)
        - fix capability check in patch 2
            this could be moved into net/core/sock.c as sk_capable_nouser()
        (rfc -> v1)
        - dropped patch 4: timestamp batching
            due to complexity, as discussed
        - dropped patch 5: default mode
            because it does not really cover all use cases, as discussed
        - added documentation
        - minor fix, see patch 2
      
      Two issues were raised during recent timestamping discussions:
      1. looping full packets on the error queue exposes packet headers
      2. TCP timestamping with retransmissions generates many timestamps
      
      This RFC patchset is an attempt at addressing both without breaking
      legacy behavior.
      
      Patch 1 reintroduces the "no payload" timestamp option, which loops
      timestamps onto an empty skb. This reduces the pressure on SO_RCVBUF
      from looping many timestamps. It does not reduce the number of recv()
      calls needed to process them. The timestamp cookie mechanism developed
      in http://patchwork.ozlabs.org/patch/427213/ did, but this is
      considerably simpler.
      
      Patch 2 then gives administrators the power to block all timestamp
      requests that contain data by unprivileged users. I proposed this
      earlier as a backward compatible workaround in the discussion of
      
        net-timestamp: pull headers for SOCK_STREAM
        http://patchwork.ozlabs.org/patch/414810/
      
      Patch 3 only updates the txtimestamp example to test this option.
      Verified that with option '-n', length is zero in all cases and
      option '-I' (PKTINFO) stops working.
      ====================
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      69422416
    • Willem de Bruijn's avatar
      net-timestamp: no-payload option in txtimestamp test · 23685923
      Willem de Bruijn authored
      Demonstrate how SOF_TIMESTAMPING_OPT_TSONLY can be used and
      test the implementation.
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      23685923
    • Willem de Bruijn's avatar
      net-timestamp: no-payload only sysctl · b245be1f
      Willem de Bruijn authored
      Tx timestamps are looped onto the error queue on top of an skb. This
      mechanism leaks packet headers to processes unless the no-payload
      options SOF_TIMESTAMPING_OPT_TSONLY is set.
      
      Add a sysctl that optionally drops looped timestamp with data. This
      only affects processes without CAP_NET_RAW.
      
      The policy is checked when timestamps are generated in the stack.
      It is possible for timestamps with data to be reported after the
      sysctl is set, if these were queued internally earlier.
      
      No vulnerability is immediately known that exploits knowledge
      gleaned from packet headers, but it may still be preferable to allow
      administrators to lock down this path at the cost of possible
      breakage of legacy applications.
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      
      ----
      
      Changes
        (v1 -> v2)
        - test socket CAP_NET_RAW instead of capable(CAP_NET_RAW)
        (rfc -> v1)
        - document the sysctl in Documentation/sysctl/net.txt
        - fix access control race: read .._OPT_TSONLY only once,
              use same value for permission check and skb generation.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b245be1f
    • Willem de Bruijn's avatar
      net-timestamp: no-payload option · 49ca0d8b
      Willem de Bruijn authored
      Add timestamping option SOF_TIMESTAMPING_OPT_TSONLY. For transmit
      timestamps, this loops timestamps on top of empty packets.
      
      Doing so reduces the pressure on SO_RCVBUF. Payload inspection and
      cmsg reception (aside from timestamps) are no longer possible. This
      works together with a follow on patch that allows administrators to
      only allow tx timestamping if it does not loop payload or metadata.
      Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
      
      ----
      
      Changes (rfc -> v1)
        - add documentation
        - remove unnecessary skb->len test (thanks to Richard Cochran)
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      49ca0d8b
  4. 02 Feb, 2015 3 commits