1. 07 12月, 2016 38 次提交
  2. 06 12月, 2016 2 次提交
    • J
      uapi glibc compat: fix outer guard of net device flags enum · efc45154
      Jonas Gorski 提交于
      Fix a wrong condition preventing the higher net device flags
      IFF_LOWER_UP etc to be defined if net/if.h is included before
      linux/if.h.
      
      The comment makes it clear the intention was to allow partial
      definition with either parts.
      
      This fixes compilation of userspace programs trying to use
      IFF_LOWER_UP, IFF_DORMANT or IFF_ECHO.
      
      Fixes: 4a91cb61 ("uapi glibc compat: fix compile errors when glibc net/if.h included before linux/if.h")
      Signed-off-by: NJonas Gorski <jonas.gorski@gmail.com>
      Reviewed-by: NMikko Rapeli <mikko.rapeli@iki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      efc45154
    • E
      net/udp: do not touch skb->peeked unless really needed · a297569f
      Eric Dumazet 提交于
      In UDP recvmsg() path we currently access 3 cache lines from an skb
      while holding receive queue lock, plus another one if packet is
      dequeued, since we need to change skb->next->prev
      
      1st cache line (contains ->next/prev pointers, offsets 0x00 and 0x08)
      2nd cache line (skb->len & skb->peeked, offsets 0x80 and 0x8e)
      3rd cache line (skb->truesize/users, offsets 0xe0 and 0xe4)
      
      skb->peeked is only needed to make sure 0-length packets are properly
      handled while MSG_PEEK is operated.
      
      I had first the intent to remove skb->peeked but the "MSG_PEEK at
      non-zero offset" support added by Sam Kumar makes this not possible.
      
      This patch avoids one cache line miss during the locked section, when
      skb->len and skb->peeked do not have to be read.
      
      It also avoids the skb_set_peeked() cost for non empty UDP datagrams.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a297569f