1. 22 11月, 2016 31 次提交
  2. 21 11月, 2016 7 次提交
  3. 20 11月, 2016 2 次提交
    • A
      net: fix bogus cast in skb_pagelen() and use unsigned variables · c72d8cda
      Alexey Dobriyan 提交于
      1) cast to "int" is unnecessary:
         u8 will be promoted to int before decrementing,
         small positive numbers fit into "int", so their values won't be changed
         during promotion.
      
         Once everything is int including loop counters, signedness doesn't
         matter: 32-bit operations will stay 32-bit operations.
      
         But! Someone tried to make this loop smart by making everything of
         the same type apparently in an attempt to optimise it.
         Do the optimization, just differently.
         Do the cast where it matters. :^)
      
      2) frag size is unsigned entity and sum of fragments sizes is also
         unsigned.
      
      Make everything unsigned, leave no MOVSX instruction behind.
      
      	add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-4 (-4)
      	function                                     old     new   delta
      	skb_cow_data                                 835     834      -1
      	ip_do_fragment                              2549    2548      -1
      	ip6_fragment                                3130    3128      -2
      	Total: Before=154865032, After=154865028, chg -0.00%
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c72d8cda
    • A
      netlink: smaller nla_attr_minlen table · 32d84cdc
      Alexey Dobriyan 提交于
      Length of a netlink attribute may be u16 but lengths of basic attributes
      are much smaller, so small we can save 16 bytes of .rodata and pocket
      change inside .text.
      
      16-bit is worse on x86-64 than 8-bit because of operand size override prefix.
      
      	add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-19 (-19)
      	function                                     old     new   delta
      	validate_nla                                 418     417      -1
      	nla_policy_len                                66      64      -2
      	nla_attr_minlen                               32      16     -16
      	Total: Before=154865051, After=154865032, chg -0.00%
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      32d84cdc