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

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: [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

[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-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 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 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 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: [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

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

[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

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

[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 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().

[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

[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 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 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 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

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: [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 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-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

[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

[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 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 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 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

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.

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.

[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

[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 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 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 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

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

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

[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

[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

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

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

Re: [PATCH bpf-next 0/6] xsk: exit NAPI loop when AF_XDP Rx ring is full

2020-09-08 Thread Maxim Mikityanskiy
On 2020-09-04 16:59, Björn Töpel wrote: On 2020-09-04 15:53, Björn Töpel wrote: This series addresses a problem that arises when AF_XDP zero-copy is enabled, and the kernel softirq Rx processing and userland process is running on the same core. [...] @Maxim I'm not well versed in Mellanox

Re: [net-next 04/10] net/mlx5e: Unify constants for WQE_EMPTY_DS_COUNT

2020-09-08 Thread Maxim Mikityanskiy
On 2020-09-04 18:05, Willem de Bruijn wrote: On Thu, Sep 3, 2020 at 11:01 PM Saeed Mahameed wrote: From: Maxim Mikityanskiy A constant for the number of DS in an empty WQE (i.e. a WQE without data segments) is needed in multiple places (normal TX data path, MPWQE in XDP), but currently we

Re: [net-next 02/10] net/mlx5e: Refactor xmit functions

2020-09-08 Thread Maxim Mikityanskiy
On 2020-09-04 18:27, Willem de Bruijn wrote: On Thu, Sep 3, 2020 at 11:00 PM Saeed Mahameed wrote: From: Maxim Mikityanskiy A huge function mlx5e_sq_xmit was split into several to achieve multiple goals: 1. Reuse the code in IPoIB. 2. Better intergrate with TLS, IPSEC, GENEVE and checksum

Re: [net-next 06/10] net/mlx5e: Support multiple SKBs in a TX WQE

2020-09-08 Thread Maxim Mikityanskiy
On 2020-09-04 01:46, Jakub Kicinski wrote: On Thu, 3 Sep 2020 14:00:18 -0700 Saeed Mahameed wrote: +static inline void mlx5e_tx_wi_consume_fifo_skbs(struct mlx5e_txqsq *sq, +struct mlx5e_tx_wqe_info *wi, +

Re: [net-next 09/10] net/mlx5e: Move TX code into functions to be used by MPWQE

2020-09-08 Thread Maxim Mikityanskiy
On 2020-09-04 18:06, Willem de Bruijn wrote: On Thu, Sep 3, 2020 at 11:01 PM Saeed Mahameed wrote: From: Maxim Mikityanskiy mlx5e_txwqe_complete performs some actions that can be taken to separate functions: 1. Update the flags needed for hardware timestamping. 2. Stop the TX queue if

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

2020-08-25 Thread Maxim Mikityanskiy
d all bits got to wanted. Signed-off-by: Maxim Mikityanskiy --- netlink/features.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/netlink/features.c b/netlink/features.c index 133529d..7622594 100644 --- a/netlink/features.c +++ b/netlink/features.c @@ -243,6 +

[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 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 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 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 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 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

Re: [PATCH net-next v2 2/2] net: sched: Lockless Token Bucket (LTB) qdisc

2020-08-04 Thread Maxim Mikityanskiy
On 2020-07-08 19:38, YU, Xiangning wrote: Lockless Token Bucket (LTB) is a qdisc implementation that controls the use of outbound bandwidth on a shared link. With the help of lockless qdisc, and by decoupling rate limiting and bandwidth sharing, LTB is designed to scale in the cloud data centers.

Re: [PATCH bpf-next v4 05/14] xsk: move queue_id, dev and need_wakeup to buffer pool

2020-07-28 Thread Maxim Mikityanskiy
On 2020-07-21 08:03, Magnus Karlsson wrote: Move queue_id, dev, and need_wakeup from the umem to the buffer pool. This so that we in a later commit can share the umem between multiple HW queues. There is one buffer pool per dev and queue id, so these variables should belong to the buffer pool, no

Re: [PATCH bpf-next v4 08/14] xsk: enable sharing of dma mappings

2020-07-28 Thread Maxim Mikityanskiy
On 2020-07-21 08:04, Magnus Karlsson wrote: Enable the sharing of dma mappings by moving them out from the buffer pool. Instead we put each dma mapped umem region in a list in the umem structure. If dma has already been mapped for this umem and device, it is not mapped again and the existing dma

Re: [PATCH bpf-next v2 04/14] xsk: move fill and completion rings to buffer pool

2020-07-15 Thread Maxim Mikityanskiy
On 2020-07-10 17:16, Magnus Karlsson wrote: Move the fill and completion rings from the umem to the buffer pool. This so that we in a later commit can share the umem between multiple HW queue ids. In this case, we need one fill and completion ring per queue id. As the buffer pool is per queue id

Re: [RFC PATCH] sch_htb: Hierarchical QoS hardware offload

2020-07-14 Thread Maxim Mikityanskiy
On 2020-07-08 09:44, Cong Wang wrote: On Fri, Jun 26, 2020 at 3:46 AM Maxim Mikityanskiy wrote: HTB doesn't scale well because of contention on a single lock, and it also consumes CPU. Mellanox hardware supports hierarchical rate limiting that can be leveraged by offloading the function

Re: [PATCH bpf-next v2 11/14] xsk: add shared umem support between devices

2020-07-14 Thread Maxim Mikityanskiy
On 2020-07-10 17:16, Magnus Karlsson wrote: Add support to share a umem between different devices. This mode can be invoked with the XDP_SHARED_UMEM bind flag. Previously, sharing was only supported within the same device. Note that when sharing a umem between devices, just as in the case of shar

Re: [PATCH bpf-next 11/14] xsk: add shared umem support between devices

2020-07-09 Thread Maxim Mikityanskiy
On 2020-07-02 15:19, Magnus Karlsson wrote: Add support to share a umem between different devices. This mode can be invoked with the XDP_SHARED_UMEM bind flag. Previously, sharing was only supported within the same device. Note that when sharing a umem between devices, just as in the case of shar

[PATCH 1/2] xsk: i40e: ice: ixgbe: mlx5: pass buffer pool to driver instead of umem

2020-07-09 Thread Maxim Mikityanskiy
Signed-off-by: Maxim Mikityanskiy --- Magnus, here are my minor changes to the mlx5 part (only mlx5 is included in these two patches). I renamed pool to xsk_pool when used outside of en/xsk and renamed umem.{c,h} to pool.{c,h}. .../net/ethernet/mellanox/mlx5/core/Makefile | 2 +- drivers/net

[PATCH 2/2] xsk: i40e: ice: ixgbe: mlx5: rename xsk zero-copy driver interfaces

2020-07-09 Thread Maxim Mikityanskiy
-off-by: Maxim Mikityanskiy --- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 4 ++-- .../net/ethernet/mellanox/mlx5/core/en/xsk/pool.c| 12 ++-- drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.h | 8 drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.c | 10

Re: [PATCH bpf-next 00/14] xsk: support shared umems between devices and queues

2020-07-08 Thread Maxim Mikityanskiy
On 2020-07-02 15:18, Magnus Karlsson wrote: This patch set adds support to share a umem between AF_XDP sockets bound to different queue ids on the same device or even between devices. It has already been possible to do this by registering the umem multiple times, but this wastes a lot of memory.

Re: [PATCH bpf-next 01/14] xsk: i40e: ice: ixgbe: mlx5: pass buffer pool to driver instead of umem

2020-07-08 Thread Maxim Mikityanskiy
On 2020-07-02 15:19, Magnus Karlsson wrote: Replace the explicit umem reference passed to the driver in AF_XDP zero-copy mode with the buffer pool instead. This in preparation for extending the functionality of the zero-copy mode so that umems can be shared between queues on the same netdev and a

Re: [PATCH bpf-next 03/14] xsk: create and free context independently from umem

2020-07-08 Thread Maxim Mikityanskiy
On 2020-07-02 15:19, Magnus Karlsson wrote: Create and free the buffer pool independently from the umem. Move these operations that are performed on the buffer pool from the umem create and destroy functions to new create and destroy functions just for the buffer pool. This so that in later commi

Re: [RFC PATCH] sch_htb: Hierarchical QoS hardware offload

2020-07-07 Thread Maxim Mikityanskiy
Comments are very welcome before I move to the full implementation. On 2020-06-26 13:46, Maxim Mikityanskiy wrote: This patch is a follow-up for the RFC posted earlier [1]. You can find a detailed description of the motivation there, and this patch is RFC code that shows possible implementation

Re: [PATCH bpf-next 00/14] xsk: support shared umems between devices and queues

2020-07-07 Thread Maxim Mikityanskiy
On 2020-07-06 21:39, Daniel Borkmann wrote: On 7/2/20 2:18 PM, Magnus Karlsson wrote: This patch set adds support to share a umem between AF_XDP sockets bound to different queue ids on the same device or even between devices. It has already been possible to do this by registering the umem multip

Re: ADQ - comparison to aRFS, clarifications on NAPI ID, binding with busy-polling

2020-06-26 Thread Maxim Mikityanskiy
Thanks a lot for your reply! It was really helpful. I have a few comments, please see below. On 2020-06-24 23:21, Samudrala, Sridhar wrote: > > > On 6/17/2020 6:15 AM, Maxim Mikityanskiy wrote: >> Hi, >> >> I discovered Intel ADQ feature [1] that allows to boost

[RFC PATCH] sch_htb: Hierarchical QoS hardware offload

2020-06-26 Thread Maxim Mikityanskiy
eciated. Thanks, Max [1]: https://www.spinics.net/lists/netdev/msg628422.html Signed-off-by: Maxim Mikityanskiy --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 + .../net/ethernet/mellanox/mlx5/core/en_main.c | 38 ++- .../net/ethernet/mellanox/mlx5/core/en_tx.c | 12 +

ADQ - comparison to aRFS, clarifications on NAPI ID, binding with busy-polling

2020-06-17 Thread Maxim Mikityanskiy
Hi, I discovered Intel ADQ feature [1] that allows to boost performance by picking dedicated queues for application traffic. We did some research, and I got some level of understanding how it works, but I have some questions, and I hope you could answer them. 1. SO_INCOMING_NAPI_ID usage. In

Re: [PATCH bpf-next 10/14] mlx5, xsk: migrate to new MEM_TYPE_XSK_BUFF_POOL

2020-05-08 Thread Maxim Mikityanskiy
On 2020-05-08 16:14, Björn Töpel wrote: On Fri, 8 May 2020 at 15:08, Björn Töpel wrote: On Fri, 8 May 2020 at 15:01, Maxim Mikityanskiy wrote: [] All zeros hints that you're probably putting in the wrong DMA address somewhere. Hmm, I can't see that you're using xsk_b

Re: [PATCH bpf-next 10/14] mlx5, xsk: migrate to new MEM_TYPE_XSK_BUFF_POOL

2020-05-08 Thread Maxim Mikityanskiy
On 2020-05-08 15:27, Björn Töpel wrote: On 2020-05-08 13:55, Maxim Mikityanskiy wrote: On 2020-05-07 13:42, Björn Töpel wrote: From: Björn Töpel Use the new MEM_TYPE_XSK_BUFF_POOL API in lieu of MEM_TYPE_ZERO_COPY in mlx5e. It allows to drop a lot of code from the driver (which is now common

Re: [PATCH bpf-next 04/14] xsk: introduce AF_XDP buffer allocation API

2020-05-08 Thread Maxim Mikityanskiy
ter. (Maxim/Björn) Signed-off-by: Maxim Mikityanskiy Signed-off-by: Björn Töpel Björn's signoff should go first (as the original author). --- include/net/xdp.h | 4 +- include/net/xdp_sock.h | 2 + include/net/xdp_sock_drv.h | 152 include/net/xsk_buf

Re: [PATCH bpf-next 10/14] mlx5, xsk: migrate to new MEM_TYPE_XSK_BUFF_POOL

2020-05-08 Thread Maxim Mikityanskiy
slightly improve performance. rfc->v1: Put back the sanity check for XSK params, use XSK API to get the total headroom size. (Maxim) Signed-off-by: Björn Töpel Signed-off-by: Maxim Mikityanskiy I did some functional and performance tests. Unfortunately, something is wrong with the traf

Re: [RFC PATCH bpf-next 04/13] xsk: introduce AF_XDP buffer allocation API

2020-05-06 Thread Maxim Mikityanskiy
On 2020-05-04 14:37, Björn Töpel wrote: From: Björn Töpel In order to simplify AF_XDP zero-copy enablement for NIC driver developers, a new AF_XDP buffer allocation API is added. The implementation is based on a single core (single producer/consumer) buffer pool for the AF_XDP UMEM. A buffer i

Re: [RFC PATCH bpf-next 04/13] xsk: introduce AF_XDP buffer allocation API

2020-05-05 Thread Maxim Mikityanskiy
On 2020-05-04 14:37, Björn Töpel wrote: From: Björn Töpel In order to simplify AF_XDP zero-copy enablement for NIC driver developers, a new AF_XDP buffer allocation API is added. The implementation is based on a single core (single producer/consumer) buffer pool for the AF_XDP UMEM. A buffer i

Re: [PATCH net v2] net: udp: fix handling of CHECKSUM_COMPLETE packets

2019-10-09 Thread Maxim Mikityanskiy
Hi Sean, I was analyzing this code and have some concerns. Please see the comments below. On Wed, Oct 24, 2018 at 1:04 AM Sean Tranchetti wrote: > > Current handling of CHECKSUM_COMPLETE packets by the UDP stack is > incorrect for any packet that has an incorrect checksum value. > > udp4/6_csum_

Re: [PATCH bpf-next] i40e: fix xdp handle calculations

2019-09-17 Thread Maxim Mikityanskiy
On Thu, Sep 5, 2019 at 4:11 AM Kevin Laatz wrote: > > Currently, we don't add headroom to the handle in i40e_zca_free, > i40e_alloc_buffer_slow_zc and i40e_alloc_buffer_zc. The addition of the > headroom to the handle was removed in > commit 2f86c806a8a8 ("i40e: modify driver for handling offsets"

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

2019-08-27 Thread Maxim Mikityanskiy
On 2019-08-22 04:44, 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 v4 07/11] mlx5e: modify driver for handling offsets

2019-08-19 Thread Maxim Mikityanskiy
On 2019-08-01 13:05, Maxim Mikityanskiy wrote: > 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 dr

Re: [PATCH bpf-next] libbpf: remove zc variable as it is not used

2019-08-18 Thread Maxim Mikityanskiy
On 2019-08-19 09:35, Magnus Karlsson wrote: > On Sat, Aug 17, 2019 at 12:02 AM Jonathan Lemon > wrote: >> >> >> >> On 16 Aug 2019, at 8:37, Yonghong Song wrote: >> >>> On 8/16/19 3:26 AM, Magnus Karlsson wrote: The zc is not used in the xsk part of libbpf, so let us remove it. Not g

[PATCH bpf-next v2] net: Don't call XDP_SETUP_PROG when nothing is changed

2019-08-14 Thread Maxim Mikityanskiy
some heavy operations on XDP_SETUP_PROG, so they all have to handle these cases internally to return early if they happen. This patch puts this check into the kernel code, so that all drivers will benefit from it. Signed-off-by: Maxim Mikityanskiy --- v2 changes: Cover the case when the program

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:

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 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

[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] net: Don't uninstall an XDP program when none is installed

2019-07-10 Thread Maxim Mikityanskiy
On 2019-06-12 19:14, Maxim Mikityanskiy wrote: > dev_change_xdp_fd doesn't perform any checks in case it uninstalls an > XDP program. It means that the driver's ndo_bpf can be called with > XDP_SETUP_PROG asking to set it to NULL even if it's already NULL. This > case h

  1   2   3   >