1. 07 1月, 2016 3 次提交
  2. 24 12月, 2015 1 次提交
  3. 23 12月, 2015 1 次提交
  4. 16 12月, 2015 1 次提交
    • I
      switchdev: Pass original device to port netdev driver · 6ff64f6f
      Ido Schimmel 提交于
      switchdev drivers need to know the netdev on which the switchdev op was
      invoked. For example, the STP state of a VLAN interface configured on top
      of a port can change while being member in a bridge. In this case, the
      underlying driver should only change the STP state of that particular
      VLAN and not of all the VLANs configured on the port.
      
      However, current switchdev infrastructure only passes the port netdev down
      to the driver. Solve that by passing the original device down to the
      driver as part of the required switchdev object / attribute.
      
      This doesn't entail any change in current switchdev drivers. It simply
      enables those supporting stacked devices to know the originating device
      and act accordingly.
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6ff64f6f
  5. 09 12月, 2015 1 次提交
  6. 04 12月, 2015 2 次提交
  7. 24 11月, 2015 4 次提交
  8. 17 11月, 2015 1 次提交
  9. 11 11月, 2015 1 次提交
    • V
      Revert "bridge: Allow forward delay to be cfgd when STP enabled" · 8a921265
      Vlad Yasevich 提交于
      This reverts commit 34c2d9fb.
      
      There are 2 reasons for this revert:
       1)  The commit in question doesn't do what it says it does.  The
           description reads: "Allow bridge forward delay to be configured
           when Spanning Tree is enabled."  This was already the case before
           the commit was made.  What the commit actually do was disallow
           invalid values or 'forward_delay' when STP was turned off.
      
       2)  The above change was actually a change in the user observed
           behavior and broke things like libvirt and other network configs
           that set 'forward_delay' to 0 without enabling STP.  The value
           of 0 is actually used when STP is turned off to immediately mark
           the bridge as forwarding.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a921265
  10. 03 11月, 2015 3 次提交
  11. 30 10月, 2015 1 次提交
    • R
      bridge: set is_local and is_static before fdb entry is added to the fdb hashtable · b7af1472
      Roopa Prabhu 提交于
      Problem Description:
      We can add fdbs pointing to the bridge with NULL ->dst but that has a
      few race conditions because br_fdb_insert() is used which first creates
      the fdb and then, after the fdb has been published/linked, sets
      "is_local" to 1 and in that time frame if a packet arrives for that fdb
      it may see it as non-local and either do a NULL ptr dereference in
      br_forward() or attach the fdb to the port where it arrived, and later
      br_fdb_insert() will make it local thus getting a wrong fdb entry.
      Call chain br_handle_frame_finish() -> br_forward():
      But in br_handle_frame_finish() in order to call br_forward() the dst
      should not be local i.e. skb != NULL, whenever the dst is
      found to be local skb is set to NULL so we can't forward it,
      and here comes the problem since it's running only
      with RCU when forwarding packets it can see the entry before "is_local"
      is set to 1 and actually try to dereference NULL.
      The main issue is that if someone sends a packet to the switch while
      it's adding the entry which points to the bridge device, it may
      dereference NULL ptr. This is needed now after we can add fdbs
      pointing to the bridge.  This poses a problem for
      br_fdb_update() as well, while someone's adding a bridge fdb, but
      before it has is_local == 1, it might get moved to a port if it comes
      as a source mac and then it may get its "is_local" set to 1
      
      This patch changes fdb_create to take is_local and is_static as
      arguments to set these values in the fdb entry before it is added to the
      hash. Also adds null check for port in br_forward.
      
      Fixes: 3741873b ("bridge: allow adding of fdb entries pointing to the bridge device")
      Reported-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
      Reviewed-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Acked-by: NStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b7af1472
  12. 22 10月, 2015 1 次提交
    • A
      netlink: Rightsize IFLA_AF_SPEC size calculation · b1974ed0
      Arad, Ronen 提交于
      if_nlmsg_size() overestimates the minimum allocation size of netlink
      dump request (when called from rtnl_calcit()) or the size of the
      message (when called from rtnl_getlink()). This is because
      ext_filter_mask is not supported by rtnl_link_get_af_size() and
      rtnl_link_get_size().
      
      The over-estimation is significant when at least one netdev has many
      VLANs configured (8 bytes for each configured VLAN).
      
      This patch-set "rightsizes" the protocol specific attribute size
      calculation by propagating ext_filter_mask to rtnl_link_get_af_size()
      and adding this a argument to get_link_af_size op in rtnl_af_ops.
      
      Bridge module already used filtering aware sizing for notifications.
      br_get_link_af_size_filtered() is consistent with the modified
      get_link_af_size op so it replaces br_get_link_af_size() in br_af_ops.
      br_get_link_af_size() becomes unused and thus removed.
      Signed-off-by: NRonen Arad <ronen.arad@intel.com>
      Acked-by: NSridhar Samudrala <sridhar.samudrala@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b1974ed0
  13. 21 10月, 2015 1 次提交
  14. 17 10月, 2015 1 次提交
  15. 15 10月, 2015 3 次提交
  16. 13 10月, 2015 7 次提交
    • N
      bridge: vlan: move back vlan_flush · f409d0ed
      Nikolay Aleksandrov 提交于
      Ido Schimmel reported a problem with switchdev devices because of the
      order change of del_nbp operations, more specifically the move of
      nbp_vlan_flush() which deletes all vlans and frees vlgrp after the
      rx_handler has been unregistered. So in order to fix this move
      vlan_flush back where it was and make it destroy the rhtable after
      NULLing vlgrp and waiting a grace period to make sure noone can see it.
      Reported-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f409d0ed
    • N
      bridge: vlan: drop unnecessary flush code · b8d02c3c
      Nikolay Aleksandrov 提交于
      As Ido Schimmel pointed out the vlan_vid_del() code in nbp_vlan_flush is
      unnecessary (and is actually a remnant of the old vlan code) so we can
      remove it.
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b8d02c3c
    • N
      bridge: vlan: use rcu for vlan_list traversal in br_fill_ifinfo · e9c953ef
      Nikolay Aleksandrov 提交于
      br_fill_ifinfo is called by br_ifinfo_notify which can be called from
      many contexts with different locks held, sometimes it relies upon
      bridge's spinlock only which is a problem for the vlan code, so use
      explicitly rcu for that to avoid problems.
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e9c953ef
    • N
      bridge: vlan: use proper rcu for the vlgrp member · 907b1e6e
      Nikolay Aleksandrov 提交于
      The bridge and port's vlgrp member is already used in RCU way, currently
      we rely on the fact that it cannot disappear while the port exists but
      that is error-prone and we might miss places with improper locking
      (either RCU or RTNL must be held to walk the vlan_list). So make it
      official and use RCU for vlgrp to catch offenders. Introduce proper vlgrp
      accessors and use them consistently throughout the code.
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Reviewed-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      907b1e6e
    • N
      bridge: fix gc_timer mod/del race condition · af379392
      Nikolay Aleksandrov 提交于
      commit c62987bb ("bridge: push bridge setting ageing_time down to
      switchdev") introduced a timer race condition because the gc_timer can
      get rearmed after it's supposedly stopped and flushed in br_dev_delete()
      leading to a use of freed memory. So take rtnl to sync with bridge
      destruction when setting ageing_timer.
      Here's the trace reproduced with these two commands running in parallel:
      while :; do echo 10000 > /sys/class/net/br0/bridge/ageing_timer; done;
      while :; do brctl addbr br0; ip l set br0 up; ip l set br0 down;
      brctl delbr br0; done;
      
      [  300.000029] BUG: unable to handle kernel paging request at
      ffffffff811c59d3
      [  300.000263] IP: [<ffffffff810f168e>] __internal_add_timer+0x2e/0xd0
      [  300.000422] PGD 1a0f067 PUD 1a10063 PMD 10001e1
      [  300.000639] Oops: 0003 [#1] SMP
      [  300.000793] Modules linked in: bridge stp llc nfsd auth_rpcgss
      oid_registry nfs_acl nfs lockd grace fscache sunrpc crct10dif_pclmul
      crc32_pclmul crc32c_intel ghash_clmulni_intel ppdev aesni_intel
      aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd
      snd_hda_codec_generic qxl drm_kms_helper psmouse pcspkr ttm
      snd_hda_intel 9pnet_virtio evdev serio_raw joydev snd_hda_codec 9pnet
      virtio_balloon drm snd_hwdep virtio_console snd_hda_core pvpanic snd_pcm
      i2c_piix4 snd_timer acpi_cpufreq parport_pc snd parport soundcore button
      processor i2c_core ipv6 autofs4 hid_generic usbhid hid ext4 crc16
      mbcache jbd2 sg sr_mod cdrom ata_generic virtio_blk virtio_net e1000
      ehci_pci uhci_hcd ehci_hcd usbcore usb_common floppy ata_piix libata
      virtio_pci virtio_ring virtio scsi_mod
      [  300.004008] CPU: 1 PID: 1169 Comm: bash Not tainted 4.3.0-rc3+ #46
      [  300.004008] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
      [  300.004008] task: ffff880035be2200 ti: ffff88003795c000 task.ti:
      ffff88003795c000
      [  300.004008] RIP: 0010:[<ffffffff810f168e>]  [<ffffffff810f168e>]
      __internal_add_timer+0x2e/0xd0
      [  300.004008] RSP: 0018:ffff88003fd03e78  EFLAGS: 00010046
      [  300.004008] RAX: ffff88003fd0ef60 RBX: 840fc78949c08548 RCX:
      00000001ffffffff
      [  300.004008] RDX: 0000000000000000 RSI: ffffffff811c59d3 RDI:
      ffff88003fd0df00
      [  300.004008] RBP: ffff88003fd03e78 R08: 00000000ffffffff R09:
      0000000000000000
      [  300.004008] R10: 0000000000000000 R11: 0000000000000000 R12:
      ffff88003fd0df00
      [  300.004008] R13: 0000000000000000 R14: 0000000000000001 R15:
      ffffffff816032e0
      [  300.004008] FS:  00007fcbdd609700(0000) GS:ffff88003fd00000(0000)
      knlGS:0000000000000000
      [  300.004008] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  300.004008] CR2: ffffffff811c59d3 CR3: 0000000037879000 CR4:
      00000000000406e0
      [  300.004008] Stack:
      [  300.004008]  ffff88003fd03ea8 ffffffff810f1775 ffff88003c8cb958
      ffff88003fd0df00
      [  300.004008]  0000000000000000 0000000000000001 ffff88003fd03f18
      ffffffff810f28c4
      [  300.004008]  ffff88003fd0eb68 ffff88003fd0e968 ffff88003fd0e768
      ffff88003fd0df68
      [  300.004008] Call Trace:
      [  300.004008]  <IRQ>
      [  300.004008]  [<ffffffff810f1775>] cascade+0x45/0x70
      [  300.004008]  [<ffffffff810f28c4>] run_timer_softirq+0x2f4/0x340
      [  300.004008]  [<ffffffff8107e380>] __do_softirq+0xd0/0x440
      [  300.004008]  [<ffffffff8107e8a3>] irq_exit+0xb3/0xc0
      [  300.004008]  [<ffffffff815c2032>] smp_apic_timer_interrupt+0x42/0x50
      [  300.004008]  [<ffffffff815bfe37>] apic_timer_interrupt+0x87/0x90
      [  300.004008]  <EOI>
      [  300.004008]  [<ffffffff811fb80c>] ? create_object+0x13c/0x2e0
      [  300.004008]  [<ffffffff8109b23e>] ? __kernel_text_address+0x4e/0x70
      [  300.004008]  [<ffffffff8109b23e>] ? __kernel_text_address+0x4e/0x70
      [  300.004008]  [<ffffffff8101e17f>] print_context_stack+0x7f/0xf0
      [  300.004008]  [<ffffffff8101d55b>] dump_trace+0x11b/0x300
      [  300.004008]  [<ffffffff8102970b>] save_stack_trace+0x2b/0x50
      [  300.004008]  [<ffffffff811fb80c>] create_object+0x13c/0x2e0
      [  300.004008]  [<ffffffff815b2e8e>] kmemleak_alloc+0x4e/0xb0
      [  300.004008]  [<ffffffff811e475d>] kmem_cache_alloc_trace+0x18d/0x2f0
      [  300.004008]  [<ffffffff8128b139>] kernfs_fop_open+0xc9/0x380
      [  300.004008]  [<ffffffff8120214f>] do_dentry_open+0x1ff/0x2f0
      [  300.004008]  [<ffffffff8128b070>] ? kernfs_fop_release+0x70/0x70
      [  300.004008]  [<ffffffff812034f9>] vfs_open+0x59/0x60
      [  300.004008]  [<ffffffff812130de>] path_openat+0x1ce/0x1260
      [  300.004008]  [<ffffffff812154ae>] do_filp_open+0x7e/0xe0
      [  300.004008]  [<ffffffff812251ff>] ? __alloc_fd+0xaf/0x180
      [  300.004008]  [<ffffffff8120387b>] do_sys_open+0x12b/0x210
      [  300.004008]  [<ffffffff8120397e>] SyS_open+0x1e/0x20
      [  300.004008]  [<ffffffff815bf0b6>] entry_SYSCALL_64_fastpath+0x16/0x7a
      [  300.004008] Code: 66 90 48 8b 46 10 48 8b 4f 40 55 48 89 c2 48 89 e5
      48 29 ca 48 81 fa ff 00 00 00 77 20 0f b6 c0 48 8d 44 c7 68 48 8b 10 48
      85 d2 <48> 89 16 74 04 48 89 72 08 48 89 30 48 89 46 08 5d c3 48 81 fa
      [  300.004008] RIP  [<ffffffff810f168e>] __internal_add_timer+0x2e/0xd0
      [  300.004008]  RSP <ffff88003fd03e78>
      [  300.004008] CR2: ffffffff811c59d3
      
      Fixes: c62987bb ("bridge: push bridge setting ageing_time down to switchdev")
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Acked-by: NScott Feldman <sfeldma@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      af379392
    • N
      bridge: vlan: enforce no pvid flag in vlan ranges · 6623c60d
      Nikolay Aleksandrov 提交于
      Currently it's possible for someone to send a vlan range to the kernel
      with the pvid flag set which will result in the pvid bouncing from a
      vlan to vlan and isn't correct, it also introduces problems for hardware
      where it doesn't make sense having more than 1 pvid. iproute2 already
      enforces this, so let's enforce it on kernel-side as well.
      Reported-by: NElad Raz <eladr@mellanox.com>
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6623c60d
    • J
      bridge: try switchdev op first in __vlan_vid_add/del · 0944d6b5
      Jiri Pirko 提交于
      Some drivers need to implement both switchdev vlan ops and
      vid_add/kill ndos. For that to work in bridge code, we need to try
      switchdev op first when adding/deleting vlan id.
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Acked-by: NScott Feldman <sfeldma@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0944d6b5
  17. 12 10月, 2015 3 次提交
  18. 07 10月, 2015 5 次提交