1. 29 5月, 2020 8 次提交
  2. 28 5月, 2020 6 次提交
  3. 27 5月, 2020 8 次提交
    • A
      net: ethtool: Allow PHY cable test TDR data to configured · f2bc8ad3
      Andrew Lunn 提交于
      Allow the user to configure where on the cable the TDR data should be
      retrieved, in terms of first and last sample, and the step between
      samples. Also add the ability to ask for TDR data for just one pair.
      
      If this configuration is not provided, it defaults to 1-150m at 1m
      intervals for all pairs.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      
      v3:
      Move the TDR configuration into a structure
      Add a range check on step
      Use NL_SET_ERR_MSG_ATTR() when appropriate
      Move TDR configuration into a nest
      Document attributes in the request
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f2bc8ad3
    • A
      net: ethtool: Add helpers for cable test TDR data · 6b4a0fc1
      Andrew Lunn 提交于
      Add helpers for returning raw TDR helpers in netlink messages.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6b4a0fc1
    • A
      net: ethtool: Add generic parts of cable test TDR · 1a644de2
      Andrew Lunn 提交于
      Add the generic parts of the code used to trigger a cable test and
      return raw TDR data. Any PHY driver which support this must implement
      the new driver op.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      
      v2
      Update nxp-tja11xx for API change.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1a644de2
    • A
      net: ethtool: Add attributes for cable test TDR data · a331172b
      Andrew Lunn 提交于
      Some Ethernet PHYs can return the raw time domain reflectromatry data.
      Add the attributes to allow this data to be requested and returned via
      netlink ethtool.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      
      v2:
      m -> cm
      Report what the PHY actually used for start/stop/step.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a331172b
    • R
      net: mdiobus: add clause 45 mdiobus accessors · 90ce665c
      Russell King 提交于
      There is a recurring pattern throughout some of the PHY code converting
      a devad and regnum to our packed clause 45 representation. Rather than
      having this scattered around the code, let's put a common translation
      function in mdio.h, and provide some register accessors.
      
      Convert the phylib core, phylink, bcm87xx and cortina to use these.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      90ce665c
    • G
      cls_flower: Support filtering on multiple MPLS Label Stack Entries · 61aec25a
      Guillaume Nault 提交于
      With struct flow_dissector_key_mpls now recording the first
      FLOW_DIS_MPLS_MAX labels, we can extend Flower to filter on any of
      these LSEs independently.
      
      In order to avoid creating new netlink attributes for every possible
      depth, let's define a new TCA_FLOWER_KEY_MPLS_OPTS nested attribute
      that contains the list of LSEs to match. Each LSE is represented by
      another attribute, TCA_FLOWER_KEY_MPLS_OPTS_LSE, which then contains
      the attributes representing the depth and the MPLS fields to match at
      this depth (label, TTL, etc.).
      
      For each MPLS field, the mask is always set to all-ones, as this is
      what the original API did. We could allow user configurable masks in
      the future if there is demand for more flexibility.
      
      The new API also allows to only specify an LSE depth. In that case,
      Flower only verifies that the MPLS label stack depth is greater or
      equal to the provided depth (that is, an LSE exists at this depth).
      
      Filters that only match on one (or more) fields of the first LSE are
      dumped using the old netlink attributes, to avoid confusing user space
      programs that don't understand the new API.
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      61aec25a
    • G
      flow_dissector: Parse multiple MPLS Label Stack Entries · 58cff782
      Guillaume Nault 提交于
      The current MPLS dissector only parses the first MPLS Label Stack
      Entry (second LSE can be parsed too, but only to set a key_id).
      
      This patch adds the possibility to parse several LSEs by making
      __skb_flow_dissect_mpls() return FLOW_DISSECT_RET_PROTO_AGAIN as long
      as the Bottom Of Stack bit hasn't been seen, up to a maximum of
      FLOW_DIS_MPLS_MAX entries.
      
      FLOW_DIS_MPLS_MAX is arbitrarily set to 7. This should be enough for
      many practical purposes, without wasting too much space.
      
      To record the parsed values, flow_dissector_key_mpls is modified to
      store an array of stack entries, instead of just the values of the
      first one. A bit field, "used_lses", is also added to keep track of
      the LSEs that have been set. The objective is to avoid defining a
      new FLOW_DISSECTOR_KEY_MPLS_XX for each level of the MPLS stack.
      
      TC flower is adapted for the new struct flow_dissector_key_mpls layout.
      Matching on several MPLS Label Stack Entries will be added in the next
      patch.
      
      The NFP and MLX5 drivers are also adapted: nfp_flower_compile_mac() and
      mlx5's parse_tunnel() now verify that the rule only uses the first LSE
      and fail if it doesn't.
      
      Finally, the behaviour of the FLOW_DISSECTOR_KEY_MPLS_ENTROPY key is
      slightly modified. Instead of recording the first Entropy Label, it
      now records the last one. This shouldn't have any consequences since
      there doesn't seem to have any user of FLOW_DISSECTOR_KEY_MPLS_ENTROPY
      in the tree. We'd probably better do a hash of all parsed MPLS labels
      instead (excluding reserved labels) anyway. That'd give better entropy
      and would probably also simplify the code. But that's not the purpose
      of this patch, so I'm keeping that as a future possible improvement.
      Signed-off-by: NGuillaume Nault <gnault@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      58cff782
    • Y
      qed: Add EDPM mode type for user-fw compatibility · ff937b91
      Yuval Basson 提交于
      In older FW versions the completion flag was treated as the ack flag in
      edpm messages. Expose the FW option of setting which mode the QP is in
      by adding a flag to the qedr <-> qed API.
      
      Flag is added for backward compatibility with libqedr.
      This flag will be set by qedr after determining whether the libqedr is
      using the updated version.
      
      Fixes: f1093940 ("qed: Add support for QP verbs")
      Signed-off-by: NYuval Basson <yuval.bason@marvell.com>
      Signed-off-by: NMichal Kalderon <michal.kalderon@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ff937b91
  4. 24 5月, 2020 1 次提交
  5. 23 5月, 2020 10 次提交
    • G
      virtchnl: Add missing explicit padding to structures · 65ece6de
      Geert Uytterhoeven 提交于
      On e.g. m68k, the alignment of 32-bit values is only 2 bytes, leading
      to the following:
      
          ./include/linux/avf/virtchnl.h:147:36: warning: division by zero [-Wdiv-by-zero]
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      					^
          ./include/linux/avf/virtchnl.h:577:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
           VIRTCHNL_CHECK_STRUCT_LEN(272, virtchnl_filter);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:577:32: error: enumerator value for ‘virtchnl_static_assert_virtchnl_filter’ is not an integer constant
           VIRTCHNL_CHECK_STRUCT_LEN(272, virtchnl_filter);
      				    ^~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:147:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      							 ^
          ./include/linux/avf/virtchnl.h:147:36: warning: division by zero [-Wdiv-by-zero]
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      					^
          ./include/linux/avf/virtchnl.h:619:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
           VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_pf_event);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:619:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_pf_event’ is not an integer constant
           VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_pf_event);
      				   ^~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:147:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      							 ^
          ./include/linux/avf/virtchnl.h:147:36: warning: division by zero [-Wdiv-by-zero]
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      					^
          ./include/linux/avf/virtchnl.h:640:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
           VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_iwarp_qv_info);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:640:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_iwarp_qv_info’ is not an integer constant
           VIRTCHNL_CHECK_STRUCT_LEN(12, virtchnl_iwarp_qv_info);
      				   ^~~~~~~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:147:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      							 ^
          ./include/linux/avf/virtchnl.h:147:36: warning: division by zero [-Wdiv-by-zero]
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      					^
          ./include/linux/avf/virtchnl.h:647:1: note: in expansion of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
           VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_iwarp_qvlist_info);
           ^~~~~~~~~~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:647:31: error: enumerator value for ‘virtchnl_static_assert_virtchnl_iwarp_qvlist_info’ is not an integer constant
           VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_iwarp_qvlist_info);
      				   ^~~~~~~~~~~~~~~~~~~~~~~~~~
          ./include/linux/avf/virtchnl.h:147:53: note: in definition of macro ‘VIRTCHNL_CHECK_STRUCT_LEN’
            { virtchnl_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) }
      							 ^
      
      Fix this by adding explicit padding to structures with holes.
      
      Reported-by: <noreply@ellerman.id.au>
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      65ece6de
    • E
      net/mlx5: Avoid processing commands before cmdif is ready · f7936ddd
      Eran Ben Elisha 提交于
      When driver is reloading during recovery flow, it can't get new commands
      till command interface is up again. Otherwise we may get to null pointer
      trying to access non initialized command structures.
      
      Add cmdif state to avoid processing commands while cmdif is not ready.
      
      Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      f7936ddd
    • E
      net/mlx5: Fix a race when moving command interface to events mode · d43b7007
      Eran Ben Elisha 提交于
      After driver creates (via FW command) an EQ for commands, the driver will
      be informed on new commands completion by EQE. However, due to a race in
      driver's internal command mode metadata update, some new commands will
      still be miss-handled by driver as if we are in polling mode. Such commands
      can get two non forced completion, leading to already freed command entry
      access.
      
      CREATE_EQ command, that maps EQ to the command queue must be posted to the
      command queue while it is empty and no other command should be posted.
      
      Add SW mechanism that once the CREATE_EQ command is about to be executed,
      all other commands will return error without being sent to the FW. Allow
      sending other commands only after successfully changing the driver's
      internal command mode metadata.
      We can safely return error to all other commands while creating the command
      EQ, as all other commands might be sent from the user/application during
      driver load. Application can rerun them later after driver's load was
      finished.
      
      Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      d43b7007
    • M
      net/mlx5: Add command entry handling completion · 17d00e83
      Moshe Shemesh 提交于
      When FW response to commands is very slow and all command entries in
      use are waiting for completion we can have a race where commands can get
      timeout before they get out of the queue and handled. Timeout
      completion on uninitialized command will cause releasing command's
      buffers before accessing it for initialization and then we will get NULL
      pointer exception while trying access it. It may also cause releasing
      buffers of another command since we may have timeout completion before
      even allocating entry index for this command.
      Add entry handling completion to avoid this race.
      
      Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
      Signed-off-by: NMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      17d00e83
    • E
      net: Add netif_is_bareudp() API to identify bareudp devices · d43600c0
      Eli Cohen 提交于
      Add netif_is_bareudp() so the device can be identified as a bareudp one.
      Signed-off-by: NEli Cohen <eli@mellanox.com>
      Reviewed-by: NRoi Dayan <roid@mellanox.com>
      Reviewed-by: NEli Britstein <elibr@mellanox.com>
      Reviewed-by: NPaul Blakey <paulb@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      d43600c0
    • H
      switchdev: mrp: Remove the variable mrp_ring_state · 89c1e111
      Horatiu Vultur 提交于
      Remove the variable mrp_ring_state from switchdev_attr because is not
      used anywhere.
      The ring state is set using SWITCHDEV_OBJ_ID_RING_STATE_MRP.
      
      Fixes: c284b545 ("switchdev: mrp: Extend switchdev API to offload MRP")
      Acked-by: NIvan Vecera <ivecera@redhat.com>
      Signed-off-by: NHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      89c1e111
    • E
      net: flow_offload: simplify hw stats check handling · 060b6381
      Edward Cree 提交于
      Make FLOW_ACTION_HW_STATS_DONT_CARE be all bits, rather than none, so that
       drivers and __flow_action_hw_stats_check can use simple bitwise checks.
      
      Pre-fill all actions with DONT_CARE in flow_rule_alloc(), rather than
       relying on implicit semantics of zero from kzalloc, so that callers which
       don't configure action stats themselves (i.e. netfilter) get the correct
       behaviour by default.
      
      Only the kernel's internal API semantics change; the TC uAPI is unaffected.
      
      v4: move DONT_CARE setting to flow_rule_alloc() for robustness and simplicity.
      
      v3: set DONT_CARE in nft and ct offload.
      
      v2: rebased on net-next, removed RFC tags.
      Signed-off-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      060b6381
    • R
      nexthop: add support for notifiers · 8590ceed
      Roopa Prabhu 提交于
      This patch adds nexthop add/del notifiers. To be used by
      vxlan driver in a later patch. Could possibly be used by
      switchdev drivers in the future.
      Signed-off-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8590ceed
    • R
      vxlan: ecmp support for mac fdb entries · 1274e1cc
      Roopa Prabhu 提交于
      Todays vxlan mac fdb entries can point to multiple remote
      ips (rdsts) with the sole purpose of replicating
      broadcast-multicast and unknown unicast packets to those remote ips.
      
      E-VPN multihoming [1,2,3] requires bridged vxlan traffic to be
      load balanced to remote switches (vteps) belonging to the
      same multi-homed ethernet segment (E-VPN multihoming is analogous
      to multi-homed LAG implementations, but with the inter-switch
      peerlink replaced with a vxlan tunnel). In other words it needs
      support for mac ecmp. Furthermore, for faster convergence, E-VPN
      multihoming needs the ability to update fdb ecmp nexthops independent
      of the fdb entries.
      
      New route nexthop API is perfect for this usecase.
      This patch extends the vxlan fdb code to take a nexthop id
      pointing to an ecmp nexthop group.
      
      Changes include:
      - New NDA_NH_ID attribute for fdbs
      - Use the newly added fdb nexthop groups
      - makes vxlan rdsts and nexthop handling code mutually
        exclusive
      - since this is a new use-case and the requirement is for ecmp
      nexthop groups, the fdb add and update path checks that the
      nexthop is really an ecmp nexthop group. This check can be relaxed
      in the future, if we want to introduce replication fdb nexthop groups
      and allow its use in lieu of current rdst lists.
      - fdb update requests with nexthop id's only allowed for existing
      fdb's that have nexthop id's
      - learning will not override an existing fdb entry with nexthop
      group
      - I have wrapped the switchdev offload code around the presence of
      rdst
      
      [1] E-VPN RFC https://tools.ietf.org/html/rfc7432
      [2] E-VPN with vxlan https://tools.ietf.org/html/rfc8365
      [3] http://vger.kernel.org/lpc_net2018_talks/scaling_bridge_fdb_database_slidesV3.pdf
      
      Includes a null check fix in vxlan_xmit from Nikolay
      
      v2 - Fixed build issue:
      Reported-by: Nkbuild test robot <lkp@intel.com>
      Signed-off-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1274e1cc
    • R
      nexthop: support for fdb ecmp nexthops · 38428d68
      Roopa Prabhu 提交于
      This patch introduces ecmp nexthops and nexthop groups
      for mac fdb entries. In subsequent patches this is used
      by the vxlan driver fdb entries. The use case is
      E-VPN multihoming [1,2,3] which requires bridged vxlan traffic
      to be load balanced to remote switches (vteps) belonging to
      the same multi-homed ethernet segment (This is analogous to
      a multi-homed LAG but over vxlan).
      
      Changes include new nexthop flag NHA_FDB for nexthops
      referenced by fdb entries. These nexthops only have ip.
      This patch includes appropriate checks to avoid routes
      referencing such nexthops.
      
      example:
      $ip nexthop add id 12 via 172.16.1.2 fdb
      $ip nexthop add id 13 via 172.16.1.3 fdb
      $ip nexthop add id 102 group 12/13 fdb
      
      $bridge fdb add 02:02:00:00:00:13 dev vxlan1000 nhid 101 self
      
      [1] E-VPN https://tools.ietf.org/html/rfc7432
      [2] E-VPN VxLAN: https://tools.ietf.org/html/rfc8365
      [3] LPC talk with mention of nexthop groups for L2 ecmp
      http://vger.kernel.org/lpc_net2018_talks/scaling_bridge_fdb_database_slidesV3.pdf
      
      v4 - fixed uninitialized variable reported by kernel test robot
      Reported-by: Nkernel test robot <rong.a.chen@intel.com>
      Signed-off-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
      Reviewed-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      38428d68
  6. 22 5月, 2020 7 次提交