1. 27 Mar, 2019 28 commits
    • Bart Van Assche's avatar
      net/core: Fix rtnetlink kernel-doc headers · a986967e
      Bart Van Assche authored
      This patch avoids that the following warnings are reported when building
      with W=1:
      
      net/core/rtnetlink.c:3580: warning: Function parameter or member 'ndm' not described in 'ndo_dflt_fdb_add'
      net/core/rtnetlink.c:3580: warning: Function parameter or member 'tb' not described in 'ndo_dflt_fdb_add'
      net/core/rtnetlink.c:3580: warning: Function parameter or member 'dev' not described in 'ndo_dflt_fdb_add'
      net/core/rtnetlink.c:3580: warning: Function parameter or member 'addr' not described in 'ndo_dflt_fdb_add'
      net/core/rtnetlink.c:3580: warning: Function parameter or member 'vid' not described in 'ndo_dflt_fdb_add'
      net/core/rtnetlink.c:3580: warning: Function parameter or member 'flags' not described in 'ndo_dflt_fdb_add'
      net/core/rtnetlink.c:3718: warning: Function parameter or member 'ndm' not described in 'ndo_dflt_fdb_del'
      net/core/rtnetlink.c:3718: warning: Function parameter or member 'tb' not described in 'ndo_dflt_fdb_del'
      net/core/rtnetlink.c:3718: warning: Function parameter or member 'dev' not described in 'ndo_dflt_fdb_del'
      net/core/rtnetlink.c:3718: warning: Function parameter or member 'addr' not described in 'ndo_dflt_fdb_del'
      net/core/rtnetlink.c:3718: warning: Function parameter or member 'vid' not described in 'ndo_dflt_fdb_del'
      net/core/rtnetlink.c:3861: warning: Function parameter or member 'skb' not described in 'ndo_dflt_fdb_dump'
      net/core/rtnetlink.c:3861: warning: Function parameter or member 'cb' not described in 'ndo_dflt_fdb_dump'
      net/core/rtnetlink.c:3861: warning: Function parameter or member 'filter_dev' not described in 'ndo_dflt_fdb_dump'
      net/core/rtnetlink.c:3861: warning: Function parameter or member 'idx' not described in 'ndo_dflt_fdb_dump'
      net/core/rtnetlink.c:3861: warning: Excess function parameter 'nlh' description in 'ndo_dflt_fdb_dump'
      
      Cc: Hubert Sokolowski <hubert.sokolowski@intel.com>
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a986967e
    • Bart Van Assche's avatar
      net/core: Document __skb_flow_dissect() flags argument · d79b3baf
      Bart Van Assche authored
      This patch avoids that the following warning is reported when building
      with W=1:
      
      warning: Function parameter or member 'flags' not described in '__skb_flow_dissect'
      
      Cc: Tom Herbert <tom@herbertland.com>
      Fixes: cd79a238 ("flow_dissector: Add flags argument to skb_flow_dissector functions") # v4.3.
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d79b3baf
    • Bart Van Assche's avatar
      net/core: Document all dev_ioctl() arguments · b3c0fd61
      Bart Van Assche authored
      This patch avoids that the following warnings are reported when building
      with W=1:
      
      net/core/dev_ioctl.c:378: warning: Function parameter or member 'ifr' not described in 'dev_ioctl'
      net/core/dev_ioctl.c:378: warning: Function parameter or member 'need_copyout' not described in 'dev_ioctl'
      net/core/dev_ioctl.c:378: warning: Excess function parameter 'arg' description in 'dev_ioctl'
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Fixes: 44c02a2c ("dev_ioctl(): move copyin/copyout to callers") # v4.16.
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b3c0fd61
    • Bart Van Assche's avatar
      net/core: Document reuseport_add_sock() bind_inany argument · 37f3c421
      Bart Van Assche authored
      This patch avoids that the following warning is reported when building
      with W=1:
      
      warning: Function parameter or member 'bind_inany' not described in 'reuseport_add_sock'
      
      Cc: Martin KaFai Lau <kafai@fb.com>
      Fixes: 2dbb9b9e ("bpf: Introduce BPF_PROG_TYPE_SK_REUSEPORT") # v4.19.
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      37f3c421
    • Heiner Kallweit's avatar
      net: dsa: mv88e6xxx: remove unneeded cmode initialization · 863d1a8d
      Heiner Kallweit authored
      This partially reverts ed8fe202 ("net: dsa: mv88e6xxx: prevent
      interrupt storm caused by mv88e6390x_port_set_cmode"). I missed
      that chip->ports[].cmode is overwritten anyway by the cmode
      caching in mv88e6xxx_setup().
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      863d1a8d
    • Sudarsana Reddy Kalluru's avatar
      bnx2x: Utilize FW 7.13.11.0. · 32705592
      Sudarsana Reddy Kalluru authored
      Commit 8fcf0ec44c11f "bnx2x: Add FW 7.13.11.0" added said .bin FW to
      linux-firmware; This patch incorporates the FW in the bnx2x driver.
      This introduces few FW fixes and the support for Tx VLAN filtering.
      
      Please consider applying it to 'net-next' tree.
      Signed-off-by: default avatarSudarsana Reddy Kalluru <skalluru@marvell.com>
      Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      32705592
    • Kristian Evensen's avatar
      fou: Support binding FoU socket · 1713cb37
      Kristian Evensen authored
      An FoU socket is currently bound to the wildcard-address. While this
      works fine, there are several use-cases where the use of the
      wildcard-address is not desirable. For example, I use FoU on some
      multi-homed servers and would like to use FoU on only one of the
      interfaces.
      
      This commit adds support for binding FoU sockets to a given source
      address/interface, as well as connecting the socket to a given
      destination address/port. udp_tunnel already provides the required
      infrastructure, so most of the code added is for exposing and setting
      the different attributes (local address, peer address, etc.).
      
      The lookups performed when we add, delete or get an FoU-socket has also
      been updated to compare all the attributes a user can set. Since the
      comparison now involves several elements, I have added a separate
      comparison-function instead of open-coding.
      
      In order to test the code and ensure that the new comparison code works
      correctly, I started by creating a wildcard socket bound to port 1234 on
      my machine. I then tried to create a non-wildcarded socket bound to the
      same port, as well as fetching and deleting the socket (including source
      address, peer address or interface index in the netlink request).  Both
      the create, fetch and delete request failed. Deleting/fetching the
      socket was only successful when my netlink request attributes matched
      those used to create the socket.
      
      I then repeated the tests, but with a socket bound to a local ip
      address, a socket bound to a local address + interface, and a bound
      socket that was also «connected» to a peer. Add only worked when no
      socket with the matching source address/interface (or wildcard) existed,
      while fetch/delete was only successful when all attributes matched.
      
      In addition to testing that the new code work, I also checked that the
      current behavior is kept. If none of the new attributes are provided,
      then an FoU-socket is configured as before (i.e., wildcarded).  If any
      of the new attributes are provided, the FoU-socket is configured as
      expected.
      
      v1->v2:
      * Fixed building with IPv6 disabled (kbuild).
      * Fixed a return type warning and make the ugly comparison function more
      readable (kbuild).
      * Describe more in detail what has been tested (thanks David Miller).
      * Make peer port required if peer address is specified.
      Signed-off-by: default avatarKristian Evensen <kristian.evensen@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1713cb37
    • David S. Miller's avatar
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · eec7e295
      David S. Miller authored
      Jeff Kirsher says:
      
      ====================
      100GbE Intel Wired LAN Driver Updates 2019-03-26
      
      This series contains more updates to the ice driver only.
      
      Jeremiah provides his first patch to the Linux kernel to clean up
      un-necessary newlines in driver log messages.
      
      Mitch updates the ice driver to use existing status codes in the iavf
      driver so that when errors occur, it will not report nonsensical
      results.  Adds support for VF admin queue interrupts by programming the
      VPINT_MBX_CTL register array.
      
      Brett adds a check for a bit that we set while preparing for a reset, to
      ensure we are prepared to do a proper reset.  Also implemented PCI error
      handling operations.  Went through and audited the hot path with pahole
      and made modifications based on the results since 2 structures were
      taking up more space than necessary due to cache alignment issues.
      Fixed an issue where when flow control was disabled, the state of flow
      control was being displayed as "Unknown".
      
      Anirudh fixes adaptive interrupt moderation changes by adding code that
      was missed, that should have been added in the initial patch to add that
      support.  Cleaned up a function prototype that was never implemented.
      Did additional code cleanup by removing unneeded braces and redundant
      code comments.
      
      Akeem fixes an issue that occurs when the VF is attempting to remove the
      default LAN/MAC address, which is programmed by the administrator by
      updating the error message to explicitly say that the VF cannot change
      the MAC programmed by the PF.
      
      Preethi fixes the driver to not fall into the error path when a added
      filter already exists, but instead continue to process the rest of the
      function and add appropriate checks after adding MAC filters.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eec7e295
    • David S. Miller's avatar
      Merge branch 'net-mvpp2-Classifier-updates-and-cleanups' · b0be25c5
      David S. Miller authored
      Maxime Chevallier says:
      
      ====================
      net: mvpp2: Classifier updates and cleanups
      
      In preparation for the future addition of classification offload
      support, this series cleans-up the current code dealing with the
      classification engines.
      
      As of today, the classification code only deals with RSS, which is a
      very narrow use-case when considering all of the classifier's features.
      
      This lead to design and naming decisions that don't really stand when
      considering using more classification features.
      
      This series therefore includes quite a lot a renaming of functions and
      macros, and tries to make the naming schemes more consistent and the
      code more readable.
      
      The debugfs interface that allows reading the various Parsing and
      Classification engines has been cleaned-up and made more generic,
      allowing to read the Flow Table and C2 engine hit counters on a
      per-entry basis.
      
      The Classifier itself has been made more robust by introducing the
      lu_type field in classification lookups, that prevents false-positive
      matches in the future. We also initialise the various engine in a more
      extensive and less error-prone way by assining default values to all
      entries in the C2 and Flow table.
      
      This is a pretty big series considering it's mostly cleanup, but my goal
      is to make the future series that will contain new big features easier
      to review, focusing on the real logic.
      
      Besides the debugfs interface, this series doesn't intend to introduce any
      new features or change in behaviours.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b0be25c5
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Rework C2 engine macros · c2d3d8ee
      Maxime Chevallier authored
      The C2 classification engine has a 256 entry TCAM, used for ternary
      matches on an 8 byte Header Extracted Key. For now, we compute the
      various indices for classification and RSS that use this engine thanks
      to a set of macros.
      
      This commit mainly renames the macros used to make it clear that they
      should be used with the C2 engine, but also make use of the full 256
      entries in the engine. For now, the C2 entries are only used for RSS.
      
      These entries are put at the end of the TCAM range, in case we want to
      add higher priority matches later on.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c2d3d8ee
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Initialize lookup priorities for all entries in the flow · 693131db
      Maxime Chevallier authored
      When classifying a packet pertaining to a given flow, the classifier
      will issue multiple lookup commands until it finds one with the 'last'
      bit set. It expects all prorities to be assign continuously (although
      not necessarily in an ordered fashion) from 0 to the number of lookups.
      
      We can initialize this once, and make sure unused lookups are given an
      empty port map. This avoids having to maintain priorities and the
      information of which lookup is the last.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      693131db
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Invalidate all C2 entries except the ones we use · 8d2847d9
      Maxime Chevallier authored
      C2 TCAM entries can be invalidated to avoid unwanted matches. Make sure
      all entries are invalidated at init, then validate only the ones we use.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d2847d9
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Rename the flow table macros · ff2f3cb6
      Maxime Chevallier authored
      The Flow Table dictates what lookups will be issued for each flow type.
      The lookup sequence for each flow is similar, and the index of each
      lookup is computed by some macros.
      
      There are similar mechanisms for the C2 TCAM lookups, so in order to
      avoid confusion, rename the flow table index computing macros with a
      common prefix.
      
      The only difference in behaviour is that we now use the very first entry
      in the flow for the RSS lookup (the first entry was previously unused).
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ff2f3cb6
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Don't use the sequence attribute for classification · 5b353806
      Maxime Chevallier authored
      The classifier allows to combine multiple lookups in one "sequence" that
      is counted as a single lookup to an engine, with a single result.
      
      We don't actually use that feature, so remove any places where we set
      this field, so that the classifier doesn't try to interpret these
      fields.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b353806
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Rename classifer per-port functions · 6310f77d
      Maxime Chevallier authored
      This commit renames some of the classifier functions to follow the
      naming 'mvpp2_port_*' that's used for function that act on a given port.
      
      This commit is purely cosmetic.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6310f77d
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Move C2 read/write helpers around · b11ffdc5
      Maxime Chevallier authored
      Move C2 read/write helpers higher in the file to ease future work that
      rely on these helpers
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b11ffdc5
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Write C2 TCAM data last when writing a C2 entry · 147c538e
      Maxime Chevallier authored
      When writing a C2 entry to hardware, some registers writes will only
      take effect when the TCAM_DATA4 register is written. This includes all
      C2 TCAM registers, and the C2 invalidate register.
      
      To make sure we always write C2 entries correctly, document that
      behaviour with a comment, and move TCAM writes to the end of the
      mvpp2_cls_c2_write helper.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      147c538e
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Use iterators to go through the cls_table · e4bfb4ac
      Maxime Chevallier authored
      The cls_table is a global read-only table containing the different
      parameters that are used by various tables in the classifier. It
      describes the links between the Header Parser, the decoding table and
      the flow_table.
      
      There are several possible way we want to iterate over that table,
      depending on wich classifier engine we want to configure. For the Header
      Parser, we want to iterate over each entry. For the Decoding table, we
      want to iterate over each entry having a unique flow_id. Finally, when
      configuring an ethtool flow, we want to iterate over each entry having a
      unique flow_id and that has a given flow_type.
      
      This commit introduces some iterator to both provide syntactic sugar and
      also clarify the way we want to iterate over the table.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e4bfb4ac
    • Maxime Chevallier's avatar
      net: mvpp2: debugfs: Allow reading the C2 engine table from debugfs · b607cc61
      Maxime Chevallier authored
      PPv2's Classifier uses multiple engines to perform classification. So
      far, only the C2 engine is used, which has a 256 entries TCAM.
      
      So far, we only accessed the relevant entries from the C2 engines, which
      are the one implementing RSS. To implement and debug ntuple
      classification offload, beaing able to see the hit count for each C2
      entry is helpful, so this commit moves the logic to a dedicated
      directory allowing to access each entry.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b607cc61
    • Maxime Chevallier's avatar
      net: mvpp2: debugfs: Allow reading the flow table from debugfs · 8aa65106
      Maxime Chevallier authored
      The Classifier flow table is the central part of the PPv2 Classifier,
      since it describes all classification steps performed for each flow.
      
      It has 512 entries, shared between all ports, which are divided into
      sequences that are pointed-to by the decoding table. Being able to see
      which entries in the flow table were hit is a key point when
      implementing and debugging classification offload.
      
      This commit allows reading each flow table entry's hit count
      independently, with a clear-on-read behaviour.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8aa65106
    • Maxime Chevallier's avatar
      net: mvpp2: debugfs: Store debugfs entries data in mvpp2 struct · 7cb5e368
      Maxime Chevallier authored
      The current way to store the required private data needed to access
      various debugfs entries is to alloc them on the fly, share them within
      the entries that need to access them, and finally have one entry free
      that data upon closing. This leads to hard to maintain code, and is very
      error-prone.
      
      This commit stores all debugfs related data in the same place, making
      sure this is allocated only when the debugfs directory is successfully
      created, so that we don't waste memory when we don't use this feature.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7cb5e368
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Make the flow definitions const · 0b27f865
      Maxime Chevallier authored
      The cls_flow table represent the overall configuration of the
      classifier, used to match the different traffic classes in the Parsing
      and Classification engines.
      
      This configuration is static, and applies to all PPv2 instances, we must
      therefore keep it const so that no modifications of this table are
      performed at runtime.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0b27f865
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Rename MVPP2_N_FLOWS to MVPP2_N_PRS_FLOWS · 93c2589c
      Maxime Chevallier authored
      The macro definition MVPP2_N_FLOWS is ambiguous because it really
      represents the number of entries in the Header Parser that are used to
      identify the classification flows.
      
      Rename the macro to clearly state that we represent the number of flows
      in the Header Parser.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      93c2589c
    • Maxime Chevallier's avatar
      net: mvpp2: cls: use Lookup Type in classification engines · 32f1a672
      Maxime Chevallier authored
      The PPv2 classifier allows to perform multiple lookups on the same
      engine when classifying a packet. These lookups can match similar parts
      of a packet header, but perform different actions upon matching. To
      differentiate these types of lookups, it's possible to specify a Lookup
      Type in the flow table entries, which will be part of the key for the
      lookup engines.
      
      This commit introduces the use of Lookup Types for C2 matches. Since for
      now we only perform C2 lookups to enable RSS, we only need one Lookup
      Type.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      32f1a672
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Start cls flow entries from beginning of table · dc61b37f
      Maxime Chevallier authored
      The Classifier flow table has 512 entries, that contains lookups
      commands executed consecutively for every flow. Since we have 21
      different flows, we have to carefully manage the flow table use.
      
      As of today, the start index of a lookup sequence is computed
      directly based in the flow->id. There are 8 reserved flow ids, from
      0-7, which don't have any corresponding sequence in the flow table. We
      can therefore ignore them when computing the index, and make so that the
      first non-reserved flow point to the very beginning of the flow table.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Suggested-by: default avatarAlan Winkowski <walan@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dc61b37f
    • Maxime Chevallier's avatar
      net: mvpp2: cls: Add missing MAC_DA field extraction · 1f29a8c4
      Maxime Chevallier authored
      PPv2's classifier supports extracting the MAC Destination Address from the
      L2 header to perform RSS and flow steering. Add the missing case when
      setting the Header Extracted Key fields in the flow table.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f29a8c4
    • Maxime Chevallier's avatar
      net: mvpp2: Don't use an int to store netdev_features_t · c9dbb6cf
      Maxime Chevallier authored
      int is not long enough to store all netdev_features, use the correct
      dedicated type to store them when building the list of dev->features.
      Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c9dbb6cf
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · 5133a4a8
      David S. Miller authored
      Alexei Starovoitov says:
      
      ====================
      pull-request: bpf-next 2019-03-26
      
      The following pull-request contains BPF updates for your *net-next* tree.
      
      The main changes are:
      
      1) introduce bpf_tcp_check_syncookie() helper for XDP and tc, from Lorenz.
      
      2) allow bpf_skb_ecn_set_ce() in tc, from Peter.
      
      3) numerous bpf tc tunneling improvements, from Willem.
      
      4) and other miscellaneous improvements from Adrian, Alan, Daniel, Ivan, Stanislav.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5133a4a8
  2. 26 Mar, 2019 12 commits