* Re: [PATCH] mISDN: Delete unnecessary checks before the macro call “dev_kfree_skb”
From: David Miller @ 2019-08-22 23:23 UTC (permalink / raw)
To: Markus.Elfring
Cc: netdev, alexios.zavras, allison, armijn, arnd, huangfq.daxian,
gregkh, hkallweit1, kjlu, isdn, tglx, linux-kernel,
kernel-janitors
In-Reply-To: <689e51d5-9a43-45a4-5d33-75a34eba928a@web.de>
From: Markus Elfring <Markus.Elfring@web.de>
Date: Wed, 21 Aug 2019 20:45:09 +0200
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 21 Aug 2019 20:10:56 +0200
>
> The dev_kfree_skb() function performs also input parameter validation.
> Thus the test around the shown calls is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Applied.
^ permalink raw reply
* Re: [PATCH] can: Delete unnecessary checks before the macro call “dev_kfree_skb”
From: David Miller @ 2019-08-22 23:23 UTC (permalink / raw)
To: Markus.Elfring
Cc: linux-can, netdev, allison, lkml, gregkh, gustavo, lukas, mkl,
sean, tglx, houweitaoo, wg, linux-kernel, kernel-janitors
In-Reply-To: <27674907-fd2a-7f0c-84fd-d8b5124739a9@web.de>
From: Markus Elfring <Markus.Elfring@web.de>
Date: Wed, 21 Aug 2019 21:30:11 +0200
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 21 Aug 2019 21:16:15 +0200
>
> The dev_kfree_skb() function performs also input parameter validation.
> Thus the test around the shown calls is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Applied.
^ permalink raw reply
* Re: [PATCH] hamradio: Delete unnecessary checks before the macro call “dev_kfree_skb”
From: David Miller @ 2019-08-22 23:23 UTC (permalink / raw)
To: Markus.Elfring
Cc: linux-hams, netdev, allison, gregkh, kstewart, rfontana, tglx,
t.sailer, linux-kernel, kernel-janitors
In-Reply-To: <61fc7b82-dbc0-93e4-bf43-9856eb4c6688@web.de>
From: Markus Elfring <Markus.Elfring@web.de>
Date: Wed, 21 Aug 2019 22:00:16 +0200
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 21 Aug 2019 21:48:46 +0200
>
> The dev_kfree_skb() function performs also input parameter validation.
> Thus the test around the shown calls is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Applied.
^ permalink raw reply
* Re: [PATCH] net: usb: Delete unnecessary checks before the macro call “dev_kfree_skb”
From: David Miller @ 2019-08-22 23:23 UTC (permalink / raw)
To: Markus.Elfring
Cc: linux-usb, netdev, gregkh, kstewart, petkan, swinslow, tglx,
linux-kernel, kernel-janitors
In-Reply-To: <425214be-355b-92c0-bc74-1d0ea899290f@web.de>
From: Markus Elfring <Markus.Elfring@web.de>
Date: Wed, 21 Aug 2019 22:24:16 +0200
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 21 Aug 2019 22:16:02 +0200
>
> The dev_kfree_skb() function performs also input parameter validation.
> Thus the test around the shown calls is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Applied.
^ permalink raw reply
* Re: [PATCH] ethernet: Delete unnecessary checks before the macro call “dev_kfree_skb”
From: David Miller @ 2019-08-22 23:23 UTC (permalink / raw)
To: Markus.Elfring
Cc: netdev, linux-arm-kernel, linux-stm32, intel-wired-lan,
bcm-kernel-feedback-list, UNGLinuxDriver, alexandre.torgue,
alexios.zavras, allison, bryan.whitehead, claudiu.manoil, opendmb,
dougmill, f.fainelli, peppe.cavallaro, gregkh, jeffrey.t.kirsher,
opensource, jonathan.lemon, joabreu, kstewart, mcgrof,
mcoquelin.stm32, michael.heimpold, nico, ynezz, shannon.nelson,
stefan.wahren, swinslow, tglx, weiyongjun1, wsa+renesas,
yang.wei9, yuehaibing, zhongjiang, linux-kernel, kernel-janitors
In-Reply-To: <af1ae1cf-4a01-5e3a-edc2-058668487137@web.de>
From: Markus Elfring <Markus.Elfring@web.de>
Date: Thu, 22 Aug 2019 20:30:15 +0200
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 22 Aug 2019 20:02:56 +0200
>
> The dev_kfree_skb() function performs also input parameter validation.
> Thus the test around the shown calls is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Applied.
^ permalink raw reply
* Re: RFC: very rough draft of a bpf permission model
From: Alexei Starovoitov @ 2019-08-22 23:26 UTC (permalink / raw)
To: Andy Lutomirski
Cc: Daniel Borkmann, Song Liu, Kees Cook, Networking, bpf,
Alexei Starovoitov, Kernel Team, Lorenz Bauer, Jann Horn, Greg KH,
Linux API, LSM List, Chenbo Feng
In-Reply-To: <CALCETrWU4xJh4UBg0BboCwdGrgj+dUShsH5ETpiRgEpXJTEfQA@mail.gmail.com>
On Thu, Aug 22, 2019 at 08:17:54AM -0700, Andy Lutomirski wrote:
> BPF security strawman, v0.1
>
> This is very rough. Most of this, especially the API details, needs
> work before it's ready to implement. The whole concept also needs
> review.
>
> = Goals =
>
> The overall goal is to make it possible to use eBPF without having
> what is effectively administrator access. For example, an eBPF user
> should not be able to directly tamper with other processes (unless
> this permission is explicitly granted) and should not be able to
> read or write other users' eBPF maps.
>
> It should be possible to use eBPF inside a user namespace without breaking
> the userns security model.
>
> Due to the risk of speculation attacks and such being carried out via
> eBPF, it should not become possible to use too much of eBPF without the
> administrator's permission. (NB: it is already possible to use
> *classic* BPF without any permission, and classic BPF is translated
> internally to eBPF, so this goal can only be met to a limited extent.)
agree with the goals.
> = Definitions =
>
> Global capability: A capability bit in the caller's effective mask, so
> long as the caller is in the root user namespace. Tasks in non-root
> user namespaces never have global capabilibies. This is what capable()
> checks.
>
> Namespace capability: A capability over a specific user namespace.
> Tasks in a user namespace have all the capabilities in their effective
> mask over their user namespace. A namespace capability generally
> indicates that the capability applies to the user namespace itself and
> to all non-user namespaces that live in the user namespace. For
> example, CAP_NET_ADMIN means that you can configure all networks
> namespaces in the current user namespace. This is what ns_capable()
> checks.
definitions make sense too.
> Anything that requires a global capability will not work in a non-root
> user namespace.
>
> = unprivileged_bpf_disabled =
>
> Nothing in here supercedes unprivileged_bpf_disabled. If
> unprivileged_bpf_disabled = 1, then these proposals should not allow anything
> that is disallowed today. The idea is to make unprivileged_bpf_disabled=0
> both safer and more useful.
... a bunch of new features skipped for brevity...
You're proposing all of the above in addition to CAP_BPF, right?
Otherwise I don't see how it addresses the use cases I kept
explaining for the last few weeks.
I don't mind additional features if people who propose them
actively help to maintain that new code and address inevitable
side channel issues in the new code.
But first things first.
Here is another example of use case that CAP_BPF is solving:
The daemon X is started by pid=1 and currently runs as root.
It loads a bunch of tracing progs and attaches them to kprobes
and tracepoints. It also loads cgroup-bpf progs and attaches them
to cgroups. All progs are collecting data about the system and
logging it for further analysis.
There can be different bugs (not security bugs) in the daemon.
Simple coding bugs, but due to processing running as root they
may make the system inoperable. There is a strong desire to
drop privileges for this daemon. Let it do all BPF things the
way it does today and drop root, since other operations do not
require root.
Essentially a bunch of daemons run as root only because
they need bpf. This tracing bpf is looking into kernel memory
and using bpf_probe_read. Clearly it's not _secure_. But it's _safe_.
The system is not going to crash because of BPF,
but it can easily crash because of simple coding bugs in the user
space bits of that daemon.
Flagging functions is not going to help this case.
bpf_probe_read is necessary.
pointer-to-integer-conversions is also necessary.
bypass hardening features is also necessary for speed,
since this data collection is 24/7.
cgroup.subtree_control idea can help some of it, but not all.
I still think that CAP_BPF is the best way to split this root privilege
universe into smaller 'bpf piece'. Just like CAP_NET_ADMIN splits
all of root into networking specific privileges.
Potentially we can go sysctl_perf_event_paranoid approach, but
it's less flexible, since it's single sysctl for the whole system.
Loading progs via FD instead of memory is something that android folks
proposed some time ago. The need is real. Whether it's going to be
loading via FD or some other form of signing the program is TBD.
imo this is orthogonal.
I hope I answered all points of your proposal.
^ permalink raw reply
* [pull request][net-next 0/8] Mellanox, mlx5 updates 2019-08-22
From: Saeed Mahameed @ 2019-08-22 23:35 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev@vger.kernel.org, Saeed Mahameed
Hi Dave,
This series provides some misc updates to mlx5 driver.
For more information please see tag log below.
Please pull and let me know if there is any problem.
Please note that the series starts with a merge of mlx5-next branch,
to resolve and avoid dependency with rdma tree.
Thanks,
Saeed.
---
The following changes since commit dc499cdf79f28a42cef0f1d62fe846090d14701a:
Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux (2019-08-22 16:32:07 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-updates-2019-08-22
for you to fetch changes up to 9f7df106da11f5863e12283700138722bdc46c83:
net/mlx5e: Support TSO and TX checksum offloads for IP-in-IP tunnels (2019-08-22 16:32:15 -0700)
----------------------------------------------------------------
mlx5-updates-2019-08-22
Misc updates for mlx5e net device driver
1) Maxim and Tariq add the support for LAG TX port affinity distribution
When VF LAG is enabled, VFs netdevs will round-robin the TX affinity
of their tx queues among the different LAG ports.
2) Aya adds the support for ip-in-ip RSS.
3) Marina adds the support for ip-in-ip TX TSO and checksum offloads.
4) Moshe adds a device internal drop counter to mlx5 ethtool stats.
----------------------------------------------------------------
Aya Levin (2):
net/mlx5e: Change function's position to a more fitting file
net/mlx5e: Support RSS for IP-in-IP and IPv6 tunneled packets
Erez Alfasi (1):
net/mlx5e: ethtool, Fix a typo in WOL function names
Marina Varshaver (2):
net/mlx5e: Improve stateless offload capability check
net/mlx5e: Support TSO and TX checksum offloads for IP-in-IP tunnels
Maxim Mikityanskiy (1):
net/mlx5e: Support LAG TX port affinity distribution
Moshe Shemesh (1):
net/mlx5e: Add device out of buffer counter
Tariq Toukan (1):
net/mlx5e: Expose new function for TIS destroy loop
drivers/net/ethernet/mellanox/mlx5/core/en.h | 18 ++++--
drivers/net/ethernet/mellanox/mlx5/core/en/fs.h | 9 +++
.../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 8 +--
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 50 +++++++++++++++
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 75 ++++++++++++++++------
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 9 +--
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 38 +++++++----
.../net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 4 +-
.../ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c | 6 +-
9 files changed, 163 insertions(+), 54 deletions(-)
^ permalink raw reply
* [net-next 1/8] net/mlx5e: ethtool, Fix a typo in WOL function names
From: Saeed Mahameed @ 2019-08-22 23:35 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev@vger.kernel.org, Erez Alfasi, Saeed Mahameed
In-Reply-To: <20190822233514.31252-1-saeedm@mellanox.com>
From: Erez Alfasi <ereza@mellanox.com>
Fix a typo in 'mlx5e_refomrat_wol_mode_mlx5_to_linux' and
'mlx5e_refomrat_wol_mode_linux_to_mlx5' function names:
"refomrat" -> "reformat".
Fixes: 928cfe8745a6 ("net/mlx5e: Wake On LAN support")
Signed-off-by: Erez Alfasi <ereza@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 7347d673f448..c5a9c20d7f00 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -1431,7 +1431,7 @@ static __u32 mlx5e_get_wol_supported(struct mlx5_core_dev *mdev)
return ret;
}
-static __u32 mlx5e_refomrat_wol_mode_mlx5_to_linux(u8 mode)
+static __u32 mlx5e_reformat_wol_mode_mlx5_to_linux(u8 mode)
{
__u32 ret = 0;
@@ -1459,7 +1459,7 @@ static __u32 mlx5e_refomrat_wol_mode_mlx5_to_linux(u8 mode)
return ret;
}
-static u8 mlx5e_refomrat_wol_mode_linux_to_mlx5(__u32 mode)
+static u8 mlx5e_reformat_wol_mode_linux_to_mlx5(__u32 mode)
{
u8 ret = 0;
@@ -1505,7 +1505,7 @@ static void mlx5e_get_wol(struct net_device *netdev,
if (err)
return;
- wol->wolopts = mlx5e_refomrat_wol_mode_mlx5_to_linux(mlx5_wol_mode);
+ wol->wolopts = mlx5e_reformat_wol_mode_mlx5_to_linux(mlx5_wol_mode);
}
static int mlx5e_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
@@ -1521,7 +1521,7 @@ static int mlx5e_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
if (wol->wolopts & ~wol_supported)
return -EINVAL;
- mlx5_wol_mode = mlx5e_refomrat_wol_mode_linux_to_mlx5(wol->wolopts);
+ mlx5_wol_mode = mlx5e_reformat_wol_mode_linux_to_mlx5(wol->wolopts);
return mlx5_set_port_wol(mdev, mlx5_wol_mode);
}
--
2.21.0
^ permalink raw reply related
* [net-next 2/8] net/mlx5e: Expose new function for TIS destroy loop
From: Saeed Mahameed @ 2019-08-22 23:35 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev@vger.kernel.org, Tariq Toukan, Saeed Mahameed
In-Reply-To: <20190822233514.31252-1-saeedm@mellanox.com>
From: Tariq Toukan <tariqt@mellanox.com>
For better modularity and code sharing.
Function internal change to be introduced in the next patches.
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 +
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 13 +++++++++----
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 9 +++------
3 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 446792799125..491c281416d0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -1107,6 +1107,7 @@ int mlx5e_create_tis(struct mlx5_core_dev *mdev, void *in, u32 *tisn);
void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn);
int mlx5e_create_tises(struct mlx5e_priv *priv);
+void mlx5e_destroy_tises(struct mlx5e_priv *priv);
int mlx5e_update_nic_rx(struct mlx5e_priv *priv);
void mlx5e_update_carrier(struct mlx5e_priv *priv);
int mlx5e_close(struct net_device *netdev);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index fa4bf2d4bcd4..d0cda5181ab4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3179,6 +3179,14 @@ void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn)
mlx5_core_destroy_tis(mdev, tisn);
}
+void mlx5e_destroy_tises(struct mlx5e_priv *priv)
+{
+ int tc;
+
+ for (tc = 0; tc < priv->profile->max_tc; tc++)
+ mlx5e_destroy_tis(priv->mdev, priv->tisn[tc]);
+}
+
int mlx5e_create_tises(struct mlx5e_priv *priv)
{
int err;
@@ -3208,10 +3216,7 @@ int mlx5e_create_tises(struct mlx5e_priv *priv)
static void mlx5e_cleanup_nic_tx(struct mlx5e_priv *priv)
{
- int tc;
-
- for (tc = 0; tc < priv->profile->max_tc; tc++)
- mlx5e_destroy_tis(priv->mdev, priv->tisn[tc]);
+ mlx5e_destroy_tises(priv);
}
static void mlx5e_build_indir_tir_ctx_common(struct mlx5e_priv *priv,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 3c0d36b2b91c..b94fc3a35e10 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -1618,7 +1618,7 @@ static int mlx5e_init_rep_tx(struct mlx5e_priv *priv)
{
struct mlx5e_rep_priv *rpriv = priv->ppriv;
struct mlx5_rep_uplink_priv *uplink_priv;
- int tc, err;
+ int err;
err = mlx5e_create_tises(priv);
if (err) {
@@ -1654,18 +1654,15 @@ static int mlx5e_init_rep_tx(struct mlx5e_priv *priv)
tc_esw_cleanup:
mlx5e_tc_esw_cleanup(&uplink_priv->tc_ht);
destroy_tises:
- for (tc = 0; tc < priv->profile->max_tc; tc++)
- mlx5e_destroy_tis(priv->mdev, priv->tisn[tc]);
+ mlx5e_destroy_tises(priv);
return err;
}
static void mlx5e_cleanup_rep_tx(struct mlx5e_priv *priv)
{
struct mlx5e_rep_priv *rpriv = priv->ppriv;
- int tc;
- for (tc = 0; tc < priv->profile->max_tc; tc++)
- mlx5e_destroy_tis(priv->mdev, priv->tisn[tc]);
+ mlx5e_destroy_tises(priv);
if (rpriv->rep->vport == MLX5_VPORT_UPLINK) {
/* clean indirect TC block notifications */
--
2.21.0
^ permalink raw reply related
* [net-next 3/8] net/mlx5e: Support LAG TX port affinity distribution
From: Saeed Mahameed @ 2019-08-22 23:35 UTC (permalink / raw)
To: David S. Miller
Cc: netdev@vger.kernel.org, Maxim Mikityanskiy, Tariq Toukan,
Mark Bloch, Saeed Mahameed
In-Reply-To: <20190822233514.31252-1-saeedm@mellanox.com>
From: Maxim Mikityanskiy <maximmi@mellanox.com>
When the VF LAG is in use, round-robin the TX affinity of channels among
the different ports, if supported by the firmware. Create a set of TISes
per port, while doing round-robin of the channels over the different
sets. Let all SQs of a channel share the same set of TISes.
If lag_tx_port_affinity HCA cap bit is supported, num_lag_ports > 1 and
we aren't the LACP owner (PF in the regular use), assign the affinities,
otherwise use tx_affinity == 0 in TIS context to let the FW assign the
affinities itself. The TISes of the LACP owner are mapped only to the
native physical port.
For VFs, the starting port for round-robin is determined by its vhca_id,
because a VF may have only one channel if attached to a single-core VM.
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en.h | 11 +++-
.../net/ethernet/mellanox/mlx5/core/en_main.c | 54 +++++++++++++------
.../ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 4 +-
.../mellanox/mlx5/core/ipoib/ipoib_vlan.c | 6 +--
4 files changed, 53 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 491c281416d0..e03f973c962f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -163,6 +163,14 @@ enum mlx5e_rq_group {
#define MLX5E_NUM_RQ_GROUPS(g) (1 + MLX5E_RQ_GROUP_##g)
};
+static inline u8 mlx5e_get_num_lag_ports(struct mlx5_core_dev *mdev)
+{
+ if (mlx5_lag_is_lacp_owner(mdev))
+ return 1;
+
+ return clamp_t(u8, MLX5_CAP_GEN(mdev, num_lag_ports), 1, MLX5_MAX_PORTS);
+}
+
static inline u16 mlx5_min_rx_wqes(int wq_type, u32 wq_size)
{
switch (wq_type) {
@@ -705,6 +713,7 @@ struct mlx5e_channel {
struct net_device *netdev;
__be32 mkey_be;
u8 num_tc;
+ u8 lag_port;
/* XDP_REDIRECT */
struct mlx5e_xdpsq xdpsq;
@@ -818,7 +827,7 @@ struct mlx5e_priv {
struct mlx5e_rq drop_rq;
struct mlx5e_channels channels;
- u32 tisn[MLX5E_MAX_NUM_TC];
+ u32 tisn[MLX5_MAX_PORTS][MLX5E_MAX_NUM_TC];
struct mlx5e_rqt indir_rqt;
struct mlx5e_tir indir_tir[MLX5E_NUM_INDIR_TIRS];
struct mlx5e_tir inner_indir_tir[MLX5E_NUM_INDIR_TIRS];
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index d0cda5181ab4..b1bc0e601cc2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -1442,7 +1442,7 @@ int mlx5e_open_xdpsq(struct mlx5e_channel *c, struct mlx5e_params *params,
return err;
csp.tis_lst_sz = 1;
- csp.tisn = c->priv->tisn[0]; /* tc = 0 */
+ csp.tisn = c->priv->tisn[c->lag_port][0]; /* tc = 0 */
csp.cqn = sq->cq.mcq.cqn;
csp.wq_ctrl = &sq->wq_ctrl;
csp.min_inline_mode = sq->min_inline_mode;
@@ -1692,7 +1692,7 @@ static int mlx5e_open_sqs(struct mlx5e_channel *c,
for (tc = 0; tc < params->num_tc; tc++) {
int txq_ix = c->ix + tc * priv->max_nch;
- err = mlx5e_open_txqsq(c, c->priv->tisn[tc], txq_ix,
+ err = mlx5e_open_txqsq(c, c->priv->tisn[c->lag_port][tc], txq_ix,
params, &cparam->sq, &c->sq[tc], tc);
if (err)
goto err_close_sqs;
@@ -1926,6 +1926,13 @@ static void mlx5e_close_queues(struct mlx5e_channel *c)
mlx5e_close_cq(&c->icosq.cq);
}
+static u8 mlx5e_enumerate_lag_port(struct mlx5_core_dev *mdev, int ix)
+{
+ u16 port_aff_bias = mlx5_core_is_pf(mdev) ? 0 : MLX5_CAP_GEN(mdev, vhca_id);
+
+ return (ix + port_aff_bias) % mlx5e_get_num_lag_ports(mdev);
+}
+
static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix,
struct mlx5e_params *params,
struct mlx5e_channel_param *cparam,
@@ -1960,6 +1967,7 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix,
c->xdp = !!params->xdp_prog;
c->stats = &priv->channel_stats[ix].ch;
c->irq_desc = irq_to_desc(irq);
+ c->lag_port = mlx5e_enumerate_lag_port(priv->mdev, ix);
err = mlx5e_alloc_xps_cpumask(c, params);
if (err)
@@ -3181,35 +3189,49 @@ void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn)
void mlx5e_destroy_tises(struct mlx5e_priv *priv)
{
- int tc;
+ int tc, i;
- for (tc = 0; tc < priv->profile->max_tc; tc++)
- mlx5e_destroy_tis(priv->mdev, priv->tisn[tc]);
+ for (i = 0; i < mlx5e_get_num_lag_ports(priv->mdev); i++)
+ for (tc = 0; tc < priv->profile->max_tc; tc++)
+ mlx5e_destroy_tis(priv->mdev, priv->tisn[i][tc]);
+}
+
+static bool mlx5e_lag_should_assign_affinity(struct mlx5_core_dev *mdev)
+{
+ return MLX5_CAP_GEN(mdev, lag_tx_port_affinity) && mlx5e_get_num_lag_ports(mdev) > 1;
}
int mlx5e_create_tises(struct mlx5e_priv *priv)
{
+ int tc, i;
int err;
- int tc;
- for (tc = 0; tc < priv->profile->max_tc; tc++) {
- u32 in[MLX5_ST_SZ_DW(create_tis_in)] = {};
- void *tisc;
+ for (i = 0; i < mlx5e_get_num_lag_ports(priv->mdev); i++) {
+ for (tc = 0; tc < priv->profile->max_tc; tc++) {
+ u32 in[MLX5_ST_SZ_DW(create_tis_in)] = {};
+ void *tisc;
- tisc = MLX5_ADDR_OF(create_tis_in, in, ctx);
+ tisc = MLX5_ADDR_OF(create_tis_in, in, ctx);
- MLX5_SET(tisc, tisc, prio, tc << 1);
+ MLX5_SET(tisc, tisc, prio, tc << 1);
- err = mlx5e_create_tis(priv->mdev, in, &priv->tisn[tc]);
- if (err)
- goto err_close_tises;
+ if (mlx5e_lag_should_assign_affinity(priv->mdev))
+ MLX5_SET(tisc, tisc, lag_tx_port_affinity, i + 1);
+
+ err = mlx5e_create_tis(priv->mdev, in, &priv->tisn[i][tc]);
+ if (err)
+ goto err_close_tises;
+ }
}
return 0;
err_close_tises:
- for (tc--; tc >= 0; tc--)
- mlx5e_destroy_tis(priv->mdev, priv->tisn[tc]);
+ for (; i >= 0; i--) {
+ for (tc--; tc >= 0; tc--)
+ mlx5e_destroy_tis(priv->mdev, priv->tisn[i][tc]);
+ tc = priv->profile->max_tc;
+ }
return err;
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
index 1a2560e3bf7c..3ed8ab2d703d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
@@ -279,7 +279,7 @@ static int mlx5i_init_tx(struct mlx5e_priv *priv)
return err;
}
- err = mlx5i_create_tis(priv->mdev, ipriv->qp.qpn, &priv->tisn[0]);
+ err = mlx5i_create_tis(priv->mdev, ipriv->qp.qpn, &priv->tisn[0][0]);
if (err) {
mlx5_core_warn(priv->mdev, "create tis failed, %d\n", err);
goto err_destroy_underlay_qp;
@@ -296,7 +296,7 @@ static void mlx5i_cleanup_tx(struct mlx5e_priv *priv)
{
struct mlx5i_priv *ipriv = priv->ppriv;
- mlx5e_destroy_tis(priv->mdev, priv->tisn[0]);
+ mlx5e_destroy_tis(priv->mdev, priv->tisn[0][0]);
mlx5i_destroy_underlay_qp(priv->mdev, &ipriv->qp);
}
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c
index c5a491e22e55..96e64187c089 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c
@@ -210,7 +210,7 @@ static int mlx5i_pkey_open(struct net_device *netdev)
goto err_unint_underlay_qp;
}
- err = mlx5i_create_tis(mdev, ipriv->qp.qpn, &epriv->tisn[0]);
+ err = mlx5i_create_tis(mdev, ipriv->qp.qpn, &epriv->tisn[0][0]);
if (err) {
mlx5_core_warn(mdev, "create child tis failed, %d\n", err);
goto err_remove_rx_uderlay_qp;
@@ -228,7 +228,7 @@ static int mlx5i_pkey_open(struct net_device *netdev)
return 0;
err_clear_state_opened_flag:
- mlx5e_destroy_tis(mdev, epriv->tisn[0]);
+ mlx5e_destroy_tis(mdev, epriv->tisn[0][0]);
err_remove_rx_uderlay_qp:
mlx5_fs_remove_rx_underlay_qpn(mdev, ipriv->qp.qpn);
err_unint_underlay_qp:
@@ -257,7 +257,7 @@ static int mlx5i_pkey_close(struct net_device *netdev)
mlx5i_uninit_underlay_qp(priv);
mlx5e_deactivate_priv_channels(priv);
mlx5e_close_channels(&priv->channels);
- mlx5e_destroy_tis(mdev, priv->tisn[0]);
+ mlx5e_destroy_tis(mdev, priv->tisn[0][0]);
unlock:
mutex_unlock(&priv->state_lock);
return 0;
--
2.21.0
^ permalink raw reply related
* [net-next 4/8] net/mlx5e: Add device out of buffer counter
From: Saeed Mahameed @ 2019-08-22 23:35 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev@vger.kernel.org, Moshe Shemesh, Saeed Mahameed
In-Reply-To: <20190822233514.31252-1-saeedm@mellanox.com>
From: Moshe Shemesh <moshe@mellanox.com>
Added the following packets drop counter:
Device out of buffer - counts packets which were dropped due to full
device internal receive queue.
This counter will be shown on ethtool as a new counter called
dev_out_of_buffer.
The counter is read from FW by command QUERY_VNIC_ENV.
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
.../ethernet/mellanox/mlx5/core/en_stats.c | 38 ++++++++++++-------
1 file changed, 25 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
index 18e4c162256a..fbf7fe2f2657 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c
@@ -369,17 +369,27 @@ static void mlx5e_grp_q_update_stats(struct mlx5e_priv *priv)
}
#define VNIC_ENV_OFF(c) MLX5_BYTE_OFF(query_vnic_env_out, c)
-static const struct counter_desc vnic_env_stats_desc[] = {
+static const struct counter_desc vnic_env_stats_steer_desc[] = {
{ "rx_steer_missed_packets",
VNIC_ENV_OFF(vport_env.nic_receive_steering_discard) },
};
-#define NUM_VNIC_ENV_COUNTERS ARRAY_SIZE(vnic_env_stats_desc)
+static const struct counter_desc vnic_env_stats_dev_oob_desc[] = {
+ { "dev_out_of_buffer",
+ VNIC_ENV_OFF(vport_env.internal_rq_out_of_buffer) },
+};
+
+#define NUM_VNIC_ENV_STEER_COUNTERS(dev) \
+ (MLX5_CAP_GEN(dev, nic_receive_steering_discard) ? \
+ ARRAY_SIZE(vnic_env_stats_steer_desc) : 0)
+#define NUM_VNIC_ENV_DEV_OOB_COUNTERS(dev) \
+ (MLX5_CAP_GEN(dev, vnic_env_int_rq_oob) ? \
+ ARRAY_SIZE(vnic_env_stats_dev_oob_desc) : 0)
static int mlx5e_grp_vnic_env_get_num_stats(struct mlx5e_priv *priv)
{
- return MLX5_CAP_GEN(priv->mdev, nic_receive_steering_discard) ?
- NUM_VNIC_ENV_COUNTERS : 0;
+ return NUM_VNIC_ENV_STEER_COUNTERS(priv->mdev) +
+ NUM_VNIC_ENV_DEV_OOB_COUNTERS(priv->mdev);
}
static int mlx5e_grp_vnic_env_fill_strings(struct mlx5e_priv *priv, u8 *data,
@@ -387,12 +397,13 @@ static int mlx5e_grp_vnic_env_fill_strings(struct mlx5e_priv *priv, u8 *data,
{
int i;
- if (!MLX5_CAP_GEN(priv->mdev, nic_receive_steering_discard))
- return idx;
+ for (i = 0; i < NUM_VNIC_ENV_STEER_COUNTERS(priv->mdev); i++)
+ strcpy(data + (idx++) * ETH_GSTRING_LEN,
+ vnic_env_stats_steer_desc[i].format);
- for (i = 0; i < NUM_VNIC_ENV_COUNTERS; i++)
+ for (i = 0; i < NUM_VNIC_ENV_DEV_OOB_COUNTERS(priv->mdev); i++)
strcpy(data + (idx++) * ETH_GSTRING_LEN,
- vnic_env_stats_desc[i].format);
+ vnic_env_stats_dev_oob_desc[i].format);
return idx;
}
@@ -401,12 +412,13 @@ static int mlx5e_grp_vnic_env_fill_stats(struct mlx5e_priv *priv, u64 *data,
{
int i;
- if (!MLX5_CAP_GEN(priv->mdev, nic_receive_steering_discard))
- return idx;
-
- for (i = 0; i < NUM_VNIC_ENV_COUNTERS; i++)
+ for (i = 0; i < NUM_VNIC_ENV_STEER_COUNTERS(priv->mdev); i++)
data[idx++] = MLX5E_READ_CTR64_BE(priv->stats.vnic.query_vnic_env_out,
- vnic_env_stats_desc, i);
+ vnic_env_stats_steer_desc, i);
+
+ for (i = 0; i < NUM_VNIC_ENV_DEV_OOB_COUNTERS(priv->mdev); i++)
+ data[idx++] = MLX5E_READ_CTR32_BE(priv->stats.vnic.query_vnic_env_out,
+ vnic_env_stats_dev_oob_desc, i);
return idx;
}
--
2.21.0
^ permalink raw reply related
* [net-next 6/8] net/mlx5e: Support RSS for IP-in-IP and IPv6 tunneled packets
From: Saeed Mahameed @ 2019-08-22 23:35 UTC (permalink / raw)
To: David S. Miller
Cc: netdev@vger.kernel.org, Aya Levin, Tariq Toukan, Saeed Mahameed
In-Reply-To: <20190822233514.31252-1-saeedm@mellanox.com>
From: Aya Levin <ayal@mellanox.com>
Add support for inner header RSS on IP-in-IP and IPv6 tunneled packets.
Add rules to the steering table regarding outer IP header, with
IPv4/6->IP-in-IP. Tunneled packets with protocol numbers: 0x4 (IP-in-IP)
and 0x29 (IPv6) are RSS-ed on the inner IP header.
Separate FW dependencies between flow table inner IP capabilities and
GRE offload support. Allowing this feature even if GRE offload is not
supported. Tested with multi stream TCP traffic tunneled with IPnIP.
Verified that:
Without this patch, only a single RX ring was processing the traffic.
With this patch, multiple RX rings were processing the traffic.
Verified with and without GRE offload support.
Signed-off-by: Aya Levin <ayal@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
.../net/ethernet/mellanox/mlx5/core/en/fs.h | 4 ++
.../net/ethernet/mellanox/mlx5/core/en_fs.c | 46 ++++++++++++++++++-
2 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
index 5acd982ff228..5aae3a7a5497 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
@@ -95,6 +95,10 @@ struct mlx5e_tirc_config {
enum mlx5e_tunnel_types {
MLX5E_TT_IPV4_GRE,
MLX5E_TT_IPV6_GRE,
+ MLX5E_TT_IPV4_IPIP,
+ MLX5E_TT_IPV6_IPIP,
+ MLX5E_TT_IPV4_IPV6,
+ MLX5E_TT_IPV6_IPV6,
MLX5E_NUM_TUNNEL_TT,
};
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
index a8340e4fb0b9..b99b17957543 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
@@ -747,11 +747,52 @@ static struct mlx5e_etype_proto ttc_tunnel_rules[] = {
.etype = ETH_P_IPV6,
.proto = IPPROTO_GRE,
},
+ [MLX5E_TT_IPV4_IPIP] = {
+ .etype = ETH_P_IP,
+ .proto = IPPROTO_IPIP,
+ },
+ [MLX5E_TT_IPV6_IPIP] = {
+ .etype = ETH_P_IPV6,
+ .proto = IPPROTO_IPIP,
+ },
+ [MLX5E_TT_IPV4_IPV6] = {
+ .etype = ETH_P_IP,
+ .proto = IPPROTO_IPV6,
+ },
+ [MLX5E_TT_IPV6_IPV6] = {
+ .etype = ETH_P_IPV6,
+ .proto = IPPROTO_IPV6,
+ },
+
};
+static bool mlx5e_tunnel_proto_supported(struct mlx5_core_dev *mdev, u8 proto_type)
+{
+ switch (proto_type) {
+ case IPPROTO_GRE:
+ return MLX5_CAP_ETH(mdev, tunnel_stateless_gre);
+ case IPPROTO_IPIP:
+ case IPPROTO_IPV6:
+ return MLX5_CAP_ETH(mdev, tunnel_stateless_ip_over_ip);
+ default:
+ return false;
+ }
+}
+
+static bool mlx5e_any_tunnel_proto_supported(struct mlx5_core_dev *mdev)
+{
+ int tt;
+
+ for (tt = 0; tt < MLX5E_NUM_TUNNEL_TT; tt++) {
+ if (mlx5e_tunnel_proto_supported(mdev, ttc_tunnel_rules[tt].proto))
+ return true;
+ }
+ return false;
+}
+
bool mlx5e_tunnel_inner_ft_supported(struct mlx5_core_dev *mdev)
{
- return (MLX5_CAP_ETH(mdev, tunnel_stateless_gre) &&
+ return (mlx5e_any_tunnel_proto_supported(mdev) &&
MLX5_CAP_FLOWTABLE_NIC_RX(mdev, ft_field_support.inner_ip_version));
}
@@ -844,6 +885,9 @@ static int mlx5e_generate_ttc_table_rules(struct mlx5e_priv *priv,
dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
dest.ft = params->inner_ttc->ft.t;
for (tt = 0; tt < MLX5E_NUM_TUNNEL_TT; tt++) {
+ if (!mlx5e_tunnel_proto_supported(priv->mdev,
+ ttc_tunnel_rules[tt].proto))
+ continue;
rules[tt] = mlx5e_generate_ttc_rule(priv, ft, &dest,
ttc_tunnel_rules[tt].etype,
ttc_tunnel_rules[tt].proto);
--
2.21.0
^ permalink raw reply related
* [net-next 7/8] net/mlx5e: Improve stateless offload capability check
From: Saeed Mahameed @ 2019-08-22 23:35 UTC (permalink / raw)
To: David S. Miller
Cc: netdev@vger.kernel.org, Marina Varshaver, Aya Levin,
Saeed Mahameed
In-Reply-To: <20190822233514.31252-1-saeedm@mellanox.com>
From: Marina Varshaver <marinav@mellanox.com>
Use generic function for checking tunnel stateless offload capability
instead of separate macros.
Signed-off-by: Marina Varshaver <marinav@mellanox.com>
Reviewed-by: Aya Levin <ayal@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/fs.h | 3 +++
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 4 ++--
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 4 ++--
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
index 5aae3a7a5497..68d593074f6c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
@@ -238,5 +238,8 @@ void mlx5e_disable_cvlan_filter(struct mlx5e_priv *priv);
int mlx5e_create_flow_steering(struct mlx5e_priv *priv);
void mlx5e_destroy_flow_steering(struct mlx5e_priv *priv);
+bool mlx5e_tunnel_proto_supported(struct mlx5_core_dev *mdev, u8 proto_type);
+bool mlx5e_any_tunnel_proto_supported(struct mlx5_core_dev *mdev);
+
#endif /* __MLX5E_FLOW_STEER_H__ */
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
index b99b17957543..15b7f0f1427c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
@@ -766,7 +766,7 @@ static struct mlx5e_etype_proto ttc_tunnel_rules[] = {
};
-static bool mlx5e_tunnel_proto_supported(struct mlx5_core_dev *mdev, u8 proto_type)
+bool mlx5e_tunnel_proto_supported(struct mlx5_core_dev *mdev, u8 proto_type)
{
switch (proto_type) {
case IPPROTO_GRE:
@@ -779,7 +779,7 @@ static bool mlx5e_tunnel_proto_supported(struct mlx5_core_dev *mdev, u8 proto_ty
}
}
-static bool mlx5e_any_tunnel_proto_supported(struct mlx5_core_dev *mdev)
+bool mlx5e_any_tunnel_proto_supported(struct mlx5_core_dev *mdev)
{
int tt;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index b1bc0e601cc2..1c4f82842df9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -4877,7 +4877,7 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
netdev->hw_features |= NETIF_F_HW_VLAN_STAG_TX;
if (mlx5_vxlan_allowed(mdev->vxlan) || mlx5_geneve_tx_allowed(mdev) ||
- MLX5_CAP_ETH(mdev, tunnel_stateless_gre)) {
+ mlx5e_any_tunnel_proto_supported(mdev)) {
netdev->hw_enc_features |= NETIF_F_HW_CSUM;
netdev->hw_enc_features |= NETIF_F_TSO;
netdev->hw_enc_features |= NETIF_F_TSO6;
@@ -4892,7 +4892,7 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
netdev->gso_partial_features = NETIF_F_GSO_UDP_TUNNEL_CSUM;
}
- if (MLX5_CAP_ETH(mdev, tunnel_stateless_gre)) {
+ if (mlx5e_tunnel_proto_supported(mdev, IPPROTO_GRE)) {
netdev->hw_features |= NETIF_F_GSO_GRE |
NETIF_F_GSO_GRE_CSUM;
netdev->hw_enc_features |= NETIF_F_GSO_GRE |
--
2.21.0
^ permalink raw reply related
* [net-next 8/8] net/mlx5e: Support TSO and TX checksum offloads for IP-in-IP tunnels
From: Saeed Mahameed @ 2019-08-22 23:35 UTC (permalink / raw)
To: David S. Miller
Cc: netdev@vger.kernel.org, Marina Varshaver, Aya Levin,
Saeed Mahameed
In-Reply-To: <20190822233514.31252-1-saeedm@mellanox.com>
From: Marina Varshaver <marinav@mellanox.com>
Add TX offloads support for IP-in-IP tunneled packets by reporting
the needed netdev features.
Signed-off-by: Marina Varshaver <marinav@mellanox.com>
Reviewed-by: Aya Levin <ayal@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 1c4f82842df9..f4a5055dfaff 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -4241,6 +4241,7 @@ static netdev_features_t mlx5e_tunnel_features_check(struct mlx5e_priv *priv,
switch (proto) {
case IPPROTO_GRE:
+ case IPPROTO_IPIP:
return features;
case IPPROTO_UDP:
udph = udp_hdr(skb);
@@ -4901,6 +4902,15 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev)
NETIF_F_GSO_GRE_CSUM;
}
+ if (mlx5e_tunnel_proto_supported(mdev, IPPROTO_IPIP)) {
+ netdev->hw_features |= NETIF_F_GSO_IPXIP4 |
+ NETIF_F_GSO_IPXIP6;
+ netdev->hw_enc_features |= NETIF_F_GSO_IPXIP4 |
+ NETIF_F_GSO_IPXIP6;
+ netdev->gso_partial_features |= NETIF_F_GSO_IPXIP4 |
+ NETIF_F_GSO_IPXIP6;
+ }
+
netdev->hw_features |= NETIF_F_GSO_PARTIAL;
netdev->gso_partial_features |= NETIF_F_GSO_UDP_L4;
netdev->hw_features |= NETIF_F_GSO_UDP_L4;
--
2.21.0
^ permalink raw reply related
* [net-next 5/8] net/mlx5e: Change function's position to a more fitting file
From: Saeed Mahameed @ 2019-08-22 23:35 UTC (permalink / raw)
To: David S. Miller
Cc: netdev@vger.kernel.org, Aya Levin, Tariq Toukan, Saeed Mahameed
In-Reply-To: <20190822233514.31252-1-saeedm@mellanox.com>
From: Aya Levin <ayal@mellanox.com>
Move function which indicates whether tunnel inner flow table is
supported from en.h to en_fs.c. It fits better right after tunnel
protocol rules definitions.
Signed-off-by: Aya Levin <ayal@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en.h | 6 ------
drivers/net/ethernet/mellanox/mlx5/core/en/fs.h | 2 ++
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 6 ++++++
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index e03f973c962f..8d76452cacdc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -1065,12 +1065,6 @@ int mlx5e_modify_sq(struct mlx5_core_dev *mdev, u32 sqn,
void mlx5e_activate_txqsq(struct mlx5e_txqsq *sq);
void mlx5e_tx_disable_queue(struct netdev_queue *txq);
-static inline bool mlx5e_tunnel_inner_ft_supported(struct mlx5_core_dev *mdev)
-{
- return (MLX5_CAP_ETH(mdev, tunnel_stateless_gre) &&
- MLX5_CAP_FLOWTABLE_NIC_RX(mdev, ft_field_support.inner_ip_version));
-}
-
static inline bool mlx5_tx_swp_supported(struct mlx5_core_dev *mdev)
{
return MLX5_CAP_ETH(mdev, swp) &&
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
index ca2161b42c7f..5acd982ff228 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
@@ -98,6 +98,8 @@ enum mlx5e_tunnel_types {
MLX5E_NUM_TUNNEL_TT,
};
+bool mlx5e_tunnel_inner_ft_supported(struct mlx5_core_dev *mdev);
+
/* L3/L4 traffic type classifier */
struct mlx5e_ttc_table {
struct mlx5e_flow_table ft;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
index 76cc10e44080..a8340e4fb0b9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
@@ -749,6 +749,12 @@ static struct mlx5e_etype_proto ttc_tunnel_rules[] = {
},
};
+bool mlx5e_tunnel_inner_ft_supported(struct mlx5_core_dev *mdev)
+{
+ return (MLX5_CAP_ETH(mdev, tunnel_stateless_gre) &&
+ MLX5_CAP_FLOWTABLE_NIC_RX(mdev, ft_field_support.inner_ip_version));
+}
+
static u8 mlx5e_etype_to_ipv(u16 ethertype)
{
if (ethertype == ETH_P_IP)
--
2.21.0
^ permalink raw reply related
* Re: r8169: regression on MIPS/Loongson
From: Aaro Koskinen @ 2019-08-22 23:38 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: netdev, linux-mips
In-Reply-To: <d76b0614-188e-885c-b346-b131cc1d9688@gmail.com>
Hi,
On Fri, Aug 23, 2019 at 12:52:34AM +0200, Heiner Kallweit wrote:
> On 23.08.2019 00:25, Aaro Koskinen wrote:
> > After upgrading from v5.2 to v5.3-rc5 on MIPS/Loongson board, copying
> > large files from network with scp started to fail with "Integrity error".
> > Bisected to:
> >
> > f072218cca5b076dd99f3dfa3aaafedfd0023a51 is the first bad commit
> > commit f072218cca5b076dd99f3dfa3aaafedfd0023a51
> > Author: Heiner Kallweit <hkallweit1@gmail.com>
> > Date: Thu Jun 27 23:19:09 2019 +0200
> >
> > r8169: remove not needed call to dma_sync_single_for_device
> >
> > Any idea what goes wrong? Should this change be reverted?
> >
> Typically the Realtek chips are used on Intel platforms and I haven't
> seen any such report yet, so it seems to be platform-specific.
Probably. On my AMD x86_64 box r8169 works fine.
> Which board (DT config) is it, and can you provide a full dmesg?
This board does not use DT (support files are under arch/mips/loongson64).
dmesg is below:
[ 0.000000] Linux version 5.3.0-rc4-lemote-los_1bf0c (aakoskin@amd-fx-6350) (gcc version 8.3.0 (GCC)) #1 Fri Aug 23 01:01:45 EEST 2019
[ 0.000000] memsize=256, highmemsize=256
[ 0.000000] CpuClock = 797800000
[ 0.000000] printk: bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 00006303 (ICT Loongson-2)
[ 0.000000] FPU revision is: 00000501
[ 0.000000] Checking for the multiply/shift bug... no.
[ 0.000000] Checking for the daddiu bug... no.
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 0000000010000000 @ 0000000000000000 (usable)
[ 0.000000] memory: 0000000030000000 @ 0000000010000000 (reserved)
[ 0.000000] memory: 0000000010000000 @ 0000000090000000 (usable)
[ 0.000000] memory: 0000000010000000 @ 0000000080000000 (reserved)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Primary instruction cache 64kB, VIPT, direct mapped, linesize 32 bytes.
[ 0.000000] Primary data cache 64kB, 4-way, VIPT, no aliases, linesize 32 bytes
[ 0.000000] Unified secondary cache 512kB 4-way, linesize 32 bytes.
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x000000009fffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000003fffffff]
[ 0.000000] node 0: [mem 0x0000000080000000-0x000000009fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000009fffffff]
[ 0.000000] On node 0 totalpages: 98304
[ 0.000000] Normal zone: 336 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 98304 pages, LIFO batch:15
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 97968
[ 0.000000] Kernel command line: console=tty console=ttyS0,115200
[ 0.000000] Dentry cache hash table entries: 262144 (order: 7, 2097152 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 131072 (order: 6, 1048576 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 489664K/1572864K available (4863K kernel code, 467K rwdata, 876K rodata, 1968K init, 16616K bss, 1083200K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 128
[ 0.000000] random: get_random_bytes called from start_kernel+0x368/0x620 with crng_init=0
[ 0.000000] Console: colour dummy device 80x25
[ 0.000000] printk: console [tty0] enabled
[ 0.000000] sched_clock: 64 bits at 250 Hz, resolution 4000000ns, wraps every 9007199254000000ns
[ 0.004000] Calibrating delay loop... 528.38 BogoMIPS (lpj=1056768)
[ 0.040000] pid_max: default: 32768 minimum: 301
[ 0.044000] Mount-cache hash table entries: 4096 (order: 1, 32768 bytes, linear)
[ 0.048000] Mountpoint-cache hash table entries: 4096 (order: 1, 32768 bytes, linear)
[ 0.052000] *** VALIDATE proc ***
[ 0.056000] Checking for the daddi bug... no.
[ 0.064000] devtmpfs: initialized
[ 0.068000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.072000] futex hash table entries: 256 (order: -2, 6144 bytes, linear)
[ 0.076000] NET: Registered protocol family 16
[ 0.080000] clocksource: mfgpt: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 133486551712 ns
[ 0.124000] SCSI subsystem initialized
[ 0.128000] usbcore: registered new interface driver usbfs
[ 0.132000] usbcore: registered new interface driver hub
[ 0.136000] usbcore: registered new device driver usb
[ 0.140000] PCI host bridge to bus 0000:00
[ 0.148000] pci_bus 0000:00: root bus resource [mem 0x40000000-0x7fffffff]
[ 0.152000] pci_bus 0000:00: root bus resource [io 0x4000-0xffff]
[ 0.156000] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[ 0.160000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[ 0.164000] pci 0000:00:06.0: [10ec:8169] type 00 class 0x020000
[ 0.168000] pci 0000:00:06.0: reg 0x10: [io 0xb100-0xb1ff]
[ 0.172000] pci 0000:00:06.0: reg 0x14: [mem 0x04075000-0x040750ff]
[ 0.176000] pci 0000:00:06.0: reg 0x30: [mem 0x04040000-0x0405ffff pref]
[ 0.180000] pci 0000:00:06.0: supports D1 D2
[ 0.184000] pci 0000:00:06.0: PME# supported from D1 D2 D3hot
[ 0.188000] pci 0000:00:08.0: [1039:0325] type 00 class 0x030000
[ 0.192000] pci 0000:00:08.0: reg 0x10: [mem 0x40000000-0x4fffffff pref]
[ 0.196000] pci 0000:00:08.0: reg 0x14: [mem 0x04000000-0x0403ffff]
[ 0.200000] pci 0000:00:08.0: reg 0x18: [io 0xb300-0xb37f]
[ 0.204000] pci 0000:00:08.0: reg 0x30: [mem 0x04060000-0x0406ffff pref]
[ 0.208000] pci 0000:00:08.0: supports D1 D2
[ 0.212000] pci 0000:00:0e.0: [1022:2090] type 00 class 0x060100
[ 0.216000] pci 0000:00:0e.0: reg 0x10: [io 0xb410-0xb417]
[ 0.220000] pci 0000:00:0e.0: reg 0x14: [io 0xb000-0xb0ff]
[ 0.224000] pci 0000:00:0e.0: reg 0x18: [io 0xb380-0xb3bf]
[ 0.228000] pci 0000:00:0e.0: reg 0x20: [io 0xb280-0xb2ff]
[ 0.232000] pci 0000:00:0e.0: reg 0x24: [io 0xb3c0-0xb3df]
[ 0.240000] pci 0000:00:0e.2: [1022:209a] type 00 class 0x010180
[ 0.244000] pci 0000:00:0e.2: reg 0x20: [io 0xb400-0xb40f]
[ 0.252000] pci 0000:00:0e.2: legacy IDE quirk: reg 0x10: [io 0x01f0-0x01f7]
[ 0.256000] pci 0000:00:0e.2: legacy IDE quirk: reg 0x14: [io 0x03f6]
[ 0.260000] pci 0000:00:0e.2: legacy IDE quirk: reg 0x18: [io 0x0170-0x0177]
[ 0.264000] pci 0000:00:0e.2: legacy IDE quirk: reg 0x1c: [io 0x0376]
[ 0.268000] pci 0000:00:0e.3: [1022:2093] type 00 class 0x040100
[ 0.272000] pci 0000:00:0e.3: reg 0x10: [io 0xb200-0xb27f]
[ 0.276000] pci 0000:00:0e.4: [1022:2094] type 00 class 0x0c0310
[ 0.280000] pci 0000:00:0e.4: reg 0x10: [mem 0x04074000-0x04074fff]
[ 0.288000] pci 0000:00:0e.5: [1022:2095] type 00 class 0x0c0320
[ 0.292000] pci 0000:00:0e.5: reg 0x10: [mem 0x04073000-0x04073fff]
[ 0.296000] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[ 0.300000] pci 0000:00:08.0: BAR 0: assigned [mem 0x40000000-0x4fffffff pref]
[ 0.304000] pci 0000:00:08.0: BAR 1: assigned [mem 0x50000000-0x5003ffff]
[ 0.308000] pci 0000:00:06.0: BAR 6: assigned [mem 0x50040000-0x5005ffff pref]
[ 0.312000] pci 0000:00:08.0: BAR 6: assigned [mem 0x50060000-0x5006ffff pref]
[ 0.316000] pci 0000:00:0e.4: BAR 0: assigned [mem 0x50070000-0x50070fff]
[ 0.320000] pci 0000:00:0e.5: BAR 0: assigned [mem 0x50071000-0x50071fff]
[ 0.324000] pci 0000:00:06.0: BAR 0: assigned [io 0x4000-0x40ff]
[ 0.328000] pci 0000:00:06.0: BAR 1: assigned [mem 0x50072000-0x500720ff]
[ 0.332000] pci 0000:00:0e.0: BAR 1: assigned [io 0x4400-0x44ff]
[ 0.336000] pci 0000:00:08.0: BAR 2: assigned [io 0x4800-0x487f]
[ 0.340000] pci 0000:00:0e.0: BAR 4: assigned [io 0x4880-0x48ff]
[ 0.344000] pci 0000:00:0e.3: BAR 0: assigned [io 0x4c00-0x4c7f]
[ 0.348000] pci 0000:00:0e.0: BAR 2: assigned [io 0x4c80-0x4cbf]
[ 0.352000] pci 0000:00:0e.0: BAR 5: assigned [io 0x4cc0-0x4cdf]
[ 0.356000] pci 0000:00:0e.2: BAR 4: assigned [io 0x4ce0-0x4cef]
[ 0.360000] pci 0000:00:0e.0: BAR 0: assigned [io 0x4cf0-0x4cf7]
[ 0.364000] clocksource: Switched to clocksource mfgpt
[ 0.392000] NET: Registered protocol family 2
[ 0.396000] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 16384 bytes, linear)
[ 0.400000] TCP established hash table entries: 16384 (order: 3, 131072 bytes, linear)
[ 0.404000] TCP bind hash table entries: 16384 (order: 3, 131072 bytes, linear)
[ 0.408000] TCP: Hash tables configured (established 16384 bind 16384)
[ 0.412000] UDP hash table entries: 1024 (order: 1, 32768 bytes, linear)
[ 0.416000] UDP-Lite hash table entries: 1024 (order: 1, 32768 bytes, linear)
[ 0.420000] NET: Registered protocol family 1
[ 0.424000] pci 0000:00:0e.4: enabling device (0000 -> 0002)
[ 0.428000] PCI: CLS 32 bytes, default 32
[ 0.888000] random: fast init done
[ 1.804000] workingset: timestamp_bits=62 max_order=15 bucket_order=0
[ 1.820000] NET: Registered protocol family 38
[ 1.824000] io scheduler bfq registered
[ 1.828000] slot: 8, pin: 1, irq: 38
[ 1.832000] sisfb 0000:00:08.0: Invalid PCI ROM header signature: expecting 0xaa55, got 0x3030
[ 1.836000] sisfb: Video ROM not found
[ 1.840000] sisfb: Video RAM at 0x40000000, mapped to 0x9000000040000000, size 32768k
[ 1.844000] sisfb: MMIO at 0x50000000, mapped to 0x9000000050000000, size 256k
[ 1.848000] sisfb: Memory heap starting at 32160K, size 32K
[ 3.140000] sisfb: Detected SiS301C video bridge
[ 3.220000] sisfb: Detected 1280x1024 flat panel
[ 3.304000] sisfb: CRT2 DDC supported
[ 3.304000] sisfb: CRT2 DDC level: 2
[ 3.512000] sisfb: Monitor range H 30-81KHz, V 56-76Hz, Max. dotclock 140MHz
[ 3.516000] sisfb: Default mode is 1280x1024x8 (60Hz)
[ 3.520000] sisfb: Initial vbflags 0x10000022
[ 4.008000] Console: switching to colour frame buffer device 160x64
[ 4.068000] sisfb: 2D acceleration is enabled, y-panning enabled (auto-max)
[ 4.072000] fb0: SiS 315PRO frame buffer device version 1.8.9
[ 4.076000] sisfb: Copyright (C) 2001-2005 Thomas Winischhofer
[ 4.156000] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 4.308000] printk: console [ttyS0] disabled
[ 4.316000] serial8250.0: ttyS0 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[ 4.320000] printk: console [ttyS0] enabled
[ 4.324000] printk: bootconsole [early0] disabled
[ 4.808000] brd: module loaded
[ 5.036000] loop: module loaded
[ 5.040000] Uniform Multi-Platform E-IDE driver
[ 5.044000] amd74xx 0000:00:0e.2: UDMA100 controller
[ 5.048000] amd74xx 0000:00:0e.2: IDE controller (0x1022:0x209a rev 0x01)
[ 5.052000] amd74xx 0000:00:0e.2: IDE port disabled
[ 5.056000] amd74xx 0000:00:0e.2: not 100% native mode: will probe irqs later
[ 5.060000] legacy IDE will be removed in 2021, please switch to libata
[ 5.060000] Report any missing HW support to linux-ide@vger.kernel.org
[ 5.064000] ide0: BM-DMA at 0x4ce0-0x4ce7
[ 5.068000] Probing IDE interface ide0...
[ 5.428000] hda: WDC WD1600BEVS-00VAT0, ATA DISK drive
[ 6.152000] hda: host max PIO5 wanted PIO255(auto-tune) selected PIO4
[ 6.152000] hda: UDMA/100 mode selected
[ 6.156000] ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
[ 6.160000] ide-gd driver 1.18
[ 6.164000] hda: max request size: 1024KiB
[ 6.244000] hda: 312581808 sectors (160041 MB) w/8192KiB Cache, CHS=19457/255/63
[ 6.248000] hda: cache flushes supported
[ 6.268000] hda: hda1
[ 6.272000] slot: 6, pin: 1, irq: 36
[ 6.276000] libphy: r8169: probed
[ 6.280000] r8169 0000:00:06.0 eth0: RTL8169sc/8110sc, 00:23:9e:00:0f:54, XID 980, IRQ 36
[ 6.284000] r8169 0000:00:06.0 eth0: jumbo features [frames: 7152 bytes, tx checksumming: ok]
[ 6.288000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 6.292000] ehci-pci: EHCI PCI platform driver
[ 6.296000] ehci-pci 0000:00:0e.5: EHCI Host Controller
[ 6.300000] ehci-pci 0000:00:0e.5: new USB bus registered, assigned bus number 1
[ 6.304000] ehci-pci 0000:00:0e.5: irq 11, io mem 0x50071000
[ 6.440000] ehci-pci 0000:00:0e.5: USB 0.0 started, EHCI 1.00
[ 6.448000] hub 1-0:1.0: USB hub found
[ 6.460000] hub 1-0:1.0: 4 ports detected
[ 6.468000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 6.472000] ohci-pci: OHCI PCI platform driver
[ 6.476000] ohci-pci 0000:00:0e.4: OHCI PCI host controller
[ 6.480000] ohci-pci 0000:00:0e.4: new USB bus registered, assigned bus number 2
[ 6.484000] ohci-pci 0000:00:0e.4: irq 11, io mem 0x50070000
[ 6.580000] hub 2-0:1.0: USB hub found
[ 6.592000] hub 2-0:1.0: 4 ports detected
[ 6.600000] usbcore: registered new interface driver usb-storage
[ 6.604000] loongson2_cpufreq: Loongson-2F CPU frequency driver
[ 6.608000] usbcore: registered new interface driver usbhid
[ 6.612000] usbhid: USB HID core driver
[ 6.620000] NET: Registered protocol family 17
[ 6.700000] Freeing unused kernel memory: 1968K
[ 6.704000] This architecture does not have kernel memory protection.
[ 6.708000] Run /init as init process
[ 10.868000] EXT4-fs (hda1): mounting ext3 file system using the ext4 subsystem
[ 12.756000] EXT4-fs (hda1): mounted filesystem with ordered data mode. Opts: (null)
[ 15.800000] RTL8211B Gigabit Ethernet r8169-30:00: attached PHY driver [RTL8211B Gigabit Ethernet] (mii_bus:phy_addr=r8169-30:00, irq=IGNORE)
[ 15.908000] r8169 0000:00:06.0 eth0: Link is Down
[ 18.424000] r8169 0000:00:06.0 eth0: Link is Up - 1Gbps/Full - flow control rx/tx
A.
^ permalink raw reply
* Re: [PATCH net-next 2/6] net: dsa: do not skip -EOPNOTSUPP in dsa_port_vid_add
From: Vivien Didelot @ 2019-08-22 23:43 UTC (permalink / raw)
To: Vladimir Oltean; +Cc: netdev, davem, f.fainelli, andrew
In-Reply-To: <f179fa10-3123-d055-1c67-0d24adf3cb08@gmail.com>
Hi Vladimir,
On Fri, 23 Aug 2019 01:06:58 +0300, Vladimir Oltean <olteanv@gmail.com> wrote:
> Hi Vivien,
>
> On 8/22/19 11:13 PM, Vivien Didelot wrote:
> > Currently dsa_port_vid_add returns 0 if the switch returns -EOPNOTSUPP.
> >
> > This function is used in the tag_8021q.c code to offload the PVID of
> > ports, which would simply not work if .port_vlan_add is not supported
> > by the underlying switch.
> >
> > Do not skip -EOPNOTSUPP in dsa_port_vid_add but only when necessary,
> > that is to say in dsa_slave_vlan_rx_add_vid.
> >
>
> Do you know why Florian suppressed -EOPNOTSUPP in 061f6a505ac3 ("net:
> dsa: Add ndo_vlan_rx_{add, kill}_vid implementation")?
> I forced a return value of -EOPNOTSUPP here and when I create a VLAN
> sub-interface nothing breaks, it just says:
> RTNETLINK answers: Operation not supported
> which IMO is expected.
I do not know what you mean. This patch does not change the behavior of
dsa_slave_vlan_rx_add_vid, which returns 0 if -EOPNOTSUPP is caught.
Thanks,
Vivien
^ permalink raw reply
* Re: [PATCH net-next 2/6] net: dsa: do not skip -EOPNOTSUPP in dsa_port_vid_add
From: Vladimir Oltean @ 2019-08-22 23:44 UTC (permalink / raw)
To: Vivien Didelot; +Cc: netdev, David S. Miller, Florian Fainelli, Andrew Lunn
In-Reply-To: <20190822194304.GB30912@t480s.localdomain>
On Fri, 23 Aug 2019 at 02:43, Vivien Didelot <vivien.didelot@gmail.com> wrote:
>
> Hi Vladimir,
>
> On Fri, 23 Aug 2019 01:06:58 +0300, Vladimir Oltean <olteanv@gmail.com> wrote:
> > Hi Vivien,
> >
> > On 8/22/19 11:13 PM, Vivien Didelot wrote:
> > > Currently dsa_port_vid_add returns 0 if the switch returns -EOPNOTSUPP.
> > >
> > > This function is used in the tag_8021q.c code to offload the PVID of
> > > ports, which would simply not work if .port_vlan_add is not supported
> > > by the underlying switch.
> > >
> > > Do not skip -EOPNOTSUPP in dsa_port_vid_add but only when necessary,
> > > that is to say in dsa_slave_vlan_rx_add_vid.
> > >
> >
> > Do you know why Florian suppressed -EOPNOTSUPP in 061f6a505ac3 ("net:
> > dsa: Add ndo_vlan_rx_{add, kill}_vid implementation")?
> > I forced a return value of -EOPNOTSUPP here and when I create a VLAN
> > sub-interface nothing breaks, it just says:
> > RTNETLINK answers: Operation not supported
> > which IMO is expected.
>
> I do not know what you mean. This patch does not change the behavior of
> dsa_slave_vlan_rx_add_vid, which returns 0 if -EOPNOTSUPP is caught.
>
Yes, but what's wrong with just forwarding -EOPNOTSUPP?
>
> Thanks,
>
> Vivien
^ permalink raw reply
* Re: [PATCH net-next 6/6] net: dsa: clear VLAN flags for CPU port
From: Vladimir Oltean @ 2019-08-22 23:51 UTC (permalink / raw)
To: Vivien Didelot, netdev; +Cc: davem, f.fainelli, andrew
In-Reply-To: <20190822201323.1292-7-vivien.didelot@gmail.com>
On 8/22/19 11:13 PM, Vivien Didelot wrote:
> When the bridge offloads a VLAN on a slave port, we also need to
> program its dedicated CPU port as a member of the VLAN.
>
> Drivers may handle the CPU port's membership as they want. For example,
> Marvell as a special "Unmodified" mode to pass frames as is through
> such ports.
>
> Even though DSA expects the drivers to handle the CPU port membership,
> they are unlikely to program such VLANs untagged, and certainly not as
> PVID. This patch clears the VLAN flags before programming the CPU port.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
> Suggested-by: Vladimir Oltean <olteanv@gmail.com>
> ---
> net/dsa/slave.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index 8267c156a51a..48df48f76c67 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -332,6 +332,12 @@ static int dsa_slave_vlan_add(struct net_device *dev,
> if (err)
> return err;
>
> + /* We need the dedicated CPU port to be a member of the VLAN as well.
> + * Even though drivers often handle CPU membership in special ways,
> + * CPU ports are likely to be tagged, so clear the VLAN flags.
> + */
> + vlan.flags = 0;
> +
How does this work exactly?
If I run 'sudo bridge vlan add vid 1 dev swp4 pvid untagged', then the
CPU port starts sending VLAN-tagged traffic. I see this in tcpdump on
the DSA master port, but if I tcpdump on swp4, the VLAN tag is removed.
Who is doing that?
> err = dsa_port_vlan_add(dp->cpu_dp, &vlan, trans);
> if (err)
> return err;
>
^ permalink raw reply
* [PATCH] ncsi-netlink: support sending NC-SI commands over Netlink interface
From: Ben Wei @ 2019-08-23 0:02 UTC (permalink / raw)
To: sam@mendozajonas.com, davem@davemloft.net, netdev@vger.kernel.org,
openbmc@lists.ozlabs.org, Justin.Lee1@Dell.com
Cc: Ben Wei
This patch extends ncsi-netlink command line utility to send NC-SI command to kernel driver
via NCSI_CMD_SEND_CMD command.
New command line option -o (opcode) is used to specify NC-SI command and optional payload.
For example, to send "Get Parameter" command
ncsi-netlink -l 2 -c 0 -p0 -o 0x17
To configure AEN
ncsi-netlink -l 2 -c 0 -p0 -o 8 0 0 0 0 0 0 0 7
Signed-off-by: Ben Wei <benwei@fb.com>
---
ncsi-netlink.c | 162 +++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 157 insertions(+), 5 deletions(-)
diff --git a/ncsi-netlink.c b/ncsi-netlink.c index c46ae76..a06e30e 100644
--- a/ncsi-netlink.c
+++ b/ncsi-netlink.c
@@ -11,10 +11,22 @@
#include <linux/ncsi.h>
//#include "ncsi.h"
+struct ncsi_pkt_hdr {
+ unsigned char mc_id; /* Management controller ID */
+ unsigned char revision; /* NCSI version - 0x01 */
+ unsigned char reserved; /* Reserved */
+ unsigned char id; /* Packet sequence number */
+ unsigned char type; /* Packet type */
+ unsigned char channel; /* Network controller ID */
+ __be16 length; /* Payload length */
+ __be32 reserved1[2]; /* Reserved */
+};
+
struct ncsi_msg {
struct nl_sock *sk;
struct nl_msg *msg;
struct nlmsghdr *hdr;
+ int ret;
};
static void free_ncsi_msg(struct ncsi_msg *msg) @@ -69,6 +81,7 @@ int setup_ncsi_message(struct ncsi_msg *msg, int cmd, int flags)
rc = -1;
goto out;
}
+ msg->ret = 1;
return 0;
out:
@@ -308,10 +321,132 @@ out:
return rc;
}
+static int send_cb(struct nl_msg *msg, void *arg) { #define
+ETHERNET_HEADER_SIZE 16
+
+ struct nlmsghdr *hdr = nlmsg_hdr(msg);
+ struct nlattr *tb[NCSI_ATTR_MAX + 1] = {0};
+ int rc, data_len, i;
+ char *data;
+ int *ret = arg;
+
+ static struct nla_policy ncsi_genl_policy[NCSI_ATTR_MAX + 1] = {
+ [NCSI_ATTR_IFINDEX] = { .type = NLA_U32 },
+ [NCSI_ATTR_PACKAGE_LIST] = { .type = NLA_NESTED },
+ [NCSI_ATTR_PACKAGE_ID] = { .type = NLA_U32 },
+ [NCSI_ATTR_CHANNEL_ID] = { .type = NLA_U32 },
+ [NCSI_ATTR_DATA] = { .type = NLA_BINARY },
+ [NCSI_ATTR_MULTI_FLAG] = { .type = NLA_FLAG },
+ [NCSI_ATTR_PACKAGE_MASK] = { .type = NLA_U32 },
+ [NCSI_ATTR_CHANNEL_MASK] = { .type = NLA_U32 },
+ };
+
+
+ rc = genlmsg_parse(hdr, 0, tb, NCSI_ATTR_MAX, ncsi_genl_policy);
+ if (rc) {
+ fprintf(stderr, "Failed to parse ncsi cmd callback\n");
+ return rc;
+ }
+
+ data_len = nla_len(tb[NCSI_ATTR_DATA]) - ETHERNET_HEADER_SIZE;
+ data = nla_data(tb[NCSI_ATTR_DATA]) + ETHERNET_HEADER_SIZE;
+
+
+ printf("NC-SI Response Payload length = %d\n", data_len);
+ printf("Response Payload:\n");
+ for (i = 0; i < data_len; ++i) {
+ if (i && !(i%4))
+ printf("\n%d: ", 16+i);
+ printf("0x%02x ", *(data+i));
+ }
+ printf("\n");
+
+ // indicating call back has been completed
+ *ret = 0;
+ return 0;
+}
+
+static int run_command_send(int ifindex, int package, int channel,
+ uint8_t type, short payload_len, uint8_t *payload) {
+ struct ncsi_msg msg;
+ struct ncsi_pkt_hdr *hdr;
+ int rc;
+ uint8_t *pData, *pCtrlPktPayload;
+
+ // allocate a contiguous buffer space to hold ncsi message
+ // (header + Control Packet payload)
+ pData = calloc(1, sizeof(struct ncsi_pkt_hdr) + payload_len);
+ if (!pData) {
+ fprintf(stderr, "Failed to allocate buffer for ctrl pkt, %m\n");
+ goto out;
+ }
+ // prepare buffer to be copied to netlink msg
+ hdr = (void *)pData;
+ pCtrlPktPayload = pData + sizeof(struct ncsi_pkt_hdr);
+ memcpy(pCtrlPktPayload, payload, payload_len);
+
+ rc = setup_ncsi_message(&msg, NCSI_CMD_SEND_CMD, 0);
+ if (rc)
+ return -1;
+
+ printf("send cmd, ifindex %d, package %d, channel %d, type 0x%x\n",
+ ifindex, package, channel, type);
+
+ rc = nla_put_u32(msg.msg, NCSI_ATTR_IFINDEX, ifindex);
+ if (rc) {
+ fprintf(stderr, "Failed to add ifindex, %m\n");
+ goto out;
+ }
+
+ if (package >= 0) {
+ rc = nla_put_u32(msg.msg, NCSI_ATTR_PACKAGE_ID, package);
+ if (rc) {
+ fprintf(stderr, "Failed to add package id, %m\n");
+ goto out;
+ }
+ }
+
+ rc = nla_put_u32(msg.msg, NCSI_ATTR_CHANNEL_ID, channel);
+ if (rc)
+ fprintf(stderr, "Failed to add channel, %m\n");
+
+ hdr->type = type; // NC-SI command
+ hdr->length = htons(payload_len); // NC-SI command payload length
+ rc = nla_put(msg.msg, NCSI_ATTR_DATA,
+ sizeof(struct ncsi_pkt_hdr)+payload_len,
+ (void *)pData);
+ if (rc)
+ fprintf(stderr, "Failed to add netlink header, %m\n");
+
+ nl_socket_disable_seq_check(msg.sk);
+ rc = nl_socket_modify_cb(msg.sk, NL_CB_VALID, NL_CB_CUSTOM, send_cb,
+ &(msg.ret));
+
+ rc = nl_send_auto(msg.sk, msg.msg);
+ if (rc < 0) {
+ fprintf(stderr, "Failed to send message, %m\n");
+ goto out;
+ }
+
+ while (msg.ret == 1) {
+ rc = nl_recvmsgs_default(msg.sk);
+ if (rc) {
+ fprintf(stderr, "Failed to rcv msg, rc=%d %m\n", rc);
+ goto out;
+ }
+ }
+
+out:
+ free_ncsi_msg(&msg);
+ return rc;
+}
+
void usage(void)
{
printf( "ncsi-netlink: Send messages to the NCSI driver via Netlink\n"
- "ncsi-netlink [-h] operation [-p PACKAGE] [-c CHANNEL] [-l IFINDEX]\n"
+ "ncsi-netlink [-h] operation [-p PACKAGE] [-c CHANNEL] [-l IFINDEX] [-o cmd [payload]]\n"
"\t--ifindex index Specify the interface index\n"
"\t--package package Package number\n"
"\t--channel channel Channel number (aka. port number)\n"
@@ -326,7 +461,9 @@ void usage(void)
int main(int argc, char *argv[])
{
int rc, operation = -1;
- int package, channel, ifindex;
+ int package, channel, ifindex, opcode;
+ uint8_t payload[2048] = {0};
+ short payload_length = 0, i = 0;
static const struct option long_opts[] = {
{"channel", required_argument, NULL, 'c'},
@@ -336,12 +473,12 @@ int main(int argc, char *argv[])
{"package", required_argument, NULL, 'p'},
{"set", no_argument, NULL, 's'},
{"clear", no_argument, NULL, 'x'},
+ {"cmd", required_argument, NULL, 'o'},
{ NULL, 0, NULL, 0},
};
- static const char short_opts[] = "c:hil:p:sx";
-
- package = channel = ifindex = -1;
+ static const char short_opts[] = "c:hil:p:sxo:";
+ package = channel = ifindex = opcode = -1;
while (true) {
int c = getopt_long(argc, argv, short_opts, long_opts, NULL);
@@ -350,6 +487,17 @@ int main(int argc, char *argv[])
errno = 0;
switch (c) {
+ case 'o':
+ opcode = strtoul(optarg, NULL, 0);
+ if (errno) {
+ fprintf(stderr, "Couldn't parse opcode, %m\n");
+ return -1;
+ }
+ operation = NCSI_CMD_SEND_CMD;
+ payload_length = argc - optind;
+ for (i = 0; i < payload_length; ++i)
+ payload[i] = (int)strtoul(argv[i + optind], NULL, 0);
+ break;
case 'c':
channel = strtoul(optarg, NULL, 0);
if (errno) {
@@ -408,6 +556,10 @@ int main(int argc, char *argv[])
case NCSI_CMD_CLEAR_INTERFACE:
rc = run_command_clear(ifindex);
break;
+ case NCSI_CMD_SEND_CMD:
+ rc = run_command_send(ifindex, package, channel,
+ opcode, payload_length, payload);
+ break;
default:
usage();
return -1;
--
2.17.1
^ permalink raw reply
* Re: [PATCH net-next v2 0/3] net: dsa: mt7530: Convert to PHYLINK and add support for port 5
From: Andrew Lunn @ 2019-08-23 1:09 UTC (permalink / raw)
To: David Miller
Cc: opensource, sean.wang, vivien.didelot, f.fainelli, matthias.bgg,
netdev, linux-arm-kernel, linux-mediatek, john, linux-mips,
frank-w
In-Reply-To: <20190822.162047.1140525762795777800.davem@davemloft.net>
On Thu, Aug 22, 2019 at 04:20:47PM -0700, David Miller wrote:
> From: René van Dorst <opensource@vdorst.com>
> Date: Wed, 21 Aug 2019 16:45:44 +0200
>
> > 1. net: dsa: mt7530: Convert to PHYLINK API
> > This patch converts mt7530 to PHYLINK API.
> > 2. dt-bindings: net: dsa: mt7530: Add support for port 5
> > 3. net: dsa: mt7530: Add support for port 5
> > These 2 patches adding support for port 5 of the switch.
> >
> > v1->v2:
> > * Mostly phylink improvements after review.
> > rfc -> v1:
> > * Mostly phylink improvements after review.
> > * Drop phy isolation patches. Adds no value for now.
>
> This definitely needs some review before I'll apply it.
That would be Russell.
We should try to improve MAINTAINER so that Russell King gets picked
by the get_maintainer script.
Andrew
^ permalink raw reply
* [PATCH] [PATCH v3] sock: fix potential memory leak in proto_register()
From: zhanglin @ 2019-08-23 1:14 UTC (permalink / raw)
To: davem
Cc: ast, daniel, kafai, songliubraving, yhs, willemb, edumazet,
deepa.kernel, arnd, dh.herrmann, gnault, netdev, linux-kernel,
bpf, xue.zhihong, wang.yi59, jiang.xuexin, zhanglin
If protocols registered exceeded PROTO_INUSE_NR, prot will be
added to proto_list, but no available bit left for prot in
proto_inuse_idx.
Changes since v2:
* Propagate the error code properly
Signed-off-by: zhanglin <zhang.lin16@zte.com.cn>
---
net/core/sock.c | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/net/core/sock.c b/net/core/sock.c
index bc3512f230a3..f39163071384 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3139,16 +3139,17 @@ static __init int net_inuse_init(void)
core_initcall(net_inuse_init);
-static void assign_proto_idx(struct proto *prot)
+static int assign_proto_idx(struct proto *prot)
{
prot->inuse_idx = find_first_zero_bit(proto_inuse_idx, PROTO_INUSE_NR);
if (unlikely(prot->inuse_idx == PROTO_INUSE_NR - 1)) {
pr_err("PROTO_INUSE_NR exhausted\n");
- return;
+ return -ENOSPC;
}
set_bit(prot->inuse_idx, proto_inuse_idx);
+ return 0;
}
static void release_proto_idx(struct proto *prot)
@@ -3157,8 +3158,9 @@ static void release_proto_idx(struct proto *prot)
clear_bit(prot->inuse_idx, proto_inuse_idx);
}
#else
-static inline void assign_proto_idx(struct proto *prot)
+static inline int assign_proto_idx(struct proto *prot)
{
+ return 0;
}
static inline void release_proto_idx(struct proto *prot)
@@ -3207,6 +3209,8 @@ static int req_prot_init(const struct proto *prot)
int proto_register(struct proto *prot, int alloc_slab)
{
+ int ret = -ENOBUFS;
+
if (alloc_slab) {
prot->slab = kmem_cache_create_usercopy(prot->name,
prot->obj_size, 0,
@@ -3243,20 +3247,27 @@ int proto_register(struct proto *prot, int alloc_slab)
}
mutex_lock(&proto_list_mutex);
+ ret = assign_proto_idx(prot);
+ if (ret) {
+ mutex_unlock(&proto_list_mutex);
+ goto out_free_timewait_sock_slab_name;
+ }
list_add(&prot->node, &proto_list);
- assign_proto_idx(prot);
mutex_unlock(&proto_list_mutex);
- return 0;
+ return ret;
out_free_timewait_sock_slab_name:
- kfree(prot->twsk_prot->twsk_slab_name);
+ if (alloc_slab && prot->twsk_prot)
+ kfree(prot->twsk_prot->twsk_slab_name);
out_free_request_sock_slab:
- req_prot_cleanup(prot->rsk_prot);
+ if (alloc_slab) {
+ req_prot_cleanup(prot->rsk_prot);
- kmem_cache_destroy(prot->slab);
- prot->slab = NULL;
+ kmem_cache_destroy(prot->slab);
+ prot->slab = NULL;
+ }
out:
- return -ENOBUFS;
+ return ret;
}
EXPORT_SYMBOL(proto_register);
--
2.17.1
^ permalink raw reply related
* Re: [net-next 4/8] net/mlx5e: Add device out of buffer counter
From: Jakub Kicinski @ 2019-08-23 1:33 UTC (permalink / raw)
To: Saeed Mahameed; +Cc: David S. Miller, netdev@vger.kernel.org, Moshe Shemesh
In-Reply-To: <20190822233514.31252-5-saeedm@mellanox.com>
On Thu, 22 Aug 2019 23:35:52 +0000, Saeed Mahameed wrote:
> From: Moshe Shemesh <moshe@mellanox.com>
>
> Added the following packets drop counter:
> Device out of buffer - counts packets which were dropped due to full
> device internal receive queue.
> This counter will be shown on ethtool as a new counter called
> dev_out_of_buffer.
> The counter is read from FW by command QUERY_VNIC_ENV.
>
> Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Sounds like rx_fifo_errors, no? Doesn't rx_fifo_errors count RX
overruns?
^ permalink raw reply
* Re: [PATCH net-next 05/10] net: dsa: mv88e6xxx: create chip->info->ops->serdes_get_lane method
From: Andrew Lunn @ 2019-08-23 1:39 UTC (permalink / raw)
To: Marek Behún
Cc: netdev, Vivien Didelot, Florian Fainelli, Vladimir Oltean
In-Reply-To: <20190821232724.1544-6-marek.behun@nic.cz>
On Thu, Aug 22, 2019 at 01:27:19AM +0200, Marek Behún wrote:
> Create a serdes_get_lane() method in the mv88e6xxx operations structure.
> Use it instead of calling the different implementations.
>
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply
* Re: [PATCH net-next 06/10] net: dsa: mv88e6xxx: add serdes_get_lane method for Topaz family
From: Andrew Lunn @ 2019-08-23 1:40 UTC (permalink / raw)
To: Marek Behún
Cc: netdev, Vivien Didelot, Florian Fainelli, Vladimir Oltean
In-Reply-To: <20190821232724.1544-7-marek.behun@nic.cz>
On Thu, Aug 22, 2019 at 01:27:20AM +0200, Marek Behún wrote:
> The Topaz family has only one SERDES, on port 5, with address 0x15.
> Currently we have MV88E6341_ADDR_SERDES macro used in the
> mv88e6341_serdes_power method. Rename the macro to MV88E6341_PORT5_LANE
> and use the new mv88e6xxx_serdes_get_lane method in
> mv88e6341_serdes_power.
>
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ 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