1. 27 Mar, 2018 5 commits
    • Maxime Chevallier's avatar
      net: mvpp2: Don't use dynamic allocs for local variables · 0c6d9b44
      Maxime Chevallier authored
      Some helper functions that search for given entries in the TCAM filter
      on PPv2 controller make use of dynamically alloced temporary variables,
      allocated with GFP_KERNEL. These functions can be called in atomic
      context, and dynamic alloc is not really needed in these cases anyways.
      
      This commit gets rid of dynamic allocs and use stack allocation in the
      following functions, and where they're used :
       - mvpp2_prs_flow_find
       - mvpp2_prs_vlan_find
       - mvpp2_prs_double_vlan_find
       - mvpp2_prs_mac_da_range_find
      
      For all these functions, instead of returning an temporary object
      representing the TCAM entry, we simply return the TCAM id that matches
      the requested entry.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0c6d9b44
    • Maxime Chevallier's avatar
      net: mvpp2: Make mvpp2_prs_hw_read a parser entry init function · 47e0e14e
      Maxime Chevallier authored
      The mvpp2_prs_hw_read function uses the 'index' field of the struct
      mvpp2_prs_entry to initialize the rest of the fields. This makes it
      unclear from a caller's perspective, who needs to manipulate a struct
      that is not entirely initialized.
      
      This commit makes it an init function for prs_entry, by passing it the
      index as a parameter. The function now zeroes the entry, and sets the
      index field before doing all other init from HW.
      
      The function is renamed 'mvpp2_prs_init_from_hw' to make that clear.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      47e0e14e
    • Colin Ian King's avatar
      net/ncsi: check for null return from call to nla_nest_start · 8daf1a2d
      Colin Ian King authored
      The call to nla_nest_start calls nla_put which can lead to a NULL
      return so it's possible for attr to become NULL and we can potentially
      get a NULL pointer dereference on attr.  Fix this by checking for
      a NULL return.
      
      Detected by CoverityScan, CID#1466125 ("Dereference null return")
      
      Fixes: 955dc68c ("net/ncsi: Add generic netlink family")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8daf1a2d
    • Xin Long's avatar
      sctp: remove unnecessary asoc in sctp_has_association · 53066538
      Xin Long authored
      After Commit dae399d7 ("sctp: hold transport instead of assoc
      when lookup assoc in rx path"), it put transport instead of asoc
      in sctp_has_association. Variable 'asoc' is not used any more.
      
      So this patch is to remove it, while at it,  it also changes the
      return type of sctp_has_association to bool, and does the same
      for it's caller sctp_endpoint_is_peeled_off.
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      53066538
    • David S. Miller's avatar
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 13d5a30a
      David S. Miller authored
      Jeff Kirsher says:
      
      ====================
      40GbE Intel Wired LAN Driver Updates 2018-03-26
      
      This series contains updates to i40e only.
      
      Jake provides several patches which remove the need for cmpxchg64(),
      starting with moving I40E_FLAG_[UDP]_FILTER_SYNC from pf->flags to pf->state
      since they are modified during run time possibly when the RTNL lock is not
      held so they should be a state bits and not flags.  Moved additional
      "flags" which should be state fields, into pf->state.  Ensure we hold
      the RTNL lock for the entire sequence of preparing for reset and when
      resuming, which will protect the flags related to interrupt scheme under
      RTNL lock so that their modification is properly threaded.  Finally,
      cleanup the use of cmpxchg64() since it is no longer needed.  Cleaned up
      the holes in the feature flags created my moving some flags to the state
      field.
      
      Björn Töpel adds XDP_REDIRECT support as well as tweaking the page
      counting for XDP_REDIRECT so that it will function properly.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      13d5a30a
  2. 26 Mar, 2018 35 commits