Skip to content
Permalink
Stanislav-Fomi…
Switch branches/tags

Commits on Aug 11, 2021

  1. selftests/bpf: verify bpf_get_netns_cookie in BPF_PROG_TYPE_CGROUP_SO…

    …CKOPT
    
    Add verifier ctx test to call bpf_get_netns_cookie from
    cgroup/setsockopt.
    
      torvalds#269/p pass ctx or null check, 1: ctx Did not run the program (not supported) OK
      torvalds#270/p pass ctx or null check, 2: null Did not run the program (not supported) OK
      torvalds#271/p pass ctx or null check, 3: 1 OK
      torvalds#272/p pass ctx or null check, 4: ctx - const OK
      torvalds#273/p pass ctx or null check, 5: null (connect) Did not run the program (not supported) OK
      torvalds#274/p pass ctx or null check, 6: null (bind) Did not run the program (not supported) OK
      torvalds#275/p pass ctx or null check, 7: ctx (bind) Did not run the program (not supported) OK
      torvalds#276/p pass ctx or null check, 8: null (bind) OK
      torvalds#277/p pass ctx or null check, 9: ctx (cgroup/setsockopt) Did not run the program (not supported) OK
      torvalds#278/p pass ctx or null check, 10: null (cgroup/setsockopt) Did not run the program (not supported) OK
    
    Signed-off-by: Stanislav Fomichev <sdf@google.com>
    fomichev authored and intel-lab-lkp committed Aug 11, 2021
  2. bpf: Allow bpf_get_netns_cookie in BPF_PROG_TYPE_CGROUP_SOCKOPT

    This is similar to existing BPF_PROG_TYPE_CGROUP_SOCK
    and BPF_PROG_TYPE_CGROUP_SOCK_ADDR.
    
    Signed-off-by: Stanislav Fomichev <sdf@google.com>
    fomichev authored and intel-lab-lkp committed Aug 11, 2021
  3. selftests/bpf: Fix running of XDP bonding tests

    An "innocent" cleanup in the last version of the XDP bonding patchset moved
    the "test__start_subtest" calls to the test main function, but I forgot to
    reverse the condition, which lead to all tests being skipped. Fix it.
    
    Fixes: 6aab1c8 ("selftests/bpf: Add tests for XDP bonding")
    Signed-off-by: Jussi Maki <joamaki@gmail.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/bpf/20210811123627.20223-1-joamaki@gmail.com
    joamaki authored and borkmann committed Aug 11, 2021
  4. Merge branch 'dsa-tagger-helpers'

    Vladimir Oltean says:
    
    ====================
    DSA tagger helpers
    
    The goal of this series is to minimize the use of memmove and skb->data
    in the DSA tagging protocol drivers. Unfiltered access to this level of
    information is not very friendly to drive-by contributors, and sometimes
    is also not the easiest to review.
    
    For starters, I have converted the most common form of DSA tagging
    protocols: the DSA headers which are placed where the EtherType is.
    
    The helper functions introduced by this series are:
    - dsa_alloc_etype_header
    - dsa_strip_etype_header
    - dsa_etype_header_pos_rx
    - dsa_etype_header_pos_tx
    
    This series is just a resend as non-RFC of v1.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Aug 11, 2021
  5. net: dsa: create a helper for locating EtherType DSA headers on TX

    Create a similar helper for locating the offset to the DSA header
    relative to skb->data, and make the existing EtherType header taggers to
    use it.
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Aug 11, 2021
  6. net: dsa: create a helper for locating EtherType DSA headers on RX

    It seems that protocol tagging driver writers are always surprised about
    the formula they use to reach their EtherType header on RX, which
    becomes apparent from the fact that there are comments in multiple
    drivers that mention the same information.
    
    Create a helper that returns a void pointer to skb->data - 2, as well as
    centralize the explanation why that is the case.
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Aug 11, 2021
  7. net: dsa: create a helper which allocates space for EtherType DSA hea…

    …ders
    
    Hide away the memmove used by DSA EtherType header taggers to shift the
    MAC SA and DA to the left to make room for the header, after they've
    called skb_push(). The call to skb_push() is still left explicit in
    drivers, to be symmetric with dsa_strip_etype_header, and because not
    all callers can be refactored to do it (for example, brcm_tag_xmit_ll
    has common code for a pre-Ethernet DSA tag and an EtherType DSA tag).
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Aug 11, 2021
  8. net: dsa: create a helper that strips EtherType DSA headers on RX

    All header taggers open-code a memmove that is fairly not all that
    obvious, and we can hide the details behind a helper function, since the
    only thing specific to the driver is the length of the header tag.
    
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    vladimiroltean authored and davem330 committed Aug 11, 2021
  9. Merge branch 'devlink-aux-devices'

    Parav Pandit says:
    
    ====================
    devlink: Control auxiliary devices
    
    Currently, for mlx5 multi-function device, a user is not able to control
    which functionality to enable/disable. For example, each PCI
    PF, VF, SF function by default has netdevice, RDMA and vdpa-net
    devices always enabled.
    
    Hence, enable user to control which device functionality to enable/disable.
    
    This is achieved by using existing devlink params [1] to
    enable/disable eth, rdma and vdpa net functionality control knob.
    
    For example user interested in only vdpa device function: performs,
    
    $ devlink dev param set pci/0000:06:00.0 name enable_rdma value false \
                       cmode driverinit
    $ devlink dev param set pci/0000:06:00.0 name enable_eth value false \
                       cmode driverinit
    $ devlink dev param set pci/0000:06:00.0 name enable_vnet value true \
                       cmode driverinit
    
    $ devlink dev reload pci/0000:06:00.0
    
    Reload command honors parameters set, initializes the device that user
    has composed using devlink dev params and resources.
    Devices before reload:
    
                mlx5_core.sf.4
             (subfunction device)
                      /\
                     /| \
                    / |  \
                   /  |   \
     mlx5_core.eth.4  |  mlx5_core.rdma.4
    (SF eth aux dev)  |  (SF rdma aux dev)
        |             |        |
        |             |        |
     enp6s0f0s88      |      mlx5_0
     (SF netdev)      |  (SF rdma device)
                      |
             mlx5_core.vnet.4
             (SF vnet aux dev)
                     |
                     |
            auxiliary/mlx5_core.sf.4
            (vdpa net mgmt device)
    
    Above example reconfigures the device with only VDPA functionality.
    Devices after reload:
    
                mlx5_core.sf.4
             (subfunction device)
                      /\
                     /  \
                    /    \
                   /      \
     mlx5_core.vnet.4     no eth, no rdma aux devices
     (SF vnet aux dev)
    
    Above parameters enable user to compose the device as needed based
    on the use case.
    
    Since devlink params are done on the devlink instance, these
    knobs are uniformly usable for PCI PF, VF and SF devices.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Aug 11, 2021
  10. net/mlx5: Support enable_vnet devlink dev param

    Enable user to disable VDPA net auxiliary device so that when it is not
    required, user can disable it.
    
    For example,
    
    $ devlink dev param set pci/0000:06:00.0 \
                  name enable_vnet value false cmode driverinit
    $ devlink dev reload pci/0000:06:00.0
    
    At this point devlink instance do not create auxiliary device
    mlx5_core.vnet.2 for the VDPA net functionality.
    
    Signed-off-by: Parav Pandit <parav@nvidia.com>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    paravmellanox authored and davem330 committed Aug 11, 2021
  11. net/mlx5: Support enable_rdma devlink dev param

    Enable user to disable RDMA auxiliary device so that when it is not
    required, user can disable it.
    
    For example,
    
    $ devlink dev param set pci/0000:06:00.0 \
                  name enable_rdma value false cmode driverinit
    $ devlink dev reload pci/0000:06:00.0
    
    At this point devlink instance do not create auxiliary device
    mlx5_core.rdma.2 for the RDMA functionality.
    
    Signed-off-by: Parav Pandit <parav@nvidia.com>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    paravmellanox authored and davem330 committed Aug 11, 2021
  12. net/mlx5: Support enable_eth devlink dev param

    Enable user to disable Ethernet auxiliary device so that when it is not
    required, user can disable it.
    
    For example,
    
    $ devlink dev param set pci/0000:06:00.0 \
                  name enable_eth value false cmode driverinit
    $ devlink dev reload pci/0000:06:00.0
    
    At this point devlink instance do not create mlx5_core.eth.2 auxiliary
    device for the Ethernet functionality.
    
    Signed-off-by: Parav Pandit <parav@nvidia.com>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    paravmellanox authored and davem330 committed Aug 11, 2021
  13. net/mlx5: Fix unpublish devlink parameters

    Cleanup routine missed to unpublish the parameters. Add it.
    
    Fixes: e890acd ("net/mlx5: Add devlink flow_steering_mode parameter")
    Signed-off-by: Parav Pandit <parav@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    paravmellanox authored and davem330 committed Aug 11, 2021
  14. devlink: Add APIs to publish, unpublish individual parameter

    Enable drivers to publish/unpublish individual parameter.
    
    Signed-off-by: Parav Pandit <parav@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    paravmellanox authored and davem330 committed Aug 11, 2021
  15. devlink: Add API to register and unregister single parameter

    Currently device configuration parameters can be registered as an array.
    Due to this a constant array must be registered. A single driver
    supporting multiple devices each with different device capabilities end
    up registering all parameters even if it doesn't support it.
    
    One possible workaround a driver can do is, it registers multiple single
    entry arrays to overcome such limitation.
    
    Better is to provide a API that enables driver to register/unregister a
    single parameter. This also further helps in two ways.
    (1) to reduce the memory of devlink_param_entry by avoiding in registering
    parameters which are not supported by the device.
    (2) avoid generating multiple parameter add, delete, publish, unpublish,
    init value notifications for such unsupported parameters
    
    Signed-off-by: Parav Pandit <parav@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    paravmellanox authored and davem330 committed Aug 11, 2021
  16. devlink: Create a helper function for one parameter registration

    Create and use a helper function for one parameter registration.
    Subsequent patch also will reuse this for driver facing routine to
    register a single parameter.
    
    Signed-off-by: Parav Pandit <parav@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    paravmellanox authored and davem330 committed Aug 11, 2021
  17. devlink: Add new "enable_vnet" generic device param

    Add new device generic parameter to enable/disable creation of
    VDPA net auxiliary device and associated device functionality
    in the devlink instance.
    
    User who prefers to disable such functionality can disable it using below
    example.
    
    $ devlink dev param set pci/0000:06:00.0 \
                  name enable_vnet value false cmode driverinit
    $ devlink dev reload pci/0000:06:00.0
    
    At this point devlink instance do not create auxiliary device for the
    VDPA net functionality.
    
    Signed-off-by: Parav Pandit <parav@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    paravmellanox authored and davem330 committed Aug 11, 2021
  18. devlink: Add new "enable_rdma" generic device param

    Add new device generic parameter to enable/disable creation of
    RDMA auxiliary device and associated device functionality
    in the devlink instance.
    
    User who prefers to disable such functionality can disable it using below
    example.
    
    $ devlink dev param set pci/0000:06:00.0 \
                  name enable_rdma value false cmode driverinit
    $ devlink dev reload pci/0000:06:00.0
    
    At this point devlink instance do not create auxiliary device for the
    RDMA functionality.
    
    Signed-off-by: Parav Pandit <parav@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    paravmellanox authored and davem330 committed Aug 11, 2021
  19. devlink: Add new "enable_eth" generic device param

    Add new device generic parameter to enable/disable creation of
    Ethernet auxiliary device and associated device functionality
    in the devlink instance.
    
    User who prefers to disable such functionality can disable it using below
    example.
    
    $ devlink dev param set pci/0000:06:00.0 \
                  name enable_eth value false cmode driverinit
    $ devlink dev reload pci/0000:06:00.0
    
    At this point devlink instance do not create auxiliary device for the
    Ethernet functionality.
    
    Signed-off-by: Parav Pandit <parav@nvidia.com>
    Reviewed-by: Jiri Pirko <jiri@nvidia.com>
    Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    paravmellanox authored and davem330 committed Aug 11, 2021
  20. Merge branch 'bridge-global-mcast'

    Nikolay Aleksandrov says:
    
    ====================
    net: bridge: vlan: add global mcast options
    
    This is the first follow-up set after the support for per-vlan multicast
    contexts which extends global vlan options to support bridge's multicast
    config per-vlan, it enables user-space to change and dump the already
    existing bridge vlan multicast context options. The global option patches
    (01 - 09 and 12-13) follow a similar pattern of changing current mcast
    functions to take multicast context instead of a port/bridge directly.
    Option equality checks have been added for dumping vlan range compression.
    The last 2 patches extend the mcast router dump support so it can be
    re-used when dumping vlan config.
    
    patches 01 - 09: add support for various mcast options
    patches 10 - 11: prepare for per-vlan querier control
    patches 12 - 13: add support for querier control and router control
    patches 14 - 15: add support for dumping per-vlan router ports
    
    Next patch-sets:
     - per-port/vlan router option config
     - iproute2 support for all new vlan options
     - selftests
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Aug 11, 2021
  21. net: bridge: vlan: use br_rports_fill_info() to export mcast router p…

    …orts
    
    Embed the standard multicast router port export by br_rports_fill_info()
    into a new global vlan attribute BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS.
    In order to have the same format for the global bridge mcast context and
    the per-vlan mcast context we need a double-nesting:
     - BRIDGE_VLANDB_GOPTS_MCAST_ROUTER_PORTS
       - MDBA_ROUTER
    
    Currently we don't compare router lists, if any router port exists in
    the bridge mcast contexts we consider their option sets as different and
    export them separately.
    
    In addition we export the router port vlan id when dumping similar to
    the router port notification format.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  22. net: bridge: mcast: use the proper multicast context when dumping rou…

    …ter ports
    
    When we are dumping the router ports of a vlan mcast context we need to
    use the bridge/vlan and port/vlan's multicast contexts to check if
    IPv4/IPv6 router port is present and later to dump the vlan id.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  23. net: bridge: vlan: add support for mcast router global option

    Add support to change and retrieve global vlan multicast router state
    which is used for the bridge itself. We just need to pass multicast context
    to br_multicast_set_router instead of bridge device and the rest of the
    logic remains the same.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  24. net: bridge: vlan: add support for mcast querier global option

    Add support to change and retrieve global vlan multicast querier state.
    We just need to pass multicast context to br_multicast_set_querier
    instead of bridge device and the rest of the logic remains the same.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  25. net: bridge: mcast: querier and query state affect only current conte…

    …xt type
    
    It is a minor optimization and better behaviour to make sure querier and
    query sending routines affect only the matching multicast context
    depending if vlan snooping is enabled (vlan ctx vs bridge ctx).
    It also avoids sending unnecessary extra query packets.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  26. net: bridge: mcast: move querier state to the multicast context

    We need to have the querier state per multicast context in order to have
    per-vlan control, so remove the internal option bit and move it to the
    multicast context. Also annotate the lockless reads of the new variable.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  27. net: bridge: vlan: add support for mcast startup query interval globa…

    …l option
    
    Add support to change and retrieve global vlan multicast startup query
    interval option.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  28. net: bridge: vlan: add support for mcast query response interval glob…

    …al option
    
    Add support to change and retrieve global vlan multicast query response
    interval option.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  29. net: bridge: vlan: add support for mcast query interval global option

    Add support to change and retrieve global vlan multicast query interval
    option.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  30. net: bridge: vlan: add support for mcast querier interval global option

    Add support to change and retrieve global vlan multicast querier interval
    option.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  31. net: bridge: vlan: add support for mcast membership interval global o…

    …ption
    
    Add support to change and retrieve global vlan multicast membership
    interval option.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  32. net: bridge: vlan: add support for mcast last member interval global …

    …option
    
    Add support to change and retrieve global vlan multicast last member
    interval option.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  33. net: bridge: vlan: add support for mcast startup query count global o…

    …ption
    
    Add support to change and retrieve global vlan multicast startup query
    count option.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  34. net: bridge: vlan: add support for mcast last member count global option

    Add support to change and retrieve global vlan multicast last member
    count option.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
  35. net: bridge: vlan: add support for mcast igmp/mld version global options

    Add support to change and retrieve global vlan IGMP/MLD versions.
    
    Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Nikolay Aleksandrov authored and davem330 committed Aug 11, 2021
Older