* [PATCH bpf-next] tools: bpftool: add completion for bpftool prog "loadall"
From: Quentin Monnet @ 2019-07-08 13:05 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann
Cc: bpf, netdev, oss-drivers, Quentin Monnet
Bash completion for proposing the "loadall" subcommand is missing. Let's
add it to the completion script.
Add a specific case to propose "load" and "loadall" for completing:
$ bpftool prog load
^ cursor is here
Otherwise, completion considers that $command is in load|loadall and
starts making related completions (file or directory names, as the
number of words on the command line is below 6), when the only suggested
keywords should be "load" and "loadall" until one has been picked and a
space entered after that to move to the next word.
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
tools/bpf/bpftool/bash-completion/bpftool | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/bpf/bpftool/bash-completion/bpftool b/tools/bpf/bpftool/bash-completion/bpftool
index 965a8658cca3..c8f42e1fcbc9 100644
--- a/tools/bpf/bpftool/bash-completion/bpftool
+++ b/tools/bpf/bpftool/bash-completion/bpftool
@@ -342,6 +342,13 @@ _bpftool()
load|loadall)
local obj
+ # Propose "load/loadall" to complete "bpftool prog load",
+ # or bash tries to complete "load" as a filename below.
+ if [[ ${#words[@]} -eq 3 ]]; then
+ COMPREPLY=( $( compgen -W "load loadall" -- "$cur" ) )
+ return 0
+ fi
+
if [[ ${#words[@]} -lt 6 ]]; then
_filedir
return 0
@@ -435,7 +442,7 @@ _bpftool()
*)
[[ $prev == $object ]] && \
COMPREPLY=( $( compgen -W 'dump help pin attach detach \
- load show list tracelog run' -- "$cur" ) )
+ load loadall show list tracelog run' -- "$cur" ) )
;;
esac
;;
--
2.17.1
^ permalink raw reply related
* Re: [PATCH net-next 10/16] net/mlx5e: Add cq info to tx reporter diagnose
From: Jiri Pirko @ 2019-07-08 13:00 UTC (permalink / raw)
To: Tariq Toukan
Cc: David S. Miller, netdev, Eran Ben Elisha, ayal, jiri,
Saeed Mahameed, moshe
In-Reply-To: <1562500388-16847-11-git-send-email-tariqt@mellanox.com>
Sun, Jul 07, 2019 at 01:53:02PM CEST, tariqt@mellanox.com wrote:
>From: Aya Levin <ayal@mellanox.com>
>
>Add cq information to general diagnose output: CQ size and stride size.
>Per SQ add information about the related CQ: cqn and CQ's HW status.
>
>$ devlink health diagnose pci/0000:00:0b.0 reporter tx
>Common config:
> SQ: stride size: 64 size: 1024
> CQ: stride size: 64 size: 1024
> SQs:
> channel ix: 0 sqn: 4283 HW state: 1 stopped: false cc: 0 pc: 0 CQ: cqn: 1030 HW status: 0
The nesting of "cqn" and "HW status" is not visible there. I know it is
comment to iproute2 patch, but still. Should be corrected in this patch
description too.
Other than this, the patch looks good.
> channel ix: 1 sqn: 4288 HW state: 1 stopped: false cc: 0 pc: 0 CQ: cqn: 1034 HW status: 0
> channel ix: 2 sqn: 4293 HW state: 1 stopped: false cc: 0 pc: 0 CQ: cqn: 1038 HW status: 0
> channel ix: 3 sqn: 4298 HW state: 1 stopped: false cc: 0 pc: 0 CQ: cqn: 1042 HW status: 0
>
>$ devlink health diagnose pci/0000:00:0b.0 reporter tx -jp
>{
> "Common config": [
> "SQ": {
> "stride size": 64,
> "size": 1024
> },
> "CQ": {
> "stride size": 64,
> "size": 1024
> } ],
> "SQs": [ {
> "channel ix": 0,
> "sqn": 4283,
> "HW state": 1,
> "stopped": false,
> "cc": 0,
> "pc": 0,
> "CQ": {
> "cqn": 1030,
> "HW status": 0
> }
> },{
> "channel ix": 1,
> "sqn": 4288,
> "HW state": 1,
> "stopped": false,
> "cc": 0,
> "pc": 0,
> "CQ": {
> "cqn": 1034,
> "HW status": 0
> }
> },{
> "channel ix": 2,
> "sqn": 4293,
> "HW state": 1,
> "stopped": false,
> "cc": 0,
> "pc": 0,
> "CQ": {
> "cqn": 1038,
> "HW status": 0
> }
> },{
> "channel ix": 3,
> "sqn": 4298,
> "HW state": 1,
> "stopped": false,
> "cc": 0,
> "pc": 0,
> "CQ": {
> "cqn": 1042,
> "HW status": 0
> }
> } ]
>}
>
>Signed-off-by: Aya Levin <ayal@mellanox.com>
>Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
[...]
^ permalink raw reply
* [PATCH net-next 2/2] bpf: avoid unused variable warning in tcp_bpf_rtt()
From: Arnd Bergmann @ 2019-07-08 12:57 UTC (permalink / raw)
To: Eric Dumazet, David S. Miller, Alexei Starovoitov,
Daniel Borkmann
Cc: Arnd Bergmann, Priyaranjan Jha, Yuchung Cheng,
Soheil Hassas Yeganeh, Stanislav Fomichev, Martin KaFai Lau,
Song Liu, Yonghong Song, Neal Cardwell, Jason Baron, Yafang Shao,
Ard Biesheuvel, netdev, linux-kernel, bpf
In-Reply-To: <20190708125733.3944836-1-arnd@arndb.de>
When CONFIG_BPF is disabled, we get a warning for an unused
variable:
In file included from drivers/target/target_core_device.c:26:
include/net/tcp.h:2226:19: error: unused variable 'tp' [-Werror,-Wunused-variable]
struct tcp_sock *tp = tcp_sk(sk);
The variable is only used in one place, so it can be
replaced with its value there to avoid the warning.
Fixes: 23729ff23186 ("bpf: add BPF_CGROUP_SOCK_OPS callback that is executed on every RTT")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/net/tcp.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index e16d8a3fd3b4..cca3c59b98bf 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -2223,9 +2223,7 @@ static inline bool tcp_bpf_ca_needs_ecn(struct sock *sk)
static inline void tcp_bpf_rtt(struct sock *sk)
{
- struct tcp_sock *tp = tcp_sk(sk);
-
- if (BPF_SOCK_OPS_TEST_FLAG(tp, BPF_SOCK_OPS_RTT_CB_FLAG))
+ if (BPF_SOCK_OPS_TEST_FLAG(tcp_sk(sk), BPF_SOCK_OPS_RTT_CB_FLAG))
tcp_call_bpf(sk, BPF_SOCK_OPS_RTT_CB, 0, NULL);
}
--
2.20.0
^ permalink raw reply related
* [PATCH net-next 1/2] bpf: skip sockopt hooks without CONFIG_NET
From: Arnd Bergmann @ 2019-07-08 12:57 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann
Cc: Arnd Bergmann, Andrii Nakryiko, Martin Lau, Stanislav Fomichev,
Song Liu, Yonghong Song, Mauricio Vasquez B, Roman Gushchin,
Matt Mullins, Willem de Bruijn, Andrey Ignatov, netdev, bpf,
linux-kernel
When CONFIG_NET is disabled, we get a link error:
kernel/bpf/cgroup.o: In function `__cgroup_bpf_run_filter_setsockopt':
cgroup.c:(.text+0x3010): undefined reference to `lock_sock_nested'
cgroup.c:(.text+0x3258): undefined reference to `release_sock'
kernel/bpf/cgroup.o: In function `__cgroup_bpf_run_filter_getsockopt':
cgroup.c:(.text+0x3568): undefined reference to `lock_sock_nested'
cgroup.c:(.text+0x3870): undefined reference to `release_sock'
kernel/bpf/cgroup.o: In function `cg_sockopt_func_proto':
cgroup.c:(.text+0x41d8): undefined reference to `bpf_sk_storage_delete_proto'
None of this code is useful in this configuration anyway, so we can
simply hide it in an appropriate #ifdef.
Fixes: 0d01da6afc54 ("bpf: implement getsockopt and setsockopt hooks")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/linux/bpf_types.h | 2 ++
kernel/bpf/cgroup.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/include/linux/bpf_types.h b/include/linux/bpf_types.h
index eec5aeeeaf92..3c7222b2db96 100644
--- a/include/linux/bpf_types.h
+++ b/include/linux/bpf_types.h
@@ -30,8 +30,10 @@ BPF_PROG_TYPE(BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, raw_tracepoint_writable)
#ifdef CONFIG_CGROUP_BPF
BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_DEVICE, cg_dev)
BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SYSCTL, cg_sysctl)
+#ifdef CONFIG_NET
BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SOCKOPT, cg_sockopt)
#endif
+#endif
#ifdef CONFIG_BPF_LIRC_MODE2
BPF_PROG_TYPE(BPF_PROG_TYPE_LIRC_MODE2, lirc_mode2)
#endif
diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c
index 76fa0076f20d..7be44460bd93 100644
--- a/kernel/bpf/cgroup.c
+++ b/kernel/bpf/cgroup.c
@@ -590,6 +590,7 @@ int cgroup_bpf_prog_query(const union bpf_attr *attr,
return ret;
}
+#ifdef CONFIG_NET
/**
* __cgroup_bpf_run_filter_skb() - Run a program for packet filtering
* @sk: The socket sending or receiving traffic
@@ -750,6 +751,7 @@ int __cgroup_bpf_run_filter_sock_ops(struct sock *sk,
return ret == 1 ? 0 : -EPERM;
}
EXPORT_SYMBOL(__cgroup_bpf_run_filter_sock_ops);
+#endif
int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor,
short access, enum bpf_attach_type type)
@@ -939,6 +941,7 @@ int __cgroup_bpf_run_filter_sysctl(struct ctl_table_header *head,
}
EXPORT_SYMBOL(__cgroup_bpf_run_filter_sysctl);
+#ifdef CONFIG_NET
static bool __cgroup_bpf_prog_array_is_empty(struct cgroup *cgrp,
enum bpf_attach_type attach_type)
{
@@ -1120,6 +1123,7 @@ int __cgroup_bpf_run_filter_getsockopt(struct sock *sk, int level,
return ret;
}
EXPORT_SYMBOL(__cgroup_bpf_run_filter_getsockopt);
+#endif
static ssize_t sysctl_cpy_dir(const struct ctl_dir *dir, char **bufp,
size_t *lenp)
@@ -1382,6 +1386,7 @@ const struct bpf_verifier_ops cg_sysctl_verifier_ops = {
const struct bpf_prog_ops cg_sysctl_prog_ops = {
};
+#ifdef CONFIG_NET
static const struct bpf_func_proto *
cg_sockopt_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
{
@@ -1531,3 +1536,4 @@ const struct bpf_verifier_ops cg_sockopt_verifier_ops = {
const struct bpf_prog_ops cg_sockopt_prog_ops = {
};
+#endif
--
2.20.0
^ permalink raw reply related
* Re: [PATCH 2/6] dt-bindings: can: rcar_can: Complete documentation for RZ/G2[EM]
From: Geert Uytterhoeven @ 2019-07-08 12:56 UTC (permalink / raw)
To: Fabrizio Castro
Cc: Simon Horman, Geert Uytterhoeven, Wolfgang Grandegger,
Marc Kleine-Budde, Rob Herring, Mark Rutland, David S. Miller,
linux-can, netdev,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Chris Paterson, Biju Das, Linux-Renesas
In-Reply-To: <1560513214-28031-3-git-send-email-fabrizio.castro@bp.renesas.com>
On Fri, Jun 14, 2019 at 1:53 PM Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> Add missing RZ/G2[EM] CANFD clock specific documentation.
>
> Fixes: 868b7c0f43e6 ("dt-bindings: can: rcar_can: Add r8a774a1 support")
> Fixes: 0c11e7d0f51c ("dt-bindings: can: rcar_can: Add r8a774c0 support")
> Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> Reviewed-by: Chris Paterson <Chris.Paterson2@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
I.e. applied and queued for v5.4.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* [PATCH] [net-next] net/mlx5e: xsk: dynamically allocate mlx5e_channel_param
From: Arnd Bergmann @ 2019-07-08 12:55 UTC (permalink / raw)
To: Saeed Mahameed, Leon Romanovsky, David S. Miller,
Alexei Starovoitov, Daniel Borkmann, Jakub Kicinski,
Jesper Dangaard Brouer, John Fastabend
Cc: Arnd Bergmann, Maxim Mikityanskiy, Tariq Toukan, netdev,
linux-rdma, linux-kernel, xdp-newbies, bpf
The structure is too large to put on the stack, resulting in a
warning on 32-bit ARM:
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c:59:5: error: stack frame size of 1344 bytes in function
'mlx5e_open_xsk' [-Werror,-Wframe-larger-than=]
Use kzalloc() instead.
Fixes: a038e9794541 ("net/mlx5e: Add XSK zero-copy support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
.../mellanox/mlx5/core/en/xsk/setup.c | 25 ++++++++++++-------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c
index aaffa6f68dc0..db9bbec68dbf 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c
@@ -60,24 +60,28 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params,
struct mlx5e_xsk_param *xsk, struct xdp_umem *umem,
struct mlx5e_channel *c)
{
- struct mlx5e_channel_param cparam = {};
+ struct mlx5e_channel_param *cparam;
struct dim_cq_moder icocq_moder = {};
int err;
if (!mlx5e_validate_xsk_param(params, xsk, priv->mdev))
return -EINVAL;
- mlx5e_build_xsk_cparam(priv, params, xsk, &cparam);
+ cparam = kzalloc(sizeof(*cparam), GFP_KERNEL);
+ if (!cparam)
+ return -ENOMEM;
- err = mlx5e_open_cq(c, params->rx_cq_moderation, &cparam.rx_cq, &c->xskrq.cq);
+ mlx5e_build_xsk_cparam(priv, params, xsk, cparam);
+
+ err = mlx5e_open_cq(c, params->rx_cq_moderation, &cparam->rx_cq, &c->xskrq.cq);
if (unlikely(err))
- return err;
+ goto err_kfree_cparam;
- err = mlx5e_open_rq(c, params, &cparam.rq, xsk, umem, &c->xskrq);
+ err = mlx5e_open_rq(c, params, &cparam->rq, xsk, umem, &c->xskrq);
if (unlikely(err))
goto err_close_rx_cq;
- err = mlx5e_open_cq(c, params->tx_cq_moderation, &cparam.tx_cq, &c->xsksq.cq);
+ err = mlx5e_open_cq(c, params->tx_cq_moderation, &cparam->tx_cq, &c->xsksq.cq);
if (unlikely(err))
goto err_close_rq;
@@ -87,18 +91,18 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params,
* is disabled and then reenabled, but the SQ continues receiving CQEs
* from the old UMEM.
*/
- err = mlx5e_open_xdpsq(c, params, &cparam.xdp_sq, umem, &c->xsksq, true);
+ err = mlx5e_open_xdpsq(c, params, &cparam->xdp_sq, umem, &c->xsksq, true);
if (unlikely(err))
goto err_close_tx_cq;
- err = mlx5e_open_cq(c, icocq_moder, &cparam.icosq_cq, &c->xskicosq.cq);
+ err = mlx5e_open_cq(c, icocq_moder, &cparam->icosq_cq, &c->xskicosq.cq);
if (unlikely(err))
goto err_close_sq;
/* Create a dedicated SQ for posting NOPs whenever we need an IRQ to be
* triggered and NAPI to be called on the correct CPU.
*/
- err = mlx5e_open_icosq(c, params, &cparam.icosq, &c->xskicosq);
+ err = mlx5e_open_icosq(c, params, &cparam->icosq, &c->xskicosq);
if (unlikely(err))
goto err_close_icocq;
@@ -123,6 +127,9 @@ int mlx5e_open_xsk(struct mlx5e_priv *priv, struct mlx5e_params *params,
err_close_rx_cq:
mlx5e_close_cq(&c->xskrq.cq);
+err_kfree_cparam:
+ kfree(cparam);
+
return err;
}
--
2.20.0
^ permalink raw reply related
* Re: [PATCH net-next 09/16] net/mlx5e: Extend tx reporter diagnostics output
From: Jiri Pirko @ 2019-07-08 12:55 UTC (permalink / raw)
To: Tariq Toukan
Cc: David S. Miller, netdev, Eran Ben Elisha, ayal, jiri,
Saeed Mahameed, moshe
In-Reply-To: <1562500388-16847-10-git-send-email-tariqt@mellanox.com>
Sun, Jul 07, 2019 at 01:53:01PM CEST, tariqt@mellanox.com wrote:
>From: Aya Levin <ayal@mellanox.com>
>
>Enhance tx reporter's diagnostics output to include: information common
>to all SQs: SQ size, SQ stride size.
>In addition add channel ix, cc and pc.
>
>$ devlink health diagnose pci/0000:00:0b.0 reporter tx
>Common config:
> SQ: stride size: 64 size: 1024
> SQs:
> channel ix: 0 sqn: 4283 HW state: 1 stopped: false cc: 0 pc: 0
> channel ix: 1 sqn: 4288 HW state: 1 stopped: false cc: 0 pc: 0
> channel ix: 2 sqn: 4293 HW state: 1 stopped: false cc: 0 pc: 0
> channel ix: 3 sqn: 4298 HW state: 1 stopped: false cc: 0 pc: 0
>
>$ devlink health diagnose pci/0000:00:0b.0 reporter tx -jp
>{
> "Common config": [
> "SQ": {
> "stride size": 64,
> "size": 1024
> } ],
> "SQs": [ {
> "channel ix": 0,
> "sqn": 4283,
> "HW state": 1,
> "stopped": false,
> "cc": 0,
> "pc": 0
> },{
> "channel ix": 1,
> "sqn": 4288,
> "HW state": 1,
> "stopped": false,
> "cc": 0,
> "pc": 0
> },{
> "channel ix": 2,
> "sqn": 4293,
> "HW state": 1,
> "stopped": false,
> "cc": 0,
> "pc": 0
> },{
> "channel ix": 3,
> "sqn": 4298,
> "HW state": 1,
> "stopped": false,
> "cc": 0,
> "pc": 0
> } ]
>}
>
>Signed-off-by: Aya Levin <ayal@mellanox.com>
>Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
>---
> .../net/ethernet/mellanox/mlx5/core/en/health.c | 30 ++++++++++++++++
> .../net/ethernet/mellanox/mlx5/core/en/health.h | 3 ++
> .../ethernet/mellanox/mlx5/core/en/reporter_tx.c | 42 ++++++++++++++++++++++
> 3 files changed, 75 insertions(+)
>
>diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/health.c b/drivers/net/ethernet/mellanox/mlx5/core/en/health.c
>index 60166e5432ae..0d44b081259f 100644
>--- a/drivers/net/ethernet/mellanox/mlx5/core/en/health.c
>+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/health.c
>@@ -4,6 +4,36 @@
> #include "health.h"
> #include "lib/eq.h"
>
>+int mlx5e_reporter_named_obj_nest_start(struct devlink_fmsg *fmsg, char *name)
>+{
>+ int err;
>+
>+ err = devlink_fmsg_pair_nest_start(fmsg, name);
>+ if (err)
>+ return err;
>+
>+ err = devlink_fmsg_obj_nest_start(fmsg);
>+ if (err)
>+ return err;
>+
>+ return 0;
>+}
>+
>+int mlx5e_reporter_named_obj_nest_end(struct devlink_fmsg *fmsg)
>+{
>+ int err;
>+
>+ err = devlink_fmsg_pair_nest_end(fmsg);
You should end the obj nest first.
>+ if (err)
>+ return err;
>+
>+ err = devlink_fmsg_obj_nest_end(fmsg);
>+ if (err)
>+ return err;
>+
>+ return 0;
>+}
>+
> int mlx5e_health_sq_to_ready(struct mlx5e_channel *channel, u32 sqn)
> {
> struct mlx5_core_dev *mdev = channel->mdev;
>diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/health.h b/drivers/net/ethernet/mellanox/mlx5/core/en/health.h
>index 960aa18c425d..0fecad63135c 100644
>--- a/drivers/net/ethernet/mellanox/mlx5/core/en/health.h
>+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/health.h
>@@ -11,6 +11,9 @@
> void mlx5e_reporter_tx_err_cqe(struct mlx5e_txqsq *sq);
> int mlx5e_reporter_tx_timeout(struct mlx5e_txqsq *sq);
>
>+int mlx5e_reporter_named_obj_nest_start(struct devlink_fmsg *fmsg, char *name);
>+int mlx5e_reporter_named_obj_nest_end(struct devlink_fmsg *fmsg);
>+
> #define MLX5E_REPORTER_PER_Q_MAX_LEN 256
>
> struct mlx5e_err_ctx {
>diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
>index dd6417930461..c481f7142a12 100644
>--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
>+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
>@@ -153,6 +153,10 @@ static int mlx5e_tx_reporter_recover(struct devlink_health_reporter *reporter,
> if (err)
> return err;
>
>+ err = devlink_fmsg_u32_pair_put(fmsg, "channel ix", sq->channel->ix);
"ix" is an attribute of the channel. I think it should be nested under
"channel" here.
>+ if (err)
>+ return err;
>+
> err = devlink_fmsg_u32_pair_put(fmsg, "sqn", sq->sqn);
> if (err)
> return err;
>@@ -165,6 +169,14 @@ static int mlx5e_tx_reporter_recover(struct devlink_health_reporter *reporter,
> if (err)
> return err;
>
>+ err = devlink_fmsg_u32_pair_put(fmsg, "cc", sq->cc);
>+ if (err)
>+ return err;
>+
>+ err = devlink_fmsg_u32_pair_put(fmsg, "pc", sq->pc);
>+ if (err)
>+ return err;
>+
> err = devlink_fmsg_obj_nest_end(fmsg);
> if (err)
> return err;
>@@ -176,6 +188,9 @@ static int mlx5e_tx_reporter_diagnose(struct devlink_health_reporter *reporter,
> struct devlink_fmsg *fmsg)
> {
> struct mlx5e_priv *priv = devlink_health_reporter_priv(reporter);
>+ struct mlx5e_txqsq *generic_sq = priv->txq2sq[0];
>+ u32 sq_stride, sq_sz;
>+
> int i, err = 0;
>
> mutex_lock(&priv->state_lock);
>@@ -183,6 +198,33 @@ static int mlx5e_tx_reporter_diagnose(struct devlink_health_reporter *reporter,
> if (!test_bit(MLX5E_STATE_OPENED, &priv->state))
> goto unlock;
>
>+ sq_sz = mlx5_wq_cyc_get_size(&generic_sq->wq);
>+ sq_stride = MLX5_SEND_WQE_BB;
>+
>+ err = devlink_fmsg_arr_pair_nest_start(fmsg, "Common config");
>+ if (err)
>+ goto unlock;
>+
>+ err = mlx5e_reporter_named_obj_nest_start(fmsg, "SQ");
>+ if (err)
>+ goto unlock;
>+
>+ err = devlink_fmsg_u64_pair_put(fmsg, "stride size", sq_stride);
>+ if (err)
>+ goto unlock;
>+
>+ err = devlink_fmsg_u32_pair_put(fmsg, "size", sq_sz);
>+ if (err)
>+ goto unlock;
>+
>+ err = devlink_fmsg_arr_pair_nest_end(fmsg);
Which nest is this supposed to end? Looks like it is extra and
should not be here...
>+ if (err)
>+ goto unlock;
>+
>+ err = mlx5e_reporter_named_obj_nest_end(fmsg);
>+ if (err)
>+ goto unlock;
>+
> err = devlink_fmsg_arr_pair_nest_start(fmsg, "SQs");
> if (err)
> goto unlock;
>--
>1.8.3.1
>
^ permalink raw reply
* Re: [PATCH 1/6] dt-bindings: can: rcar_canfd: document r8a774a1 support
From: Geert Uytterhoeven @ 2019-07-08 12:55 UTC (permalink / raw)
To: Simon Horman
Cc: Fabrizio Castro, David S. Miller, Geert Uytterhoeven,
Wolfgang Grandegger, Marc Kleine-Budde, Rob Herring, Mark Rutland,
linux-can, netdev,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Chris Paterson, Biju Das, Linux-Renesas
In-Reply-To: <20190617093023.nhvrvujg52gcglko@verge.net.au>
On Mon, Jun 17, 2019 at 11:30 AM Simon Horman <horms@verge.net.au> wrote:
> On Fri, Jun 14, 2019 at 12:53:29PM +0100, Fabrizio Castro wrote:
> > Document the support for rcar_canfd on R8A774A1 SoC devices.
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
> > Reviewed-by: Chris Paterson <Chris.Paterson2@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > Hello Simon,
> >
> > I think it would make more sense if this patch went through you as it
> > sits on series:
> > https://lkml.org/lkml/2019/5/9/941
> >
> > Do you think that's doable?
>
> That seems reasonable to me.
>
> Dave are you happy with me taking this, and 2/6, through
> the renesas tree?
As the previous change to this file was acked by Dave, and went in through
the Renesas tree, have I applied this patch and patch 2/6, and queued
it for v5.4.
Thanks!
> > Documentation/devicetree/bindings/net/can/rcar_canfd.txt | 9 +++++----
> > 1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/net/can/rcar_canfd.txt b/Documentation/devicetree/bindings/net/can/rcar_canfd.txt
> > index 32f051f..00afaff 100644
> > --- a/Documentation/devicetree/bindings/net/can/rcar_canfd.txt
> > +++ b/Documentation/devicetree/bindings/net/can/rcar_canfd.txt
> > @@ -4,6 +4,7 @@ Renesas R-Car CAN FD controller Device Tree Bindings
> > Required properties:
> > - compatible: Must contain one or more of the following:
> > - "renesas,rcar-gen3-canfd" for R-Car Gen3 and RZ/G2 compatible controllers.
> > + - "renesas,r8a774a1-canfd" for R8A774A1 (RZ/G2M) compatible controller.
> > - "renesas,r8a774c0-canfd" for R8A774C0 (RZ/G2E) compatible controller.
> > - "renesas,r8a7795-canfd" for R8A7795 (R-Car H3) compatible controller.
> > - "renesas,r8a7796-canfd" for R8A7796 (R-Car M3-W) compatible controller.
> > @@ -32,10 +33,10 @@ enable/disable the respective channel.
> > Required properties for "renesas,r8a774c0-canfd", "renesas,r8a7795-canfd",
> > "renesas,r8a7796-canfd", "renesas,r8a77965-canfd", and "renesas,r8a77990-canfd"
> > compatible:
> > -In R8A774C0, R8A7795, R8A7796, R8A77965, and R8A77990 SoCs, canfd clock is a
> > -div6 clock and can be used by both CAN and CAN FD controller at the same time.
> > -It needs to be scaled to maximum frequency if any of these controllers use it.
> > -This is done using the below properties:
> > +In R8A774A1, R8A774C0, R8A7795, R8A7796, R8A77965, and R8A77990 SoCs, canfd
> > +clock is a div6 clock and can be used by both CAN and CAN FD controller at the
> > +same time. It needs to be scaled to maximum frequency if any of these
> > +controllers use it. This is done using the below properties:
> >
> > - assigned-clocks: phandle of canfd clock.
> > - assigned-clock-rates: maximum frequency of this clock.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* [PATCH] ath10k: work around uninitialized vht_pfr variable
From: Arnd Bergmann @ 2019-07-08 12:50 UTC (permalink / raw)
To: Kalle Valo
Cc: Arnd Bergmann, Miaoqing Pan, David S. Miller, Rakesh Pillai,
Brian Norris, Balaji Pothunoori, Wen Gong, Pradeep kumar Chitrapu,
Sriram R, ath10k, linux-wireless, netdev, linux-kernel,
clang-built-linux
As clang points out, the vht_pfr is assigned to a struct member
without being initialized in one case:
drivers/net/wireless/ath/ath10k/mac.c:7528:7: error: variable 'vht_pfr' is used uninitialized whenever 'if' condition
is false [-Werror,-Wsometimes-uninitialized]
if (!ath10k_mac_can_set_bitrate_mask(ar, band, mask,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:7551:20: note: uninitialized use occurs here
arvif->vht_pfr = vht_pfr;
^~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:7528:3: note: remove the 'if' if its condition is always true
if (!ath10k_mac_can_set_bitrate_mask(ar, band, mask,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ath/ath10k/mac.c:7483:12: note: initialize the variable 'vht_pfr' to silence this warning
u8 vht_pfr;
Add an explicit but probably incorrect initialization here.
I suspect we want a better fix here, but chose this approach to
illustrate the issue.
Fixes: 8b97b055dc9d ("ath10k: fix failure to set multiple fixed rate")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/wireless/ath/ath10k/mac.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index e43a566eef77..0606416dc971 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -7541,6 +7541,8 @@ static int ath10k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw,
&vht_nss,
true);
update_bitrate_mask = false;
+ } else {
+ vht_pfr = 0;
}
mutex_lock(&ar->conf_mutex);
--
2.20.0
^ permalink raw reply related
* [PATCH] [net-next] macb: fix build warning for !CONFIG_OF
From: Arnd Bergmann @ 2019-07-08 12:48 UTC (permalink / raw)
To: Nicolas Ferre, David S. Miller, Palmer Dabbelt, Paul Walmsley
Cc: Arnd Bergmann, Yash Shah, Harini Katakam, Claudiu Beznea, netdev,
linux-kernel, linux-riscv
When CONFIG_OF is disabled, we get a harmless warning about the
newly added variable:
drivers/net/ethernet/cadence/macb_main.c:48:39: error: 'mgmt' defined but not used [-Werror=unused-variable]
static struct sifive_fu540_macb_mgmt *mgmt;
Move the variable closer to its use inside of the #ifdef.
Fixes: c218ad559020 ("macb: Add support for SiFive FU540-C000")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/cadence/macb_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index a27d32f69de9..5ca17e62dc3e 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -45,8 +45,6 @@ struct sifive_fu540_macb_mgmt {
struct clk_hw hw;
};
-static struct sifive_fu540_macb_mgmt *mgmt;
-
#define MACB_RX_BUFFER_SIZE 128
#define RX_BUFFER_MULTIPLE 64 /* bytes */
@@ -3628,6 +3626,8 @@ static int macb_init(struct platform_device *pdev)
/* max number of receive buffers */
#define AT91ETHER_MAX_RX_DESCR 9
+static struct sifive_fu540_macb_mgmt *mgmt;
+
/* Initialize and start the Receiver and Transmit subsystems */
static int at91ether_start(struct net_device *dev)
{
--
2.20.0
^ permalink raw reply related
* [PATCH] [RFC] Revert "bpf: Fix ORC unwinding in non-JIT BPF code"
From: Arnd Bergmann @ 2019-07-08 12:45 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann
Cc: Josh Poimboeuf, Arnd Bergmann, Martin KaFai Lau, netdev, bpf,
linux-kernel
Apparently this was a bit premature, at least I still get this
warning with gcc-8.1:
kernel/bpf/core.o: warning: objtool: ___bpf_prog_run()+0x44d2: sibling call from callable instruction with modified stack frame
This reverts commit b22cf36c189f31883ad0238a69ccf82aa1f3b16b.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
kernel/bpf/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 7e98f36a14e2..16079550db6d 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -1299,7 +1299,7 @@ static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn, u64 *stack)
{
#define BPF_INSN_2_LBL(x, y) [BPF_##x | BPF_##y] = &&x##_##y
#define BPF_INSN_3_LBL(x, y, z) [BPF_##x | BPF_##y | BPF_##z] = &&x##_##y##_##z
- static const void * const jumptable[256] __annotate_jump_table = {
+ static const void *jumptable[256] = {
[0 ... 255] = &&default_label,
/* Now overwrite non-defaults ... */
BPF_INSN_MAP(BPF_INSN_2_LBL, BPF_INSN_3_LBL),
@@ -1558,6 +1558,7 @@ static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn, u64 *stack)
BUG_ON(1);
return 0;
}
+STACK_FRAME_NON_STANDARD(___bpf_prog_run); /* jump table */
#define PROG_NAME(stack_size) __bpf_prog_run##stack_size
#define DEFINE_BPF_PROG_RUN(stack_size) \
--
2.20.0
^ permalink raw reply related
* [PATCH] [net-next] gve: fix unused variable/label warnings
From: Arnd Bergmann @ 2019-07-08 12:43 UTC (permalink / raw)
To: Catherine Sullivan, David S. Miller
Cc: Arnd Bergmann, Sagi Shahar, Jon Olson, Willem de Bruijn,
Luigi Rizzo, netdev, linux-kernel
On unusual page sizes, we get harmless warnings:
drivers/net/ethernet/google/gve/gve_rx.c:283:6: error: unused variable 'pagecount' [-Werror,-Wunused-variable]
drivers/net/ethernet/google/gve/gve_rx.c:336:1: error: unused label 'have_skb' [-Werror,-Wunused-label]
Change the preprocessor #if to regular if() to avoid this.
Fixes: f5cedc84a30d ("gve: Add transmit and receive support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/google/gve/gve_rx.c | 66 ++++++++++++------------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/drivers/net/ethernet/google/gve/gve_rx.c b/drivers/net/ethernet/google/gve/gve_rx.c
index 84e0ecce14c4..c1aeabd1c594 100644
--- a/drivers/net/ethernet/google/gve/gve_rx.c
+++ b/drivers/net/ethernet/google/gve/gve_rx.c
@@ -297,41 +297,41 @@ static bool gve_rx(struct gve_rx_ring *rx, struct gve_rx_desc *rx_desc,
* it so that we can return it to the device.
*/
-#if PAGE_SIZE == 4096
- if (len <= priv->rx_copybreak) {
- /* Just copy small packets */
- skb = gve_rx_copy(dev, napi, page_info, len);
- goto have_skb;
- }
- if (unlikely(!gve_can_recycle_pages(dev))) {
- skb = gve_rx_copy(dev, napi, page_info, len);
- goto have_skb;
- }
- pagecount = page_count(page_info->page);
- if (pagecount == 1) {
- /* No part of this page is used by any SKBs; we attach
- * the page fragment to a new SKB and pass it up the
- * stack.
- */
- skb = gve_rx_add_frags(dev, napi, page_info, len);
- if (!skb)
- return true;
- /* Make sure the kernel stack can't release the page */
- get_page(page_info->page);
- /* "flip" to other packet buffer on this page */
- gve_rx_flip_buff(page_info, &rx->data.data_ring[idx]);
- } else if (pagecount >= 2) {
- /* We have previously passed the other half of this
- * page up the stack, but it has not yet been freed.
- */
- skb = gve_rx_copy(dev, napi, page_info, len);
+ if (PAGE_SIZE == 4096) {
+ if (len <= priv->rx_copybreak) {
+ /* Just copy small packets */
+ skb = gve_rx_copy(dev, napi, page_info, len);
+ goto have_skb;
+ }
+ if (unlikely(!gve_can_recycle_pages(dev))) {
+ skb = gve_rx_copy(dev, napi, page_info, len);
+ goto have_skb;
+ }
+ pagecount = page_count(page_info->page);
+ if (pagecount == 1) {
+ /* No part of this page is used by any SKBs; we attach
+ * the page fragment to a new SKB and pass it up the
+ * stack.
+ */
+ skb = gve_rx_add_frags(dev, napi, page_info, len);
+ if (!skb)
+ return true;
+ /* Make sure the kernel stack can't release the page */
+ get_page(page_info->page);
+ /* "flip" to other packet buffer on this page */
+ gve_rx_flip_buff(page_info, &rx->data.data_ring[idx]);
+ } else if (pagecount >= 2) {
+ /* We have previously passed the other half of this
+ * page up the stack, but it has not yet been freed.
+ */
+ skb = gve_rx_copy(dev, napi, page_info, len);
+ } else {
+ WARN(pagecount < 1, "Pagecount should never be < 1");
+ return false;
+ }
} else {
- WARN(pagecount < 1, "Pagecount should never be < 1");
- return false;
+ skb = gve_rx_copy(dev, napi, page_info, len);
}
-#else
- skb = gve_rx_copy(dev, napi, page_info, len);
-#endif
have_skb:
/* We didn't manage to allocate an skb but we haven't had any
--
2.20.0
^ permalink raw reply related
* Re: [PATCH net-next 08/16] net/mlx5e: Extend tx diagnose function
From: Jiri Pirko @ 2019-07-08 12:43 UTC (permalink / raw)
To: Tariq Toukan
Cc: David S. Miller, netdev, Eran Ben Elisha, ayal, jiri,
Saeed Mahameed, moshe
In-Reply-To: <1562500388-16847-9-git-send-email-tariqt@mellanox.com>
Sun, Jul 07, 2019 at 01:53:00PM CEST, tariqt@mellanox.com wrote:
>From: Aya Levin <ayal@mellanox.com>
>
>The following patches in the set enhance the diagnostics info of tx
>reporter. Therefore, it is better to pass a pointer to the SQ for
>further data extraction.
>
>Signed-off-by: Aya Levin <ayal@mellanox.com>
>Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply
* Re: [PATCH net-next 07/16] net/mlx5e: Generalize tx reporter's functionality
From: Jiri Pirko @ 2019-07-08 12:42 UTC (permalink / raw)
To: Tariq Toukan
Cc: David S. Miller, netdev, Eran Ben Elisha, ayal, jiri,
Saeed Mahameed, moshe
In-Reply-To: <1562500388-16847-8-git-send-email-tariqt@mellanox.com>
Sun, Jul 07, 2019 at 01:52:59PM CEST, tariqt@mellanox.com wrote:
>From: Aya Levin <ayal@mellanox.com>
>
>Prepare for code sharing with rx reporter, which is added in the
>following patches in the set. Introduce a generic error_ctx for
>agnostic recovery despatch.
>
>Signed-off-by: Aya Levin <ayal@mellanox.com>
>Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
>---
> drivers/net/ethernet/mellanox/mlx5/core/Makefile | 5 +-
> .../net/ethernet/mellanox/mlx5/core/en/health.c | 82 ++++++++++++++
> .../net/ethernet/mellanox/mlx5/core/en/health.h | 15 ++-
> .../ethernet/mellanox/mlx5/core/en/reporter_tx.c | 126 ++++-----------------
> 4 files changed, 124 insertions(+), 104 deletions(-)
> create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/health.c
>
>diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Makefile b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
>index 57d2cc666fe3..23d566a45a30 100644
>--- a/drivers/net/ethernet/mellanox/mlx5/core/Makefile
>+++ b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
>@@ -23,8 +23,9 @@ mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
> #
> mlx5_core-$(CONFIG_MLX5_CORE_EN) += en_main.o en_common.o en_fs.o en_ethtool.o \
> en_tx.o en_rx.o en_dim.o en_txrx.o en/xdp.o en_stats.o \
>- en_selftest.o en/port.o en/monitor_stats.o en/reporter_tx.o \
>- en/params.o en/xsk/umem.o en/xsk/setup.o en/xsk/rx.o en/xsk/tx.o
>+ en_selftest.o en/port.o en/monitor_stats.o en/health.o \
>+ en/reporter_tx.o en/params.o en/xsk/umem.o en/xsk/setup.o \
>+ en/xsk/rx.o en/xsk/tx.o
>
> #
> # Netdev extra
>diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/health.c b/drivers/net/ethernet/mellanox/mlx5/core/en/health.c
>new file mode 100644
>index 000000000000..60166e5432ae
>--- /dev/null
>+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/health.c
>@@ -0,0 +1,82 @@
>+// SPDX-License-Identifier: GPL-2.0
>+// Copyright (c) 2019 Mellanox Technologies.
>+
>+#include "health.h"
>+#include "lib/eq.h"
>+
>+int mlx5e_health_sq_to_ready(struct mlx5e_channel *channel, u32 sqn)
>+{
>+ struct mlx5_core_dev *mdev = channel->mdev;
>+ struct net_device *dev = channel->netdev;
>+ struct mlx5e_modify_sq_param msp = {0};
>+ int err;
>+
>+ msp.curr_state = MLX5_SQC_STATE_ERR;
>+ msp.next_state = MLX5_SQC_STATE_RST;
>+
>+ err = mlx5e_modify_sq(mdev, sqn, &msp);
>+ if (err) {
>+ netdev_err(dev, "Failed to move sq 0x%x to reset\n", sqn);
>+ return err;
>+ }
>+
>+ memset(&msp, 0, sizeof(msp));
>+ msp.curr_state = MLX5_SQC_STATE_RST;
>+ msp.next_state = MLX5_SQC_STATE_RDY;
>+
>+ err = mlx5e_modify_sq(mdev, sqn, &msp);
>+ if (err) {
>+ netdev_err(dev, "Failed to move sq 0x%x to ready\n", sqn);
>+ return err;
>+ }
>+
>+ return 0;
>+}
>+
>+int mlx5e_health_recover_channels(struct mlx5e_priv *priv)
>+{
>+ int err = 0;
>+
>+ rtnl_lock();
>+ mutex_lock(&priv->state_lock);
>+
>+ if (!test_bit(MLX5E_STATE_OPENED, &priv->state))
>+ goto out;
>+
>+ err = mlx5e_safe_reopen_channels(priv);
>+
>+out:
>+ mutex_unlock(&priv->state_lock);
>+ rtnl_unlock();
>+
>+ return err;
>+}
>+
>+int mlx5e_health_channel_eq_recover(struct mlx5_eq_comp *eq, struct mlx5e_channel *channel)
>+{
>+ u32 eqe_count;
>+
>+ netdev_err(channel->netdev, "EQ 0x%x: Cons = 0x%x, irqn = 0x%x\n",
>+ eq->core.eqn, eq->core.cons_index, eq->core.irqn);
>+
>+ eqe_count = mlx5_eq_poll_irq_disabled(eq);
>+ if (!eqe_count)
>+ return -EIO;
>+
>+ netdev_err(channel->netdev, "Recovered %d eqes on EQ 0x%x\n",
>+ eqe_count, eq->core.eqn);
>+
>+ channel->stats->eq_rearm++;
>+ return 0;
>+}
>+
>+int mlx5e_health_report(struct mlx5e_priv *priv,
>+ struct devlink_health_reporter *reporter, char *err_str,
>+ struct mlx5e_err_ctx *err_ctx)
>+{
>+ if (!reporter) {
>+ netdev_err(priv->netdev, err_str);
>+ return err_ctx->recover(&err_ctx->ctx);
>+ }
>+ return devlink_health_report(reporter, err_str, err_ctx);
>+}
>diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/health.h b/drivers/net/ethernet/mellanox/mlx5/core/en/health.h
>index e3a3bcee89e7..960aa18c425d 100644
>--- a/drivers/net/ethernet/mellanox/mlx5/core/en/health.h
>+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/health.h
>@@ -4,7 +4,6 @@
> #ifndef __MLX5E_EN_REPORTER_H
> #define __MLX5E_EN_REPORTER_H
>
>-#include <linux/mlx5/driver.h>
How is this related to the rest of the patch?
> #include "en.h"
>
> int mlx5e_reporter_tx_create(struct mlx5e_priv *priv);
>@@ -12,4 +11,18 @@
> void mlx5e_reporter_tx_err_cqe(struct mlx5e_txqsq *sq);
> int mlx5e_reporter_tx_timeout(struct mlx5e_txqsq *sq);
>
>+#define MLX5E_REPORTER_PER_Q_MAX_LEN 256
>+
>+struct mlx5e_err_ctx {
>+ int (*recover)(void *ctx);
>+ void *ctx;
>+};
>+
>+int mlx5e_health_sq_to_ready(struct mlx5e_channel *channel, u32 sqn);
>+int mlx5e_health_channel_eq_recover(struct mlx5_eq_comp *eq, struct mlx5e_channel *channel);
>+int mlx5e_health_recover_channels(struct mlx5e_priv *priv);
>+int mlx5e_health_report(struct mlx5e_priv *priv,
>+ struct devlink_health_reporter *reporter, char *err_str,
>+ struct mlx5e_err_ctx *err_ctx);
>+
> #endif
>diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
>index d5ecfcfe5d52..3e03a1ac8e5a 100644
>--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
>+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
>@@ -2,14 +2,6 @@
> /* Copyright (c) 2019 Mellanox Technologies. */
>
> #include "health.h"
>-#include "lib/eq.h"
>-
>-#define MLX5E_TX_REPORTER_PER_SQ_MAX_LEN 256
>-
>-struct mlx5e_tx_err_ctx {
>- int (*recover)(struct mlx5e_txqsq *sq);
>- struct mlx5e_txqsq *sq;
>-};
>
> static int mlx5e_wait_for_sq_flush(struct mlx5e_txqsq *sq)
> {
>@@ -39,37 +31,9 @@ static void mlx5e_reset_txqsq_cc_pc(struct mlx5e_txqsq *sq)
> sq->pc = 0;
> }
>
>-static int mlx5e_sq_to_ready(struct mlx5e_txqsq *sq, int curr_state)
>-{
>- struct mlx5_core_dev *mdev = sq->channel->mdev;
>- struct net_device *dev = sq->channel->netdev;
>- struct mlx5e_modify_sq_param msp = {0};
>- int err;
>-
>- msp.curr_state = curr_state;
>- msp.next_state = MLX5_SQC_STATE_RST;
>-
>- err = mlx5e_modify_sq(mdev, sq->sqn, &msp);
>- if (err) {
>- netdev_err(dev, "Failed to move sq 0x%x to reset\n", sq->sqn);
>- return err;
>- }
>-
>- memset(&msp, 0, sizeof(msp));
>- msp.curr_state = MLX5_SQC_STATE_RST;
>- msp.next_state = MLX5_SQC_STATE_RDY;
>-
>- err = mlx5e_modify_sq(mdev, sq->sqn, &msp);
>- if (err) {
>- netdev_err(dev, "Failed to move sq 0x%x to ready\n", sq->sqn);
>- return err;
>- }
>-
>- return 0;
>-}
>-
>-static int mlx5e_tx_reporter_err_cqe_recover(struct mlx5e_txqsq *sq)
>+static int mlx5e_tx_reporter_err_cqe_recover(void *ctx)
> {
>+ struct mlx5e_txqsq *sq = (struct mlx5e_txqsq *)ctx;
No need to cast from void *
> struct mlx5_core_dev *mdev = sq->channel->mdev;
> struct net_device *dev = sq->channel->netdev;
> u8 state;
>@@ -101,7 +65,7 @@ static int mlx5e_tx_reporter_err_cqe_recover(struct mlx5e_txqsq *sq)
> * pending WQEs. SQ can safely reset the SQ.
> */
>
>- err = mlx5e_sq_to_ready(sq, state);
>+ err = mlx5e_health_sq_to_ready(sq->channel, sq->sqn);
> if (err)
> return err;
>
>@@ -112,104 +76,64 @@ static int mlx5e_tx_reporter_err_cqe_recover(struct mlx5e_txqsq *sq)
> return 0;
> }
>
>-static int mlx5_tx_health_report(struct devlink_health_reporter *tx_reporter,
>- char *err_str,
>- struct mlx5e_tx_err_ctx *err_ctx)
>-{
>- if (!tx_reporter) {
>- netdev_err(err_ctx->sq->channel->netdev, err_str);
>- return err_ctx->recover(err_ctx->sq);
>- }
>-
>- return devlink_health_report(tx_reporter, err_str, err_ctx);
>-}
>-
> void mlx5e_reporter_tx_err_cqe(struct mlx5e_txqsq *sq)
> {
>- char err_str[MLX5E_TX_REPORTER_PER_SQ_MAX_LEN];
>- struct mlx5e_tx_err_ctx err_ctx = {0};
>+ struct mlx5e_priv *priv = sq->channel->priv;
>+ char err_str[MLX5E_REPORTER_PER_Q_MAX_LEN];
>+ struct mlx5e_err_ctx err_ctx = {0};
>
>- err_ctx.sq = sq;
>- err_ctx.recover = mlx5e_tx_reporter_err_cqe_recover;
>+ err_ctx.ctx = sq;
>+ err_ctx.recover = mlx5e_tx_reporter_err_cqe_recover;
> sprintf(err_str, "ERR CQE on SQ: 0x%x", sq->sqn);
>
>- mlx5_tx_health_report(sq->channel->priv->tx_reporter, err_str,
>- &err_ctx);
>+ mlx5e_health_report(priv, priv->tx_reporter, err_str, &err_ctx);
> }
>
>-static int mlx5e_tx_reporter_timeout_recover(struct mlx5e_txqsq *sq)
>+static int mlx5e_tx_reporter_timeout_recover(void *ctx)
> {
>+ struct mlx5e_txqsq *sq = (struct mlx5e_txqsq *)ctx;
No need to cast from void *
> struct mlx5_eq_comp *eq = sq->cq.mcq.eq;
>- u32 eqe_count;
>- int ret;
>-
>- netdev_err(sq->channel->netdev, "EQ 0x%x: Cons = 0x%x, irqn = 0x%x\n",
>- eq->core.eqn, eq->core.cons_index, eq->core.irqn);
>+ int err;
>
>- eqe_count = mlx5_eq_poll_irq_disabled(eq);
>- ret = eqe_count ? false : true;
>- if (!eqe_count) {
>+ err = mlx5e_health_channel_eq_recover(eq, sq->channel);
>+ if (err)
> clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state);
>- return ret;
>- }
>
>- netdev_err(sq->channel->netdev, "Recover %d eqes on EQ 0x%x\n",
>- eqe_count, eq->core.eqn);
>- sq->channel->stats->eq_rearm++;
>- return ret;
>+ return err;
> }
>
> int mlx5e_reporter_tx_timeout(struct mlx5e_txqsq *sq)
> {
>- char err_str[MLX5E_TX_REPORTER_PER_SQ_MAX_LEN];
>- struct mlx5e_tx_err_ctx err_ctx;
>+ struct mlx5e_priv *priv = sq->channel->priv;
>+ char err_str[MLX5E_REPORTER_PER_Q_MAX_LEN];
>+ struct mlx5e_err_ctx err_ctx;
>
>- err_ctx.sq = sq;
>- err_ctx.recover = mlx5e_tx_reporter_timeout_recover;
>+ err_ctx.ctx = sq;
>+ err_ctx.recover = mlx5e_tx_reporter_timeout_recover;
> sprintf(err_str,
> "TX timeout on queue: %d, SQ: 0x%x, CQ: 0x%x, SQ Cons: 0x%x SQ Prod: 0x%x, usecs since last trans: %u\n",
> sq->channel->ix, sq->sqn, sq->cq.mcq.cqn, sq->cc, sq->pc,
> jiffies_to_usecs(jiffies - sq->txq->trans_start));
>
>- return mlx5_tx_health_report(sq->channel->priv->tx_reporter, err_str,
>- &err_ctx);
>+ return mlx5e_health_report(priv, priv->tx_reporter, err_str, &err_ctx);
> }
>
> /* state lock cannot be grabbed within this function.
> * It can cause a dead lock or a read-after-free.
> */
>-static int mlx5e_tx_reporter_recover_from_ctx(struct mlx5e_tx_err_ctx *err_ctx)
>+static int mlx5e_tx_reporter_recover_from_ctx(struct mlx5e_err_ctx *err_ctx)
> {
>- return err_ctx->recover(err_ctx->sq);
>-}
>-
>-static int mlx5e_tx_reporter_recover_all(struct mlx5e_priv *priv)
>-{
>- int err = 0;
>-
>- rtnl_lock();
>- mutex_lock(&priv->state_lock);
>-
>- if (!test_bit(MLX5E_STATE_OPENED, &priv->state))
>- goto out;
>-
>- err = mlx5e_safe_reopen_channels(priv);
>-
>-out:
>- mutex_unlock(&priv->state_lock);
>- rtnl_unlock();
>-
>- return err;
>+ return err_ctx->recover(err_ctx->ctx);
> }
>
> static int mlx5e_tx_reporter_recover(struct devlink_health_reporter *reporter,
> void *context)
> {
> struct mlx5e_priv *priv = devlink_health_reporter_priv(reporter);
>- struct mlx5e_tx_err_ctx *err_ctx = context;
>+ struct mlx5e_err_ctx *err_ctx = context;
>
> return err_ctx ? mlx5e_tx_reporter_recover_from_ctx(err_ctx) :
>- mlx5e_tx_reporter_recover_all(priv);
>+ mlx5e_health_recover_channels(priv);
> }
>
> static int
>--
>1.8.3.1
>
^ permalink raw reply
* [PATCH 14/14] net: phy: Make use of linkmode_mod_bit helper
From: Fuqian Huang @ 2019-07-08 12:34 UTC (permalink / raw)
Cc: Andrew Lunn, Florian Fainelli, Heiner Kallweit, David S . Miller,
netdev, linux-kernel, Fuqian Huang
linkmode_mod_bit is introduced as a helper function to set/clear
bits in a linkmode.
Replace the if else code structure with a call to the helper
linkmode_mod_bit.
Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
---
drivers/net/phy/phy.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index e8885429293a..75b8e5aff747 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -297,12 +297,8 @@ int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd)
linkmode_copy(phydev->advertising, advertising);
- if (AUTONEG_ENABLE == cmd->autoneg)
- linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
- phydev->advertising);
- else
- linkmode_clear_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
- phydev->advertising);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
+ phydev->advertising, AUTONEG_ENABLE == cmd->autoneg);
phydev->duplex = cmd->duplex;
@@ -352,12 +348,8 @@ int phy_ethtool_ksettings_set(struct phy_device *phydev,
linkmode_copy(phydev->advertising, advertising);
- if (autoneg == AUTONEG_ENABLE)
- linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
- phydev->advertising);
- else
- linkmode_clear_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
- phydev->advertising);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
+ phydev->advertising, autoneg == AUTONEG_ENABLE);
phydev->duplex = duplex;
--
2.11.0
^ permalink raw reply related
* [PATCH net] net: stmmac: Re-work the queue selection for TSO packets
From: Jose Abreu @ 2019-07-08 12:26 UTC (permalink / raw)
To: netdev
Cc: Joao Pinto, Jose Abreu, Giuseppe Cavallaro, Alexandre Torgue,
David S. Miller, Maxime Coquelin, linux-stm32, linux-arm-kernel,
linux-kernel, Ben Hutchings
Ben Hutchings says:
"This is the wrong place to change the queue mapping.
stmmac_xmit() is called with a specific TX queue locked,
and accessing a different TX queue results in a data race
for all of that queue's state.
I think this commit should be reverted upstream and in all
stable branches. Instead, the driver should implement the
ndo_select_queue operation and override the queue mapping there."
Fixes: c5acdbee22a1 ("net: stmmac: Send TSO packets always from Queue 0")
Suggested-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
---
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Jose Abreu <joabreu@synopsys.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: netdev@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: Ben Hutchings <ben@decadent.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 28 +++++++++++++++--------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 06358fe5b245..11b6feb33b54 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3045,17 +3045,8 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
/* Manage oversized TCP frames for GMAC4 device */
if (skb_is_gso(skb) && priv->tso) {
- if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) {
- /*
- * There is no way to determine the number of TSO
- * capable Queues. Let's use always the Queue 0
- * because if TSO is supported then at least this
- * one will be capable.
- */
- skb_set_queue_mapping(skb, 0);
-
+ if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))
return stmmac_tso_xmit(skb, dev);
- }
}
if (unlikely(stmmac_tx_avail(priv, queue) < nfrags + 1)) {
@@ -3872,6 +3863,22 @@ static int stmmac_setup_tc(struct net_device *ndev, enum tc_setup_type type,
}
}
+static u16 stmmac_select_queue(struct net_device *dev, struct sk_buff *skb,
+ struct net_device *sb_dev)
+{
+ if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) {
+ /*
+ * There is no way to determine the number of TSO
+ * capable Queues. Let's use always the Queue 0
+ * because if TSO is supported then at least this
+ * one will be capable.
+ */
+ return 0;
+ }
+
+ return netdev_pick_tx(dev, skb, NULL) % dev->real_num_tx_queues;
+}
+
static int stmmac_set_mac_address(struct net_device *ndev, void *addr)
{
struct stmmac_priv *priv = netdev_priv(ndev);
@@ -4088,6 +4095,7 @@ static const struct net_device_ops stmmac_netdev_ops = {
.ndo_tx_timeout = stmmac_tx_timeout,
.ndo_do_ioctl = stmmac_ioctl,
.ndo_setup_tc = stmmac_setup_tc,
+ .ndo_select_queue = stmmac_select_queue,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = stmmac_poll_controller,
#endif
--
2.7.4
^ permalink raw reply related
* Re: [PATCH net] tcp: Reset bytes_acked and bytes_received when disconnecting
From: Eric Dumazet @ 2019-07-08 12:26 UTC (permalink / raw)
To: Christoph Paasch; +Cc: netdev, David Miller
In-Reply-To: <20190706231307.98483-1-cpaasch@apple.com>
On Sun, Jul 7, 2019 at 1:13 AM Christoph Paasch <cpaasch@apple.com> wrote:
>
> If an app is playing tricks to reuse a socket via tcp_disconnect(),
> bytes_acked/received needs to be reset to 0. Otherwise tcp_info will
> report the sum of the current and the old connection..
>
> Cc: Eric Dumazet <edumazet@google.com>
> Fixes: 0df48c26d841 ("tcp: add tcpi_bytes_acked to tcp_info")
> Fixes: bdd1f9edacb5 ("tcp: add tcpi_bytes_received to tcp_info")
> Signed-off-by: Christoph Paasch <cpaasch@apple.com>
> ---
Signed-off-by: Eric Dumazet <edumazet@google.com>
I am sure other fields miss their zeroing as well.
^ permalink raw reply
* Re: [PATCH net-next v6 05/15] ethtool: helper functions for netlink interface
From: Michal Kubecek @ 2019-07-08 12:22 UTC (permalink / raw)
To: netdev
Cc: Jiri Pirko, David Miller, Jakub Kicinski, Andrew Lunn,
Florian Fainelli, John Linville, Stephen Hemminger, Johannes Berg,
linux-kernel
In-Reply-To: <20190703100435.GS2250@nanopsycho>
On Wed, Jul 03, 2019 at 12:04:35PM +0200, Jiri Pirko wrote:
> Tue, Jul 02, 2019 at 06:34:37PM CEST, mkubecek@suse.cz wrote:
> >On Tue, Jul 02, 2019 at 03:05:15PM +0200, Jiri Pirko wrote:
> >> Tue, Jul 02, 2019 at 01:50:04PM CEST, mkubecek@suse.cz wrote:
> >> >+/**
> >> >+ * ethnl_is_privileged() - check if request has sufficient privileges
> >> >+ * @skb: skb with client request
> >> >+ *
> >> >+ * Checks if client request has CAP_NET_ADMIN in its netns. Unlike the flags
> >> >+ * in genl_ops, this allows finer access control, e.g. allowing or denying
> >> >+ * the request based on its contents or witholding only part of the data
> >> >+ * from unprivileged users.
> >> >+ *
> >> >+ * Return: true if request is privileged, false if not
> >> >+ */
> >> >+static inline bool ethnl_is_privileged(struct sk_buff *skb)
> >>
> >> I wonder why you need this helper. Genetlink uses
> >> ops->flags & GENL_ADMIN_PERM for this.
> >
> >It's explained in the function description. Sometimes we need finer
> >control than by request message type. An example is the WoL password:
> >ETHTOOL_GWOL is privileged because of it but I believe there si no
> >reason why unprivileged user couldn't see enabled WoL modes, we can
> >simply omit the password for him. (Also, it allows to combine query for
> >WoL settings with other unprivileged settings.)
>
> Why can't we have rather:
> ETHTOOL_WOL_GET for all
> ETHTOOL_WOL_PASSWORD_GET with GENL_ADMIN_PERM
> ?
> Better to stick with what we have in gennetlink rather then to bend the
> implementation from the very beginning I think.
We can. But it would also mean two separate SET requests (or breaking
the rule that _GET_REPLY, _SET and _NTF share the layout). That would be
unfortunate as ethtool_ops callback does not actually allow setting only
the modes so that the ETHTOOL_MSG_WOL_SET request (which would have to
go first as many drivers ignore .sopass if WAKE_MAGICSECURE is not set)
would have to pass a different password (most likely just leaving what
->get_wol() put there) and that password would be actually set until the
second request arrives. There goes the idea of getting rid of ioctl
interface raciness...
I would rather see returning to WoL modes not being visible to
unprivileged users than that (even if there is no actual reason for it).
Anyway, shortening the series left WoL settings out if the first part so
that I can split this out for now and leave the discussion for when we
get to WoL one day.
> >> >+/**
> >> >+ * ethnl_reply_header_size() - total size of reply header
> >> >+ *
> >> >+ * This is an upper estimate so that we do not need to hold RTNL lock longer
> >> >+ * than necessary (to prevent rename between size estimate and composing the
> >>
> >> I guess this description is not relevant anymore. I don't see why to
> >> hold rtnl mutex for this function...
> >
> >You don't need it for this function, it's the other way around: unless
> >you hold RTNL lock for the whole time covering both checking needed
> >message size and filling the message - and we don't - the device could
> >be renamed in between. Thus if we returned size based on current device
> >name, it might not be sufficient at the time the header is filled.
> >That's why this function returns maximum possible size (which is
> >actually a constant).
>
> I suggest to avoid the description. It is misleading. Perhaps something
> to have in a patch description but not here in code.
The reason I put the comment there was to prevent someone "optimizing"
the helper by using strlen() later. Maybe something shorter and more to
the point, e.g.
Using IFNAMSIZ is faster and prevents a race if the device is renamed
before we fill the name into skb.
?
Michal
^ permalink raw reply
* Re: [PATCH net-next 06/16] net/mlx5e: Change naming convention for reporter's functions
From: Jiri Pirko @ 2019-07-08 11:29 UTC (permalink / raw)
To: Tariq Toukan
Cc: David S. Miller, netdev, Eran Ben Elisha, ayal, jiri,
Saeed Mahameed, moshe
In-Reply-To: <1562500388-16847-7-git-send-email-tariqt@mellanox.com>
Sun, Jul 07, 2019 at 01:52:58PM CEST, tariqt@mellanox.com wrote:
>From: Aya Levin <ayal@mellanox.com>
>
>Change from mlx5e_tx_reporter_* to mlx5e_reporter_tx_*. In the following
>patches in the set rx reporter is added, the new naming convention is
>more uniformed.
>
>Signed-off-by: Aya Levin <ayal@mellanox.com>
>Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply
* Re: [RFC PATCH net-next 3/6] net: dsa: Pass tc-taprio offload to drivers
From: Ilias Apalodimas @ 2019-07-08 11:23 UTC (permalink / raw)
To: Vladimir Oltean
Cc: f.fainelli, vivien.didelot, andrew, davem, vinicius.gomes,
vedang.patel, richardcochran, weifeng.voon, jiri, m-karicheri2,
Jose.Abreu, netdev
In-Reply-To: <20190707172921.17731-4-olteanv@gmail.com>
Hi Vladimir,
> tc-taprio is a qdisc based on the enhancements for scheduled traffic
> specified in IEEE 802.1Qbv (later merged in 802.1Q). This qdisc has
> a software implementation and an optional offload through which
> compatible Ethernet ports may configure their egress 802.1Qbv
> schedulers.
>
> Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
> ---
> include/net/dsa.h | 3 +++
> net/dsa/slave.c | 14 ++++++++++++++
> 2 files changed, 17 insertions(+)
>
> diff --git a/include/net/dsa.h b/include/net/dsa.h
> index 1e8650fa8acc..e7ee6ac8ce6b 100644
> --- a/include/net/dsa.h
> +++ b/include/net/dsa.h
> @@ -152,6 +152,7 @@ struct dsa_mall_tc_entry {
> };
> };
>
> +struct tc_taprio_qopt_offload;
>
> struct dsa_port {
> /* A CPU port is physically connected to a master device.
> @@ -516,6 +517,8 @@ struct dsa_switch_ops {
> bool ingress);
> void (*port_mirror_del)(struct dsa_switch *ds, int port,
> struct dsa_mall_mirror_tc_entry *mirror);
> + int (*port_setup_taprio)(struct dsa_switch *ds, int port,
> + struct tc_taprio_qopt_offload *qopt);
Is there any way to make this more generic? 802.1Qbv are not the only hardware
schedulers. CBS and ETF are examples that first come to mind. Maybe having
something more generic than tc_taprio_qopt_offload as an option could host
future schedulers?
>
> /*
> * Cross-chip operations
> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index 99673f6b07f6..2bae33788708 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -965,12 +965,26 @@ static int dsa_slave_setup_tc_block(struct net_device *dev,
> }
> }
>
> +static int dsa_slave_setup_tc_taprio(struct net_device *dev,
> + struct tc_taprio_qopt_offload *f)
> +{
> + struct dsa_port *dp = dsa_slave_to_port(dev);
> + struct dsa_switch *ds = dp->ds;
> +
> + if (!ds->ops->port_setup_taprio)
> + return -EOPNOTSUPP;
> +
> + return ds->ops->port_setup_taprio(ds, dp->index, f);
> +}
> +
> static int dsa_slave_setup_tc(struct net_device *dev, enum tc_setup_type type,
> void *type_data)
> {
> switch (type) {
> case TC_SETUP_BLOCK:
> return dsa_slave_setup_tc_block(dev, type_data);
> + case TC_SETUP_QDISC_TAPRIO:
> + return dsa_slave_setup_tc_taprio(dev, type_data);
> default:
> return -EOPNOTSUPP;
> }
> --
> 2.17.1
>
Thanks
/Ilias
^ permalink raw reply
* Re: [PATCH net-next 05/16] net/mlx5e: Rename reporter header file
From: Jiri Pirko @ 2019-07-08 11:11 UTC (permalink / raw)
To: Tariq Toukan
Cc: David S. Miller, netdev, Eran Ben Elisha, ayal, jiri,
Saeed Mahameed, moshe
In-Reply-To: <1562500388-16847-6-git-send-email-tariqt@mellanox.com>
Sun, Jul 07, 2019 at 01:52:57PM CEST, tariqt@mellanox.com wrote:
>From: Aya Levin <ayal@mellanox.com>
>
>Rename reporter.h -> health.h so patches in the set can use it for
>health related functionality.
>
>Signed-off-by: Aya Levin <ayal@mellanox.com>
>Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
>---
> drivers/net/ethernet/mellanox/mlx5/core/en/health.h | 15 +++++++++++++++
> drivers/net/ethernet/mellanox/mlx5/core/en/reporter.h | 15 ---------------
> drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 2 +-
> drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +-
> 4 files changed, 17 insertions(+), 17 deletions(-)
> create mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/health.h
> delete mode 100644 drivers/net/ethernet/mellanox/mlx5/core/en/reporter.h
>
>diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/health.h b/drivers/net/ethernet/mellanox/mlx5/core/en/health.h
>new file mode 100644
>index 000000000000..e78e92753d73
>--- /dev/null
>+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/health.h
>@@ -0,0 +1,15 @@
>+/* SPDX-License-Identifier: GPL-2.0 */
>+/* Copyright (c) 2019 Mellanox Technologies. */
>+
>+#ifndef __MLX5E_EN_REPORTER_H
>+#define __MLX5E_EN_REPORTER_H
This should be "__MLX5E_EN_HEALTH_H" now.
[...]
^ permalink raw reply
* Re: [PATCH net-next 02/16] net/mlx5e: Fix error flow in tx reporter diagnose
From: Jiri Pirko @ 2019-07-08 11:09 UTC (permalink / raw)
To: Tariq Toukan
Cc: David S. Miller, netdev, Eran Ben Elisha, ayal, jiri,
Saeed Mahameed, moshe
In-Reply-To: <1562500388-16847-3-git-send-email-tariqt@mellanox.com>
Sun, Jul 07, 2019 at 01:52:54PM CEST, tariqt@mellanox.com wrote:
>From: Aya Levin <ayal@mellanox.com>
>
>Fix tx reporter's diagnose call back. Propagate error when failing to
s/call back/callback/ - it's a noun.
>gather diagnostics information or failing to print diagnostic data per
>queue.
>
>Signed-off-by: Aya Levin <ayal@mellanox.com>
>Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
It's a fix, please provide "Fixes" line:
Fixes: de8650a82071 ("net/mlx5e: Add tx reporter support")
Also, it should be most likely sent to -net tree.
The patch itself looks fine.
Acked-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply
* [PATCH net-next] sfc: Remove 'PCIE error reporting unavailable'
From: Martin Habets @ 2019-07-08 11:07 UTC (permalink / raw)
To: mhabets, davem, linux-net-drivers; +Cc: netdev
This is only at notice level but it was pointed out that no other driver
does this.
Also there is no action the user can take as it is really a property of
the server.
Signed-off-by: Martin Habets <mhabets@solarflare.com>
---
drivers/net/ethernet/sfc/efx.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 53b726bfe945..ab58b837df47 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -3614,11 +3614,7 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
netif_warn(efx, probe, efx->net_dev,
"failed to create MTDs (%d)\n", rc);
- rc = pci_enable_pcie_error_reporting(pci_dev);
- if (rc && rc != -EINVAL)
- netif_notice(efx, probe, efx->net_dev,
- "PCIE error reporting unavailable (%d).\n",
- rc);
+ (void)pci_enable_pcie_error_reporting(pci_dev);
if (efx->type->udp_tnl_push_ports)
efx->type->udp_tnl_push_ports(efx);
^ permalink raw reply related
* [PATCH bpf] xdp: fix potential deadlock on socket mutex
From: Ilya Maximets @ 2019-07-08 11:03 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, bpf, xdp-newbies, David S. Miller,
Björn Töpel, Magnus Karlsson, Jonathan Lemon,
Jakub Kicinski, Alexei Starovoitov, Daniel Borkmann,
Ilya Maximets
In-Reply-To: <CGME20190708110350eucas1p16357da1f812ff8309b1edc98d4cdacc1@eucas1p1.samsung.com>
There are 2 call chains:
a) xsk_bind --> xdp_umem_assign_dev
b) unregister_netdevice_queue --> xsk_notifier
with the following locking order:
a) xs->mutex --> rtnl_lock
b) rtnl_lock --> xdp.lock --> xs->mutex
Different order of taking 'xs->mutex' and 'rtnl_lock' could produce a
deadlock here. Fix that by moving the 'rtnl_lock' before 'xs->lock' in
the bind call chain (a).
Reported-by: syzbot+bf64ec93de836d7f4c2c@syzkaller.appspotmail.com
Fixes: 455302d1c9ae ("xdp: fix hang while unregistering device bound to xdp socket")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---
This patch is a fix for patch that is not yet in mainline, but
already in 'net' tree. I'm not sure what is the correct process
for applying such fixes.
net/xdp/xdp_umem.c | 16 ++++++----------
net/xdp/xsk.c | 2 ++
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c
index 20c91f02d3d8..83de74ca729a 100644
--- a/net/xdp/xdp_umem.c
+++ b/net/xdp/xdp_umem.c
@@ -87,21 +87,20 @@ int xdp_umem_assign_dev(struct xdp_umem *umem, struct net_device *dev,
struct netdev_bpf bpf;
int err = 0;
+ ASSERT_RTNL();
+
force_zc = flags & XDP_ZEROCOPY;
force_copy = flags & XDP_COPY;
if (force_zc && force_copy)
return -EINVAL;
- rtnl_lock();
- if (xdp_get_umem_from_qid(dev, queue_id)) {
- err = -EBUSY;
- goto out_rtnl_unlock;
- }
+ if (xdp_get_umem_from_qid(dev, queue_id))
+ return -EBUSY;
err = xdp_reg_umem_at_qid(dev, umem, queue_id);
if (err)
- goto out_rtnl_unlock;
+ return err;
umem->dev = dev;
umem->queue_id = queue_id;
@@ -110,7 +109,7 @@ int xdp_umem_assign_dev(struct xdp_umem *umem, struct net_device *dev,
if (force_copy)
/* For copy-mode, we are done. */
- goto out_rtnl_unlock;
+ return 0;
if (!dev->netdev_ops->ndo_bpf ||
!dev->netdev_ops->ndo_xsk_async_xmit) {
@@ -125,7 +124,6 @@ int xdp_umem_assign_dev(struct xdp_umem *umem, struct net_device *dev,
err = dev->netdev_ops->ndo_bpf(dev, &bpf);
if (err)
goto err_unreg_umem;
- rtnl_unlock();
umem->zc = true;
return 0;
@@ -135,8 +133,6 @@ int xdp_umem_assign_dev(struct xdp_umem *umem, struct net_device *dev,
err = 0; /* fallback to copy mode */
if (err)
xdp_clear_umem_at_qid(dev, queue_id);
-out_rtnl_unlock:
- rtnl_unlock();
return err;
}
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 703cf5ea448b..2aa6072a3e55 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -416,6 +416,7 @@ static int xsk_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
if (flags & ~(XDP_SHARED_UMEM | XDP_COPY | XDP_ZEROCOPY))
return -EINVAL;
+ rtnl_lock();
mutex_lock(&xs->mutex);
if (xs->state != XSK_READY) {
err = -EBUSY;
@@ -501,6 +502,7 @@ static int xsk_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
xs->state = XSK_BOUND;
out_release:
mutex_unlock(&xs->mutex);
+ rtnl_unlock();
return err;
}
--
2.17.1
^ permalink raw reply related
* Re: [PATCH net-next 01/16] Revert "net/mlx5e: Fix mlx5e_tx_reporter_create return value"
From: Jiri Pirko @ 2019-07-08 11:03 UTC (permalink / raw)
To: Tariq Toukan
Cc: David S. Miller, netdev, Eran Ben Elisha, ayal, jiri,
Saeed Mahameed, moshe
In-Reply-To: <1562500388-16847-2-git-send-email-tariqt@mellanox.com>
Sun, Jul 07, 2019 at 01:52:53PM CEST, tariqt@mellanox.com wrote:
>From: Aya Levin <ayal@mellanox.com>
>
>This reverts commit 2e5b0534622fa87fd570d54af2d01ce304b88077.
>
>This commit was needed prior to commit f6b19b354d50 ("net: devlink:
>select NET_DEVLINK from drivers") Then, reporter's pointer could have
>been a NULL. But with NET_DEVLINK mandatory to MLX5_CORE in Kconfig,
>pointer can only hold an error in bad path.
>
>Signed-off-by: Aya Levin <ayal@mellanox.com>
>Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
I'm not sure if the patch name "Revert: ..." is correct. I would rather
just describe the change and don't mention the "revert" even in the
patch description.
The patch looks good.
Acked-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox