[PATCH bpf-next v3 00/16] AF_XDP infrastructure improvements and mlx5e support

2019-05-24 Thread Maxim Mikityanskiy
newer bpf-next, resolved conflicts in libbpf. Addressed Björn's comments for coding style. Fixed a bug in error handling flow in mlx5e_open_xsk. Maxim Mikityanskiy (16): xsk: Add API to check for available entries in FQ xsk: Add getsockopt XDP_OPTIONS libbpf: Support getsockopt XDP_OP

[PATCH bpf-next v3 01/16] xsk: Add API to check for available entries in FQ

2019-05-24 Thread Maxim Mikityanskiy
Add a function that checks whether the Fill Ring has the specified amount of descriptors available. It will be useful for mlx5e that wants to check in advance, whether it can allocate a bulk of RX descriptors, to get the best performance. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq

[PATCH bpf-next v3 02/16] xsk: Add getsockopt XDP_OPTIONS

2019-05-24 Thread Maxim Mikityanskiy
Make it possible for the application to determine whether the AF_XDP socket is running in zero-copy mode. To achieve this, add a new getsockopt option XDP_OPTIONS that returns flags. The only flag supported for now is the zero-copy mode indicator. Signed-off-by: Maxim Mikityanskiy Acked-by

[PATCH bpf-next v3 03/16] libbpf: Support getsockopt XDP_OPTIONS

2019-05-24 Thread Maxim Mikityanskiy
Query XDP_OPTIONS in libbpf to determine if the zero-copy mode is active or not. Signed-off-by: Maxim Mikityanskiy Acked-by: Saeed Mahameed --- tools/lib/bpf/xsk.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c index 38667b62f1fe

[PATCH bpf-next v3 07/16] net/mlx5e: Replace deprecated PCI_DMA_TODEVICE

2019-05-24 Thread Maxim Mikityanskiy
The PCI API for DMA is deprecated, and PCI_DMA_TODEVICE is just defined to DMA_TO_DEVICE for backward compatibility. Just use DMA_TO_DEVICE. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 +- 1 file

[PATCH bpf-next v3 11/16] net/mlx5e: Share the XDP SQ for XDP_TX between RQs

2019-05-24 Thread Maxim Mikityanskiy
previous patches. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 4 ++- .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 20 +++--- .../net/ethernet/mellanox/mlx5/core/en/xdp.h | 4 +-- .../net

[PATCH bpf-next v3 13/16] net/mlx5e: Consider XSK in XDP MTU limit calculation

2019-05-24 Thread Maxim Mikityanskiy
Use the existing mlx5e_get_linear_rq_headroom function to calculate the headroom for mlx5e_xdp_max_mtu. This function takes the XSK headroom into consideration, which will be used in the following patches. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed

[PATCH bpf-next v3 10/16] net/mlx5e: Refactor struct mlx5e_xdp_info

2019-05-24 Thread Maxim Mikityanskiy
| Completion Ring. On send, the same set of mlx5e_xdp_xmit_data fields is used in all flows: DMA and virtual addresses and length. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 46 +-- .../n

[PATCH bpf-next v3 08/16] net/mlx5e: Calculate linear RX frag size considering XSK

2019-05-24 Thread Maxim Mikityanskiy
support for XSK is introduced. Use this function in the implementation of mlx5e_get_rq_headroom. Change headroom to u32 to match the headroom field in struct xdp_umem. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- .../ethernet/mellanox/mlx5/core/en

[PATCH bpf-next v3 06/16] xsk: Return the whole xdp_desc from xsk_umem_consume_tx

2019-05-24 Thread Maxim Mikityanskiy
. Adapt the implementation of i40e and ixgbe to this change. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed Cc: Björn Töpel Cc: Magnus Karlsson --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 12 +++- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c

[PATCH bpf-next v3 14/16] net/mlx5e: Encapsulate open/close queues into a function

2019-05-24 Thread Maxim Mikityanskiy
Create new functions mlx5e_{open,close}_queues to encapsulate opening and closing RQs and SQs, and call the new functions from mlx5e_{open,close}_channel. It simplifies the existing functions a bit and prepares them for the upcoming AF_XDP changes. Signed-off-by: Maxim Mikityanskiy Reviewed-by

[PATCH bpf-next v3 12/16] net/mlx5e: XDP_TX from UMEM support

2019-05-24 Thread Maxim Mikityanskiy
in the end unmap it and call xdp_return_frame. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 50 --- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet

[PATCH bpf-next v3 09/16] net/mlx5e: Allow ICO SQ to be used by multiple RQs

2019-05-24 Thread Maxim Mikityanskiy
WQEs") is reverted. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 9 +++ .../net/ethernet/mellanox/mlx5/core/en_rx.c | 27 +++ .../net/ethernet/mellanox/mlx5/core/en_txrx.c | 4 +

[PATCH bpf-next v3 05/16] xsk: Change the default frame size to 4096 and allow controlling it

2019-05-24 Thread Maxim Mikityanskiy
. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- samples/bpf/xdpsock_user.c | 44 -- tools/lib/bpf/xsk.h| 2 +- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/samples/bpf/xdpsock_user.c b/samples

[PATCH bpf-next v3 15/16] net/mlx5e: Move queue param structs to en/params.h

2019-05-24 Thread Maxim Mikityanskiy
structs mlx5e_{rq,sq,cq,channel}_param are going to be used in the upcoming XSK RX and TX patches. Move them to a header file to make them accessible from other C files. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- .../ethernet/mellanox/mlx5/core/en

[PATCH bpf-next v3 04/16] xsk: Extend channels to support combined XSK/non-XSK traffic

2019-05-24 Thread Maxim Mikityanskiy
gnore the flag in the XDP program (implemented in the reference XDP program in libbpf). mlx5e will support this extension. A single XDP program can run both with drivers supporting or not supporting this extension. The xdpsock sample and libbpf are updated accordingly. Signed-off-by: Maxim Mikityanskiy

[PATCH net-next v2] net/mlx5e: xsk: dynamically allocate mlx5e_channel_param

2019-07-23 Thread Maxim Mikityanskiy
() instead. Fixes: a038e9794541 ("net/mlx5e: Add XSK zero-copy support") Signed-off-by: Arnd Bergmann Signed-off-by: Maxim Mikityanskiy --- v2 changes: use kvzalloc/kvfree and fix a memory leak. .../mellanox/mlx5/core/en/xsk/setup.c | 27 --- 1 file changed,

Re: [PATCH bpf-next v3 03/11] xsk: add support to allow unaligned chunk placement

2019-07-25 Thread Maxim Mikityanskiy
On 2019-07-24 08:10, Kevin Laatz wrote: > Currently, addresses are chunk size aligned. This means, we are very > restricted in terms of where we can place chunk within the umem. For > example, if we have a chunk size of 2k, then our chunks can only be placed > at 0,2k,4k,6k,8k... and so on (ie. eve

Re: [PATCH bpf-next v3 08/11] samples/bpf: add unaligned chunks mode support to xdpsock

2019-07-25 Thread Maxim Mikityanskiy
On 2019-07-24 08:10, Kevin Laatz wrote: > This patch adds support for the unaligned chunks mode. The addition of the > unaligned chunks option will allow users to run the application with more > relaxed chunk placement in the XDP umem. > > Unaligned chunks mode can be used with the '-u' or '--unal

Re: [PATCH bpf-next v3 03/11] xsk: add support to allow unaligned chunk placement

2019-07-25 Thread Maxim Mikityanskiy
On 2019-07-24 08:10, Kevin Laatz wrote: > Currently, addresses are chunk size aligned. This means, we are very > restricted in terms of where we can place chunk within the umem. For > example, if we have a chunk size of 2k, then our chunks can only be placed > at 0,2k,4k,6k,8k... and so on (ie. eve

Re: [PATCH bpf-next v3 06/11] mlx5e: modify driver for handling offsets

2019-07-25 Thread Maxim Mikityanskiy
On 2019-07-24 08:10, Kevin Laatz wrote: > With the addition of the unaligned chunks option, we need to make sure we > handle the offsets accordingly based on the mode we are currently running > in. This patch modifies the driver to appropriately mask the address for > each case. > > Signed-off-by:

Re: [PATCH bpf-next v4 07/11] mlx5e: modify driver for handling offsets

2019-08-01 Thread Maxim Mikityanskiy
On 2019-07-30 11:53, Kevin Laatz wrote: > With the addition of the unaligned chunks option, we need to make sure we > handle the offsets accordingly based on the mode we are currently running > in. This patch modifies the driver to appropriately mask the address for > each case. > > Signed-off-by:

[PATCH bpf] xsk: Clear pool even for inactive queues

2021-01-18 Thread Maxim Mikityanskiy
d TX queues, regardless of real_num_*_queues, still taking into consideration num_*_queues to avoid overflows. Fixes: 1c1efc2af158 ("xsk: Create and free buffer pool independently from umem") Fixes: a41b4f3c58dd ("xsk: simplify xdp_clear_umem_at_qid implementation") Signed-off-by: M

[PATCH net-next v4 1/5] net: sched: Add multi-queue support to sch_tree_lock

2021-01-19 Thread Maxim Mikityanskiy
qdisc itself if it's the MQROOT. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- include/net/sch_generic.h | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 639e465a108f..9448e8cf1ee6

[PATCH net-next v4 2/5] net: sched: Add extack to Qdisc_class_ops.delete

2021-01-19 Thread Maxim Mikityanskiy
In a following commit, sch_htb will start using extack in the delete class operation to pass hardware errors in offload mode. This commit prepares for that by adding the extack parameter to this callback and converting usage of the existing qdiscs. Signed-off-by: Maxim Mikityanskiy Reviewed-by

[PATCH net-next v4 0/5] HTB offload

2021-01-19 Thread Maxim Mikityanskiy
explanations of how it works in the commit message. Remove %hu from format strings. Add resiliency when leaf_del_last fails to create a new leaf node. Maxim Mikityanskiy (5): net: sched: Add multi-queue support to sch_tree_lock net: sched: Add extack to Qdisc_class_ops.delete sch_htb: Hierarchical

[PATCH net-next v4 3/5] sch_htb: Hierarchical QoS hardware offload

2021-01-19 Thread Maxim Mikityanskiy
t enabled by default, a new parameter is used to enable it: # tc qdisc replace dev eth0 root handle 1: htb offload Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- include/linux/netdevice.h| 1 + include/net/pkt_cls.h| 36 ++ include/ua

[PATCH net-next v4 5/5] net/mlx5e: Support HTB offload

2021-01-19 Thread Maxim Mikityanskiy
), and * is the counter name (the counters are the same as for the normal SQs). Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/Makefile | 6 +- drivers/net/ethernet/mellanox/mlx5/core/en.h | 27 +- .../ethernet/mellanox/mlx5/core/en/params.h

[PATCH net-next v4 4/5] sch_htb: Stats for offloaded HTB

2021-01-19 Thread Maxim Mikityanskiy
This commit adds support for statistics of offloaded HTB. Bytes and packets counters for leaf and inner nodes are supported, the values are taken from per-queue qdiscs, and the numbers that the user sees should have the same behavior as the software (non-offloaded) HTB. Signed-off-by: Maxim

Re: [PATCH bpf-next v2 0/8] Introduce bpf_redirect_xsk() helper

2021-01-20 Thread Maxim Mikityanskiy
On 2021-01-19 17:50, Björn Töpel wrote: This series extends bind() for XDP sockets, so that the bound socket is added to the netdev_rx_queue _rx array in the netdevice. We call this to register the socket. To redirect packets to the registered socket, a new BPF helper is used: bpf_redirect_xsk().

Re: [PATCH net-next 3/4] sch_htb: Stats for offloaded HTB

2020-12-10 Thread Maxim Mikityanskiy
On 2020-12-10 10:28, Dan Carpenter wrote: Hi Maxim, url: https://github.com/0day-ci/linux/commits/Maxim-Mikityanskiy/HTB-offload/20201210-000703 base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git afae3cc2da100ead3cd6ef4bb1fb8bc9d4b817c5 config: i386-randconfig-m021

Re: [PATCH net-next 3/4] sch_htb: Stats for offloaded HTB

2020-12-11 Thread Maxim Mikityanskiy
On 2020-12-11 10:41, Dan Carpenter wrote: On Thu, Dec 10, 2020 at 05:07:28PM +0200, Maxim Mikityanskiy wrote: On 2020-12-10 10:28, Dan Carpenter wrote: Hi Maxim, url: https://github.com/0day-ci/linux/commits/Maxim-Mikityanskiy/HTB-offload/20201210-000703 base: https://git.kernel.org/pub

[PATCH net-next v2 1/4] net: sched: Add multi-queue support to sch_tree_lock

2020-12-11 Thread Maxim Mikityanskiy
qdisc itself if it's the MQROOT. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- include/net/sch_generic.h | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 162ed6249e8b..cfac2b0b5cc7

[PATCH net-next v2 2/4] sch_htb: Hierarchical QoS hardware offload

2020-12-11 Thread Maxim Mikityanskiy
ted, the granularity of rate and ceil parameters may be different, etc. - so, the offload is not enabled by default, a new parameter is used to enable it: # tc qdisc replace dev eth0 root handle 1: htb offload Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- inclu

[PATCH net-next v2 3/4] sch_htb: Stats for offloaded HTB

2020-12-11 Thread Maxim Mikityanskiy
This commit adds support for statistics of offloaded HTB. Bytes and packets counters for leaf and inner nodes are supported, the values are taken from per-queue qdiscs, and the numbers that the user sees should have the same behavior as the software (non-offloaded) HTB. Signed-off-by: Maxim

[PATCH net-next v2 0/4] HTB offload

2020-12-11 Thread Maxim Mikityanskiy
to 80 chars per line. Maxim Mikityanskiy (4): net: sched: Add multi-queue support to sch_tree_lock sch_htb: Hierarchical QoS hardware offload sch_htb: Stats for offloaded HTB net/mlx5e: Support HTB offload .../net/ethernet/mellanox/mlx5/core/Makefile | 6 +- drivers/net/ethernet

[PATCH net-next v2 4/4] net/mlx5e: Support HTB offload

2020-12-11 Thread Maxim Mikityanskiy
), and * is the counter name (the counters are the same as for the normal SQs). Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/Makefile | 6 +- drivers/net/ethernet/mellanox/mlx5/core/en.h | 27 +- .../ethernet/mellanox/mlx5/core/en/params.h

Re: [PATCH net-next v2 2/4] sch_htb: Hierarchical QoS hardware offload

2020-12-14 Thread Maxim Mikityanskiy
On 2020-12-11 21:16, Cong Wang wrote: On Fri, Dec 11, 2020 at 7:26 AM Maxim Mikityanskiy wrote: HTB doesn't scale well because of contention on a single lock, and it also consumes CPU. This patch adds support for offloading HTB to hardware that supports hierarchical rate limiting.

Re: [PATCH net-next v2 2/4] sch_htb: Hierarchical QoS hardware offload

2020-12-14 Thread Maxim Mikityanskiy
On 2020-12-14 21:35, Cong Wang wrote: On Mon, Dec 14, 2020 at 7:13 AM Maxim Mikityanskiy wrote: On 2020-12-11 21:16, Cong Wang wrote: On Fri, Dec 11, 2020 at 7:26 AM Maxim Mikityanskiy wrote: HTB doesn't scale well because of contention on a single lock, and it also consumes CPU.

[PATCH iproute2-next] tc/htb: Hierarchical QoS hardware offload

2020-12-14 Thread Maxim Mikityanskiy
lasses are created as usual, but filters should be moved to clsact for lock-free classification (filters attached to HTB itself are not supported in the offload mode): # tc filter add dev eth0 egress protocol ip flower dst_port 80 action skbedit priority 1:10 Signed-off-by: Maxim Mi

[PATCH net-next v3 1/4] net: sched: Add multi-queue support to sch_tree_lock

2020-12-14 Thread Maxim Mikityanskiy
qdisc itself if it's the MQROOT. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- include/net/sch_generic.h | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 162ed6249e8b..cfac2b0b5cc7

[PATCH net-next v3 0/4] HTB offload

2020-12-14 Thread Maxim Mikityanskiy
to 80 chars per line. v3 changes: Fixed the CI failure on parisc with 16-bit xchg by replacing it with WRITE_ONCE. Fixed the capability bits in mlx5_ifc.h and the value of MLX5E_QOS_MAX_LEAF_NODES. Maxim Mikityanskiy (4): net: sched: Add multi-queue support to sch_tree_lock sch_htb

[PATCH net-next v3 3/4] sch_htb: Stats for offloaded HTB

2020-12-14 Thread Maxim Mikityanskiy
This commit adds support for statistics of offloaded HTB. Bytes and packets counters for leaf and inner nodes are supported, the values are taken from per-queue qdiscs, and the numbers that the user sees should have the same behavior as the software (non-offloaded) HTB. Signed-off-by: Maxim

[PATCH net-next v3 4/4] net/mlx5e: Support HTB offload

2020-12-14 Thread Maxim Mikityanskiy
), and * is the counter name (the counters are the same as for the normal SQs). Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/Makefile | 6 +- drivers/net/ethernet/mellanox/mlx5/core/en.h | 27 +- .../ethernet/mellanox/mlx5/core/en/params.h

[PATCH net-next v3 2/4] sch_htb: Hierarchical QoS hardware offload

2020-12-14 Thread Maxim Mikityanskiy
ted, the granularity of rate and ceil parameters may be different, etc. - so, the offload is not enabled by default, a new parameter is used to enable it: # tc qdisc replace dev eth0 root handle 1: htb offload Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- inclu

Re: [PATCH net-next v2 2/4] sch_htb: Hierarchical QoS hardware offload

2020-12-16 Thread Maxim Mikityanskiy
On 2020-12-15 18:37, Jamal Hadi Salim wrote: On 2020-12-14 3:30 p.m., Maxim Mikityanskiy wrote: On 2020-12-14 21:35, Cong Wang wrote: On Mon, Dec 14, 2020 at 7:13 AM Maxim Mikityanskiy wrote: On 2020-12-11 21:16, Cong Wang wrote: On Fri, Dec 11, 2020 at 7:26 AM Maxim Mikityanskiy wrote

Re: [PATCH net-next v2 2/4] sch_htb: Hierarchical QoS hardware offload

2020-12-17 Thread Maxim Mikityanskiy
On 2020-12-16 21:01, Cong Wang wrote: On Mon, Dec 14, 2020 at 12:30 PM Maxim Mikityanskiy wrote: On 2020-12-14 21:35, Cong Wang wrote: On Mon, Dec 14, 2020 at 7:13 AM Maxim Mikityanskiy wrote: On 2020-12-11 21:16, Cong Wang wrote: On Fri, Dec 11, 2020 at 7:26 AM Maxim Mikityanskiy wrote

Re: [PATCH net-next v2 2/4] sch_htb: Hierarchical QoS hardware offload

2020-12-18 Thread Maxim Mikityanskiy
On 2020-12-17 17:09, Jamal Hadi Salim wrote: On 2020-12-16 6:47 a.m., Maxim Mikityanskiy wrote: On 2020-12-15 18:37, Jamal Hadi Salim wrote: [..] Same question above: Is there a limit to the number of classes that can be created? Yes, the commit message of the mlx5 patch lists the

Re: [PATCH bpf] xdp: Handle MEM_TYPE_XSK_BUFF_POOL correctly in xdp_return_buff()

2020-11-30 Thread Maxim Mikityanskiy
program that drops the buffer. This change simply puts the handling of MEM_TYPE_XSK_BUFF_POOL back into xdp_return_buff(). Reported-by: Maxim Mikityanskiy Fixes: 82c41671ca4f ("xdp: Simplify xdp_return_{frame, frame_rx_napi, buff}") Signed-off-by: Björn Töpel Thanks for addre

[PATCH net-next 0/4] HTB offload

2020-12-09 Thread Maxim Mikityanskiy
14.2 times in the UDP multi-stream test, compared to software HTB implementation (more details in the mlx5 patch). [1]: https://www.spinics.net/lists/netdev/msg628422.html [2]: https://www.spinics.net/lists/netdev/msg663548.html Maxim Mikityanskiy (4): net: sched: Add multi-queue support to

[PATCH net-next 1/4] net: sched: Add multi-queue support to sch_tree_lock

2020-12-09 Thread Maxim Mikityanskiy
qdisc itself if it's the MQROOT. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- include/net/sch_generic.h | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 162ed6249e8b..cfac2b0b5cc7

[PATCH net-next 3/4] sch_htb: Stats for offloaded HTB

2020-12-09 Thread Maxim Mikityanskiy
This commit adds support for statistics of offloaded HTB. Bytes and packets counters for leaf and inner nodes are supported, the values are taken from per-queue qdiscs, and the numbers that the user sees should have the same behavior as the software (non-offloaded) HTB. Signed-off-by: Maxim

[PATCH net-next 4/4] net/mlx5e: Support HTB offload

2020-12-09 Thread Maxim Mikityanskiy
), and * is the counter name (the counters are the same as for the normal SQs). Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- .../net/ethernet/mellanox/mlx5/core/Makefile | 6 +- drivers/net/ethernet/mellanox/mlx5/core/en.h | 27 +- .../ethernet/mellanox/mlx5/core/en/params.h

[PATCH net-next 2/4] sch_htb: Hierarchical QoS hardware offload

2020-12-09 Thread Maxim Mikityanskiy
ted, the granularity of rate and ceil parameters may be different, etc. - so, the offload is not enabled by default, a new parameter is used to enable it: # tc qdisc replace dev eth0 root handle 1: htb offload Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- inclu

Re: [PATCH net-next v3 2/4] sch_htb: Hierarchical QoS hardware offload

2021-01-04 Thread Maxim Mikityanskiy
On 2020-12-22 03:17, Jakub Kicinski wrote: On Tue, 15 Dec 2020 09:42:11 +0200 Maxim Mikityanskiy wrote: + q->offload = nla_get_flag(tb[TCA_HTB_OFFLOAD]); + + if (q->offload) { + if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc) +

Re: [net 4/9] net/mlx5e: Fix refcount leak on kTLS RX resync

2020-11-05 Thread Maxim Mikityanskiy
On 2020-11-05 00:59, Jakub Kicinski wrote: On Tue, 3 Nov 2020 11:18:25 -0800 Saeed Mahameed wrote: From: Maxim Mikityanskiy On resync, the driver calls inet_lookup_established (__inet6_lookup_established) that increases sk_refcnt of the socket. To decrease it, the driver set skb->destruc

[PATCH iproute2-next v2] tc/htb: Hierarchical QoS hardware offload

2021-01-26 Thread Maxim Mikityanskiy
lasses are created as usual, but filters should be moved to clsact for lock-free classification (filters attached to HTB itself are not supported in the offload mode): # tc filter add dev eth0 egress protocol ip flower dst_port 80 action skbedit priority 1:10 Signed-off-by: Maxim Mikityanskiy R

Re: [PATCH iproute2-next] tc/htb: Hierarchical QoS hardware offload

2021-02-02 Thread Maxim Mikityanskiy
On 2021-01-29 18:05, David Ahern wrote: On 12/15/20 12:42 AM, Maxim Mikityanskiy wrote: This commit adds support for configuring HTB in offload mode. HTB offload eliminates the single qdisc lock in the datapath and offloads the algorithm to the NIC. The new 'offload' parameter i

Re: [syzbot] BUG: unable to handle kernel NULL pointer dereference in htb_select_queue

2021-03-10 Thread Maxim Mikityanskiy
: Maxim Mikityanskiy Date: Tue Jan 19 12:08:13 2021 + sch_htb: Hierarchical QoS hardware offload bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=13ab12ecd0 final oops: https://syzkaller.appspot.com/x/report.txt?x=106b12ecd0 console output: https

Re: [syzbot] BUG: unable to handle kernel NULL pointer dereference in htb_select_queue

2021-03-10 Thread Maxim Mikityanskiy
On 2021-03-10 19:03, Eric Dumazet wrote: On 3/10/21 3:54 PM, Maxim Mikityanskiy wrote: On 2021-03-09 17:20, Eric Dumazet wrote: On 3/9/21 4:13 PM, syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:    38b5133a octeontx2-pf: Fix otx2_get_fecparam() git tree:   net

[PATCH net 0/2] Bugfixes for HTB

2021-03-11 Thread Maxim Mikityanskiy
The HTB offload feature introduced a few bugs in HTB. One affects the non-offload mode, preventing attaching qdiscs to HTB classes, and the other affects the error flow, when the netdev doesn't support the offload, but it was requested. This short series fixes them. Maxim Mikityansk

[PATCH net 2/2] sch_htb: Fix offload cleanup in htb_destroy on htb_init failure

2021-03-11 Thread Maxim Mikityanskiy
Hierarchical QoS hardware offload") Suggested-by: Eric Dumazet Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- net/sched/sch_htb.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index b23203159996

[PATCH net 1/2] sch_htb: Fix select_queue for non-offload mode

2021-03-11 Thread Maxim Mikityanskiy
pspotmail.com Fixes: d03b195b5aa0 ("sch_htb: Hierarchical QoS hardware offload") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- net/sched/sch_htb.c | 4 1 file changed, 4 insertions(+) diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index dff3adf5a915..b23203

Re: [PATCH net-next v3 15/16] net/mlx5e: take the rtnl lock when calling netif_set_xps_queue

2021-03-15 Thread Maxim Mikityanskiy
On 2021-03-15 10:38, Antoine Tenart wrote: Quoting Saeed Mahameed (2021-03-12 21:54:18) On Fri, 2021-03-12 at 16:04 +0100, Antoine Tenart wrote: netif_set_xps_queue must be called with the rtnl lock taken, and this is now enforced using ASSERT_RTNL(). mlx5e_attach_netdev was taking the lock con

[PATCH iproute2-next v3] tc/htb: Hierarchical QoS hardware offload

2021-02-04 Thread Maxim Mikityanskiy
uot;,"handle":"0:","parent":"1:","options":{"limit":1000}},{"kind":"pfifo","handle":"0:","parent":"1:","options":{"limit":1000}},{"kind":"pfifo&qu

[RFC PATCH net] bonding: Work around lockdep_is_held false positives

2021-03-22 Thread Maxim Mikityanskiy
t use xmit_hash") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan --- While this patch works around the issue, I would like to discuss better options. Another straightforward approach is to extend lockdep API with lockdep_is_not_held(), which will be basically !lockdep_is_held() wh

Re: [PATCH] net/mlx5: Fix a potential use after free in mlx5e_ktls_del_rx

2021-03-23 Thread Maxim Mikityanskiy
On 2021-03-22 16:21, Lv Yunlong wrote: My static analyzer tool reported a potential uaf in mlx5e_ktls_del_rx. In this function, if the condition cancel_work_sync(&resync->work) is true, and then priv_rx could be freed. But priv_rx is used later. I'm unfamiliar with how this function works. Maybe

Re: [RFC PATCH net] bonding: Work around lockdep_is_held false positives

2021-03-23 Thread Maxim Mikityanskiy
On 2021-03-22 16:09, Leon Romanovsky wrote: On Mon, Mar 22, 2021 at 02:38:46PM +0200, Maxim Mikityanskiy wrote: After lockdep gets triggered for the first time, it gets disabled, and lockdep_enabled() will return false. It will affect lockdep_is_held(), which will start returning true all the

Re: [RFC PATCH net] bonding: Work around lockdep_is_held false positives

2021-03-23 Thread Maxim Mikityanskiy
On 2021-03-23 19:56, Jay Vosburgh wrote: Maxim Mikityanskiy wrote: On 2021-03-22 16:09, Leon Romanovsky wrote: On Mon, Mar 22, 2021 at 02:38:46PM +0200, Maxim Mikityanskiy wrote: After lockdep gets triggered for the first time, it gets disabled, and lockdep_enabled() will return false. It

[PATCH net 2/3] ethtool: Account for hw_features in netlink interface

2020-08-14 Thread Maxim Mikityanskiy
-tx-offload: on [fixed] Fitler out dev->hw_features from req_wanted to fix it and to resemble the legacy ethtool behavior. Signed-off-by: Maxim Mikityanskiy --- net/ethtool/features.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ethtool/features.c b/net/e

[PATCH net 0/3] ethtool-netlink bug fixes

2020-08-14 Thread Maxim Mikityanskiy
userspace tool. Maxim Mikityanskiy (3): ethtool: Fix preserving of wanted feature bits in netlink interface ethtool: Account for hw_features in netlink interface ethtool: Don't omit the netlink reply if no features were changed net/ethtool/features.c | 19 ++- 1 file change

[PATCH net 1/3] ethtool: Fix preserving of wanted feature bits in netlink interface

2020-08-14 Thread Maxim Mikityanskiy
is commit fixes it by changing the formula to: (req_wanted & req_mask) | (old_wanted & ~req_mask), where old_active was replaced by old_wanted to account for the wanted bits. The shortcut condition for the case where nothing was changed now compares wanted bitmasks, instead of wanted to act

[PATCH ethtool 1/2] netlink: Fix the condition for displaying actual changes

2020-08-14 Thread Maxim Mikityanskiy
from active_mask to avoid reacting on bit changes that we asked for. The new condition now matches the ifs in the loop above that print "[requested on/off]" and "[not requested]". Signed-off-by: Maxim Mikityanskiy --- netlink/features.c | 2 +- 1 file changed, 1 insertion

[PATCH net 3/3] ethtool: Don't omit the netlink reply if no features were changed

2020-08-14 Thread Maxim Mikityanskiy
-netlink always return a reply when requested, and it still avoids unnecessary calls to __netdev_update_features if the wanted features haven't changed. Signed-off-by: Maxim Mikityanskiy --- net/ethtool/features.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/net/

[PATCH ethtool 2/2] netlink: Print and return an error when features weren't changed

2020-08-14 Thread Maxim Mikityanskiy
d all bits got to wanted. Signed-off-by: Maxim Mikityanskiy --- netlink/features.c | 25 ++--- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/netlink/features.c b/netlink/features.c index 133529d..4f63fa2 100644 --- a/netlink/features.c +++ b/netlink/featu

[PATCH ethtool 0/2] ethtool-netlink compatibility fixes

2020-08-14 Thread Maxim Mikityanskiy
This series contains fixes for ethtool-netlink to make the behavior similar to the legacy ethtool and avoid regressions caused by differences in behavior between the old and the new tool. Please also see the sibling series for the kernel. Maxim Mikityanskiy (2): netlink: Fix the condition for

[PATCH net v2 1/3] ethtool: Fix preserving of wanted feature bits in netlink interface

2020-08-17 Thread Maxim Mikityanskiy
tive. Fixes: 0980bfcd6954 ("ethtool: set netdev features with FEATURES_SET request") Signed-off-by: Maxim Mikityanskiy --- net/ethtool/features.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/net/ethtool/features.c b/net/ethtool/features.c index 4e632dc

[PATCH net v2 2/3] ethtool: Account for hw_features in netlink interface

2020-08-17 Thread Maxim Mikityanskiy
-tx-offload: on [fixed] Fitler out dev->hw_features from req_wanted to fix it and to resemble the legacy ethtool behavior. Fixes: 0980bfcd6954 ("ethtool: set netdev features with FEATURES_SET request") Signed-off-by: Maxim Mikityanskiy --- net/ethtool/features.c | 3 ++- 1

[PATCH net v2 0/3] ethtool-netlink bug fixes

2020-08-17 Thread Maxim Mikityanskiy
userspace tool. v2 changes: Added Fixes tags. Maxim Mikityanskiy (3): ethtool: Fix preserving of wanted feature bits in netlink interface ethtool: Account for hw_features in netlink interface ethtool: Don't omit the netlink reply if no features were changed net/ethtool/features.c

[PATCH net v2 3/3] ethtool: Don't omit the netlink reply if no features were changed

2020-08-17 Thread Maxim Mikityanskiy
-netlink always return a reply when requested, and it still avoids unnecessary calls to __netdev_update_features if the wanted features haven't changed. Fixes: 0980bfcd6954 ("ethtool: set netdev features with FEATURES_SET request") Signed-off-by: Maxim Mikityanskiy --- net/ethtool/featu

[PATCH bpf-next v4 03/17] xsk: Add getsockopt XDP_OPTIONS

2019-06-12 Thread Maxim Mikityanskiy
Make it possible for the application to determine whether the AF_XDP socket is running in zero-copy mode. To achieve this, add a new getsockopt option XDP_OPTIONS that returns flags. The only flag supported for now is the zero-copy mode indicator. Signed-off-by: Maxim Mikityanskiy Reviewed-by

[PATCH bpf-next v4 02/17] xsk: Add API to check for available entries in FQ

2019-06-12 Thread Maxim Mikityanskiy
Add a function that checks whether the Fill Ring has the specified amount of descriptors available. It will be useful for mlx5e that wants to check in advance, whether it can allocate a bulk of RX descriptors, to get the best performance. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq

[PATCH bpf-next v4 01/17] net/mlx5e: Attach/detach XDP program safely

2019-06-12 Thread Maxim Mikityanskiy
ed or disabled. However, it's performed in an unsafe way: if the new channels fail to open, the old ones are already closed, and the interface goes down. Use the safe way to switch channels instead. The same way is already used for other configuration changes. Signed-off-by: Maxim Mikityanskiy R

[PATCH bpf-next v4 04/17] libbpf: Support getsockopt XDP_OPTIONS

2019-06-12 Thread Maxim Mikityanskiy
Query XDP_OPTIONS in libbpf to determine if the zero-copy mode is active or not. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- tools/lib/bpf/xsk.c | 12 1 file changed, 12 insertions(+) diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf

[PATCH bpf-next v4 08/17] net/mlx5e: Replace deprecated PCI_DMA_TODEVICE

2019-06-12 Thread Maxim Mikityanskiy
The PCI API for DMA is deprecated, and PCI_DMA_TODEVICE is just defined to DMA_TO_DEVICE for backward compatibility. Just use DMA_TO_DEVICE. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 2 +- 1 file

[PATCH bpf-next v4 05/17] xsk: Change the default frame size to 4096 and allow controlling it

2019-06-12 Thread Maxim Mikityanskiy
. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- samples/bpf/xdpsock_user.c | 44 -- tools/lib/bpf/xsk.h| 2 +- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/samples/bpf/xdpsock_user.c b/samples

[PATCH bpf-next v4 12/17] net/mlx5e: Share the XDP SQ for XDP_TX between RQs

2019-06-12 Thread Maxim Mikityanskiy
previous patches. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 4 ++- .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 20 +++--- .../net/ethernet/mellanox/mlx5/core/en/xdp.h | 4 +-- .../net

[PATCH bpf-next v4 10/17] net/mlx5e: Allow ICO SQ to be used by multiple RQs

2019-06-12 Thread Maxim Mikityanskiy
WQEs") is reverted. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 9 +++ .../net/ethernet/mellanox/mlx5/core/en_rx.c | 27 +++ .../net/ethernet/mellanox/mlx5/core/en_txrx.c | 4 +

[PATCH bpf-next v4 07/17] libbpf: Support drivers with non-combined channels

2019-06-12 Thread Maxim Mikityanskiy
). libbpf shouldn't limit applications to a lower max queue number. Account for non-combined RX and TX channels when calculating the max queue number. Use the same formula that is used in ethtool. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- tool

[PATCH bpf-next v4 13/17] net/mlx5e: XDP_TX from UMEM support

2019-06-12 Thread Maxim Mikityanskiy
in the end unmap it and call xdp_return_frame. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 50 --- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet

[PATCH bpf-next v4 11/17] net/mlx5e: Refactor struct mlx5e_xdp_info

2019-06-12 Thread Maxim Mikityanskiy
| Completion Ring. On send, the same set of mlx5e_xdp_xmit_data fields is used in all flows: DMA and virtual addresses and length. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 46 +-- .../n

[PATCH bpf-next v4 15/17] net/mlx5e: Encapsulate open/close queues into a function

2019-06-12 Thread Maxim Mikityanskiy
Create new functions mlx5e_{open,close}_queues to encapsulate opening and closing RQs and SQs, and call the new functions from mlx5e_{open,close}_channel. It simplifies the existing functions a bit and prepares them for the upcoming AF_XDP changes. Signed-off-by: Maxim Mikityanskiy Reviewed-by

[PATCH bpf-next v4 14/17] net/mlx5e: Consider XSK in XDP MTU limit calculation

2019-06-12 Thread Maxim Mikityanskiy
Use the existing mlx5e_get_linear_rq_headroom function to calculate the headroom for mlx5e_xdp_max_mtu. This function takes the XSK headroom into consideration, which will be used in the following patches. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed

[PATCH bpf-next v4 09/17] net/mlx5e: Calculate linear RX frag size considering XSK

2019-06-12 Thread Maxim Mikityanskiy
support for XSK is introduced. Use this function in the implementation of mlx5e_get_rq_headroom. Change headroom to u32 to match the headroom field in struct xdp_umem. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- .../ethernet/mellanox/mlx5/core/en

[PATCH bpf-next v4 06/17] xsk: Return the whole xdp_desc from xsk_umem_consume_tx

2019-06-12 Thread Maxim Mikityanskiy
. Adapt the implementation of i40e and ixgbe to this change. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed Cc: Björn Töpel Cc: Magnus Karlsson --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 12 +++- drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c

[PATCH bpf-next v4 16/17] net/mlx5e: Move queue param structs to en/params.h

2019-06-12 Thread Maxim Mikityanskiy
structs mlx5e_{rq,sq,cq,channel}_param are going to be used in the upcoming XSK RX and TX patches. Move them to a header file to make them accessible from other C files. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Acked-by: Saeed Mahameed --- .../ethernet/mellanox/mlx5/core/en

[PATCH bpf-next v4 00/17] AF_XDP infrastructure improvements and mlx5e support

2019-06-12 Thread Maxim Mikityanskiy
uff from this one. Added "libbpf: Support drivers with non-combined channels", which aligns the condition in libbpf with the condition in the kernel. Rebased over the newer bpf-next. Maxim Mikityanskiy (17): net/mlx5e: Attach/detach XDP program safely xsk: Add API to check for available

[PATCH bpf-next] net: Don't uninstall an XDP program when none is installed

2019-06-12 Thread Maxim Mikityanskiy
no XDP program attached. The drivers typically perform some heavy operations on XDP_SETUP_PROG, so they all have to handle this case internally to return early if it happens. This patch puts this check into the kernel code, so that all drivers will benefit from it. Signed-off-by: Maxim Mikityan

Re: [PATCH bpf-next v4 00/17] AF_XDP infrastructure improvements and mlx5e support

2019-06-13 Thread Maxim Mikityanskiy
On 2019-06-13 15:58, Björn Töpel wrote: > On Wed, 12 Jun 2019 at 22:49, Jakub Kicinski > wrote: >> >> On Wed, 12 Jun 2019 15:56:33 +, Maxim Mikityanskiy wrote: >>> UAPI is not changed, XSK RX queues are exposed to the kernel. The lower >>> half of the avail

Re: [PATCH bpf-next v4 05/17] xsk: Change the default frame size to 4096 and allow controlling it

2019-06-13 Thread Maxim Mikityanskiy
On 2019-06-12 23:10, Jakub Kicinski wrote: > On Wed, 12 Jun 2019 15:56:43 +0000, Maxim Mikityanskiy wrote: >> The typical XDP memory scheme is one packet per page. Change the AF_XDP >> frame size in libbpf to 4096, which is the page size on x86, to allow >> libbpf to be used

  1   2   3   >