1. 15 9月, 2020 2 次提交
  2. 12 9月, 2020 5 次提交
    • V
      Revert "net: dsa: Add more convenient functions for installing port VLANs" · 88236591
      Vladimir Oltean 提交于
      This reverts commit 314f76d7.
      
      Citing that commit message, the call graph was:
      
          dsa_slave_vlan_rx_add_vid   dsa_port_setup_8021q_tagging
                      |                        |
                      |                        |
                      |          +-------------+
                      |          |
                      v          v
                     dsa_port_vid_add      dsa_slave_port_obj_add
                            |                         |
                            +-------+         +-------+
                                    |         |
                                    v         v
                                 dsa_port_vlan_add
      
      Now that tag_8021q has its own ops structure, it no longer relies on
      dsa_port_vid_add, and therefore on the dsa_switch_ops to install its
      VLANs.
      
      So dsa_port_vid_add now only has one single caller. So we can simplify
      the call graph to what it was before, aka:
      
              dsa_slave_vlan_rx_add_vid     dsa_slave_port_obj_add
                            |                         |
                            +-------+         +-------+
                                    |         |
                                    v         v
                                 dsa_port_vlan_add
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      88236591
    • V
      net: dsa: tag_8021q: add a context structure · 5899ee36
      Vladimir Oltean 提交于
      While working on another tag_8021q driver implementation, some things
      became apparent:
      
      - It is not mandatory for a DSA driver to offload the tag_8021q VLANs by
        using the VLAN table per se. For example, it can add custom TCAM rules
        that simply encapsulate RX traffic, and redirect & decapsulate rules
        for TX traffic. For such a driver, it makes no sense to receive the
        tag_8021q configuration through the same callback as it receives the
        VLAN configuration from the bridge and the 8021q modules.
      
      - Currently, sja1105 (the only tag_8021q user) sets a
        priv->expect_dsa_8021q variable to distinguish between the bridge
        calling, and tag_8021q calling. That can be improved, to say the
        least.
      
      - The crosschip bridging operations are, in fact, stateful already. The
        list of crosschip_links must be kept by the caller and passed to the
        relevant tag_8021q functions.
      
      So it would be nice if the tag_8021q configuration was more
      self-contained. This patch attempts to do that.
      
      Create a struct dsa_8021q_context which encapsulates a struct
      dsa_switch, and has 2 function pointers for adding and deleting a VLAN.
      These will replace the previous channel to the driver, which was through
      the .port_vlan_add and .port_vlan_del callbacks of dsa_switch_ops.
      
      Also put the list of crosschip_links into this dsa_8021q_context.
      Drivers that don't support cross-chip bridging can simply omit to
      initialize this list, as long as they dont call any cross-chip function.
      
      The sja1105_vlan_add and sja1105_vlan_del functions are refactored into
      a smaller sja1105_vlan_add_one, which now has 2 entry points:
      - sja1105_vlan_add, from struct dsa_switch_ops
      - sja1105_dsa_8021q_vlan_add, from the tag_8021q ops
      But even this change is fairly trivial. It just reflects the fact that
      for sja1105, the VLANs from these 2 channels end up in the same hardware
      table. However that is not necessarily true in the general sense (and
      that's the reason for making this change).
      
      The rest of the patch is mostly plain refactoring of "ds" -> "ctx". The
      dsa_8021q_context structure needs to be propagated because adding a VLAN
      is now done through the ops function pointers inside of it.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5899ee36
    • V
      net: dsa: tag_8021q: setup tagging via a single function call · 7e092af2
      Vladimir Oltean 提交于
      There is no point in calling dsa_port_setup_8021q_tagging for each
      individual port. Additionally, it will become more difficult to do that
      when we'll have a context structure to tag_8021q (next patch). So
      refactor this now.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7e092af2
    • I
      bridge: mcast: Fix incomplete MDB dump · 12913f74
      Ido Schimmel 提交于
      Each MDB entry is encoded in a nested netlink attribute called
      'MDBA_MDB_ENTRY'. In turn, this attribute contains another nested
      attributed called 'MDBA_MDB_ENTRY_INFO', which encodes a single port
      group entry within the MDB entry.
      
      The cited commit added the ability to restart a dump from a specific
      port group entry. However, on failure to add a port group entry to the
      dump the entire MDB entry (stored in 'nest2') is removed, resulting in
      missing port group entries.
      
      Fix this by finalizing the MDB entry with the partial list of already
      encoded port group entries.
      
      Fixes: 5205e919 ("net: bridge: mcast: add support for src list and filter mode dumping")
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Acked-by: NNikolay Aleksandrov <nikolay@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      12913f74
    • C
      ipv6: remove redundant assignment to variable err · 2291267e
      Colin Ian King 提交于
      The variable err is being initialized with a value that is never read and
      it is being updated later with a new value. The initialization is redundant
      and can be removed.  Also re-order variable declarations in reverse
      Christmas tree ordering.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Reviewed-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2291267e
  3. 11 9月, 2020 19 次提交
  4. 10 9月, 2020 3 次提交
    • P
      devlink: Use controller while building phys_port_name · 66b17082
      Parav Pandit 提交于
      Now that controller number attribute is available, use it when
      building phsy_port_name for external controller ports.
      
      An example devlink port and representor netdev name consist of controller
      annotation for external controller with controller number = 1,
      for a VF 1 of PF 0:
      
      $ devlink port show pci/0000:06:00.0/2
      pci/0000:06:00.0/2: type eth netdev ens2f0c1pf0vf1 flavour pcivf controller 1 pfnum 0 vfnum 1 external true splittable false
        function:
          hw_addr 00:00:00:00:00:00
      
      $ devlink port show pci/0000:06:00.0/2 -jp
      {
          "port": {
              "pci/0000:06:00.0/2": {
                  "type": "eth",
                  "netdev": "ens2f0c1pf0vf1",
                  "flavour": "pcivf",
                  "controller": 1,
                  "pfnum": 0,
                  "vfnum": 1,
                  "external": true,
                  "splittable": false,
                  "function": {
                      "hw_addr": "00:00:00:00:00:00"
                  }
              }
          }
      }
      
      Controller number annotation is skipped for non external controllers to
      maintain backward compatibility.
      Signed-off-by: NParav Pandit <parav@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      66b17082
    • P
      devlink: Introduce controller number · 3a2d9588
      Parav Pandit 提交于
      A devlink port may be for a controller consist of PCI device.
      A devlink instance holds ports of two types of controllers.
      (1) controller discovered on same system where eswitch resides
      This is the case where PCI PF/VF of a controller and devlink eswitch
      instance both are located on a single system.
      (2) controller located on external host system.
      This is the case where a controller is located in one system and its
      devlink eswitch ports are located in a different system.
      
      When a devlink eswitch instance serves the devlink ports of both
      controllers together, PCI PF/VF numbers may overlap.
      Due to this a unique phys_port_name cannot be constructed.
      
      For example in below such system controller-0 and controller-1, each has
      PCI PF pf0 whose eswitch ports can be present in controller-0.
      These results in phys_port_name as "pf0" for both.
      Similar problem exists for VFs and upcoming Sub functions.
      
      An example view of two controller systems:
      
                   ---------------------------------------------------------
                   |                                                       |
                   |           --------- ---------         ------- ------- |
      -----------  |           | vf(s) | | sf(s) |         |vf(s)| |sf(s)| |
      | server  |  | -------   ----/---- ---/----- ------- ---/--- ---/--- |
      | pci rc  |=== | pf0 |______/________/       | pf1 |___/_______/     |
      | connect |  | -------                       -------                 |
      -----------  |     | controller_num=1 (no eswitch)                   |
                   ------|--------------------------------------------------
                   (internal wire)
                         |
                   ---------------------------------------------------------
                   | devlink eswitch ports and reps                        |
                   | ----------------------------------------------------- |
                   | |ctrl-0 | ctrl-0 | ctrl-0 | ctrl-0 | ctrl-0 |ctrl-0 | |
                   | |pf0    | pf0vfN | pf0sfN | pf1    | pf1vfN |pf1sfN | |
                   | ----------------------------------------------------- |
                   | |ctrl-1 | ctrl-1 | ctrl-1 | ctrl-1 | ctrl-1 |ctrl-1 | |
                   | |pf1    | pf1vfN | pf1sfN | pf1    | pf1vfN |pf0sfN | |
                   | ----------------------------------------------------- |
                   |                                                       |
                   |                                                       |
                   |           --------- ---------         ------- ------- |
                   |           | vf(s) | | sf(s) |         |vf(s)| |sf(s)| |
                   | -------   ----/---- ---/----- ------- ---/--- ---/--- |
                   | | pf0 |______/________/       | pf1 |___/_______/     |
                   | -------                       -------                 |
                   |                                                       |
                   |  local controller_num=0 (eswitch)                     |
                   ---------------------------------------------------------
      
      An example devlink port for external controller with controller
      number = 1 for a VF 1 of PF 0:
      
      $ devlink port show pci/0000:06:00.0/2
      pci/0000:06:00.0/2: type eth netdev ens2f0pf0vf1 flavour pcivf controller 1 pfnum 0 vfnum 1 external true splittable false
        function:
          hw_addr 00:00:00:00:00:00
      
      $ devlink port show pci/0000:06:00.0/2 -jp
      {
          "port": {
              "pci/0000:06:00.0/2": {
                  "type": "eth",
                  "netdev": "ens2f0pf0vf1",
                  "flavour": "pcivf",
                  "controller": 1,
                  "pfnum": 0,
                  "vfnum": 1,
                  "external": true,
                  "splittable": false,
                  "function": {
                      "hw_addr": "00:00:00:00:00:00"
                  }
              }
          }
      }
      Signed-off-by: NParav Pandit <parav@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3a2d9588
    • P
      devlink: Introduce external controller flag · 05b595e9
      Parav Pandit 提交于
      A devlink eswitch port may represent PCI PF/VF ports of a controller.
      
      A controller either located on same system or it can be an external
      controller located in host where such NIC is plugged in.
      
      Add the ability for driver to specify if a port is for external
      controller.
      
      Use such flag in the mlx5_core driver.
      
      An example of an external controller having VF1 of PF0 belong to
      controller 1.
      
      $ devlink port show pci/0000:06:00.0/2
      pci/0000:06:00.0/2: type eth netdev ens2f0pf0vf1 flavour pcivf pfnum 0 vfnum 1 external true splittable false
        function:
          hw_addr 00:00:00:00:00:00
      $ devlink port show pci/0000:06:00.0/2 -jp
      {
          "port": {
              "pci/0000:06:00.0/2": {
                  "type": "eth",
                  "netdev": "ens2f0pf0vf1",
                  "flavour": "pcivf",
                  "pfnum": 0,
                  "vfnum": 1,
                  "external": true,
                  "splittable": false,
                  "function": {
                      "hw_addr": "00:00:00:00:00:00"
                  }
              }
          }
      }
      Signed-off-by: NParav Pandit <parav@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05b595e9
  5. 09 9月, 2020 8 次提交
    • W
      ipv6: add tos reflection in TCP reset and ack · e92dd77e
      Wei Wang 提交于
      Currently, ipv6 stack does not do any TOS reflection. To make the
      behavior consistent with v4 stack, this commit adds TOS reflection in
      tcp_v6_reqsk_send_ack() and tcp_v6_send_reset(). We clear the lower
      2-bit ECN value of the received TOS in compliance with RFC 3168 6.1.5
      robustness principles.
      Signed-off-by: NWei Wang <weiwan@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e92dd77e
    • N
      net: bridge: mcast: fix unused br var when lockdep isn't defined · 071445c6
      Nikolay Aleksandrov 提交于
      Stephen reported the following warning:
       net/bridge/br_multicast.c: In function 'br_multicast_find_port':
       net/bridge/br_multicast.c:1818:21: warning: unused variable 'br' [-Wunused-variable]
        1818 |  struct net_bridge *br = mp->br;
             |                     ^~
      
      It happens due to bridge's mlock_dereference() when lockdep isn't defined.
      Silence the warning by annotating the variable as __maybe_unused.
      
      Fixes: 0436862e ("net: bridge: mcast: support for IGMPv3/MLDv2 ALLOW_NEW_SOURCES report")
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      071445c6
    • W
      netlabel: Fix some kernel-doc warnings · 8c70b268
      Wang Hai 提交于
      Fixes the following W=1 kernel build warning(s):
      
      net/netlabel/netlabel_calipso.c:438: warning: Excess function parameter 'audit_secid' description in 'calipso_doi_remove'
      net/netlabel/netlabel_calipso.c:605: warning: Excess function parameter 'reg' description in 'calipso_req_delattr'
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NWang Hai <wanghai38@huawei.com>
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8c70b268
    • W
      cipso: fix 'audit_secid' kernel-doc warning in cipso_ipv4.c · 7edce636
      Wang Hai 提交于
      Fixes the following W=1 kernel build warning(s):
      
      net/ipv4/cipso_ipv4.c:510: warning: Excess function parameter 'audit_secid' description in 'cipso_v4_doi_remove'
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NWang Hai <wanghai38@huawei.com>
      Acked-by: NPaul Moore <paul@paul-moore.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7edce636
    • T
      net: sched: skip an unnecessay check · c1f1f16c
      Tom Rix 提交于
      Reviewing the error handling in tcf_action_init_1()
      most of the early handling uses
      
      err_out:
      	if (cookie) {
      		kfree(cookie->data);
      		kfree(cookie);
      	}
      
      before cookie could ever be set.
      
      So skip the unnecessay check.
      Signed-off-by: NTom Rix <trix@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c1f1f16c
    • D
      rxrpc: Allow multiple client connections to the same peer · 288827d5
      David Howells 提交于
      Allow the number of parallel connections to a machine to be expanded from a
      single connection to a maximum of four.  This allows up to 16 calls to be
      in progress at the same time to any particular peer instead of 4.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      288827d5
    • D
      rxrpc: Rewrite the client connection manager · 245500d8
      David Howells 提交于
      Rewrite the rxrpc client connection manager so that it can support multiple
      connections for a given security key to a peer.  The following changes are
      made:
      
       (1) For each open socket, the code currently maintains an rbtree with the
           connections placed into it, keyed by communications parameters.  This
           is tricky to maintain as connections can be culled from the tree or
           replaced within it.  Connections can require replacement for a number
           of reasons, e.g. their IDs span too great a range for the IDR data
           type to represent efficiently, the call ID numbers on that conn would
           overflow or the conn got aborted.
      
           This is changed so that there's now a connection bundle object placed
           in the tree, keyed on the same parameters.  The bundle, however, does
           not need to be replaced.
      
       (2) An rxrpc_bundle object can now manage the available channels for a set
           of parallel connections.  The lock that manages this is moved there
           from the rxrpc_connection struct (channel_lock).
      
       (3) There'a a dummy bundle for all incoming connections to share so that
           they have a channel_lock too.  It might be better to give each
           incoming connection its own bundle.  This bundle is not needed to
           manage which channels incoming calls are made on because that's the
           solely at whim of the client.
      
       (4) The restrictions on how many client connections are around are
           removed.  Instead, a previous patch limits the number of client calls
           that can be allocated.  Ordinarily, client connections are reaped
           after 2 minutes on the idle queue, but when more than a certain number
           of connections are in existence, the reaper starts reaping them after
           2s of idleness instead to get the numbers back down.
      
           It could also be made such that new call allocations are forced to
           wait until the number of outstanding connections subsides.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      245500d8
    • D
      rxrpc: Impose a maximum number of client calls · b7a7d674
      David Howells 提交于
      Impose a maximum on the number of client rxrpc calls that are allowed
      simultaneously.  This will be in lieu of a maximum number of client
      connections as this is easier to administed as, unlike connections, calls
      aren't reusable (to be changed in a subsequent patch)..
      
      This doesn't affect the limits on service calls and connections.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      b7a7d674
  6. 08 9月, 2020 3 次提交