1. 23 Apr, 2019 12 commits
    • David S. Miller's avatar
      Merge branch 'net-clean-up-needless-use-of-module-infrastructure' · 7e5ebd0b
      David S. Miller authored
      Paul Gortmaker says:
      
      ====================
      clean up needless use of module infrastructure
      
      People can embed modular includes and modular exit functions into code
      that never use any of it, and they won't get any errors or warnings.
      
      Using modular infrastructure in non-modules might seem harmless, but some
      of the downfalls this leads to are:
      
       (1) it is easy to accidentally write unused module_exit removal code
       (2) it can be misleading when reading the source, thinking a driver can
           be modular when the Makefile and/or Kconfig prohibit it
       (3) an unused include of the module.h header file will in turn
           include nearly everything else; adding a lot to CPP overhead.
       (4) it gets copied/replicated into other drivers and spreads quickly.
      
      As a data point for #3 above, an empty C file that just includes the
      module.h header generates over 750kB of CPP output.  Repeating the same
      experiment with init.h and the result is less than 12kB; with export.h
      it is only about 1/2kB; with both it still is less than 12kB.  One driver
      in this series gets the module.h ---> init.h+export.h conversion.
      
      Worse, are headers in include/linux that in turn include <linux/module.h>
      as they can impact a whole fleet of drivers, or a whole subsystem, so
      special care should be used in order to avoid that.  Such headers should
      only include what they need to be stand-alone; they should not be trying
      to anticipate the various header needs of their possible end users.
      
      In this series, four include/linux headers have module.h removed from
      them because they don't strictly need it.  Then three chunks of net
      related code have modular infrastructure that isn't used, removed.
      
      There are no runtime changes, so the biggest risk is a genuine consumer
      of module.h content relying on implicitly getting it from one of the
      include/linux instances removed here - thus resulting in a build fail.
      
      With that in mind, allmodconfig build testing was done on x86-64, arm64,
      x86-32, arm. powerpc, and mips on linux-next (and hence net-next).
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7e5ebd0b
    • Paul Gortmaker's avatar
      net: strparser: make it explicitly non-modular · 15253b4a
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      net/strparser/Kconfig:config STREAM_PARSER
      net/strparser/Kconfig:  def_bool n
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      Since module_init translates to device_initcall in the non-modular
      case, the init ordering remains unchanged with this commit.  For
      clarity, we change the fcn name mod_init to dev_init at the same time.
      
      We replace module.h with init.h and export.h ; the latter since this
      file exports some syms.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Martin KaFai Lau <kafai@fb.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Yonghong Song <yhs@fb.com>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      15253b4a
    • Paul Gortmaker's avatar
      net: bpfilter: dont use module_init in non-modular code · 3557b3fd
      Paul Gortmaker authored
      The Kconfig controlling this code is:
      
      bpfilter/Kconfig:menuconfig BPFILTER
      bpfilter/Kconfig:   bool "BPF based packet filtering framework (BPFILTER)"
      
      Since it isn't a module, we shouldn't use module_init().  Instead we
      use device_initcall() - which is exactly what module_init() defaults
      to for non-modular code/builds.
      
      We don't remove <linux/module.h> from the includes since this file does
      a request_module() and hence is a valid user of that header file, even
      though it is not modular itself.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3557b3fd
    • Paul Gortmaker's avatar
      cgroup: net: remove left over MODULE_LICENSE tag · 9628495d
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      net/Kconfig:config CGROUP_NET_PRIO
      net/Kconfig:    bool "Network priority cgroup"
      
      ...meaning that it currently is not being built as a module by anyone,
      as module support was discontinued in 2014.
      
      We delete the MODULE_LICENSE tag since all that information is already
      contained at the top of the file in the comments.
      
      We don't delete module.h from the includes since it was no longer there
      to begin with.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: "Rosen, Rami" <rami.rosen@intel.com>
      Cc: Daniel Wagner <daniel.wagner@bmw-carit.de>
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9628495d
    • Paul Gortmaker's avatar
      net: tc_act: drop include of module.h from tc_ife.h · a130f9b2
      Paul Gortmaker authored
      Ideally, header files under include/linux shouldn't be adding
      includes of other headers, in anticipation of their consumers,
      but just the headers needed for the header itself to pass
      parsing with CPP.
      
      The module.h is particularly bad in this sense, as it itself does
      include a whole bunch of other headers, due to the complexity of
      module support.
      
      Since tc_ife.h is not going into a module struct looking for
      specific fields, we can just let it know that module is a struct,
      just like about 60 other include/linux headers already do.
      
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Cong Wang <xiyou.wangcong@gmail.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a130f9b2
    • Paul Gortmaker's avatar
      net: fib: drop include of module.h from fib_notifier.h · 113e6328
      Paul Gortmaker authored
      Ideally, header files under include/linux shouldn't be adding
      includes of other headers, in anticipation of their consumers,
      but just the headers needed for the header itself to pass
      parsing with CPP.
      
      The module.h is particularly bad in this sense, as it itself does
      include a whole bunch of other headers, due to the complexity of
      module support.
      
      Since fib_notifier.h is not going into a module struct looking for
      specific fields, we can just let it know that module is a struct,
      just like about 60 other include/linux headers already do.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      113e6328
    • Paul Gortmaker's avatar
      net: ife: drop include of module.h from net/ife.h · c517796e
      Paul Gortmaker authored
      Ideally, header files under include/linux shouldn't be adding
      includes of other headers, in anticipation of their consumers,
      but just the headers needed for the header itself to pass
      parsing with CPP.
      
      The module.h is particularly bad in this sense, as it itself does
      include a whole bunch of other headers, due to the complexity of
      module support.
      
      There doesn't appear to be anything in net/ife.h that is module
      related, and build coverage doesn't appear to show any other
      files/drivers relying implicitly on getting it from here.
      
      So it appears we are simply free to just remove it in this case.
      
      Cc: Yotam Gigi <yotam.gi@gmail.com>
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c517796e
    • Paul Gortmaker's avatar
      net: psample: drop include of module.h from psample.h · a79eda3a
      Paul Gortmaker authored
      Ideally, header files under include/linux shouldn't be adding
      includes of other headers, in anticipation of their consumers,
      but just the headers needed for the header itself to pass
      parsing with CPP.
      
      The module.h is particularly bad in this sense, as it itself does
      include a whole bunch of other headers, due to the complexity of
      module support.
      
      There doesn't appear to be anything in psample.h that is module
      related, and build coverage doesn't appear to show any other
      files/drivers relying implicitly on getting it from here.
      
      So it appears we are simply free to just remove it in this case.
      
      Cc: Yotam Gigi <yotam.gi@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a79eda3a
    • David Ahern's avatar
      net: Rename net/nexthop.h net/rtnh.h · 3c618c1d
      David Ahern authored
      The header contains rtnh_ macros so rename the file accordingly.
      Allows a later patch to use the nexthop.h name for the new
      nexthop code.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c618c1d
    • David Ahern's avatar
      ipv6: Remove fib6_info_nh_lwt · 7e5f4cdb
      David Ahern authored
      fib6_info_nh_lwt is no longer used; remove it.
      Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7e5f4cdb
    • Daniel T. Lee's avatar
      include/net/tcp.h: whitespace cleanup at tcp_v4_check · 0b13c9bb
      Daniel T. Lee authored
      This patch makes trivial whitespace fix to the function
      tcp_v4_check at include/net/tcp.h file.
      
      It has stylistic issue, which is "space required after that ','"
      and it can be confirmed with ./scripts/checkpatch.pl tool.
      
          ERROR: space required after that ',' (ctx:VxV)
          #29: FILE: include/net/tcp.h:1317:
          +	        return csum_tcpudp_magic(saddr,daddr,len,IPPROTO_TCP,base);
               	                              ^
      Signed-off-by: default avatarDaniel T. Lee <danieltimlee@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0b13c9bb
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · 2843ba2e
      David S. Miller authored
      Alexei Starovoitov says:
      
      ====================
      pull-request: bpf-next 2019-04-22
      
      The following pull-request contains BPF updates for your *net-next* tree.
      
      The main changes are:
      
      1) allow stack/queue helpers from more bpf program types, from Alban.
      
      2) allow parallel verification of root bpf programs, from Alexei.
      
      3) introduce bpf sysctl hook for trusted root cases, from Andrey.
      
      4) recognize var/datasec in btf deduplication, from Andrii.
      
      5) cpumap performance optimizations, from Jesper.
      
      6) verifier prep for alu32 optimization, from Jiong.
      
      7) libbpf xsk cleanup, from Magnus.
      
      8) other various fixes and cleanups.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2843ba2e
  2. 22 Apr, 2019 5 commits
  3. 21 Apr, 2019 7 commits
  4. 20 Apr, 2019 15 commits
  5. 19 Apr, 2019 1 commit
    • Eric Dumazet's avatar
      tcp: properly reset skb->truesize for tx recycling · d7cc399e
      Eric Dumazet authored
      tcp sendmsg() and sendpage() normally advance skb->data_len
      and skb->truesize by the payload added to an skb.
      
      But sendmsg(fd, ..., MSG_ZEROCOPY) has to account for whole pages,
      even if a single byte of payload is used in the page.
      
      This means that we can not assume skb->truesize can be adjusted
      by skb->data_len. We must instead overwrite its value.
      
      Otherwise skb->truesize is too big and can hit socket sndbuf limit,
      especially if the skb is recycled multiple times :/
      
      Fixes: 472c2e07 ("tcp: add one skb cache for tx")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Soheil Hassas Yeganeh <soheil@google.com>
      Cc: Willem de Bruijn <willemb@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d7cc399e