[net-next 14/15] net/mlx5: DR, Add support for force-loopback QP

2021-04-19 Thread Saeed Mahameed
From: Yevgeny Kliteynik When supported by the device, SW steering RoCE RC QP that is used to write/read to/from ICM will be created with force-loopback attribute. Such QP doesn't require GID index upon creation. Signed-off-by: Erez Shitrit Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed

[net-next 15/15] net/mlx5: DR, Add support for isolate_vl_tc QP

2021-04-19 Thread Saeed Mahameed
From: Yevgeny Kliteynik When using SW steering, rule insertion rate depends on the RDMA RC QP performance used for writing to the ICM. During stress this QP is competing on the HW resources with all the other QPs that are used to send data. To protect SW steering QP's performance in such cases, w

[net-next 12/15] net/mlx5: DR, Set flex parser for TNL_MPLS dynamically

2021-04-19 Thread Saeed Mahameed
From: Yevgeny Kliteynik Query the flex_parser id that's intended for TNL_MPLS and use an appropriate flex parser for MPLS over UDP/GRE. Signed-off-by: Muhammad Sammar Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_cmd.c | 8 ++ ...

[net-next 11/15] net/mlx5: DR, Add support for matching on geneve TLV option

2021-04-19 Thread Saeed Mahameed
From: Yevgeny Kliteynik Enable matching on tunnel geneve TLV option using the flex parser. Signed-off-by: Muhammad Sammar Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_cmd.c | 4 +++ .../mellanox/mlx5/core/steering/dr_matcher.c |

[net-next 13/15] net/mlx5: DR, Add support for matching tunnel GTP-U

2021-04-19 Thread Saeed Mahameed
From: Yevgeny Kliteynik Enable matching on tunnel GTP-U and GTP-U first extension header using dynamic flex parser. Signed-off-by: Muhammad Sammar Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_cmd.c | 16 +++ .../mellanox/mlx5/cor

[net-next 10/15] net/mlx5: DR, Set STEv0 ICMP flex parser dynamically

2021-04-19 Thread Saeed Mahameed
From: Yevgeny Kliteynik Set the flex parser ID dynamicly for ICMP instead of relying on hardcoded values. Signed-off-by: Muhammad Sammar Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_matcher.c | 12 ++--- .../mellanox/mlx5/core/steerin

[net-next 09/15] net/mlx5: DR, Add support for dynamic flex parser

2021-04-19 Thread Saeed Mahameed
From: Yevgeny Kliteynik Flex parser is a HW parser that can support protocols that are not natively supported by the HCA, such as Geneve (TLV options) and GTP-U. There are 8 such parsers, and each of them can be assigned to parse a specific set of protocols. This patch adds misc4 match params whi

[net-next 08/15] net/mlx5: DR, Remove protocol-specific flex_parser_3 definitions

2021-04-19 Thread Saeed Mahameed
From: Muhammad Sammar Remove MPLS specific fields from flex parser 3 layout. Flex parser can be used for multiple protocols and should not be hardcoded to a specific type. Signed-off-by: Muhammad Sammar Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core

[net-next 04/15] net/mlx5: DR, Rename an argument in dr_rdma_segments

2021-04-19 Thread Saeed Mahameed
From: Yevgeny Kliteynik Rename the argument to better reflect that the meaning is not number of records, but wheather or not we should ring the dorbell. Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/steering/dr_send.c| 8 1

[net-next 05/15] net/mlx5: DR, Fix SQ/RQ in doorbell bitmask

2021-04-19 Thread Saeed Mahameed
From: Yevgeny Kliteynik QP doorbell size is 16 bits. Fixing sw steering's QP doorbel bitmask, which had 20 bits. Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[net-next V2 11/16] net/mlx5: DR, Alloc cmd buffer with kvzalloc() instead of kzalloc()

2021-04-14 Thread Saeed Mahameed
From: Roi Dayan The cmd size is 8K so use kvzalloc(). Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c | 6 +++--- 2 files changed, 5 insertions(+), 5 dele

[net-next V2 10/16] net/mlx5: DR, Use variably sized data structures for different actions

2021-04-14 Thread Saeed Mahameed
From: Jianbo Liu mlx5dr_action is a generally used data structure, and there is an union for different types of actions in it. The size of mlx5dr_action is about 72 bytes, but for those actions with fewer fields, most of the allocated memory is wasted. Remove this union, and mlx5dr_action becomes

[net-next 10/16] net/mlx5: DR, Use variably sized data structures for different actions

2021-04-13 Thread Saeed Mahameed
From: Jianbo Liu mlx5dr_action is a generally used data structure, and there is an union for different types of actions in it. The size of mlx5dr_action is about 72 bytes, but for those actions with fewer fields, most of the allocated memory is wasted. Remove this union, and mlx5dr_action becomes

[net-next 11/16] net/mlx5: DR, Alloc cmd buffer with kvzalloc() instead of kzalloc()

2021-04-13 Thread Saeed Mahameed
From: Roi Dayan The cmd size is 8K so use kvzalloc(). Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c | 6 +++--- 2 files changed, 5 insertions(+), 5 dele

[net-next 02/15] net/mlx5: DR, Fix potential shift wrapping of 32-bit value in STEv1 getter

2021-03-24 Thread Saeed Mahameed
From: Yevgeny Kliteynik Fix 32-bit variable shift wrapping in dr_ste_v1_get_miss_addr. Fixes: a6098129c781 ("net/mlx5: DR, Add STEv1 setters and getters") Reported-by: Dan Carpenter Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- d

[net-next 01/13] net/mlx5: DR, Fixed typo in STE v0

2021-03-12 Thread Saeed Mahameed
From: Yevgeny Kliteynik "reforamt" -> "reformat" Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/m

[net-next 03/13] net/mlx5: DR, Add missing vhca_id consume from STEv1

2021-03-12 Thread Saeed Mahameed
From: Yevgeny Kliteynik The field source_eswitch_owner_vhca_id was not consumed in the same way as in STEv0. Added the missing set. Fixes: 10b694186410 ("net/mlx5: DR, Add HW STEv1 match logic") Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker

[net-next 02/13] net/mlx5: DR, Remove unneeded rx_decap_l3 function for STEv1

2021-03-12 Thread Saeed Mahameed
From: Yevgeny Kliteynik Remove the dr_ste_v1_set_rx_decap_l3 function that was replaced by another function - fixing a rebase error. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_ste_v1.c| 18 ---

[net 18/18] net/mlx5: DR, Fix potential shift wrapping of 32-bit value in STEv1 getter

2021-03-10 Thread Saeed Mahameed
From: Yevgeny Kliteynik Fix 32-bit variable shift wrapping in dr_ste_v1_get_miss_addr. Fixes: a6098129c781 ("net/mlx5: DR, Add STEv1 setters and getters") Reported-by: Dan Carpenter Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- d

[net-next 14/14] net/mlx5: DR, Avoid unnecessary csum recalculation on supporting devices

2021-02-01 Thread Saeed Mahameed
From: Yevgeny Kliteynik If as part of the actions the TTL of the packet is modified, the packet's checksum needs to be recalculated. Connect-X6DX can handle this csum recalculation natively. Older devices require this additional recalculation. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex

Re: [net-next 01/11] net/mlx5: DR, Fix potential shift wrapping of 32-bit value

2021-02-01 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (refs/heads/master): On Fri, 29 Jan 2021 18:26:08 -0800 you wrote: > From: Yevgeny Kliteynik > > Fix 32-bit variable shift wrapping in dr_ste_v0_get_miss_addr. > > Fixes: 6b93b400aa88 ("net/mlx5: DR, Move STEv0

[net-next 01/11] net/mlx5: DR, Fix potential shift wrapping of 32-bit value

2021-01-30 Thread Saeed Mahameed
From: Yevgeny Kliteynik Fix 32-bit variable shift wrapping in dr_ste_v0_get_miss_addr. Fixes: 6b93b400aa88 ("net/mlx5: DR, Move STEv0 setters and getters") Reported-by: Dan Carpenter Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- d

[net-next 04/11] net/mlx5: DR, Allow native protocol support for HW STEv1

2021-01-30 Thread Saeed Mahameed
From: Yevgeny Kliteynik Some flex parser protocols are native as part of STEv1. The check for supported protocols was modified to allow this. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_matcher.c | 1

[net-next 07/11] net/mlx5: DR, Add STEv1 modify header logic

2021-01-30 Thread Saeed Mahameed
From: Yevgeny Kliteynik Add HW specific modify header fields and logic to STEv1 file. Since STEv0 and STEv1 modify actions values are different, each version has its own implementation. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox

[net-next 08/11] net/mlx5: DR, Use the right size when writing partial STE into HW

2021-01-30 Thread Saeed Mahameed
From: Yevgeny Kliteynik In these cases we need to update only the ctrl area of the STE. So it is better to write only the control 32B and avoid copying the unneeded reduced 48B (control 32B + tag 16B). Signed-off-by: Erez Shitrit Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Sig

[net-next 05/11] net/mlx5: DR, Add STEv1 setters and getters

2021-01-30 Thread Saeed Mahameed
From: Yevgeny Kliteynik Add HW specific setter and getters to STEv1 file. Since STEv0 and STEv1 format are different, each version should implemented different setters and getters. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5

[net-next 11/11] net/mlx5: DR, Allow SW steering for sw_owner_v2 devices

2021-01-30 Thread Saeed Mahameed
From: Yevgeny Kliteynik Allow sw_owner_v2 based on sw_format_version. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_cmd.c| 17 +++-- .../mellanox/mlx5/core/steering/dr_domain.c | 17 +++

[net-next 02/11] net/mlx5: DR, Add match STEv1 structs to ifc

2021-01-30 Thread Saeed Mahameed
From: Yevgeny Kliteynik Add mlx5_ifc_dr_ste_v1.h - a new header with HW specific STE structs for version 1. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mlx5/core/steering/mlx5_ifc_dr_ste_v1.h | 273 ++ 1 file changed, 27

[net-next 09/11] net/mlx5: DR, Use HW specific logic API when writing STE

2021-01-30 Thread Saeed Mahameed
From: Yevgeny Kliteynik STEv0 format and STEv1 HW format are different, each has a different order: STEv0: CTRL 32B, TAG 16B, BITMASK 16B STEv1: CTRL 32B, BITMASK 16B, TAG 16B To make this transparent to upper layers we introduce a new ste_ctx function to format the STE prior to writing it. Sig

[net-next 06/11] net/mlx5: DR, Add STEv1 action apply logic

2021-01-30 Thread Saeed Mahameed
From: Yevgeny Kliteynik Add HW specific action apply logic to STEv1. Since STEv0 and STEv1 actions format is different, each version has its implementation. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_ste_v1

[net-next 03/11] net/mlx5: DR, Add HW STEv1 match logic

2021-01-29 Thread Saeed Mahameed
From: Yevgeny Kliteynik Add STEv1 match logic to a new file. This file will be used for HW specific STEv1. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/Makefile | 2 +- .../mellanox/mlx5/core/steering/dr_

[net-next 10/11] net/mlx5: DR, Copy all 64B whenever replacing STE in the head of miss-list

2021-01-29 Thread Saeed Mahameed
From: Yevgeny Kliteynik Till now the code assumed that need to copy reduced size of the ste because the rest is the mask part which shouldn't be changed. This is not true for all types of HW (like STEv1). Take all 64B from the new STE and write them in the replaced STE place. This change will mak

[net-next 13/16] net/mlx5: DR, Add STE tx/rx actions per-device API

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Extend the STE context struct with per-device tx/rx actions. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed --- .../ethernet/mellanox/mlx5/core/steering/dr_ste.h| 12 1 file changed, 12 insertions(+) diff -

[net-next 15/16] net/mlx5: DR, Add STE modify header actions per-device API

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Extend the STE context struct with per-device modify header actions. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_ste.h | 23 +++ 1 file changed, 23 insertions(+)

[net-next 16/16] net/mlx5: DR, Move STEv0 modify header logic

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Move HW specific modify header fields and logic to STEv0 file and use the new STE context callbacks. Since STEv0 and STEv1 modify actions values are different, each version has its own implementation. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Reviewed-by

[net-next 14/16] net/mlx5: DR, Move STEv0 action apply logic

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Use STE tx/rx actions per-device API: move HW specific action apply logic from dr_ste to STEv0 file - STEv0 and STEv1 actions format is different, each version should have its own implementation. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Reviewed-by: S

[net-next 11/16] net/mlx5: DR, Add STE setters and getters per-device API

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Extend the STE context struct with various per-device setters and getters. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed --- .../ethernet/mellanox/mlx5/core/steering/dr_ste.h| 12 1 file changed, 12 inserti

[net-next 10/16] net/mlx5: DR, Move action apply logic to dr_ste

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik The action apply logic is device specific per STE version, moving to the STE layer will allow implementing it for both devices while keeping DR upper layers the same. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Reviewed-by: Saeed Mahameed Signed-off-by

[net-next 12/16] net/mlx5: DR, Move STEv0 setters and getters

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Use the new setters and getters API for STEv0: move HW specific setter and getters from dr_ste to STEv0 file. Since STEv0 and STEv1 format are different each version should implemented different setters and getters. Rename remaining static functions w/o mlx5 prefix. Signe

[net-next 07/16] net/mlx5: DR, Merge similar DR STE SET macros

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Merge DR_STE_STE macros for better code reuse, the macro DR_STE_SET_MASK_V and DR_STE_SET_TAG are merged to avoid tag and bit_mask function creation which are usually the same. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Reviewed-by: Saeed Mahameed Sign

[net-next 09/16] net/mlx5: DR, Refactor ICMP STE builder

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Reworked ICMP tag builder to better handle ICMP v4/6 fields and avoid unneeded code duplication and 'if' statements, removed unused macro, changed bitfield of len 8 to u8. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Reviewed-by: Saeed Mahameed Signed-of

[net-next 05/16] net/mlx5: DR, Remove unused macro definition from dr_ste

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Signed-off-by: Yevgeny Kliteynik Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c b/dr

[net-next 08/16] net/mlx5: DR, Move STEv0 look up types from mlx5_ifc_dr header

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik The lookup types are device specific and should not be exposed to DR upper layers, matchers/tables. Each HW STE version should keep them internal. The lu_type size is updated to support larger lu_types as required for STEv1. Signed-off-by: Alex Vesker Signed-off-by

[net-next 06/16] net/mlx5: DR, Fix STEv0 source_eswitch_owner_vhca_id support

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Check vport_cap only if match on source gvmi is required. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_ste_v0.c | 25 +++ 1 file changed, 1

[net-next 04/16] net/mlx5: DR, Move HW STEv0 match logic to a separate file

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Move current STE match logic to a seprate file. This file will be used for HW specific STEv0. Future patches will add functionality for v1 steering. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed --

[net-next 02/16] net/mlx5: DR, Move macros from dr_ste.c to header

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Move some macros from dr_ste.c to header - these macros will be used by all the format-specific functions. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_ste.c | 74 ---

[net-next 03/16] net/mlx5: DR, Use the new HW specific STE infrastructure

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Split the STE builders functionality into the common part and device-specific part. All the device-specific part (with 'v0' in the function names) is accessed through the STE context structure. Subsequent patches will have the device-specific logic moved to a separate fil

[net-next 01/16] net/mlx5: DR, Add infrastructure for supporting several steering formats

2021-01-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Add a struct of device specific callbacks for STE layer below dr_ste. Each device will implement its HW-specific function, and a comon logic from the DR code will access these functions through the new ste_ctx API. More callbacks will follow in the subsequent patches

DR

2020-12-16 Thread db.bankdirecto...@gmail.com

[net 4/4] net/mlx5: DR, Proper handling of unsupported Connect-X6DX SW steering

2020-12-02 Thread Saeed Mahameed
mlx5_ifc definitions for Connect-X6DX SW steering, read FW capability to get the current format version, and check this version when domain is being created. Fixes: 26d688e33f88 ("net/mlx5: DR, Add Steering entry (STE) utilities") Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saee

[PATCH mlx5-next 03/16] net/mlx5: Check dr mask size against mlx5_match_param size

2020-11-20 Thread Saeed Mahameed
From: Muhammad Sammar This is to allow passing misc4 match param from userspace when function like ib_flow_matcher_create is called. Signed-off-by: Muhammad Sammar Reviewed-by: Alex Vesker Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/stee

[net-next v2 06/12] net/mlx5: DR, Sync chunks only during free

2020-11-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik When freeing chunks, we want to sync the steering so that all the "hot" memory will be written to ICM and all the chunks that are in the hot_list will be actually destroyed. When allocating from the pool, we don't have a need to sync the steering, as we're not freeing anyt

[net-next v2 08/12] net/mlx5: DR, Free unused buddy ICM memory

2020-11-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Track buddy's used ICM memory, and free it if all of the buddy's memory bacame unused. Do this only for STEs. MODIFY_ACTION buddies are much smaller, so in case there is a large amount of modify_header actions, which result in large amount of MODIFY_ACTION buddies, doing t

[net-next v2 01/12] net/mlx5: DR, Remove unused member of action struct

2020-11-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Struct mlx5dr_action doesn't use this member Signed-off-by: Erez Shitrit Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h | 1 - 1 file changed, 1 deletion(-) diff

[net-next v2 03/12] net/mlx5: DR, Rename matcher functions to be more HW agnostic

2020-11-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Remove flex parser from the matcher function names since the matcher should not be aware of such HW specific details. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_cmd.c | 4 +- .

[net-next v2 02/12] net/mlx5: DR, Rename builders HW specific names

2020-11-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik We will support multiple STE versions. The existing naming is not suitable for newer versions. Removed the HW specific details and renamed with a more general names. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mell

[net-next v2 07/12] net/mlx5: DR, ICM memory pools sync optimization

2020-11-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Track the pool's hot ICM memory when freeing/allocating chunk, so that when checking if the sync is required, just check if the pool hot memory has reached the sync threshold. Signed-off-by: Hamdan Igbaria Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Revie

[net-next v2 05/12] net/mlx5: DR, Handle ICM memory via buddy allocation instead of buckets

2020-11-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Till now in order to manage the ICM memory we used bucket mechanism, which kept a bucket per specified size (sizes were between 1 block to 2^21 blocks). Now changing that with buddy-system mechanism, which gives us much more flexible way to manage the ICM memory. Its bigg

[net-next v2 04/12] net/mlx5: DR, Add buddy allocator utilities

2020-11-05 Thread Saeed Mahameed
From: Yevgeny Kliteynik Add implementation of SW Steering variation of buddy allocator. The buddy system for ICM memory uses 2 main data structures: - Bitmap per order, that keeps the current state of allocated blocks for this order - Indicator for the number of available blocks per each order

[net-next 06/12] net/mlx5: DR, Sync chunks only during free

2020-11-03 Thread Saeed Mahameed
From: Yevgeny Kliteynik When freeing chunks, we want to sync the steering so that all the "hot" memory will be written to ICM and all the chunks that are in the hot_list will be actually destroyed. When allocating from the pool, we don't have a need to sync the steering, as we're not freeing anyt

[net-next 08/12] net/mlx5: DR, Free unused buddy ICM memory

2020-11-03 Thread Saeed Mahameed
From: Yevgeny Kliteynik Track buddy's used ICM memory, and free it if all of the buddy's memory bacame unused. Do this only for STEs. MODIFY_ACTION buddies are much smaller, so in case there is a large amount of modify_header actions, which result in large amount of MODIFY_ACTION buddies, doing t

[net-next 02/12] net/mlx5: DR, Rename builders HW specific names

2020-11-03 Thread Saeed Mahameed
From: Yevgeny Kliteynik We will support multiple STE versions. The existing naming is not suitable for newer versions. Removed the HW specific details and renamed with a more general names. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mell

[net-next 01/12] net/mlx5: DR, Remove unused member of action struct

2020-11-03 Thread Saeed Mahameed
From: Yevgeny Kliteynik Struct mlx5dr_action doesn't use this member Signed-off-by: Erez Shitrit Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h | 1 - 1 file changed, 1 deletion(-) diff

[net-next 05/12] net/mlx5: DR, Handle ICM memory via buddy allocation instead of buckets

2020-11-03 Thread Saeed Mahameed
From: Yevgeny Kliteynik Till now in order to manage the ICM memory we used bucket mechanism, which kept a bucket per specified size (sizes were between 1 block to 2^21 blocks). Now changing that with buddy-system mechanism, which gives us much more flexible way to manage the ICM memory. Its bigg

[net-next 07/12] net/mlx5: DR, ICM memory pools sync optimization

2020-11-03 Thread Saeed Mahameed
From: Yevgeny Kliteynik Track the pool's hot ICM memory when freeing/allocating chunk, so that when checking if the sync is required, just check if the pool hot memory has reached the sync threshold. Signed-off-by: Hamdan Igbaria Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Revie

[net-next 04/12] net/mlx5: DR, Add buddy allocator utilities

2020-11-03 Thread Saeed Mahameed
From: Yevgeny Kliteynik Add implementation of SW Steering variation of buddy allocator. The buddy system for ICM memory uses 2 main data structures: - Bitmap per order, that keeps the current state of allocated blocks for this order - Indicator for the number of available blocks per each order

[net-next 03/12] net/mlx5: DR, Rename matcher functions to be more HW agnostic

2020-11-03 Thread Saeed Mahameed
From: Yevgeny Kliteynik Remove flex parser from the matcher function names since the matcher should not be aware of such HW specific details. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_cmd.c | 4 +- .

[PATCH 1/6] ipvs: inspect reply packets from DR/TUN real servers

2020-10-11 Thread Pablo Neira Ayuso
From: "longguang.yue" Just like for MASQ, inspect the reply packets coming from DR/TUN real servers and alter the connection's state and timeout according to the protocol. It's ipvs's duty to do traffic statistic if packets get hit, no matter what mode it is. Sig

Re: [net-next 01/15] net/mlx5: DR, Add buddy allocator utilities

2020-10-07 Thread Yevgeny Kliteynik
On 06-Oct-20 17:47, David Miller wrote: > From: Yevgeny Kliteynik > Date: Tue, 6 Oct 2020 16:02:24 +0300 > >> Buddy allocator allocates blocks of different sizes, so when it >> scans the bits array, the allocator looks for free *area* of at >> least the required size. >> Can't store this info in

Re: [net-next 01/15] net/mlx5: DR, Add buddy allocator utilities

2020-10-06 Thread David Miller
From: Yevgeny Kliteynik Date: Tue, 6 Oct 2020 16:02:24 +0300 > Buddy allocator allocates blocks of different sizes, so when it > scans the bits array, the allocator looks for free *area* of at > least the required size. > Can't store this info in a 'lowest set bit' counter. If you make it per-or

Re: [net-next 01/15] net/mlx5: DR, Add buddy allocator utilities

2020-10-06 Thread Yevgeny Kliteynik
On 29-Sep-20 23:44, Yevgeny Kliteynik wrote:> > On 29-Sep-20 00:41, David Miller wrote: >> >> From: Yevgeny Kliteynik >> Date: Mon, 28 Sep 2020 19:58:59 + >> >>> By replacing the bits-per-long array with a single counter we loose >>> this ability to jump faster to the free spot. >> >> I don't

[net-next 03/15] net/mlx5: DR, Remove unneeded vlan check from L2 builder

2020-09-30 Thread saeed
From: Yevgeny Kliteynik When we create a matcher we check that all fields are consumed. There is no need for this specific check. This keeps the STE builder functions simple and clean. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/

[net-next 05/15] net/mlx5: DR, Call ste_builder directly with tag pointer

2020-09-30 Thread saeed
From: Yevgeny Kliteynik Instead of getting the tag in each function, call the builder directly with the tag. This will allow to use the same function for building the tag and the bitmask. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellan

[net-next 06/15] net/mlx5: DR, Add support for rule creation with flow source hint

2020-09-30 Thread saeed
From: Hamdan Igbaria Skip the rule according to flow arrival source, in case of RX and the source is local port skip and in case of TX and the source is uplink skip, we get this info according to the flow source hint we get from upper layers when creating the rule. This is needed because for exam

[net-next 02/15] net/mlx5: DR, Remove unneeded check from source port builder

2020-09-30 Thread saeed
From: Yevgeny Kliteynik Mask validity for ste builders is checked by mlx5dr_ste_build_pre_check during matcher creation. It already checks the mask value of source_vport, so removing this duplicated check. Also, moving there the check of source_eswitch_owner_vhca_id mask. Signed-off-by: Alex Ves

[net-next 01/15] net/mlx5: DR, Replace the check for valid STE entry

2020-09-30 Thread saeed
From: Yevgeny Kliteynik Validity check is done by reading the next lu_type from the STE, this check can be replaced by checking the refcount. This will make the check independent on internal STE structure. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahamee

[net-next 04/15] net/mlx5: DR, Remove unneeded local variable

2020-09-30 Thread saeed
From: Yevgeny Kliteynik The misc3 variable is used only once and can be dropped. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-

[PATCH v3] ipvs: Add traffic statistic up even it is VS/DR or VS/TUN mode

2020-09-29 Thread longguang.yue
It's ipvs's duty to do traffic statistic if packets get hit, no matter what mode it is. Signed-off-by: longguang.yue --- net/netfilter/ipvs/ip_vs_conn.c | 14 -- net/netfilter/ipvs/ip_vs_core.c | 5 - 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/net/netfilter/

Re: [net-next 01/15] net/mlx5: DR, Add buddy allocator utilities

2020-09-29 Thread Yevgeny Kliteynik
On 29-Sep-20 00:41, David Miller wrote: From: Yevgeny Kliteynik Date: Mon, 28 Sep 2020 19:58:59 + By replacing the bits-per-long array with a single counter we loose this ability to jump faster to the free spot. I don't understand why this is true, because upon the free we will update

Re: [PATCH v2] ipvs: Add traffic statistic up even it is VS/DR or VS/TUN mode

2020-09-29 Thread Jakub Kicinski
On Tue, 29 Sep 2020 16:18:11 +0800 longguang.yue wrote: > @@ -411,10 +413,17 @@ struct ip_vs_conn *ip_vs_conn_out_get(const struct > ip_vs_conn_param *p) > rcu_read_lock(); > > hlist_for_each_entry_rcu(cp, &ip_vs_conn_tab[hash], c_list) { > - if (p->vport == cp->cport &&

[PATCH v2] ipvs: Add traffic statistic up even it is VS/DR or VS/TUN mode

2020-09-29 Thread longguang.yue
It's ipvs's duty to do traffic statistic if packets get hit, no matter what mode it is. Signed-off-by: longguang.yue --- net/netfilter/ipvs/ip_vs_conn.c | 13 +++-- net/netfilter/ipvs/ip_vs_core.c | 5 - 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/net/netfilter/i

Re: [PATCH] ipvs: Add traffic statistic up even it is VS/DR or VS/TUN mode

2020-09-28 Thread yue longguang
especially in public cloud case, statistic is related to monitorring and billing , both ingress and egress packets will go throught ipvs, even dr/tun mode. in dr/tun mode, ipvs need to do nothing except statistic, so skb->ipvs_property = 1 regards On Tue, Sep 29, 2020 at 1:04 PM longguang.

[PATCH] ipvs: Add traffic statistic up even it is VS/DR or VS/TUN mode

2020-09-28 Thread longguang.yue
It's ipvs's duty to do traffic statistic if packets get hit, no matter what mode it is. Signed-off-by: longguang.yue --- net/netfilter/ipvs/ip_vs_core.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index

Re: [net-next 01/15] net/mlx5: DR, Add buddy allocator utilities

2020-09-28 Thread David Miller
From: Yevgeny Kliteynik Date: Mon, 28 Sep 2020 19:58:59 + > By replacing the bits-per-long array with a single counter we loose > this ability to jump faster to the free spot. I don't understand why this is true, because upon the free we will update the hint and that's where the next bit sea

RE: [net-next 01/15] net/mlx5: DR, Add buddy allocator utilities

2020-09-28 Thread Yevgeny Kliteynik
> From: David Miller > Sent: Sunday, September 27, 2020 01:16 > To: sa...@kernel.org > Cc: k...@kernel.org; netdev@vger.kernel.org; Yevgeny Kliteynik > ; Erez Shitrit ; Mark Bloch > ; Saeed Mahameed > Subject: Re: [net-next 01/15] net/mlx5: DR, Add buddy allocator utilitie

Re: [net-next 01/15] net/mlx5: DR, Add buddy allocator utilities

2020-09-26 Thread David Miller
From: sa...@kernel.org Date: Fri, 25 Sep 2020 12:37:55 -0700 > From: Yevgeny Kliteynik > > Add implementation of SW Steering variation of buddy allocator. > > The buddy system for ICM memory uses 2 main data structures: > - Bitmap per order, that keeps the current state of allocated > blo

[net-next 10/15] net/mlx5: DR, Remove unneeded local variable

2020-09-25 Thread saeed
From: Yevgeny Kliteynik The misc3 variable is used only once and can be dropped. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-

[net-next 04/15] net/mlx5: DR, ICM memory pools sync optimization

2020-09-25 Thread saeed
From: Yevgeny Kliteynik Track the pool's hot ICM memory when freeing/allocating chunk, so that when checking if the sync is required, just check if the pool hot memory has reached the sync threshold. Signed-off-by: Hamdan Igbaria Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Revie

[net-next 13/15] net/mlx5: DR, Rename builders HW specific names

2020-09-25 Thread saeed
From: Yevgeny Kliteynik We will support multiple STE versions. The existing naming is not suitable for newer versions. Removed the HW specific details and renamed with a more general names. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mell

[net-next 01/15] net/mlx5: DR, Add buddy allocator utilities

2020-09-25 Thread saeed
From: Yevgeny Kliteynik Add implementation of SW Steering variation of buddy allocator. The buddy system for ICM memory uses 2 main data structures: - Bitmap per order, that keeps the current state of allocated blocks for this order - Indicator for the number of available blocks per each

[net-next 09/15] net/mlx5: DR, Remove unneeded vlan check from L2 builder

2020-09-25 Thread saeed
From: Yevgeny Kliteynik When we create a matcher we check that all fields are consumed. There is no need for this specific check. This keeps the STE builder functions simple and clean. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/

[net-next 03/15] net/mlx5: DR, Sync chunks only during free

2020-09-25 Thread saeed
From: Yevgeny Kliteynik When freeing chunks, we want to sync the steering so that all the "hot" memory will be written to ICM and all the chunks that are in the hot_list will be actually destroyed. When allocating from the pool, we don't have a need to sync the steering, as we're not freeing anyt

[net-next 08/15] net/mlx5: DR, Remove unneeded check from source port builder

2020-09-25 Thread saeed
From: Yevgeny Kliteynik Mask validity for ste builders is checked by mlx5dr_ste_build_pre_check during matcher creation. It already checks the mask value of source_vport, so removing this duplicated check. Also, moving there the check of source_eswitch_owner_vhca_id mask. Signed-off-by: Alex Ves

[net-next 15/15] net/mlx5: DR, Add support for rule creation with flow source hint

2020-09-25 Thread saeed
From: Hamdan Igbaria Skip the rule according to flow arrival source, in case of RX and the source is local port skip and in case of TX and the source is uplink skip, we get this info according to the flow source hint we get from upper layers when creating the rule. This is needed because for exam

[net-next 11/15] net/mlx5: DR, Call ste_builder directly with tag pointer

2020-09-25 Thread saeed
From: Yevgeny Kliteynik Instead of getting the tag in each function, call the builder directly with the tag. This will allow to use the same function for building the tag and the bitmask. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellan

[net-next 14/15] net/mlx5: DR, Rename matcher functions to be more HW agnostic

2020-09-25 Thread saeed
From: Yevgeny Kliteynik Remove flex parser from the matcher function names since the matcher should not be aware of such HW specific details. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed --- .../mellanox/mlx5/core/steering/dr_cmd.c | 4 +- .

[net-next 02/15] net/mlx5: DR, Handle ICM memory via buddy allocation instead of bucket management

2020-09-25 Thread saeed
From: Yevgeny Kliteynik Till now in order to manage the ICM memory we used bucket mechanism, which kept a bucket per specified size (sizes were between 1 block to 2^21 blocks). Now changing that with buddy-system mechanism, which gives us much more flexible way to manage the ICM memory. Its bigg

[net-next 05/15] net/mlx5: DR, Free buddy ICM memory if it is unused

2020-09-25 Thread saeed
From: Yevgeny Kliteynik Track buddy's used ICM memory, and free it if all of the buddy's memory bacame unused. Do this only for STEs. MODIFY_ACTION buddies are much smaller, so in case there is a large amount of modify_header actions, which result in large amount of MODIFY_ACTION buddies, doing t

[net-next 07/15] net/mlx5: DR, Replace the check for valid STE entry

2020-09-25 Thread saeed
From: Yevgeny Kliteynik Validity check is done by reading the next lu_type from the STE, this check can be replaced by checking the refcount. This will make the check independent on internal STE structure. Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahamee

[net-next 12/15] net/mlx5: DR, Remove unused member of action struct

2020-09-25 Thread saeed
From: Yevgeny Kliteynik Struct mlx5dr_action doesn't use this member Signed-off-by: Erez Shitrit Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h | 1 - 1 file changed, 1 deletion(-) diff

  1   2   >