1. 20 2月, 2018 1 次提交
    • A
      High Performance UML Vector Network Driver · 49da7e64
      Anton Ivanov 提交于
      1. Provides infrastructure for vector IO using recvmmsg/sendmmsg.
          1.1. Multi-message read.
          1.2. Multi-message write.
          1.3. Optimized queue support for multi-packet enqueue/dequeue.
          1.4. BQL/DQL support.
      2. Implements transports for several transports as well support
      for direct wiring of PWEs to NIC. Allows direct connection of VMs
      to host, other VMs and network devices with no switch in use.
          2.1. Raw socket >4 times higher PPS and 10 times higher tcp RX
          than existing pcap based transport (> 4Gbit)
          2.2. New tap transport using socket RX and tap xmit. Similar
          performance improvements (>4Gbit)
          2.3. GRE transport - direct wiring to GRE PWE
          2.4. L2TPv3 transport - direct wiring to L2TPv3 PWE
      3. Tuning, performance and offload related setting support via ethtool.
      4. Initial BPF support - used in tap/raw to avoid software looping
      5. Scatter Gather support.
      6. VNET and checksum offload support for raw socket transport.
      7. TSO/GSO support where applicable or available
      8. Migrates all error messages to netdevice_*() and rate limits
      them where needed.
      Signed-off-by: NAnton Ivanov <anton.ivanov@cambridgegreys.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      49da7e64
  2. 18 10月, 2017 1 次提交
    • K
      um: net: Convert timers to use timer_setup() · 02ab4fca
      Kees Cook 提交于
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly. (Note that this timer is actually
      disabled.)
      
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jarod Wilson <jarod@redhat.com>
      Cc: user-mode-linux-devel@lists.sourceforge.net
      Cc: user-mode-linux-user@lists.sourceforge.net
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      02ab4fca
  3. 21 10月, 2016 1 次提交
    • J
      net: use core MTU range checking in misc drivers · b3e3893e
      Jarod Wilson 提交于
      firewire-net:
      - set min/max_mtu
      - remove fwnet_change_mtu
      
      nes:
      - set max_mtu
      - clean up nes_netdev_change_mtu
      
      xpnet:
      - set min/max_mtu
      - remove xpnet_dev_change_mtu
      
      hippi:
      - set min/max_mtu
      - remove hippi_change_mtu
      
      batman-adv:
      - set max_mtu
      - remove batadv_interface_change_mtu
      - initialization is a little async, not 100% certain that max_mtu is set
        in the optimal place, don't have hardware to test with
      
      rionet:
      - set min/max_mtu
      - remove rionet_change_mtu
      
      slip:
      - set min/max_mtu
      - streamline sl_change_mtu
      
      um/net_kern:
      - remove pointless ndo_change_mtu
      
      hsi/clients/ssi_protocol:
      - use core MTU range checking
      - remove now redundant ssip_pn_set_mtu
      
      ipoib:
      - set a default max MTU value
      - Note: ipoib's actual max MTU can vary, depending on if the device is in
        connected mode or not, so we'll just set the max_mtu value to the max
        possible, and let the ndo_change_mtu function continue to validate any new
        MTU change requests with checks for CM or not. Note that ipoib has no
        min_mtu set, and thus, the network core's mtu > 0 check is the only lower
        bounds here.
      
      mptlan:
      - use net core MTU range checking
      - remove now redundant mpt_lan_change_mtu
      
      fddi:
      - min_mtu = 21, max_mtu = 4470
      - remove now redundant fddi_change_mtu (including export)
      
      fjes:
      - min_mtu = 8192, max_mtu = 65536
      - The max_mtu value is actually one over IP_MAX_MTU here, but the idea is to
        get past the core net MTU range checks so fjes_change_mtu can validate a
        new MTU against what it supports (see fjes_support_mtu in fjes_hw.c)
      
      hsr:
      - min_mtu = 0 (calls ether_setup, max_mtu is 1500)
      
      f_phonet:
      - min_mtu = 6, max_mtu = 65541
      
      u_ether:
      - min_mtu = 14, max_mtu = 15412
      
      phonet/pep-gprs:
      - min_mtu = 576, max_mtu = 65530
      - remove redundant gprs_set_mtu
      
      CC: netdev@vger.kernel.org
      CC: linux-rdma@vger.kernel.org
      CC: Stefan Richter <stefanr@s5r6.in-berlin.de>
      CC: Faisal Latif <faisal.latif@intel.com>
      CC: linux-rdma@vger.kernel.org
      CC: Cliff Whickman <cpw@sgi.com>
      CC: Robin Holt <robinmholt@gmail.com>
      CC: Jes Sorensen <jes@trained-monkey.org>
      CC: Marek Lindner <mareklindner@neomailbox.ch>
      CC: Simon Wunderlich <sw@simonwunderlich.de>
      CC: Antonio Quartulli <a@unstable.cc>
      CC: Sathya Prakash <sathya.prakash@broadcom.com>
      CC: Chaitra P B <chaitra.basappa@broadcom.com>
      CC: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
      CC: MPT-FusionLinux.pdl@broadcom.com
      CC: Sebastian Reichel <sre@kernel.org>
      CC: Felipe Balbi <balbi@kernel.org>
      CC: Arvid Brodin <arvid.brodin@alten.se>
      CC: Remi Denis-Courmont <courmisch@gmail.com>
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b3e3893e
  4. 05 5月, 2016 1 次提交
  5. 07 11月, 2015 1 次提交
  6. 14 10月, 2014 1 次提交
  7. 25 3月, 2014 1 次提交
  8. 11 3月, 2013 1 次提交
  9. 07 1月, 2013 1 次提交
  10. 04 1月, 2013 1 次提交
  11. 10 10月, 2012 1 次提交
  12. 17 7月, 2012 1 次提交
  13. 22 5月, 2012 1 次提交
  14. 25 3月, 2012 1 次提交
  15. 18 2月, 2012 1 次提交
  16. 18 8月, 2011 1 次提交
  17. 26 7月, 2011 1 次提交
  18. 30 9月, 2010 1 次提交
    • B
      um: Proper Fix for f25c80a4: remove duplicate structure field initialization · 9337057d
      Boaz Harrosh 提交于
      uml_net_set_mac() was broken and luckily it was never used, before.
      What it was trying to do is spin_lock before memcopy the mac address.
      Linus attempted to fix it in assumption that someone decided the
      lock was needed. But since it was never ever used at all, and was
      just dead code, I think we can assume that it is not needed, after
      all.
      
      On the other hand patch [f25c80a4] was trying to use eth_mac_addr()
      in eth_configure(), *which was the real fallout*. Because of state
      checks done inside eth_mac_addr() the address was never set. I have
      not reintroduced the memcpy wrapper, but I've put a comment for future
      cats.
      
      The code now is back to exactly as it was before [f25c80a4]. With
      the cleanup applied. If the spin_lock is indeed needed then a contender
      should supply a test case that fails, then fix it with the proper
      locking, as a separate unrelated patch.
      
      CC: Julia Lawall <julia@diku.dk>
      CC: David S. Miller <davem@davemloft.net>
      CC: Andrew Morton <akpm@linux-foundation.org>
      CC: Al Viro <viro@ZenIV.linux.org.uk>
      Tested-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9337057d
  19. 22 7月, 2010 1 次提交
    • J
      arch/um/drivers: remove duplicate structure field initialization · f25c80a4
      Julia Lawall 提交于
      There are two initializations of ndo_set_mac_address, one to a local
      function that is not used otherwise and one to a function that is defined
      elsewhere.
      
      The semantic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r@
      identifier I, s, fld;
      position p0,p;
      expression E;
      @@
      
      struct I s =@p0 { ... .fld@p = E, ...};
      
      @s@
      identifier I, s, r.fld;
      position r.p0,p;
      expression E;
      @@
      
      struct I s =@p0 { ... .fld@p = E, ...};
      
      @script:python@
      p0 << r.p0;
      fld << r.fld;
      ps << s.p;
      pr << r.p;
      @@
      
      if int(ps[0].line)<int(pr[0].line) or int(ps[0].column)<int(pr[0].column):
        cocci.print_main(fld,p0)
      // </smpl>
      
      akpm:
      
      - Use the standard eth_mac_addr() in uml_net_set_mac()
      
      - Remove unneeded and racy local set_ether_mac()
      
      - Remove duplicated (and incorrect)
        uml_netdev_ops.ndo_set_mac_address initializer.
      
      Fixes 8bb95b39 ("uml: convert network
      device to netdevice ops").
      
      [akpm@linux-foundation.org: rework as above]
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f25c80a4
  20. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  21. 21 9月, 2009 1 次提交
  22. 02 9月, 2009 1 次提交
  23. 06 7月, 2009 1 次提交
  24. 16 6月, 2009 1 次提交
    • G
      uml: remove driver_data direct access of struct device · 8691b97b
      Greg Kroah-Hartman 提交于
      In the near future, the driver core is going to not allow direct access
      to the driver_data pointer in struct device.  Instead, the functions
      dev_get_drvdata() and dev_set_drvdata() should be used.  These functions
      have been around since the beginning, so are backwards compatible with
      all older kernel versions.
      
      Cc: user-mode-linux-devel@lists.sourceforge.net
      Cc: Jeff Dike <jdike@addtoit.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8691b97b
  25. 03 4月, 2009 1 次提交
  26. 27 3月, 2009 2 次提交
  27. 05 12月, 2008 1 次提交
  28. 28 10月, 2008 1 次提交
  29. 28 4月, 2008 1 次提交
  30. 26 3月, 2008 1 次提交
  31. 06 2月, 2008 2 次提交
  32. 11 12月, 2007 1 次提交
  33. 15 11月, 2007 1 次提交
  34. 17 10月, 2007 3 次提交
    • J
      uml: correctly handle skb allocation failures · 605c1e57
      Jeff Dike 提交于
      Handle memory allocation failures when reading packets.
      
      We have to read something from the host, even if we can't allocate any
      memory.  If we don't, the host side of the device may fill up and stop
      delivering interrupts because no new packets can be queued.
      
      A single sk_buff is allocated whenever an MTU is seen which is larger
      than any seen earlier.  This is used to read packets if there is a
      memory allocation failure.
      
      The large MTU check is done from eth_configure, which is called when a
      interface is added to the system.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      605c1e57
    • J
      uml: network driver MTU cleanups · b53f35a8
      Jeff Dike 提交于
      A bunch of MTU-related cleanups in the network code.
      
      First, there is the addition of the notion of a maximally-sized packet, which
      is the MTU plus headers.  This is used to size the skb that will receive a
      packet.  This allows ether_adjust_skb to go away, as it was used to resize the
      skb after it was allocated.
      
      Since the skb passed into the low-level read routine is no longer resized, and
      possibly reallocated, there, they (and the write routines) don't need to get
      an sk_buff **.  They just need the sk_buff * now.  The callers of
      ether_adjust_skb still need to do the skb_put, so that's now inlined.
      
      The MAX_PACKET definitions in most of the drivers are gone.
      
      The set_mtu methods were all the same and did nothing, so they can be
      removed.
      
      The ethertap driver had a typo which doubled the size of the packet rather
      than adding two bytes to it.  It also wasn't defining its setup_size, causing
      a zero-byte kmalloc and crash when the invalid pointer returned from kmalloc
      was dereferenced.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b53f35a8
    • J
      uml: network formatting · cd1ae0e4
      Jeff Dike 提交于
      Style and other non-functional changes in the UML networking code, including
      	include tidying
      	style violations
      	copyright updates
      	printks getting severities
      	userspace code calling libc directly rather than using the os_*
      wrappers
      
      There's also a exit path cleanup in the pcap driver.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd1ae0e4
  35. 25 7月, 2007 1 次提交
    • J
      uml: more __init annotations · 97a1fcbb
      Jeff Dike 提交于
      2.6.23-rc1 turned up another batch of references from non-__init code to
      __init code.  In most cases, these were missing __init annotations.  In one
      case (os_drop_memory), the annotation was present but wrong.
      
      init_maps is __init, but for some reason was being very careful about the
      mechanism by which it allocated memory, checking whether it was OK to use
      kmalloc (at this point in the boot, it definitely isn't) and using either
      alloc_bootmem_low_pages or kmalloc/vmalloc.  So, the kmalloc/vmalloc code is
      removed.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      97a1fcbb
  36. 09 5月, 2007 1 次提交
    • J
      uml: network and pcap cleanup · 7d98230a
      Jeff Dike 提交于
      Some network device cleanup.
      
      When setup_etheraddr found a globally valid MAC being assigned to an
      interface, it went ahead and used it rather than assigning a random MAC like
      the other cases do.  This isn't really an error like the others, but it seems
      consistent to make it behave the same.
      
      We were getting some duplicate kfree() in the error case in eth_configure
      because platform_device_unregister frees buffers that the error cases
      following tried to free again.
      
      The pcap initialization routine wasn't doing the proper printk of its
      information, causing a printk of the first part of that line to be
      unterminated by a newline.
      
      The pcap code had a bunch of style violations, which are now fixed.
      
      pcap_setup wasn't returning false when it detected an unrecognized
      option.
      
      The printks in pcap_user all got UM_KERN_BLAH prepended to their
      format strings.
      
      pcap_remove now checks for a non-NULL pcap structure before it calls
      pcap_close.
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Acked-by: NPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7d98230a