1. 21 Jul, 2014 5 commits
    • David S. Miller's avatar
      Merge branch 'netdev_print' · 4ec68378
      David S. Miller authored
      Veaceslav Falico says:
      
      ====================
      net: print net_device name/state more often
      
      Currently we use net_device->name only if it's the NETREG_REGISTERED
      reg_state, otherwise we return "(unregistered device)".
      
      However, we always populate net_device->name on creation, so it's always
      available to us for use. The only caveat is that we might have a name like
      "eth%d", in which case we cannot use it as it might change in the future.
      
      Also, the net_device might not be NETREG_UNREGISTERED when the function is
      called (_UNINITIALIZED, _UNREGISTERING, _RELEASED, _DUMMY), so it's
      misleading.
      
      So, a better way would be to always return the dev->name in netdev_name(),
      unless it's in the form of "eth%d" or it's empty, then return
      "unnamed net_device". This way we'll always return the name in
      NETREG_REGISTERED reg_state, and also return it in other states, when
      possible.
      
      Also, to be more verbose on non-NETREG_REGISTERED states, add a function
      netdev_reg_state(), which returns a string describing the state, and use it
      in netdev_printk()-related functions. If the dev is in NETREG_REGISTERED
      state then a void string is regurned and, thus, nothing changes.
      
      After these two patches we'll have the same behaviour in the usual cases,
      and more verbose in non-standardad/buggy ones.
      
      v2->v3:
      Correct the string for _UNINITIALIZED and warn on a bad reg_state,
      per Joe Perches's comments.
      
      v1->v2:
      As Tom Gundersen suggested, there might be a case when we have an empty
      string as a name for a device, so account this also and return "unnamed
      device" for that case too.
      ====================
      Signed-off-by: default avatarVeaceslav Falico <vfalico@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ec68378
    • Veaceslav Falico's avatar
      net: print net_device reg_state in netdev_* unless it's registered · ccc7f496
      Veaceslav Falico authored
      This way we'll always know in what status the device is, unless it's
      running normally (i.e. NETDEV_REGISTERED).
      
      Also, emit a warning once in case of a bad reg_state.
      
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Jason Baron <jbaron@akamai.com>
      CC: Eric Dumazet <edumazet@google.com>
      CC: Vlad Yasevich <vyasevic@redhat.com>
      CC: stephen hemminger <stephen@networkplumber.org>
      CC: Jerry Chu <hkchu@google.com>
      CC: Ben Hutchings <bhutchings@solarflare.com>
      CC: Joe Perches <joe@perches.com>
      Signed-off-by: default avatarVeaceslav Falico <vfalico@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ccc7f496
    • Veaceslav Falico's avatar
      net: use dev->name in netdev_pr* when it's available · c6f854d5
      Veaceslav Falico authored
      netdev_name() returns dev->name only when the net_device is in
      NETREG_REGISTERED state.
      
      However, dev->name is always populated on creation, so we can easily use
      it.
      
      There are two cases when there's no real name - when it's an empty string
      or when the name is in form of "eth%d", then netdev_name() returns "unnamed
      net_device".
      
      CC: "David S. Miller" <davem@davemloft.net>
      CC: Tom Gundersen <teg@jklm.no>
      Signed-off-by: default avatarVeaceslav Falico <vfalico@gmail.com>
      Acked-by: default avatarTom Gundersen <teg@jklm.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c6f854d5
    • Veaceslav Falico's avatar
      bonding: make it possible to have unlimited nested upper vlans · 3e403a77
      Veaceslav Falico authored
      Currently we're limited by a constant level of vlan nestings, and fail to
      find anything beyound that level (currently 2).
      
      To fix this - remove the limit of nestings when going through device tree,
      and when the end device is found - allocate the needed amount of vlan tags
      and return them, instead of found/not found.
      
      CC: Jay Vosburgh <j.vosburgh@gmail.com>
      CC: Andy Gospodarek <andy@greyhouse.net>
      Signed-off-by: default avatarVeaceslav Falico <vfalico@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3e403a77
    • Cong Wang's avatar
      net_sched: hold tcf_lock in netdevice notifier · 224e923c
      Cong Wang authored
      We modify mirred action (m->tcfm_dev) in netdev event, we need to
      prevent on-going mirred actions from reading freed m->tcfm_dev.
      So we need to acquire this spin lock.
      
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarCong Wang <cwang@twopensource.com>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      224e923c
  2. 20 Jul, 2014 1 commit
  3. 17 Jul, 2014 34 commits