1. 22 2月, 2016 1 次提交
  2. 16 7月, 2015 3 次提交
    • W
      ipvlan: use rcu_deference_bh() in ipvlan_queue_xmit() · 0fba37a3
      WANG Cong 提交于
      In tx path rcu_read_lock_bh() is held, so we need rcu_deference_bh().
      This fixes the following warning:
      
       ===============================
       [ INFO: suspicious RCU usage. ]
       4.1.0-rc1+ #1007 Not tainted
       -------------------------------
       drivers/net/ipvlan/ipvlan.h:106 suspicious rcu_dereference_check() usage!
      
       other info that might help us debug this:
      
       rcu_scheduler_active = 1, debug_locks = 0
       1 lock held by dhclient/1076:
        #0:  (rcu_read_lock_bh){......}, at: [<ffffffff817e8d84>] rcu_lock_acquire+0x0/0x26
      
       stack backtrace:
       CPU: 2 PID: 1076 Comm: dhclient Not tainted 4.1.0-rc1+ #1007
       Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
        0000000000000001 ffff8800d381bac8 ffffffff81a4154f 000000003c1a3c19
        ffff8800d4d0a690 ffff8800d381baf8 ffffffff810b849f ffff880117d41148
        ffff880117d40000 ffff880117d40068 0000000000000156 ffff8800d381bb18
       Call Trace:
        [<ffffffff81a4154f>] dump_stack+0x4c/0x65
        [<ffffffff810b849f>] lockdep_rcu_suspicious+0x107/0x110
        [<ffffffff8165a522>] ipvlan_port_get_rcu+0x47/0x4e
        [<ffffffff8165ad14>] ipvlan_queue_xmit+0x35/0x450
        [<ffffffff817ea45d>] ? rcu_read_unlock+0x3e/0x5f
        [<ffffffff810a20bf>] ? local_clock+0x19/0x22
        [<ffffffff810b4781>] ? __lock_is_held+0x39/0x52
        [<ffffffff8165b64c>] ipvlan_start_xmit+0x1b/0x44
        [<ffffffff817edf7f>] dev_hard_start_xmit+0x2ae/0x467
        [<ffffffff817ee642>] __dev_queue_xmit+0x50a/0x60c
        [<ffffffff817ee7a7>] dev_queue_xmit_sk+0x13/0x15
        [<ffffffff81997596>] dev_queue_xmit+0x10/0x12
        [<ffffffff8199b41c>] packet_sendmsg+0xb6b/0xbdf
        [<ffffffff810b5ea7>] ? mark_lock+0x2e/0x226
        [<ffffffff810a1fcc>] ? sched_clock_cpu+0x9e/0xb7
        [<ffffffff817d56f9>] sock_sendmsg_nosec+0x12/0x1d
        [<ffffffff817d7257>] sock_sendmsg+0x29/0x2e
        [<ffffffff817d72cc>] sock_write_iter+0x70/0x91
        [<ffffffff81199563>] __vfs_write+0x7e/0xa7
        [<ffffffff811996bc>] vfs_write+0x92/0xe8
        [<ffffffff811997d7>] SyS_write+0x47/0x7e
        [<ffffffff81a4d517>] system_call_fastpath+0x12/0x6f
      
      Fixes: 2ad7bf36 ("ipvlan: Initial check-in of the IPVLAN driver.")
      Cc: Mahesh Bandewar <maheshb@google.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: NMahesh Bandewar <maheshb@google.com>
      Acked-by: NKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0fba37a3
    • K
      ipvlan: unhash addresses without synchronize_rcu · 6640e673
      Konstantin Khlebnikov 提交于
      All structures used in traffic forwarding are rcu-protected:
      ipvl_addr, ipvl_dev and ipvl_port. Thus we can unhash addresses
      without synchronization. We'll anyway hash it back into the same
      bucket: in worst case lockless lookup will scan hash once again.
      Signed-off-by: NKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6640e673
    • K
      ipvlan: remove counters of ipv4 and ipv6 addresses · 515866f8
      Konstantin Khlebnikov 提交于
      They are unused after commit f631c44b ("ipvlan: Always set broadcast bit in
      multicast filter").
      Signed-off-by: NKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      515866f8
  3. 06 5月, 2015 1 次提交
    • M
      ipvlan: Defer multicast / broadcast processing to a work-queue · ba35f858
      Mahesh Bandewar 提交于
      Processing multicast / broadcast in fast path is performance draining
      and having more links means more cloning and bringing performance
      down further.
      
      Broadcast; in particular, need to be given to all the virtual links.
      Earlier tricks of enabling broadcast bit for IPv4 only interfaces are not
      really working since it fails autoconf. Which means enabling broadcast
      for all the links if protocol specific hacks do not have to be added into
      the driver.
      
      This patch defers all (incoming as well as outgoing) multicast traffic to
      a work-queue leaving only the unicast traffic in the fast-path. Now if we
      need to apply any additional tricks to further reduce the impact of this
      (multicast / broadcast) type of traffic, it can be implemented while
      processing this work without affecting the fast-path.
      Signed-off-by: NMahesh Bandewar <maheshb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ba35f858
  4. 01 4月, 2015 1 次提交
  5. 12 2月, 2015 1 次提交
  6. 10 12月, 2014 1 次提交
  7. 30 11月, 2014 1 次提交
  8. 25 11月, 2014 1 次提交
    • M
      ipvlan: Initial check-in of the IPVLAN driver. · 2ad7bf36
      Mahesh Bandewar 提交于
      This driver is very similar to the macvlan driver except that it
      uses L3 on the frame to determine the logical interface while
      functioning as packet dispatcher. It inherits L2 of the master
      device hence the packets on wire will have the same L2 for all
      the packets originating from all virtual devices off of the same
      master device.
      
      This driver was developed keeping the namespace use-case in
      mind. Hence most of the examples given here take that as the
      base setup where main-device belongs to the default-ns and
      virtual devices are assigned to the additional namespaces.
      
      The device operates in two different modes and the difference
      in these two modes in primarily in the TX side.
      
      (a) L2 mode : In this mode, the device behaves as a L2 device.
      TX processing upto L2 happens on the stack of the virtual device
      associated with (namespace). Packets are switched after that
      into the main device (default-ns) and queued for xmit.
      
      RX processing is simple and all multicast, broadcast (if
      applicable), and unicast belonging to the address(es) are
      delivered to the virtual devices.
      
      (b) L3 mode : In this mode, the device behaves like a L3 device.
      TX processing upto L3 happens on the stack of the virtual device
      associated with (namespace). Packets are switched to the
      main-device (default-ns) for the L2 processing. Hence the routing
      table of the default-ns will be used in this mode.
      
      RX processins is somewhat similar to the L2 mode except that in
      this mode only Unicast packets are delivered to the virtual device
      while main-dev will handle all other packets.
      
      The devices can be added using the "ip" command from the iproute2
      package -
      
      	ip link add link <master> <virtual> type ipvlan mode [ l2 | l3 ]
      Signed-off-by: NMahesh Bandewar <maheshb@google.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Maciej Żenczykowski <maze@google.com>
      Cc: Laurent Chavey <chavey@google.com>
      Cc: Tim Hockin <thockin@google.com>
      Cc: Brandon Philips <brandon.philips@coreos.com>
      Cc: Pavel Emelianov <xemul@parallels.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2ad7bf36