1. 18 1月, 2015 6 次提交
    • D
      net: rocker: Add basic netdev counters - v2 · f2bbca51
      David Ahern 提交于
      Add packet and byte counters for RX and TX paths.
      
      $ ifconfig eth1
      eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
              inet6 fe80::5054:ff:fe12:3501  prefixlen 64  scopeid 0x20<link>
              ether 52:54:00:12:35:01  txqueuelen 1000  (Ethernet)
              RX packets 63  bytes 15813 (15.4 KiB)
              RX errors 1  dropped 0  overruns 0  frame 0
              TX packets 79  bytes 17991 (17.5 KiB)
              TX errors 7  dropped 0 overruns 0  carrier 0  collisions 0
      
      Rx / Tx errors tested by injecting faults in qemu's hardware model for Rocker.
      
      v2:
      - moved counter locations to avoid potential use after free per Florian's comment
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Cc: Scott Feldman <sfeldma@gmail.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NScott Feldman <sfeldma@gmail.com>
      Acked-by: NJiri Pirko <jiri@resnulli.us>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f2bbca51
    • F
      net: ethernet: cpsw: don't requests IRQs we don't use · c03abd84
      Felipe Balbi 提交于
      CPSW never uses RX_THRESHOLD or MISC interrupts. In
      fact, they are always kept masked in their appropriate
      IRQ Enable register.
      
      Instead of allocating an IRQ that never fires, it's best
      to remove that code altogether and let future patches
      implement it if anybody needs those.
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c03abd84
    • F
      net: ethernet: cpsw: unroll IRQ request loop · 5087b915
      Felipe Balbi 提交于
      This patch is in preparation for a nicer IRQ
      handling scheme where we use different IRQ
      handlers for each IRQ line (as it should be).
      
      Later, we will also drop IRQs offset 0 and 3
      because they are always disabled in this driver.
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5087b915
    • J
      netlink: make nlmsg_end() and genlmsg_end() void · 053c095a
      Johannes Berg 提交于
      Contrary to common expectations for an "int" return, these functions
      return only a positive value -- if used correctly they cannot even
      return 0 because the message header will necessarily be in the skb.
      
      This makes the very common pattern of
      
        if (genlmsg_end(...) < 0) { ... }
      
      be a whole bunch of dead code. Many places also simply do
      
        return nlmsg_end(...);
      
      and the caller is expected to deal with it.
      
      This also commonly (at least for me) causes errors, because it is very
      common to write
      
        if (my_function(...))
          /* error condition */
      
      and if my_function() does "return nlmsg_end()" this is of course wrong.
      
      Additionally, there's not a single place in the kernel that actually
      needs the message length returned, and if anyone needs it later then
      it'll be very easy to just use skb->len there.
      
      Remove this, and make the functions void. This removes a bunch of dead
      code as described above. The patch adds lines because I did
      
      -	return nlmsg_end(...);
      +	nlmsg_end(...);
      +	return 0;
      
      I could have preserved all the function's return values by returning
      skb->len, but instead I've audited all the places calling the affected
      functions and found that none cared. A few places actually compared
      the return value with <= 0 in dump functionality, but that could just
      be changed to < 0 with no change in behaviour, so I opted for the more
      efficient version.
      
      One instance of the error I've made numerous times now is also present
      in net/phonet/pn_netlink.c in the route_dumpit() function - it didn't
      check for <0 or <=0 and thus broke out of the loop every single time.
      I've preserved this since it will (I think) have caused the messages to
      userspace to be formatted differently with just a single message for
      every SKB returned to userspace. It's possible that this isn't needed
      for the tools that actually use this, but I don't even know what they
      are so couldn't test that changing this behaviour would be acceptable.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      053c095a
    • J
      net: replace br_fdb_external_learn_* calls with switchdev notifier events · 3aeb6617
      Jiri Pirko 提交于
      This patch benefits from newly introduced switchdev notifier and uses it
      to propagate fdb learn events from rocker driver to bridge. That avoids
      direct function calls and possible use by other listeners (ovs).
      Suggested-by: NThomas Graf <tgraf@suug.ch>
      Signed-off-by: NJiri Pirko <jiri@resnulli.us>
      Signed-off-by: NScott Feldman <sfeldma@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3aeb6617
    • E
      niu: remove one compound_head() call · ff8b3356
      Eric Dumazet 提交于
      After a "page = alloc_page(mask);", we do not need to use
      compound_head() : page already points to the right place.
      
      This would be true even if using alloc_pages().
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ff8b3356
  2. 17 1月, 2015 12 次提交
  3. 16 1月, 2015 22 次提交