1. 21 Sep, 2015 20 commits
  2. 18 Sep, 2015 20 commits
    • Szymon Janc's avatar
      Bluetooth: Fix reporting incorrect EIR in device found mgmt event · 6818375e
      Szymon Janc authored
      Some remote devices (ie Gigaset G-Tag) misbehave with ADV data length.
      This can lead to incorrect EIR format in device found event when
      ADV_DATA and SCAN_RSP are merged (terminator field before SCAN_RSP
      part).
      
      Fix this by inspecting ADV_DATA and correct its length if terminator
      is found.
      
      > HCI Event: LE Meta Event (0x3e) plen 42              [hci0] 32.172182
            LE Advertising Report (0x02)
              Num reports: 1
              Event type: Connectable undirected - ADV_IND (0x00)
              Address type: Public (0x00)
              Address: 7C:2F:80:94:97:5A (Gigaset Communications GmbH)
              Data length: 30
              Flags: 0x06
                LE General Discoverable Mode
                BR/EDR Not Supported
              Company: Gigaset Communications GmbH (384)
                Data: 021512348094975abbc5
              16-bit Service UUIDs (partial): 1 entry
                Battery Service (0x180f)
              RSSI: -65 dBm (0xbf)
      > HCI Event: LE Meta Event (0x3e) plen 27              [hci0] 32.172191
            LE Advertising Report (0x02)
              Num reports: 1
              Event type: Scan response - SCAN_RSP (0x04)
              Address type: Public (0x00)
              Address: 7C:2F:80:94:97:5A (Gigaset Communications GmbH)
              Data length: 15
              Name (complete): Gigaset G-tag
              RSSI: -59 dBm (0xc5)
      
      Note "Data length: 30" in ADV_DATA which results in 9 extra zero bytes
      after Battery Service UUID. Terminator field present in the middle of
      EIR in Device Found event resulted in userspace stop parsing EIR and
      skipping device name.
      
      @ Device Found: 7C:2F:80:94:97:5A (1) rssi -59 flags 0x0000
            02 01 06 0d ff 80 01 02 15 12 34 80 94 97 5a bb  ..........4...Z.
            c5 03 02 0f 18 00 00 00 00 00 00 00 00 00 0e 09  ................
            47 69 67 61 73 65 74 20 47 2d 74 61 67           Gigaset G-tag
      
      With this fix EIR with merged ADV_DATA and SCAN_RSP in device found
      event is properly formatted:
      
      @ Device Found: 7C:2F:80:94:97:5A (1) rssi -59 flags 0x0000
            02 01 06 0d ff 80 01 02 15 12 34 80 94 97 5a bb  ..........4...Z.
            c5 03 02 0f 18 0e 09 47 69 67 61 73 65 74 20 47  .......Gigaset G
            2d 74 61 67                                      -tag
      Signed-off-by: default avatarSzymon Janc <ext.szymon.janc@tieto.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      6818375e
    • Szymon Janc's avatar
      Bluetooth: Add BT_ERR_RATELIMITED · e781b7f7
      Szymon Janc authored
      This patch adds ratelimited version of the BT_ERR macro.
      Signed-off-by: default avatarSzymon Janc <ext.szymon.janc@tieto.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      e781b7f7
    • Eric Dumazet's avatar
      sch_dsmark: improve memory locality · 47bbbb30
      Eric Dumazet authored
      Memory placement in sch_dsmark is silly : Better place mask/value
      in the same cache line.
      
      Also, we can embed small arrays in the first cache line and
      remove a potential cache miss.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      47bbbb30
    • David S. Miller's avatar
      Merge branch 'bcmgenet-irq-coalesce' · 25354001
      David S. Miller authored
      Florian Fainelli says:
      
      ====================
      net: bcmgenet: Interrupt coalescing
      
      This patch series adds support for interrupt coalescing for GENET
      adapters.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      25354001
    • Florian Fainelli's avatar
      net: bcmgenet: Implement RX coalescing control knobs · 4a29645b
      Florian Fainelli authored
      Add support for the ethtool rx-frames coalescing parameter which allows
      defining the number of RX interrupts per frames received. The RDMA
      engine supports a configurable timeout with a resolution of
      approximately 8.192 us.
      
      We can no longer enable the BDONE/PDONE interrupts as those would
      fire for each packet/buffer received, which would defeat the MBDONE
      interrupt purpose. The MBDONE interrupt is guaranteed to correspond to a
      PDONE/BDONE interrupt when the threshold is set to 1.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4a29645b
    • Florian Fainelli's avatar
      net: bcmgenet: Implement TX coalescing control knobs · 2f913070
      Florian Fainelli authored
      Configuring the ethtool tx-frames property, which translates into N
      packets before a TX interrupt is the simplest configuration scheme
      because it requires no locking neither at the softare nor hardware
      level, and is completely indepedent from the link speed. Since ethtool
      does not allow per-tx queue coalescing parameters, we apply the same
      setting to any transmit queue.
      
      We can no longer enable the BDONE/PDONE interrupts as those would fire
      for each packet/buffer received, which would defeat the MBDONE interrupt
      purpose. The MBDONE interrupt is guaranteed to correspond to a
      PDONE/BDONE interrupt when the threshold is set to 1, but offers
      interrupt coalescing when the value is > 1.
      
      Since the HW is configured to generate an interrupt when the ring
      becomes emtpy, we have to deny any timeout/timer settings coming from
      user-space to indicate we can only generate an interrupt very <N>
      packets.
      
      While we are at it, fix the DMA_INTR_THRESHOLD_MASK value which was off
      by one bit (0xff vs. 0x1ff).
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2f913070
    • Woojung.Huh@microchip.com's avatar
      lan78xx: Remove not defined MAC_CR_GMII_EN_ bit from MAC_CR. · 9110fe4a
      Woojung.Huh@microchip.com authored
      Remove not defined MAC_CR_GMII_EN_ bit from MAC_CR.
      Signed-off-by: default avatarWoojung Huh <woojung.huh@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9110fe4a
    • Woojung.Huh@microchip.com's avatar
      lan78xx: Create lan78xx_get_mdix_status() and lan78xx_set_mdix_status() for MDIX control. · 758c5c11
      Woojung.Huh@microchip.com authored
      Create lan78xx_get_mdix_status() and lan78xx_set_mdix_status() for MDIX control.
      Signed-off-by: default avatarWoojung Huh <woojung.huh@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      758c5c11
    • Woojung.Huh@microchip.com's avatar
      lan78xx: Remove phy defines in lan78xx.h and use defines in include/linux/microchipphy.h · bdfba55e
      Woojung.Huh@microchip.com authored
      Remove phy defines in lan78xx.h and use defines in include/linux/microchipphy.h.
      Signed-off-by: default avatarWoojung Huh <woojung.huh@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bdfba55e
    • Woojung.Huh@microchip.com's avatar
      lan78xx: Update to use phylib instead of mii_if_info. · ce85e13a
      Woojung.Huh@microchip.com authored
      Update to use phylib instead of mii_if_info.
      Signed-off-by: default avatarWoojung Huh <woojung.huh@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ce85e13a
    • Woojung.Huh@microchip.com's avatar
      lan78xx: Add PHYLIB and MICROCHIP_PHY as default config. · 05fe68c0
      Woojung.Huh@microchip.com authored
      Add PHYLIB and MICROCHIP_PHY as default configuration for lan78xx.
      Signed-off-by: default avatarWoojung Huh <woojung.huh@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05fe68c0
    • Woojung.Huh@microchip.com's avatar
      lan78xx: Check device ready bit (PMT_CTL_READY_) after reset the PHY · 6c595b03
      Woojung.Huh@microchip.com authored
      Check device ready bit (PMT_CTL_READY_) after reset the PHY.
      Device may not be ready even if PHY_RST_ is cleared depends on configuration.
      Signed-off-by: default avatarWoojung Huh <woojung.huh@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c595b03
    • David Ahern's avatar
      net: Initialize table in fib result · bde6f9de
      David Ahern authored
      Sergey, Richard and Fabio reported an oops in ip_route_input_noref. e.g., from Richard:
      
      [    0.877040] BUG: unable to handle kernel NULL pointer dereference at 0000000000000056
      [    0.877597] IP: [<ffffffff8155b5e2>] ip_route_input_noref+0x1a2/0xb00
      [    0.877597] PGD 3fa14067 PUD 3fa6e067 PMD 0
      [    0.877597] Oops: 0000 [#1] SMP
      [    0.877597] Modules linked in: virtio_net virtio_pci virtio_ring virtio
      [    0.877597] CPU: 1 PID: 119 Comm: ifconfig Not tainted 4.2.0+ #1
      [    0.877597] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
      [    0.877597] task: ffff88003fab0bc0 ti: ffff88003faa8000 task.ti: ffff88003faa8000
      [    0.877597] RIP: 0010:[<ffffffff8155b5e2>]  [<ffffffff8155b5e2>] ip_route_input_noref+0x1a2/0xb00
      [    0.877597] RSP: 0018:ffff88003ed03ba0  EFLAGS: 00010202
      [    0.877597] RAX: 0000000000000046 RBX: 00000000ffffff8f RCX: 0000000000000020
      [    0.877597] RDX: ffff88003fab50b8 RSI: 0000000000000200 RDI: ffffffff8152b4b8
      [    0.877597] RBP: ffff88003ed03c50 R08: 0000000000000000 R09: 0000000000000000
      [    0.877597] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88003fab6f00
      [    0.877597] R13: ffff88003fab5000 R14: 0000000000000000 R15: ffffffff81cb5600
      [    0.877597] FS:  00007f6de5751700(0000) GS:ffff88003ed00000(0000) knlGS:0000000000000000
      [    0.877597] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [    0.877597] CR2: 0000000000000056 CR3: 000000003fa6d000 CR4: 00000000000006e0
      [    0.877597] Stack:
      [    0.877597]  0000000000000000 0000000000000046 ffff88003fffa600 ffff88003ed03be0
      [    0.877597]  ffff88003f9e2c00 697da8c0017da8c0 ffff880000000000 000000000007fd00
      [    0.877597]  0000000000000000 0000000000000046 0000000000000000 0000000400000000
      [    0.877597] Call Trace:
      [    0.877597]  <IRQ>
      [    0.877597]  [<ffffffff812bfa1f>] ? cpumask_next_and+0x2f/0x40
      [    0.877597]  [<ffffffff8158e13c>] arp_process+0x39c/0x690
      [    0.877597]  [<ffffffff8158e57e>] arp_rcv+0x13e/0x170
      [    0.877597]  [<ffffffff8151feec>] __netif_receive_skb_core+0x60c/0xa00
      [    0.877597]  [<ffffffff81515795>] ? __build_skb+0x25/0x100
      [    0.877597]  [<ffffffff81515795>] ? __build_skb+0x25/0x100
      [    0.877597]  [<ffffffff81521ff6>] __netif_receive_skb+0x16/0x70
      [    0.877597]  [<ffffffff81522078>] netif_receive_skb_internal+0x28/0x90
      [    0.877597]  [<ffffffff8152288f>] napi_gro_receive+0x7f/0xd0
      [    0.877597]  [<ffffffffa0017906>] virtnet_receive+0x256/0x910 [virtio_net]
      [    0.877597]  [<ffffffffa0017fd8>] virtnet_poll+0x18/0x80 [virtio_net]
      [    0.877597]  [<ffffffff815234cd>] net_rx_action+0x1dd/0x2f0
      [    0.877597]  [<ffffffff81053228>] __do_softirq+0x98/0x260
      [    0.877597]  [<ffffffff8164969c>] do_softirq_own_stack+0x1c/0x30
      
      The root cause is use of res.table uninitialized.
      
      Thanks to Nikolay for noticing the uninitialized use amongst the maze of
      gotos.
      
      As Nikolay pointed out the second initialization is not required to fix
      the oops, but rather to fix a related problem where a valid lookup should
      be invalidated before creating the rth entry.
      
      Fixes: b7503e0c ("net: Add FIB table id to rtable")
      Reported-by: default avatarSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Reported-by: default avatarRichard Alpe <richard.alpe@ericsson.com>
      Reported-by: default avatarFabio Estevam <festevam@gmail.com>
      Tested-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Tested-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bde6f9de
    • David S. Miller's avatar
      Merge branch 'bpf_avoid_clone' · 41a9802f
      David S. Miller authored
      Alexei Starovoitov says:
      
      ====================
      bpf: performance improvements
      
      v1->v2: dropped redundant iff_up check in patch 2
      
      At plumbers we discussed different options on how to get rid of skb_clone
      from bpf_clone_redirect(), the patch 2 implements the best option.
      Patch 1 adds 'integrated exts' to cls_bpf to improve performance by
      combining simple actions into bpf classifier.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      41a9802f
    • Alexei Starovoitov's avatar
      bpf: add bpf_redirect() helper · 27b29f63
      Alexei Starovoitov authored
      Existing bpf_clone_redirect() helper clones skb before redirecting
      it to RX or TX of destination netdev.
      Introduce bpf_redirect() helper that does that without cloning.
      
      Benchmarked with two hosts using 10G ixgbe NICs.
      One host is doing line rate pktgen.
      Another host is configured as:
      $ tc qdisc add dev $dev ingress
      $ tc filter add dev $dev root pref 10 u32 match u32 0 0 flowid 1:2 \
         action bpf run object-file tcbpf1_kern.o section clone_redirect_xmit drop
      so it receives the packet on $dev and immediately xmits it on $dev + 1
      The section 'clone_redirect_xmit' in tcbpf1_kern.o file has the program
      that does bpf_clone_redirect() and performance is 2.0 Mpps
      
      $ tc filter add dev $dev root pref 10 u32 match u32 0 0 flowid 1:2 \
         action bpf run object-file tcbpf1_kern.o section redirect_xmit drop
      which is using bpf_redirect() - 2.4 Mpps
      
      and using cls_bpf with integrated actions as:
      $ tc filter add dev $dev root pref 10 \
        bpf run object-file tcbpf1_kern.o section redirect_xmit integ_act classid 1
      performance is 2.5 Mpps
      
      To summarize:
      u32+act_bpf using clone_redirect - 2.0 Mpps
      u32+act_bpf using redirect - 2.4 Mpps
      cls_bpf using redirect - 2.5 Mpps
      
      For comparison linux bridge in this setup is doing 2.1 Mpps
      and ixgbe rx + drop in ip_rcv - 7.8 Mpps
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      27b29f63
    • Daniel Borkmann's avatar
      cls_bpf: introduce integrated actions · 045efa82
      Daniel Borkmann authored
      Often cls_bpf classifier is used with single action drop attached.
      Optimize this use case and let cls_bpf return both classid and action.
      For backwards compatibility reasons enable this feature under
      TCA_BPF_FLAG_ACT_DIRECT flag.
      
      Then more interesting programs like the following are easier to write:
      int cls_bpf_prog(struct __sk_buff *skb)
      {
        /* classify arp, ip, ipv6 into different traffic classes
         * and drop all other packets
         */
        switch (skb->protocol) {
        case htons(ETH_P_ARP):
          skb->tc_classid = 1;
          break;
        case htons(ETH_P_IP):
          skb->tc_classid = 2;
          break;
        case htons(ETH_P_IPV6):
          skb->tc_classid = 3;
          break;
        default:
          return TC_ACT_SHOT;
        }
      
        return TC_ACT_OK;
      }
      
      Joint work with Daniel Borkmann.
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      045efa82
    • Junwei Zhang's avatar
      net: only check perm protocol when register proto · f6c53334
      Junwei Zhang authored
      The permanent protocol nodes are at the head of the list,
      So only need check all these nodes.
      
      No matter the new node is permanent or not,
      insert the new node after the last permanent protocol node,
      
      If the new node conflicts with existing permanent node,
      return error.
      Signed-off-by: default avatarMartin Zhang <martinbj2008@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f6c53334
    • Eric Dumazet's avatar
      bonding: use l4 hash if available · 4b1b865e
      Eric Dumazet authored
      If skb carries a l4 hash, no need to perform a flow dissection.
      
      Performance is slightly better :
      
      lpaa5:~# ./super_netperf 200 -H lpaa6 -t TCP_RR -l 100
      2.39012e+06
      lpaa5:~# ./super_netperf 200 -H lpaa6 -t TCP_RR -l 100
      2.39393e+06
      lpaa5:~# ./super_netperf 200 -H lpaa6 -t TCP_RR -l 100
      2.39988e+06
      
      After patch :
      
      lpaa5:~# ./super_netperf 200 -H lpaa6 -t TCP_RR -l 100
      2.43579e+06
      lpaa5:~# ./super_netperf 200 -H lpaa6 -t TCP_RR -l 100
      2.44304e+06
      lpaa5:~# ./super_netperf 200 -H lpaa6 -t TCP_RR -l 100
      2.44312e+06
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Tom Herbert <tom@herbertland.com>
      Cc: Mahesh Bandewar <maheshb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4b1b865e
    • Eric Dumazet's avatar
      tcp: provide skb->hash to synack packets · 58d607d3
      Eric Dumazet authored
      In commit b73c3d0e ("net: Save TX flow hash in sock and set in skbuf
      on xmit"), Tom provided a l4 hash to most outgoing TCP packets.
      
      We'd like to provide one as well for SYNACK packets, so that all packets
      of a given flow share same txhash, to later enable bonding driver to
      also use skb->hash to perform slave selection.
      
      Note that a SYNACK retransmit shuffles the tx hash, as Tom did
      in commit 265f94ff ("net: Recompute sk_txhash on negative routing
      advice") for established sockets.
      
      This has nice effect making TCP flows resilient to some kind of black
      holes, even at connection establish phase.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Tom Herbert <tom@herbertland.com>
      Cc: Mahesh Bandewar <maheshb@google.com>
      Acked-by: default avatarTom Herbert <tom@herbertland.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      58d607d3
    • Catherine Sullivan's avatar
      i40e/i40evf: Bump i40e to 1.3.21 and i40evf to 1.3.13 · f91638af
      Catherine Sullivan authored
      Bump.
      
      Change-ID: If7ce84218361defa209142d1d8c6f69d48c2d7ad
      Signed-off-by: default avatarCatherine Sullivan <catherine.sullivan@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      f91638af