1. 21 4月, 2016 3 次提交
    • J
      fm10k: add helper functions to set strings and data for ethtool stats · 09401ae2
      Jacob Keller 提交于
      Reduce duplicate code and the amount of indentation by adding
      fm10k_add_stat_strings and fm10k_add_ethtool_stats functions which help
      add fm10k_stat structures to the ethtool stats callbacks. This helps
      increase ease of use for future stat additions, and increases code
      readability.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      09401ae2
    • R
      rtnetlink: add new RTM_GETSTATS message to dump link stats · 10c9ead9
      Roopa Prabhu 提交于
      This patch adds a new RTM_GETSTATS message to query link stats via netlink
      from the kernel. RTM_NEWLINK also dumps stats today, but RTM_NEWLINK
      returns a lot more than just stats and is expensive in some cases when
      frequent polling for stats from userspace is a common operation.
      
      RTM_GETSTATS is an attempt to provide a light weight netlink message
      to explicity query only link stats from the kernel on an interface.
      The idea is to also keep it extensible so that new kinds of stats can be
      added to it in the future.
      
      This patch adds the following attribute for NETDEV stats:
      struct nla_policy ifla_stats_policy[IFLA_STATS_MAX + 1] = {
              [IFLA_STATS_LINK_64]  = { .len = sizeof(struct rtnl_link_stats64) },
      };
      
      Like any other rtnetlink message, RTM_GETSTATS can be used to get stats of
      a single interface or all interfaces with NLM_F_DUMP.
      
      Future possible new types of stat attributes:
      link af stats:
          - IFLA_STATS_LINK_IPV6  (nested. for ipv6 stats)
          - IFLA_STATS_LINK_MPLS  (nested. for mpls/mdev stats)
      extended stats:
          - IFLA_STATS_LINK_EXTENDED (nested. extended software netdev stats like bridge,
            vlan, vxlan etc)
          - IFLA_STATS_LINK_HW_EXTENDED (nested. extended hardware stats which are
            available via ethtool today)
      
      This patch also declares a filter mask for all stat attributes.
      User has to provide a mask of stats attributes to query. filter mask
      can be specified in the new hdr 'struct if_stats_msg' for stats messages.
      Other important field in the header is the ifindex.
      
      This api can also include attributes for global stats (eg tcp) in the future.
      When global stats are included in a stats msg, the ifindex in the header
      must be zero. A single stats message cannot contain both global and
      netdev specific stats. To easily distinguish them, netdev specific stat
      attributes name are prefixed with IFLA_STATS_LINK_
      
      Without any attributes in the filter_mask, no stats will be returned.
      
      This patch has been tested with mofified iproute2 ifstat.
      Suggested-by: NJamal Hadi Salim <jhs@mojatatu.com>
      Signed-off-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      10c9ead9
    • D
      net: nla_align_64bit() needs to test the right pointer. · e6f268ef
      David S. Miller 提交于
      Netlink messages are appended, one object at a time, to the end of
      the SKB.  Therefore we need to test skb_tail_pointer() not skb->data
      for alignment.
      
      Fixes: 35c58459 ("net: Add helpers for 64-bit aligning netlink attributes.")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e6f268ef
  2. 20 4月, 2016 11 次提交
  3. 19 4月, 2016 12 次提交
  4. 18 4月, 2016 10 次提交
  5. 17 4月, 2016 4 次提交
    • D
      Merge branch 'nfp-next' · efde611b
      David S. Miller 提交于
      Jakub Kicinski says
      
      ====================
      nfp: cleanups and improvements
      
      Main purpose of this set is to get rid of doing potentially long
      mdelay()s but it also contains some trivial changes I've accumulated.
      First two patches fix harmless copy-paste errors, next two clean up
      the documentation and remove unused defines.  Patch 5 clarifies the
      interpretation of RX descriptor fields.  Patch 6, by far the biggest,
      adds ability to perform FW reconfig asynchronously thanks to which
      we can stop using mdelay().
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      efde611b
    • J
      nfp: add async reconfiguration mechanism · 3d780b92
      Jakub Kicinski 提交于
      Some callers of nfp_net_reconfig() are in atomic context so
      we used to busy wait for commands to complete.  In worst case
      scenario that means locking up a core for up to 5 seconds
      when a command times out.  Lets add a timer-based mechanism
      of asynchronously checking whether reconfiguration completed
      successfully for atomic callers to use.  Non-atomic callers
      can now just sleep.
      
      The approach taken is quite simple because (1) synchronous
      reconfigurations always happen under RTNL (or before device
      is registered); (2) we can coalesce pending reconfigs.
      There is no need for request queues, timer which eventually
      takes a look at reconfiguration result to report errors is
      good enough.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3d780b92
    • J
      nfp: remove buggy RX buffer length validation · 180012dc
      Jakub Kicinski 提交于
      Meaning of data_len and meta_len RX WB descriptor fields is
      slightly confusing.  Add a comment with a diagram clarifying
      the layout.  Also remove the buffer length validation:
      (a) it's imprecise for static rx-offsets; (b) if firmware
      is buggy enough to DMA past the end of the buffer
      WARN_ON_ONCE() doesn't seem like a strong enough response.
      skb_put() will do the checking for us anyway.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      180012dc
    • J
      nfp: remove unused suspicious mask defines · 2db221cd
      Jakub Kicinski 提交于
      NFP_NET_RXR_MASK sounds like a mask which could be used on
      NFP_NET_CFG_RXRS_ENABLE register but its value is quite
      strange.  In fact there are no users of this define so let's
      just remove it.  Same for TX rings.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2db221cd