1. 03 Oct, 2013 7 commits
    • Peter Senna Tschudin's avatar
      net: atl1c: Change variable type to bool · 55705639
      Peter Senna Tschudin authored
      The variable ret is only assigned the values true and false.
      The function atl1c_read_eeprom already returns bool. Change
      ret type to bool.
      
      The simplified semantic patch that find this problem is as
      follows (http://coccinelle.lip6.fr/):
      
      @exists@
      type T;
      identifier b;
      @@
      - T
      + bool
        b = ...;
        ... when any
        b = \(true\|false\)
      Signed-off-by: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      55705639
    • David S. Miller's avatar
      Merge branch 'bond_hash' · 99ebe9f2
      David S. Miller authored
      Nikolay Aleksandrov says:
      
      ====================
      This is a complete remake of my old patch that modified the bonding hash
      functions to use skb_flow_dissect which was suggested by Eric Dumazet.
      This time around I've left the old modes although using a new hash function
      again suggested by Eric, which is the same for all modes. The only
      difference is the way the headers are obtained. The old modes obtain them
      as before in order to address concerns about speed, but the 2 new ones use
      skb_flow_dissect. The unification of the hash function allows to remove a
      pointer from struct bonding and also a few extra functions that dealt with
      it. Two new functions are added which take care of the hashing based on
      bond->params.xmit_policy only:
      bond_xmit_hash() - global function, used by XOR and 3ad modes
      bond_flow_dissect() - used by bond_xmit_hash() to obtain the necessary
      headers and combine them according to bond->params.xmit_policy.
      Also factor out the ports extraction from skb_flow_dissect and add a new
      function - skb_flow_get_ports() which can be re-used.
      
      v2: add the flow_dissector patch and use skb_flow_get_ports in patch 02
      v3: fix a bug in the flow_dissector patch that caused a different thoff
          by modifying the thoff argument in skb_flow_get_ports directly, most
          of the users already do it anyway.
          Also add the necessary export symbol for skb_flow_get_ports.
      v4: integrate the thoff bug fix in patch 01
      v5: disintegrate the thoff bug fix and re-base on top of Eric's fix
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      99ebe9f2
    • Nikolay Aleksandrov's avatar
      bonding: document the new xmit policy modes and update the changed ones · 7a6afab1
      Nikolay Aleksandrov authored
      Add new documentation for encap2+3 and encap3+4, also update the formula
      for the old modes due to the changes.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7a6afab1
    • Nikolay Aleksandrov's avatar
      bonding: modify the old and add new xmit hash policies · 32819dc1
      Nikolay Aleksandrov authored
      This patch adds two new hash policy modes which use skb_flow_dissect:
      3 - Encapsulated layer 2+3
      4 - Encapsulated layer 3+4
      There should be a good improvement for tunnel users in those modes.
      It also changes the old hash functions to:
      hash ^= (__force u32)flow.dst ^ (__force u32)flow.src;
      hash ^= (hash >> 16);
      hash ^= (hash >> 8);
      
      Where hash will be initialized either to L2 hash, that is
      SRCMAC[5] XOR DSTMAC[5], or to flow->ports which should be extracted
      from the upper layer. Flow's dst and src are also extracted based on the
      xmit policy either directly from the buffer or by using skb_flow_dissect,
      but in both cases if the protocol is IPv6 then dst and src are obtained by
      ipv6_addr_hash() on the real addresses. In case of a non-dissectable
      packet, the algorithms fall back to L2 hashing.
      The bond_set_mode_ops() function is now obsolete and thus deleted
      because it was used only to set the proper hash policy. Also we trim a
      pointer from struct bonding because we no longer need to keep the hash
      function, now there's only a single hash function - bond_xmit_hash that
      works based on bond->params.xmit_policy.
      
      The hash function and skb_flow_dissect were suggested by Eric Dumazet.
      The layer names were suggested by Andy Gospodarek, because I suck at
      semantics.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@redhat.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      32819dc1
    • Nikolay Aleksandrov's avatar
      flow_dissector: factor out the ports extraction in skb_flow_get_ports · 357afe9c
      Nikolay Aleksandrov authored
      Factor out the code that extracts the ports from skb_flow_dissect and
      add a new function skb_flow_get_ports which can be re-used.
      Suggested-by: default avatarVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@redhat.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Reviewed-by: default avatarVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      357afe9c
    • Eric Dumazet's avatar
      inet: consolidate INET_TW_MATCH · 50805466
      Eric Dumazet authored
      TCP listener refactoring, part 2 :
      
      We can use a generic lookup, sockets being in whatever state, if
      we are sure all relevant fields are at the same place in all socket
      types (ESTABLISH, TIME_WAIT, SYN_RECV)
      
      This patch removes these macros :
      
       inet_addrpair, inet_addrpair, tw_addrpair, tw_portpair
      
      And adds :
      
       sk_portpair, sk_addrpair, sk_daddr, sk_rcv_saddr
      
      Then, INET_TW_MATCH() is really the same than INET_MATCH()
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      50805466
    • Joe Perches's avatar
      ath10k: wmi: Convert use of 6 to ETH_ALEN · 7b4371ea
      Joe Perches authored
      Use the appropriate define instead of 6.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Noticed-by: Julia Lawall <julia.lawall@lip6.fr> via spatch script
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b4371ea
  2. 02 Oct, 2013 9 commits
    • Joe Perches's avatar
      net:drivers/net: Miscellaneous conversions to ETH_ALEN · d458cdf7
      Joe Perches authored
      Convert the memset/memcpy uses of 6 to ETH_ALEN
      where appropriate.
      
      Also convert some struct definitions and u8 array
      declarations of [6] to ETH_ALEN.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Acked-by: default avatarArend van Spriel <arend@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d458cdf7
    • Denis Kirjanov's avatar
      include/linux/skbuff.h: move CONFIG_XFRM check inside the skb_sec_path() · 0b3d8e08
      Denis Kirjanov authored
      And thus we have only one function definition
      Signed-off-by: default avatarDenis Kirjanov <kda@linux-powerpc.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0b3d8e08
    • Eric Dumazet's avatar
      tcp: sndbuf autotuning improvements · 6ae70532
      Eric Dumazet authored
      tcp_fixup_sndbuf() is underestimating initial send buffer requirements.
      
      It was not noticed because big GSO packets were escaping the limitation,
      but with smaller TSO packets (or TSO/GSO/SG off), application hits
      sk_sndbuf before having a chance to fill enough packets in socket write
      queue.
      
      - initial cwnd can be bigger than 10 for specific routes
      
      - SKB_TRUESIZE() is a bit under real needs in some cases,
        because of power-of-two rounding in kmalloc()
      
      - Fast Recovery (RFC 5681 3.2) : Cubic needs 70% factor
      
      - Extra cushion (application might react slowly to POLLOUT)
      
      tcp_v4_conn_req_fastopen() needs to call tcp_init_metrics() before
      calling tcp_init_buffer_space()
      
      Then we realize tcp_new_space() should call tcp_fixup_sndbuf()
      instead of duplicating this stuff.
      
      Rename tcp_fixup_sndbuf() to tcp_sndbuf_expand() to be more
      descriptive.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
      Acked-by: default avatarMaciej Żenczykowski <maze@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6ae70532
    • baker.zhang's avatar
      fib_trie: avoid a redundant bit judgement in inflate · bbe34cf8
      baker.zhang authored
      Because 'node' is the i'st child of 'oldnode',
      thus, here 'i' equals
      tkey_extract_bits(node->key, oldtnode->pos, oldtnode->bits)
      
      we just get 1 more bit,
      and need not care the detail value of this bits.
      
      I apologize for the mistake.
      
      I generated the patch on a branch version,
      and did not notice the put_child has been changed.
      
      I have redone the test on HEAD version with my patch.
      
      two cases are used.
      case 1. inflate a node which has a leaf child node.
      case 2: inflate a node which has a an child node with skipped bits
      
      test env:
        ip link set eth0 up
        ip a add dev eth0 192.168.11.1/32
      here, we just focus on route table(MAIN),
      so I use a "192.168.11.1/32" address to simplify the test case.
      
      call trace:
      + fib_insert_node
      + + trie_rebalance
      + + + resize
      + + + + inflate
      
      Test case 1:  inflate a node which has a leaf child node.
      
      ===========================================================
      step 1. prepare a fib trie
      ------------------------------------------
        ip r a 192.168.0.0/24 via 192.168.11.1
        ip r a 192.168.1.0/24 via 192.168.11.1
      
      we get a fib trie.
      root@baker:~# cat /proc/net/fib_trie
      Main:
        +-- 192.168.0.0/23 1 0 0
         |-- 192.168.0.0
          /24 universe UNICAST
         |-- 192.168.1.0
          /24 universe UNICAST
      Local:
      .....
      
      step 2. Add the third route
      ------------------------------------------
      root@baker:~# ip r a 192.168.2.0/24 via 192.168.11.1
      
      A fib_trie leaf will be inserted in fib_insert_node before trie_rebalance.
      
      For function 'inflate':
      'inflate' is called with following trie.
        +-- 192.168.0.0/22 1 1 0 <=== tn node
          +-- 192.168.0.0/23 1 0 0    <== node a
              |-- 192.168.0.0
                /24 universe UNICAST
              |-- 192.168.1.0
                /24 universe UNICAST
            |-- 192.168.2.0          <== leaf(node b)
      
      When process node b, which is a leaf. here:
      i is 1,
      node key "192.168.2.0"
      oldnode is (pos:22, bits:1)
      
      unpatch source:
      tkey_extract_bits(node->key, oldtnode->pos + oldtnode->bits, 1)
      it equals:
      tkey_extract_bits("192.168,2,0", 22 + 1, 1)
      
      thus got 0, and call put_child(tn, 2*i, node); <== 2*i=2.
      
      patched source:
      tkey_extract_bits(node->key, oldtnode->pos, oldtnode->bits + 1),
      tkey_extract_bits("192.168,2,0", 22, 1 + 1)  <== get 2.
      
      Test case 2:  inflate a node which has a an child node with skipped bits
      ==========================================================================
      step 1. prepare a fib trie.
        ip link set eth0 up
        ip a add dev eth0 192.168.11.1/32
        ip r a 192.168.128.0/24 via 192.168.11.1
        ip r a 192.168.0.0/24  via 192.168.11.1
        ip r a 192.168.16.0/24   via 192.168.11.1
        ip r a 192.168.32.0/24  via 192.168.11.1
        ip r a 192.168.48.0/24  via 192.168.11.1
        ip r a 192.168.144.0/24   via 192.168.11.1
        ip r a 192.168.160.0/24   via 192.168.11.1
        ip r a 192.168.176.0/24   via 192.168.11.1
      
      check:
      root@baker:~# cat /proc/net/fib_trie
      Main:
        +-- 192.168.0.0/16 1 0 0
           +-- 192.168.0.0/18 2 0 0
              |-- 192.168.0.0
                 /24 universe UNICAST
              |-- 192.168.16.0
                 /24 universe UNICAST
              |-- 192.168.32.0
                 /24 universe UNICAST
              |-- 192.168.48.0
                 /24 universe UNICAST
           +-- 192.168.128.0/18 2 0 0
              |-- 192.168.128.0
                 /24 universe UNICAST
              |-- 192.168.144.0
                 /24 universe UNICAST
              |-- 192.168.160.0
                 /24 universe UNICAST
              |-- 192.168.176.0
                 /24 universe UNICAST
      Local:
        ...
      
      step 2. add a route to trigger inflate.
        ip r a 192.168.96.0/24   via 192.168.11.1
      
      This command will call serveral times inflate.
      In the first time, the fib_trie is:
      ________________________
      +-- 192.168.128.0/(16, 1) <== tn node
       +-- 192.168.0.0/(17, 1)  <== node a
        +-- 192.168.0.0/(18, 2)
         |-- 192.168.0.0
         |-- 192.168.16.0
         |-- 192.168.32.0
         |-- 192.168.48.0
        |-- 192.168.96.0
       +-- 192.168.128.0/(18, 2) <== node b.
        |-- 192.168.128.0
        |-- 192.168.144.0
        |-- 192.168.160.0
        |-- 192.168.176.0
      
      NOTE: node b is a interal node with skipped bits.
      here,
      i:1,
      node->key "192.168.128.0",
      oldnode:(pos:16, bits:1)
      so
      tkey_extract_bits(node->key, oldtnode->pos + oldtnode->bits, 1)
      it equals:
      tkey_extract_bits("192.168,128,0", 16 + 1, 1) <=== 0
      
      tkey_extract_bits(node->key, oldtnode->pos, oldtnode->bits, 1)
      it equals:
      tkey_extract_bits("192.168,128,0", 16, 1+1) <=== 2
      
      2*i + 0 == 2, so the result is same.
      Signed-off-by: default avatarbaker.zhang <baker.kernel@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bbe34cf8
    • Jesper Juhl's avatar
      isdn: eicon: free pointer after using it in log msg in divas_um_idi_delete_entity() · 84557783
      Jesper Juhl authored
      Not really a problem, but nice IMHO; the Coverity static analyzer
      complains that we use the pointer 'e' after it has been freed, so move
      the freeing below the final use, even if that use is just using the
      value of the pointer and not actually dereferencing it.
      Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      84557783
    • Wei Liu's avatar
      xen-netfront: convert to GRO API · 99d3d587
      Wei Liu authored
      Anirban was seeing netfront received MTU size packets, which downgraded
      throughput. The following patch makes netfront use GRO API which
      improves throughput for that case.
      Signed-off-by: default avatarWei Liu <wei.liu2@citrix.com>
      Cc: Anirban Chakraborty <abchak@juniper.net>
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Acked-by: default avatarKonrad Wilk <konrad.wilk@oracle.com>
      Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      99d3d587
    • Hauke Mehrtens's avatar
      tg3: use phylib when robo switch is in use · ee002b64
      Hauke Mehrtens authored
      When a switch is connected as a PHY to the MAC driven by tg3, use
      phylib and provide the phy address to tg3 from the sprom.
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Acked-by: default avatarNithin Nayak Sujir <nsujir@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ee002b64
    • Hauke Mehrtens's avatar
      ssb: provide phy address for Gigabit Ethernet driver · 4bcef89f
      Hauke Mehrtens authored
      Add a function to provide the phy address which should be used to the
      Gigabit Ethernet driver connected to ssb.
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Reviewed-by: default avatarNithin Nayak Sujir <nsujir@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4bcef89f
    • Hauke Mehrtens's avatar
      tg3: add support a phy at an address different than 01 · ead2402c
      Hauke Mehrtens authored
      When phylib was in use tg3 only searched at address 01 on the mdio
      bus and did not work with any other address. On the BCM4705 SoCs the
      switch is connected as a PHY behind the MAC driven by tg3 and it is at
      PHY address 30 in most cases. This is a preparation patch to allow
      support for such switches.
      
      phy_addr is set to TG3_PHY_MII_ADDR for all devices, which are using
      phylib, so this should not change any behavior.
      Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
      Acked-by: default avatarNithin Nayak Sujir <nsujir@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ead2402c
  3. 01 Oct, 2013 24 commits