* [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
* Re: [PATCH net-next 07/10] net: dsa: mv88e6xxx: rename port cmode macro
From: Andrew Lunn @ 2019-08-23 1:41 UTC (permalink / raw)
To: Marek Behún
Cc: netdev, Vivien Didelot, Florian Fainelli, Vladimir Oltean
In-Reply-To: <20190821232724.1544-8-marek.behun@nic.cz>
On Thu, Aug 22, 2019 at 01:27:21AM +0200, Marek Behún wrote:
> This is a cosmetic update. We are removing the last underscore from
> macros MV88E6XXX_PORT_STS_CMODE_100BASE_X and
> MV88E6XXX_PORT_STS_CMODE_1000BASE_X. The 2500base-x version does not
> have that underscore. Also PHY_INTERFACE_MODE_ macros do not have it
> there.
>
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply
* Re: [PATCH 2/2] selinux: use netlink_receive hook
From: kbuild test robot @ 2019-08-23 1:44 UTC (permalink / raw)
To: Jeff Vander Stoep
Cc: kbuild-all, netdev, linux-security-module, selinux,
Jeff Vander Stoep
In-Reply-To: <20190821134616.97894-1-jeffv@google.com>
[-- Attachment #1: Type: text/plain, Size: 3117 bytes --]
Hi Jeff,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc5 next-20190822]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Jeff-Vander-Stoep/rtnetlink-gate-MAC-address-with-an-LSM-hook/20190823-071253
config: i386-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-10) 7.4.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
In file included from include/linux/sched.h:12:0,
from include/linux/tracehook.h:46,
from security/selinux/hooks.c:27:
security/selinux/hooks.c: In function 'selinux_netlink_receive':
>> arch/x86/include/asm/current.h:18:17: error: passing argument 1 of 'sock_has_perm' from incompatible pointer type [-Werror=incompatible-pointer-types]
#define current get_current()
^
>> security/selinux/hooks.c:5830:23: note: in expansion of macro 'current'
return sock_has_perm(current, sk, NETLINK_ROUTE_SOCKET__NLMSG_READPRIV);
^~~~~~~
security/selinux/hooks.c:4422:12: note: expected 'struct sock *' but argument is of type 'struct task_struct *'
static int sock_has_perm(struct sock *sk, u32 perms)
^~~~~~~~~~~~~
>> security/selinux/hooks.c:5830:32: warning: passing argument 2 of 'sock_has_perm' makes integer from pointer without a cast [-Wint-conversion]
return sock_has_perm(current, sk, NETLINK_ROUTE_SOCKET__NLMSG_READPRIV);
^~
security/selinux/hooks.c:4422:12: note: expected 'u32 {aka unsigned int}' but argument is of type 'struct sock *'
static int sock_has_perm(struct sock *sk, u32 perms)
^~~~~~~~~~~~~
>> security/selinux/hooks.c:5830:9: error: too many arguments to function 'sock_has_perm'
return sock_has_perm(current, sk, NETLINK_ROUTE_SOCKET__NLMSG_READPRIV);
^~~~~~~~~~~~~
security/selinux/hooks.c:4422:12: note: declared here
static int sock_has_perm(struct sock *sk, u32 perms)
^~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/sock_has_perm +18 arch/x86/include/asm/current.h
f0766440dda7ac include/asm-x86/current.h Christoph Lameter 2008-05-09 17
c6f5e0acd5d12e arch/x86/include/asm/current.h Brian Gerst 2009-01-19 @18 #define current get_current()
f0766440dda7ac include/asm-x86/current.h Christoph Lameter 2008-05-09 19
:::::: The code at line 18 was first introduced by commit
:::::: c6f5e0acd5d12ee23f701f15889872e67b47caa6 x86-64: Move current task from PDA to per-cpu and consolidate with 32-bit.
:::::: TO: Brian Gerst <brgerst@gmail.com>
:::::: CC: Tejun Heo <tj@kernel.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28074 bytes --]
^ permalink raw reply
* Re: [PATCH 2/2] selinux: use netlink_receive hook
From: kbuild test robot @ 2019-08-23 1:54 UTC (permalink / raw)
To: Jeff Vander Stoep
Cc: kbuild-all, netdev, linux-security-module, selinux,
Jeff Vander Stoep
In-Reply-To: <20190821134616.97894-1-jeffv@google.com>
[-- Attachment #1: Type: text/plain, Size: 3307 bytes --]
Hi Jeff,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc5 next-20190822]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Jeff-Vander-Stoep/rtnetlink-gate-MAC-address-with-an-LSM-hook/20190823-071253
config: s390-debug_defconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/sched.h:12:0,
from include/linux/tracehook.h:46,
from security/selinux/hooks.c:27:
security/selinux/hooks.c: In function 'selinux_netlink_receive':
>> arch/s390/include/asm/current.h:17:17: error: passing argument 1 of 'sock_has_perm' from incompatible pointer type [-Werror=incompatible-pointer-types]
#define current ((struct task_struct *const)S390_lowcore.current_task)
^
security/selinux/hooks.c:5830:23: note: in expansion of macro 'current'
return sock_has_perm(current, sk, NETLINK_ROUTE_SOCKET__NLMSG_READPRIV);
^~~~~~~
security/selinux/hooks.c:4422:12: note: expected 'struct sock *' but argument is of type 'struct task_struct *'
static int sock_has_perm(struct sock *sk, u32 perms)
^~~~~~~~~~~~~
security/selinux/hooks.c:5830:32: warning: passing argument 2 of 'sock_has_perm' makes integer from pointer without a cast [-Wint-conversion]
return sock_has_perm(current, sk, NETLINK_ROUTE_SOCKET__NLMSG_READPRIV);
^~
security/selinux/hooks.c:4422:12: note: expected 'u32 {aka unsigned int}' but argument is of type 'struct sock *'
static int sock_has_perm(struct sock *sk, u32 perms)
^~~~~~~~~~~~~
security/selinux/hooks.c:5830:9: error: too many arguments to function 'sock_has_perm'
return sock_has_perm(current, sk, NETLINK_ROUTE_SOCKET__NLMSG_READPRIV);
^~~~~~~~~~~~~
security/selinux/hooks.c:4422:12: note: declared here
static int sock_has_perm(struct sock *sk, u32 perms)
^~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/sock_has_perm +17 arch/s390/include/asm/current.h
^1da177e4c3f41 include/asm-s390/current.h Linus Torvalds 2005-04-16 16
^1da177e4c3f41 include/asm-s390/current.h Linus Torvalds 2005-04-16 @17 #define current ((struct task_struct *const)S390_lowcore.current_task)
^1da177e4c3f41 include/asm-s390/current.h Linus Torvalds 2005-04-16 18
:::::: The code at line 17 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 20136 bytes --]
^ permalink raw reply
* Re: [PATCH] net/ncsi: Fix the payload copying for the request coming from Netlink
From: David Miller @ 2019-08-23 2:27 UTC (permalink / raw)
To: Justin.Lee1; +Cc: netdev, openbmc, linux-kernel, sam
In-Reply-To: <a94e5fa397a64ae3a676ec11ea09aaba@AUSX13MPS302.AMER.DELL.COM>
From: <Justin.Lee1@Dell.com>
Date: Wed, 21 Aug 2019 21:24:52 +0000
> The request coming from Netlink should use the OEM generic handler.
>
> The standard command handler expects payload in bytes/words/dwords
> but the actual payload is stored in data if the request is coming from Netlink.
>
> Signed-off-by: Justin Lee <justin.lee1@dell.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net-next] net/ncsi: update response packet length for GCPS/GNS/GNPTS commands
From: David Miller @ 2019-08-23 2:28 UTC (permalink / raw)
To: benwei; +Cc: sam, netdev, linux-kernel, openbmc
In-Reply-To: <CH2PR15MB3686567EBCBE71B41C5F079AA3AA0@CH2PR15MB3686.namprd15.prod.outlook.com>
From: Ben Wei <benwei@fb.com>
Date: Wed, 21 Aug 2019 22:08:49 +0000
> Update response packet length for the following commands per NC-SI spec
> - Get Controller Packet Statistics
> - Get NC-SI Statistics
> - Get NC-SI Pass-through Statistics command
>
> Signed-off-by: Ben Wei <benwei@fb.com>
Applied, thanks Ben.
^ permalink raw reply
* linux-next: manual merge of the net-next tree with the pci tree
From: Stephen Rothwell @ 2019-08-23 2:35 UTC (permalink / raw)
To: David Miller, Networking, Bjorn Helgaas
Cc: Linux Next Mailing List, Linux Kernel Mailing List, Randy Dunlap,
Haiyang Zhang, Saeed Mahameed, Lorenzo Pieralisi
[-- Attachment #1: Type: text/plain, Size: 2216 bytes --]
Hi all,
Today's linux-next merge of the net-next tree got conflicts in:
drivers/pci/Kconfig
drivers/pci/controller/pci-hyperv.c
between commit:
f58ba5e3f686 ("PCI: pci-hyperv: Fix build errors on non-SYSFS config")
44b1ece783ff ("PCI: hv: Detect and fix Hyper-V PCI domain number collision")
from the pci tree and commit:
348dd93e40c1 ("PCI: hv: Add a Hyper-V PCI interface driver for software backchannel interface")
from the net-next tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc drivers/pci/Kconfig
index 232042722261,c313de96a357..000000000000
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@@ -181,7 -181,8 +181,8 @@@ config PCI_LABE
config PCI_HYPERV
tristate "Hyper-V PCI Frontend"
- depends on X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && X86_64
+ depends on X86_64 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && SYSFS
+ select PCI_HYPERV_INTERFACE
help
The PCI device frontend driver allows the kernel to import arbitrary
PCI devices from a PCI backend to support PCI driver domains.
diff --cc drivers/pci/controller/pci-hyperv.c
index 3a56de6b2ec2,9c93ac2215b7..000000000000
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@@ -2810,9 -3050,11 +3113,14 @@@ static void __exit exit_hv_pci_drv(void
static int __init init_hv_pci_drv(void)
{
+ /* Set the invalid domain number's bit, so it will not be used */
+ set_bit(HVPCI_DOM_INVALID, hvpci_dom_map);
+
+ /* Initialize PCI block r/w interface */
+ hvpci_block_ops.read_block = hv_read_config_block;
+ hvpci_block_ops.write_block = hv_write_config_block;
+ hvpci_block_ops.reg_blk_invalidate = hv_register_block_invalidate;
+
return vmbus_driver_register(&hv_pci_drv);
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH ipsec-next 1/7] net: add queue argument to __skb_wait_for_more_packets and __skb_{,try_}recv_datagram
From: kbuild test robot @ 2019-08-23 2:39 UTC (permalink / raw)
To: Sabrina Dubroca
Cc: kbuild-all, netdev, Herbert Xu, Steffen Klassert, Sabrina Dubroca
In-Reply-To: <46946935e3faf51447443c9504d56c5eba49bef2.1566395202.git.sd@queasysnail.net>
[-- Attachment #1: Type: text/plain, Size: 30831 bytes --]
Hi Sabrina,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on ipsec-next/master]
url: https://github.com/0day-ci/linux/commits/Sabrina-Dubroca/ipsec-add-TCP-encapsulation-support-RFC-8229/20190823-065431
base: https://kernel.googlesource.com/pub/scm/linux/kernel/git/klassert/ipsec-next.git master
reproduce: make htmldocs
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:294: warning: Excess function parameter 'start' description in 'amdgpu_mn_invalidate_range_start_hsa'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:294: warning: Excess function parameter 'end' description in 'amdgpu_mn_invalidate_range_start_hsa'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:343: warning: Excess function parameter 'mm' description in 'amdgpu_mn_invalidate_range_end'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:343: warning: Excess function parameter 'start' description in 'amdgpu_mn_invalidate_range_end'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:343: warning: Excess function parameter 'end' description in 'amdgpu_mn_invalidate_range_end'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:183: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_read_lock'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:295: warning: Function parameter or member 'range' not described in 'amdgpu_mn_invalidate_range_start_hsa'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:295: warning: Excess function parameter 'mm' description in 'amdgpu_mn_invalidate_range_start_hsa'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:295: warning: Excess function parameter 'start' description in 'amdgpu_mn_invalidate_range_start_hsa'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:295: warning: Excess function parameter 'end' description in 'amdgpu_mn_invalidate_range_start_hsa'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:344: warning: Function parameter or member 'range' not described in 'amdgpu_mn_invalidate_range_end'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:344: warning: Excess function parameter 'mm' description in 'amdgpu_mn_invalidate_range_end'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:344: warning: Excess function parameter 'start' description in 'amdgpu_mn_invalidate_range_end'
drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:344: warning: Excess function parameter 'end' description in 'amdgpu_mn_invalidate_range_end'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:347: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor '
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:348: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor '
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:494: warning: Function parameter or member 'start' not described in 'amdgpu_vm_pt_first_dfs'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'adev' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'vm' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'start' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'cursor' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:546: warning: Function parameter or member 'entry' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:823: warning: Function parameter or member 'level' not described in 'amdgpu_vm_bo_param'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'params' not described in 'amdgpu_vm_update_flags'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'bo' not described in 'amdgpu_vm_update_flags'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'level' not described in 'amdgpu_vm_update_flags'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'pe' not described in 'amdgpu_vm_update_flags'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'addr' not described in 'amdgpu_vm_update_flags'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'count' not described in 'amdgpu_vm_update_flags'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'incr' not described in 'amdgpu_vm_update_flags'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1285: warning: Function parameter or member 'flags' not described in 'amdgpu_vm_update_flags'
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:2812: warning: Function parameter or member 'pasid' not described in 'amdgpu_vm_make_compute'
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:375: warning: Excess function parameter 'entry' description in 'amdgpu_irq_dispatch'
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:376: warning: Function parameter or member 'ih' not described in 'amdgpu_irq_dispatch'
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:376: warning: Excess function parameter 'entry' description in 'amdgpu_irq_dispatch'
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:1: warning: no structured comments found
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:128: warning: Incorrect use of kernel-doc format: * @atomic_obj
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:210: warning: Function parameter or member 'atomic_obj' not described in 'amdgpu_display_manager'
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:210: warning: Function parameter or member 'backlight_link' not described in 'amdgpu_display_manager'
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:210: warning: Function parameter or member 'backlight_caps' not described in 'amdgpu_display_manager'
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:210: warning: Function parameter or member 'freesync_module' not described in 'amdgpu_display_manager'
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:210: warning: Function parameter or member 'fw_dmcu' not described in 'amdgpu_display_manager'
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:210: warning: Function parameter or member 'dmcu_fw_version' not described in 'amdgpu_display_manager'
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1: warning: no structured comments found
include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver'
include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver'
include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver'
include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver'
include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver'
include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver'
include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver'
include/drm/drm_drv.h:722: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver'
include/drm/drm_modeset_helper_vtables.h:1004: warning: Function parameter or member 'prepare_writeback_job' not described in 'drm_connector_helper_funcs'
include/drm/drm_modeset_helper_vtables.h:1004: warning: Function parameter or member 'cleanup_writeback_job' not described in 'drm_connector_helper_funcs'
include/drm/drm_atomic_state_helper.h:1: warning: no structured comments found
drivers/gpu/drm/scheduler/sched_main.c:419: warning: Function parameter or member 'full_recovery' not described in 'drm_sched_start'
drivers/gpu/drm/i915/i915_vma.h:50: warning: cannot understand function prototype: 'struct i915_vma '
drivers/gpu/drm/i915/i915_vma.h:1: warning: no structured comments found
drivers/gpu/drm/i915/intel_guc_fwif.h:536: warning: cannot understand function prototype: 'struct guc_log_buffer_state '
drivers/gpu/drm/i915/i915_trace.h:1: warning: no structured comments found
drivers/gpu/drm/i915/i915_reg.h:156: warning: bad line:
include/linux/interconnect.h:1: warning: no structured comments found
include/linux/skbuff.h:897: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'list' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'ip_defrag_offset' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'skb_mstamp_ns' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'head_frag' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'encapsulation' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'csum_valid' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member '__pkt_vlan_present_offset' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'vlan_present' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'csum_level' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff'
include/linux/skbuff.h:897: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff'
include/net/sock.h:238: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_portpair' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_cookie' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_listener' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common'
include/net/sock.h:238: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common'
include/net/sock.h:520: warning: Function parameter or member 'sk_rx_skb_cache' not described in 'sock'
include/net/sock.h:520: warning: Function parameter or member 'sk_wq_raw' not described in 'sock'
include/net/sock.h:520: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock'
include/net/sock.h:520: warning: Function parameter or member 'sk_tx_skb_cache' not described in 'sock'
include/net/sock.h:520: warning: Function parameter or member 'sk_route_forced_caps' not described in 'sock'
include/net/sock.h:520: warning: Function parameter or member 'sk_txtime_report_errors' not described in 'sock'
include/net/sock.h:520: warning: Function parameter or member 'sk_validate_xmit_skb' not described in 'sock'
include/net/sock.h:520: warning: Function parameter or member 'sk_bpf_storage' not described in 'sock'
>> net/core/datagram.c:253: warning: Function parameter or member 'queue' not described in '__skb_try_recv_datagram'
include/linux/netdevice.h:2044: warning: Function parameter or member 'gso_partial_features' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member 'tlsdev_ops' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member 'name_assign_type' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member 'mpls_ptr' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member 'xdp_prog' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member 'nf_hooks_ingress' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member '____cacheline_aligned_in_smp' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member 'qdisc_hash' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member 'xps_cpus_map' not described in 'net_device'
include/linux/netdevice.h:2044: warning: Function parameter or member 'xps_rxqs_map' not described in 'net_device'
include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising' not described in 'phylink_link_state'
include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising' not described in 'phylink_link_state'
drivers/net/phy/phylink.c:593: warning: Function parameter or member 'config' not described in 'phylink_create'
drivers/net/phy/phylink.c:593: warning: Excess function parameter 'ndev' description in 'phylink_create'
include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'quotactl' not described in 'security_list_options'
include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'quota_on' not described in 'security_list_options'
include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_free_mnt_opts' not described in 'security_list_options'
include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_eat_lsm_opts' not described in 'security_list_options'
include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_kern_mount' not described in 'security_list_options'
include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_show_options' not described in 'security_list_options'
include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'sb_add_mnt_opt' not described in 'security_list_options'
include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'd_instantiate' not described in 'security_list_options'
include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'getprocattr' not described in 'security_list_options'
include/linux/lsm_hooks.h:1811: warning: Function parameter or member 'setprocattr' not described in 'security_list_options'
Documentation/admin-guide/mm/numaperf.rst:168: WARNING: Footnote [1] is not referenced.
Documentation/bpf/btf.rst:154: WARNING: Unexpected indentation.
Documentation/bpf/btf.rst:163: WARNING: Unexpected indentation.
lib/list_sort.c:162: WARNING: Unexpected indentation.
lib/list_sort.c:163: WARNING: Block quote ends without a blank line; unexpected unindent.
include/linux/xarray.h:232: WARNING: Unexpected indentation.
kernel/time/hrtimer.c:1120: WARNING: Block quote ends without a blank line; unexpected unindent.
kernel/signal.c:349: WARNING: Inline literal start-string without end-string.
include/uapi/linux/firewire-cdev.h:312: WARNING: Inline literal start-string without end-string.
Documentation/driver-api/gpio/driver.rst:419: WARNING: Unknown target name: "devm".
include/linux/i2c.h:511: WARNING: Inline strong start-string without end-string.
drivers/ata/libata-core.c:5944: WARNING: Unknown target name: "hw".
drivers/message/fusion/mptbase.c:5057: WARNING: Definition list ends without a blank line; unexpected unindent.
drivers/tty/serial/serial_core.c:1959: WARNING: Definition list ends without a blank line; unexpected unindent.
include/linux/regulator/driver.h:289: WARNING: Unknown target name: "regulator_regmap_x_voltage".
Documentation/driver-api/soundwire/locking.rst:50: WARNING: Inconsistent literal block quoting.
Documentation/driver-api/soundwire/locking.rst:51: WARNING: Line block ends without a blank line.
Documentation/driver-api/soundwire/locking.rst:55: WARNING: Inline substitution_reference start-string without end-string.
Documentation/driver-api/soundwire/locking.rst:56: WARNING: Line block ends without a blank line.
include/linux/spi/spi.h:380: WARNING: Unexpected indentation.
fs/posix_acl.c:636: WARNING: Inline emphasis start-string without end-string.
fs/debugfs/inode.c:385: WARNING: Inline literal start-string without end-string.
fs/debugfs/inode.c:464: WARNING: Inline literal start-string without end-string.
fs/debugfs/inode.c:496: WARNING: Inline literal start-string without end-string.
fs/debugfs/inode.c:583: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:394: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:400: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:439: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:445: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:484: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:490: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:530: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:536: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:578: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:584: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:845: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:851: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:898: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:904: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:1001: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:1001: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:1096: WARNING: Inline literal start-string without end-string.
fs/debugfs/file.c:1102: WARNING: Inline literal start-string without end-string.
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:2024: WARNING: Inline emphasis start-string without end-string.
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:2026: WARNING: Inline emphasis start-string without end-string.
Documentation/networking/af_xdp.rst:319: WARNING: Literal block expected; none found.
Documentation/networking/af_xdp.rst:326: WARNING: Literal block expected; none found.
Documentation/networking/device_drivers/freescale/dpaa2/dpio-driver.rst:43: WARNING: Definition list ends without a blank line; unexpected unindent.
Documentation/networking/device_drivers/freescale/dpaa2/dpio-driver.rst:63: WARNING: Unexpected indentation.
Documentation/networking/dsa/sja1105.rst:91: WARNING: Block quote ends without a blank line; unexpected unindent.
Documentation/networking/dsa/sja1105.rst:91: WARNING: Block quote ends without a blank line; unexpected unindent.
include/linux/netdevice.h:3486: WARNING: Inline emphasis start-string without end-string.
include/linux/netdevice.h:3486: WARNING: Inline emphasis start-string without end-string.
net/core/dev.c:4994: WARNING: Unknown target name: "page_is".
Documentation/security/keys/core.rst:1597: WARNING: Inline literal start-string without end-string.
Documentation/security/keys/core.rst:1597: WARNING: Inline emphasis start-string without end-string.
Documentation/security/keys/core.rst:1597: WARNING: Inline emphasis start-string without end-string.
Documentation/security/keys/core.rst:1598: WARNING: Inline emphasis start-string without end-string.
Documentation/security/keys/core.rst:1598: WARNING: Inline emphasis start-string without end-string.
Documentation/security/keys/core.rst:1600: WARNING: Inline literal start-string without end-string.
Documentation/security/keys/core.rst:1600: WARNING: Inline emphasis start-string without end-string.
Documentation/security/keys/core.rst:1600: WARNING: Inline emphasis start-string without end-string.
Documentation/security/keys/core.rst:1600: WARNING: Inline emphasis start-string without end-string.
Documentation/security/keys/core.rst:1600: WARNING: Inline emphasis start-string without end-string.
Documentation/security/keys/core.rst:1666: WARNING: Inline literal start-string without end-string.
Documentation/security/keys/core.rst:1666: WARNING: Inline emphasis start-string without end-string.
Documentation/security/keys/core.rst:1666: WARNING: Inline emphasis start-string without end-string.
Documentation/security/keys/core.rst:1666: WARNING: Inline emphasis start-string without end-string.
Documentation/security/keys/trusted-encrypted.rst:112: WARNING: Literal block expected; none found.
Documentation/security/keys/trusted-encrypted.rst:121: WARNING: Unexpected indentation.
Documentation/security/keys/trusted-encrypted.rst:122: WARNING: Block quote ends without a blank line; unexpected unindent.
Documentation/security/keys/trusted-encrypted.rst:123: WARNING: Block quote ends without a blank line; unexpected unindent.
vim +253 net/core/datagram.c
65101aeca52241 Paolo Abeni 2017-05-16 209
^1da177e4c3f41 Linus Torvalds 2005-04-16 210 /**
ea3793ee29d362 Rainer Weikusat 2015-12-06 211 * __skb_try_recv_datagram - Receive a datagram skbuff
4dc3b16ba18c0f Pavel Pisa 2005-05-01 212 * @sk: socket
d3f6cd9e6018db stephen hemminger 2017-07-12 213 * @flags: MSG\_ flags
7c13f97ffde63c Paolo Abeni 2016-11-04 214 * @destructor: invoked under the receive lock on successful dequeue
3f518bf745cbd6 Pavel Emelyanov 2012-02-21 215 * @off: an offset in bytes to peek skb from. Returns an offset
3f518bf745cbd6 Pavel Emelyanov 2012-02-21 216 * within an skb where data actually starts
4dc3b16ba18c0f Pavel Pisa 2005-05-01 217 * @err: error code returned
ea3793ee29d362 Rainer Weikusat 2015-12-06 218 * @last: set to last peeked message to inform the wait function
ea3793ee29d362 Rainer Weikusat 2015-12-06 219 * what to look for when peeking
^1da177e4c3f41 Linus Torvalds 2005-04-16 220 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 221 * Get a datagram skbuff, understands the peeking, nonblocking wakeups
^1da177e4c3f41 Linus Torvalds 2005-04-16 222 * and possible races. This replaces identical code in packet, raw and
^1da177e4c3f41 Linus Torvalds 2005-04-16 223 * udp, as well as the IPX AX.25 and Appletalk. It also finally fixes
^1da177e4c3f41 Linus Torvalds 2005-04-16 224 * the long standing peek and read race for datagram sockets. If you
^1da177e4c3f41 Linus Torvalds 2005-04-16 225 * alter this routine remember it must be re-entrant.
^1da177e4c3f41 Linus Torvalds 2005-04-16 226 *
ea3793ee29d362 Rainer Weikusat 2015-12-06 227 * This function will lock the socket if a skb is returned, so
ea3793ee29d362 Rainer Weikusat 2015-12-06 228 * the caller needs to unlock the socket in that case (usually by
d651983dde41a8 Mauro Carvalho Chehab 2017-05-12 229 * calling skb_free_datagram). Returns NULL with @err set to
ea3793ee29d362 Rainer Weikusat 2015-12-06 230 * -EAGAIN if no data was available or to some other value if an
ea3793ee29d362 Rainer Weikusat 2015-12-06 231 * error was detected.
^1da177e4c3f41 Linus Torvalds 2005-04-16 232 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 233 * * It does not lock socket since today. This function is
^1da177e4c3f41 Linus Torvalds 2005-04-16 234 * * free of race conditions. This measure should/can improve
^1da177e4c3f41 Linus Torvalds 2005-04-16 235 * * significantly datagram socket latencies at high loads,
^1da177e4c3f41 Linus Torvalds 2005-04-16 236 * * when data copying to user space takes lots of time.
^1da177e4c3f41 Linus Torvalds 2005-04-16 237 * * (BTW I've just killed the last cli() in IP/IPv6/core/netlink/packet
^1da177e4c3f41 Linus Torvalds 2005-04-16 238 * * 8) Great win.)
^1da177e4c3f41 Linus Torvalds 2005-04-16 239 * * --ANK (980729)
^1da177e4c3f41 Linus Torvalds 2005-04-16 240 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 241 * The order of the tests when we find no data waiting are specified
^1da177e4c3f41 Linus Torvalds 2005-04-16 242 * quite explicitly by POSIX 1003.1g, don't change them without having
^1da177e4c3f41 Linus Torvalds 2005-04-16 243 * the standard around please.
^1da177e4c3f41 Linus Torvalds 2005-04-16 244 */
ccefe503d27b45 Sabrina Dubroca 2019-08-21 245 struct sk_buff *__skb_try_recv_datagram(struct sock *sk,
ccefe503d27b45 Sabrina Dubroca 2019-08-21 246 struct sk_buff_head *queue,
ccefe503d27b45 Sabrina Dubroca 2019-08-21 247 unsigned int flags,
7c13f97ffde63c Paolo Abeni 2016-11-04 248 void (*destructor)(struct sock *sk,
7c13f97ffde63c Paolo Abeni 2016-11-04 249 struct sk_buff *skb),
fd69c399c7d626 Paolo Abeni 2019-04-08 250 int *off, int *err,
ea3793ee29d362 Rainer Weikusat 2015-12-06 251 struct sk_buff **last)
^1da177e4c3f41 Linus Torvalds 2005-04-16 252 {
ea3793ee29d362 Rainer Weikusat 2015-12-06 @253 struct sk_buff *skb;
738ac1ebb96d02 Herbert Xu 2015-07-13 254 unsigned long cpu_flags;
^1da177e4c3f41 Linus Torvalds 2005-04-16 255 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 256 * Caller is allowed not to check sk->sk_err before skb_recv_datagram()
^1da177e4c3f41 Linus Torvalds 2005-04-16 257 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 258 int error = sock_error(sk);
^1da177e4c3f41 Linus Torvalds 2005-04-16 259
^1da177e4c3f41 Linus Torvalds 2005-04-16 260 if (error)
^1da177e4c3f41 Linus Torvalds 2005-04-16 261 goto no_packet;
^1da177e4c3f41 Linus Torvalds 2005-04-16 262
^1da177e4c3f41 Linus Torvalds 2005-04-16 263 do {
^1da177e4c3f41 Linus Torvalds 2005-04-16 264 /* Again only user level code calls this function, so nothing
^1da177e4c3f41 Linus Torvalds 2005-04-16 265 * interrupt level will suddenly eat the receive_queue.
^1da177e4c3f41 Linus Torvalds 2005-04-16 266 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 267 * Look at current nfs client by the way...
8917a3c0b7d155 David Shwatrz 2010-12-02 268 * However, this function was correct in any case. 8)
^1da177e4c3f41 Linus Torvalds 2005-04-16 269 */
4934b0329f7150 Pavel Emelyanov 2012-02-21 270 spin_lock_irqsave(&queue->lock, cpu_flags);
65101aeca52241 Paolo Abeni 2017-05-16 271 skb = __skb_try_recv_from_queue(sk, queue, flags, destructor,
fd69c399c7d626 Paolo Abeni 2019-04-08 272 off, &error, last);
3f518bf745cbd6 Pavel Emelyanov 2012-02-21 273 spin_unlock_irqrestore(&queue->lock, cpu_flags);
de321ed3847125 Andrey Vagin 2017-05-17 274 if (error)
de321ed3847125 Andrey Vagin 2017-05-17 275 goto no_packet;
65101aeca52241 Paolo Abeni 2017-05-16 276 if (skb)
^1da177e4c3f41 Linus Torvalds 2005-04-16 277 return skb;
2b5cd0dfa38424 Alexander Duyck 2017-03-24 278
2b5cd0dfa38424 Alexander Duyck 2017-03-24 279 if (!sk_can_busy_loop(sk))
2b5cd0dfa38424 Alexander Duyck 2017-03-24 280 break;
2b5cd0dfa38424 Alexander Duyck 2017-03-24 281
2b5cd0dfa38424 Alexander Duyck 2017-03-24 282 sk_busy_loop(sk, flags & MSG_DONTWAIT);
ccefe503d27b45 Sabrina Dubroca 2019-08-21 283 } while (queue->prev != *last);
a5b50476f77a8f Eliezer Tamir 2013-06-10 284
^1da177e4c3f41 Linus Torvalds 2005-04-16 285 error = -EAGAIN;
^1da177e4c3f41 Linus Torvalds 2005-04-16 286
^1da177e4c3f41 Linus Torvalds 2005-04-16 287 no_packet:
^1da177e4c3f41 Linus Torvalds 2005-04-16 288 *err = error;
^1da177e4c3f41 Linus Torvalds 2005-04-16 289 return NULL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 290 }
ea3793ee29d362 Rainer Weikusat 2015-12-06 291 EXPORT_SYMBOL(__skb_try_recv_datagram);
ea3793ee29d362 Rainer Weikusat 2015-12-06 292
:::::: The code at line 253 was first introduced by commit
:::::: ea3793ee29d3621faf857fa8ef5425e9ff9a756d core: enable more fine-grained datagram reception control
:::::: TO: Rainer Weikusat <rweikusat@mobileactivedefense.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 7243 bytes --]
^ permalink raw reply
* BUG: bnxt_en driver fails to initialize
From: Jonathan Lemon @ 2019-08-23 3:03 UTC (permalink / raw)
To: Netdev, michael.chan; +Cc: kernel-team
On a recent net-next 932630fa902878f4c8c50d0b1260eeb9de16b0a4,
installing the build on a box which has a Broadcom card with
the 20.1 firmware, the driver refuses to initialize. I tracked
this down to:
static int bnxt_alloc_stats(struct bnxt *bp)
...
cpr->hw_stats = dma_alloc_coherent(&pdev->dev, size,
&cpr->hw_stats_map,
GFP_KERNEL);
if (!cpr->hw_stats)
return -ENOMEM;
Where size == 0, so obviously it returns NULL, and -ENOMEM.
The same build, when installed on different box with the
20.6.167.0 firmware, works fine. Details below.
Taken from the same box with a 4.16 kernel, showing firmware:
# ethtool -i eth0
driver: bnxt_en
version: 1.9.0
firmware-version: 20.1.20.0
expansion-rom-version:
bus-info: 0000:03:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: yes
supports-register-dump: no
supports-priv-flags: no
The problematic box:
[ 0.000000] Linux version 5.3.0-rc5-00987-g12a993533ad1
(bsd@devvm1828.vll1.facebook.com) (gcc version 4.8.5 20150623 (Red Hat
4.8.5-36) (GCC)) #7 SMP Thu Aug 22 19:48:01 PDT 2019
[ 11.195653] Broadcom NetXtreme-C/E driver bnxt_en v1.10.0
[ 11.262489] b:00.0 (unnamed net_device) (uninitialized): Firmware
does not support TC flower offload.
[ 11.283546] bnxt_en 0000:03:00.0 eth0: Firmware does not support NVM
params
[ 11.297448] bnxt_en 0000:03:00.0 eth0: Broadcom BCM57302 NetXtreme-C
10Gb/25Gb Ethernet found at mem 383fffe10000, node addr
00:0a:f7:a3:d8:94
[ 11.322965] bnxt_en 0000:03:00.0: 63.008 Gb/s available PCIe
bandwidth (8 GT/s x8 link)
[ 12.136319] WARNING: CPU: 5 PID: 1 at ../mm/page_alloc.c:4707
__alloc_pages_nodemask+0x27c/0x330
[ 12.155239] Modules linked in:
[ 12.155242] CPU: 5 PID: 1 Comm: swapper/0 Not tainted
5.3.0-rc5-00987-g12a993533ad1 #7
[ 12.155243] Hardware name: Quanta Leopard ORv2-DDR4/Leopard
ORv2-DDR4, BIOS F06_3B17 03/16/2018
[ 12.155245] RIP: 0010:__alloc_pages_nodemask+0x27c/0x330
[ 12.239793] Code: 48 83 c3 18 44 89 e9 44 89 e2 48 89 ee e8 5c b9 bb
00 4c 8b 0b 4d 85 c9 75 df 48 89 e8 e9 42 ff ff ff 81 e7 00 20 00 00 75
02 <0f> 0b 31 c0 e9 31 ff ff ff 48 89 e8 e9 29 ff ff ff 89 c2 90 e9 f0
[ 12.277249] RSP: 0000:ffffc9000c4dfc08 EFLAGS: 00010246
[ 12.287667] RAX: 0000000000000000 RBX: 0000000000000cc0 RCX:
0000000000000000
[ 12.301897] RDX: 0000000000000000 RSI: 0000000000000034 RDI:
0000000000000000
[ 12.316127] RBP: 0000000000000000 R08: 0000000000000000 R09:
0000000000000000
[ 12.330358] R10: ffff888000000000 R11: 00000000ffdd4f00 R12:
0000000000000034
[ 12.344587] R13: 0000160000000000 R14: ffffffffffffffff R15:
ffff889ff71ad0b0
[ 12.358819] FS: 0000000000000000(0000) GS:ffff889fff540000(0000)
knlGS:0000000000000000
[ 12.374957] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 12.386413] CR2: 0000000000000000 CR3: 000000000240a001 CR4:
00000000003606e0
[ 12.400643] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[ 12.414875] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7:
0000000000000400
[ 12.429107] Call Trace:
[ 12.433981] __dma_direct_alloc_pages+0x89/0x120
[ 12.443200] dma_direct_alloc_pages+0x1c/0xa0
[ 12.451902] bnxt_alloc_mem+0x32e/0xe20
[ 12.459566] ? bnxt_need_reserve_rings+0x30/0x120
[ 12.468957] __bnxt_open_nic+0x8c/0x880
[ 12.476601] bnxt_open+0x34/0xb0
[ 12.483032] __dev_open+0xd1/0x160
[ 12.489807] dev_open+0x43/0x90
[ 12.496070] netpoll_setup+0x26d/0x330
[ 12.503558] init_netconsole+0x145/0x276
[ 12.511390] ? option_setup+0x1f/0x1f
[ 12.518705] do_one_initcall+0x4e/0x1f4
[ 12.526351] ? trace_event_define_fields_initcall_finish+0x62/0x62
[ 12.538690] kernel_init_freeable+0x182/0x224
[ 12.547376] ? trace_event_define_fields_initcall_finish+0x62/0x62
[ 12.559716] ? rest_init+0xb0/0xb0
[ 12.566491] kernel_init+0xa/0x110
[ 12.573269] ret_from_fork+0x35/0x40
[ 12.580392] ---[ end trace e4d68dee87999a79 ]---
[ 12.589614] bnxt_en 0000:03:00.0 eth0: bnxt_alloc_mem err: fffffff4
^ 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