summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-02-24selftests: devlink_trap_acl_drops: Add ACL traps testJiri Pirko
Add a test to check functionality of ACL traps. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24selftests: pass pref and handle to devlink_trap_drop_* helpersJiri Pirko
Currently the helpers assume pref 1 and handle 101. Make that explicit and pass the values from callers. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24selftests: introduce test for mlxsw tc flower restrictionsJiri Pirko
Include test of forbidding to have drop rule on mixed-bound shared block. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mlxsw: spectrum_trap: Add ACL devlink-trap supportJiri Pirko
Add the trap group used to report ACL drops. Setup the trap IDs for ingress/egress flow action drop. Register the two packet traps associated with ACL trap group with devlink during driver initialization. As these are "source traps", set the disabled trap group to be the dummy, discarding as many packets in HW as possible. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mlxsw: spectrum_trap: Introduce dummy group with thin policerJiri Pirko
For "source traps" it is not possible to change HPKT action to discard. But there is still need to disallow packets arriving to CPU as much as possible. Handle this by introduction of a "dummy group". It has a "thin" policer, which passes as less packets to CPU as possible. The rest is going to be discarded there. The "dummy group" is to be used later on by ACL trap (which is a "source trap"). Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mlxsw: core: Extend MLXSW_RXL_DIS to register disabled trap groupJiri Pirko
Extend the mlxsw_listener struct to contain trap group for disabled traps too. Rename the original "trap_group" item to "en_trap_group" as it represents enabled state. Let both groups be the same for MLXSW_RXL however extend MLXSW_RXL_DIS to register separate groups for enable and disable. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mlxsw: core: Allow to enable/disable rx_listener for trapJiri Pirko
For source traps, the "thin policer" is going to be used in order to reduce the amount of trapped packets to minimum. However, there will be still small number of packets coming in that need to be dropped in the driver. Allow to enable/disable rx_listener related to specific trap in order to prevent unwanted packets to go up the stack. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mlxsw: acl_flex_actions: Trap all ACL dropped packets to DISCARD_*_ACL trapsJiri Pirko
Introduce a new set of traps: DISCARD_INGRESS_ACL and DISCARD_EGRESS_ACL Set the trap_action from NOP to TRAP which causes the packets dropped by the TRAP action to be trapped under new trap IDs, depending on the ingress/egress binding point. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mlxsw: spectrum_acl: Pass the ingress indication down to flex actionJiri Pirko
The ACL flex action will have to know if it is in ingress or egress, so it can use correct trap ID. Pass the ingress indication down to it. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mlxsw: spectrum_flower: Disable mixed bound blocks to contain action dropJiri Pirko
Action drop is going to be tracked by two separate traps, one for ingress and one for egress. Prepare for it and disallow the possibility to have drop action in blocks which are bound to both ingress and egress. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mlxsw: spectrum_acl: Track ingress and egress block bindingsJiri Pirko
Count the number of ingress and egress block bindings. Use the egress counter in "is_egress_bound" helper. Add couple of helpers to check ingress and mixed bound. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24devlink: add ACL generic packet trapsJiri Pirko
Add packet traps that can report packets that were dropped during ACL processing. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mlxsw: spectrum_trap: Prepare mlxsw_core_trap_action_set() to handle not ↵Jiri Pirko
only action Rename function mlxsw_core_trap_action_set() to mlxsw_core_trap_state_set() and pass bool enabled instead of action. Figure out the action according to the enabled state there. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mlxsw: spectrum_trap: Use listener->en/dis_action instead of hard-coded valuesJiri Pirko
The listener fields en_action and dis_action now contain the actions to be used for TRAP and DROP devlink trap actions. Use them directly instead of the hard-coded values. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mlxsw: core: Allow to register disabled traps using MLXSW_RXL_DISJiri Pirko
Introduce a new macro MLXSW_RXL_DIS that allows to register listeners as disabled. That allows that from now on, the "action" can be understood always as "enabled action" and "unreg_action" as "disabled action". Rename them and treat them accordingly. Use the new macro for defining drops in spectrum_trap.c. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mlxsw: spectrum_trap: Set unreg_action to be SET_FW_DEFAULTJiri Pirko
Currently it does not really matter if it is set to DISCARD or SET_FW_DEFAULT because it is set only during unregister of the listener. The unreg_action is going to be used for disabling the listener too, so change to SET_FW_DEFAULT and ensure the HW is going to behave correctly. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24Merge branch 'net-Clean-driver-module-and-FW-versions'David S. Miller
Leon Romanovsky says: ==================== Clean driver, module and FW versions Change log: v1: * Split all FW cleanups patches to separate patches * Fixed commit message * Deleted odd DRV_RELDATE * Added everyone from MAINTAINERS file v0: https://lore.kernel.org/netdev/20200220145855.255704-1-leon@kernel.org This is first patchset to netdev (already sent RDMA [1] and arch/um [2]) in attempt to unify the version management for in-tree kernel code. The patches follow already accepted ethtool change [3] to set as a default linux kernel version. It allows us to remove driver version and present to the users unified picture of driver version, which is similar to default MODULE_VERSION(). As part of this series, I deleted various creative attempts to mark absence of FW. There is no need to set "N/A" in ethtool ->fw_version field and it is enough to do not set it. 1. The code is compile tested and passes 0-day kbuild. 2. The proposed changes are based on commit: 2bb07f4e1d86 ("tc-testing: updated tdc tests for basic filter") 3. WIP branch is [4]. [1] https://lore.kernel.org/linux-rdma/20200220071239.231800-1-leon@kernel.org/ [2] http://lists.infradead.org/pipermail/linux-um/2020-February/002913.html [3] https://lore.kernel.org/linux-rdma/20200127072028.19123-1-leon@kernel.org/ [4] https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/log/?h=ethtool ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/atheros: Clean atheros code from driver versionLeon Romanovsky
Use linux kernel version for ethtool and module versions. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Acked-by: Chris Snook <chris.snook@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/arc: Delete driver versionLeon Romanovsky
Drop constant driver version in favour of global linux kernel. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/aquantia: Delete module versionLeon Romanovsky
There is no need to keep module and driver versions in in-tree kernel code. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/apm: Properly mark absence of FWLeon Romanovsky
There is no need to set "N/A" if FW is not available. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/apm: Remove useless driver versionLeon Romanovsky
Delete module version in favor of global and unique linux kernel. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/amd: Remove useless driver versionLeon Romanovsky
Convert AMD drivers to respect universal linux kernel version. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/amazon: Ensure that driver version is aligned to the linux kernelLeon Romanovsky
Upstream drivers are managed inside global repository and released all together, this ensure that driver version is the same as linux kernel, so update amazon drivers to properly reflect it. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/althera: Delete hardcoded driver versionLeon Romanovsky
Convert to use default version provided by ethtool. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/alteon: Properly report FW versionLeon Romanovsky
The acenic driver assigns FW version in driver version field, as part of cleanup driver version, set FW version properly. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/allwinner: Remove driver versionLeon Romanovsky
There is no need in custom driver version for in-tree code. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/alacritech: Delete driver versionLeon Romanovsky
Use standard variant of the driver version. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/agere: Delete unneeded driver versionLeon Romanovsky
There is no need in driver version for in-tree kernel code. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/aeroflex: Don't assign FW if it is not availableLeon Romanovsky
If FW version is not available, it is enough to leave that field as empty, there is no need to write N/A. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/aeroflex: Clean ethtool_info struct assignmentsLeon Romanovsky
If FW version is not available, it is enough to leave that field as empty, there is no need to write N/A. The driver version is replaced in favor of generally available in-tree variant. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/adaptec: Clean driver versionsLeon Romanovsky
Delete useless driver version in favor of default ones. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/3com: Delete driver and module versions from 3com driversLeon Romanovsky
There is no need to mislead users by providing different versions for driver, ethtool and modules. Delete driver assignments and let use the default one. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/dummy: Ditch driver and module versionsLeon Romanovsky
Delete constant driver and module versions in favor of standard global version which is unique to whole kernel. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/bond: Delete driver and module versionsLeon Romanovsky
The in-kernel code has already unique version, which is based on Linus's tag, update the bond driver to be consistent with that version. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net: hns3: remove redundant initialization of pointer 'client'Colin Ian King
The pointer 'client' is being initialized with a value that is never read, it is being updated later on. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net/mlxfw: fix spelling mistake: "progamming" -> "programming"Colin Ian King
There is a spelling mistake in a literal string. Fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24net: Remove unneeded export of a couple of xdp generic functionsDavid Ahern
generic_xdp_tx and xdp_do_generic_redirect are only used by builtin code, so remove the EXPORT_SYMBOL_GPL for them. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-24mac80211: Add api to support configuring TID specific configurationTamizh chelvam
Implement drv_set_tid_config api to allow TID specific configuration and drv_reset_tid_config api to reset peer specific TID configuration. This per-TID onfiguration will be applied for all the connected stations when MAC is NULL. Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org> Link: https://lore.kernel.org/r/1579506687-18296-7-git-send-email-tamizhr@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-02-24nl80211: Add support to configure TID specific RTSCTS configurationTamizh chelvam
This patch adds support to configure per TID RTSCTS control configuration to enable/disable through the NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL attribute. Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org> Link: https://lore.kernel.org/r/1579506687-18296-5-git-send-email-tamizhr@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-02-24nl80211: Add support to configure TID specific AMPDU configurationTamizh chelvam
This patch adds support to configure per TID AMPDU control configuration to enable/disable aggregation through the NL80211_TID_CONFIG_ATTR_AMPDU_CTRL attribute. Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org> Link: https://lore.kernel.org/r/1579506687-18296-4-git-send-email-tamizhr@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-02-24nl80211: Add support to configure TID specific retry configurationTamizh chelvam
This patch adds support to configure per TID retry configuration through the NL80211_TID_CONFIG_ATTR_RETRY_SHORT and NL80211_TID_CONFIG_ATTR_RETRY_LONG attributes. This TID specific retry configuration will have more precedence than phy level configuration. Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org> Link: https://lore.kernel.org/r/1579506687-18296-3-git-send-email-tamizhr@codeaurora.org [rebase completely on top of my previous API changes] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-02-24nl80211: modify TID-config APIJohannes Berg
Make some changes to the TID-config API: * use u16 in nl80211 (only, and restrict to using 8 bits for now), to avoid issues in the future if we ever want to use higher TIDs. * reject empty TIDs mask (via netlink policy) * change feature advertising to not use extended feature flags but have own mechanism for this, which simplifies the code * fix all variable names from 'tid' to 'tids' since it's a mask * change to cfg80211_ name prefixes, not ieee80211_ * fix some minor docs/spelling things. Change-Id: Ia234d464b3f914cdeab82f540e018855be580dce Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-02-24nl80211: Add NL command to support TID speicific configurationsTamizh chelvam
Add the new NL80211_CMD_SET_TID_CONFIG command to support data TID specific configuration. Per TID configuration is passed in the nested NL80211_ATTR_TID_CONFIG attribute. This patch adds support to configure per TID noack policy through the NL80211_TID_CONFIG_ATTR_NOACK attribute. Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org> Link: https://lore.kernel.org/r/1579506687-18296-2-git-send-email-tamizhr@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-02-24mac80211_hwsim: enable Beacon protectionJouni Malinen
Now that there is support for BIGTK configuration and AP/STA functionality for using BIP with Beacon frames, indicate support for the Beacon protection functionality. Johannes: move this to hwsim, since it's not clear that all drivers using mac80211 will do this correctly - lots of them modify the beacon before transmission e.g. to update the TIM element, and that would obviously break the signature. Signed-off-by: Jouni Malinen <jouni@codeaurora.org> Link: https://lore.kernel.org/r/20200222132548.20835-7-jouni@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-02-24mac80211: Beacon protection using the new BIGTK (STA)Jouni Malinen
This adds support for mac80211 to verify that received Beacon frames have a valid MME in station mode when a BIGTK is configured. Signed-off-by: Jouni Malinen <jouni@codeaurora.org> Link: https://lore.kernel.org/r/20200222132548.20835-6-jouni@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-02-24mac80211: Beacon protection using the new BIGTK (AP)Jouni Malinen
This adds support for mac80211 to add an MME into Beacon frames in AP mode when a BIGTK is configured. Signed-off-by: Jouni Malinen <jouni@codeaurora.org> Link: https://lore.kernel.org/r/20200222132548.20835-5-jouni@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-02-24mac80211: Update BIP to support Beacon framesJouni Malinen
When BIP is used to protect Beacon frames, the Timestamp field is masked to zero. Otherwise, the BIP processing is identical to the way it was already used with group-addressed Robust Management frames. Signed-off-by: Jouni Malinen <jouni@codeaurora.org> Link: https://lore.kernel.org/r/20200222132548.20835-4-jouni@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-02-24mac80211: Support BIGTK configuration for Beacon protectionJouni Malinen
Extend mac80211 key configuration to support the new BIGTK with key index values 6 and 7. Support for actually protecting Beacon frames (adding the MME in AP mode and checking it in STA mode) is covered in separate commits. Signed-off-by: Jouni Malinen <jouni@codeaurora.org> Link: https://lore.kernel.org/r/20200222132548.20835-3-jouni@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2020-02-24cfg80211: Support key configuration for Beacon protection (BIGTK)Jouni Malinen
IEEE P802.11-REVmd/D3.0 adds support for protecting Beacon frames using a new set of keys (BIGTK; key index 6..7) similarly to the way group-addressed Robust Management frames are protected (IGTK; key index 4..5). Extend cfg80211 and nl80211 to allow the new BIGTK to be configured. Add an extended feature flag to indicate driver support for the new key index values to avoid array overflows in driver implementations and also to indicate to user space when this functionality is available. Signed-off-by: Jouni Malinen <jouni@codeaurora.org> Link: https://lore.kernel.org/r/20200222132548.20835-2-jouni@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>