* [PATCH net-next 0/5] mlx5e rc2 misc patches
@ 2024-04-04 17:33 Tariq Toukan
2024-04-04 17:33 ` [PATCH net-next 1/5] net/mlx5e: Extract checking of FEC support for a link mode Tariq Toukan
` (6 more replies)
0 siblings, 7 replies; 12+ messages in thread
From: Tariq Toukan @ 2024-04-04 17:33 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
Cc: netdev, Saeed Mahameed, Gal Pressman, Leon Romanovsky,
Tariq Toukan
Hi,
This patchset includes small features and a cleanup for the mlx5e driver.
Patches 1-2 by Cosmin implements FEC settings for 100G/lane modes.
Patch 3-4 by Carolina adds generic rep-port ethtool stats group and implements
an mlx5e counter that exposes RX packet drops of VFs/SFs on their representor.
Patch 5 is a simple cleanup.
Series generated against:
commit 57a03d83f229 ("Merge branch 'mlxsw-preparations-for-improving-performance'")
Thanks,
Tariq.
Carolina Jubran (2):
ethtool: add interface to read representor Rx statistics
net/mlx5e: Expose the VF/SF RX drop counter on the representor
Cosmin Ratiu (2):
net/mlx5e: Extract checking of FEC support for a link mode
net/mlx5e: Support FEC settings for 100G/lane modes
Tariq Toukan (1):
net/mlx5e: Un-expose functions in en.h
drivers/net/ethernet/mellanox/mlx5/core/en.h | 12 -----
.../net/ethernet/mellanox/mlx5/core/en/port.c | 50 ++++++++++++++++---
.../ethernet/mellanox/mlx5/core/en_ethtool.c | 22 ++++----
.../net/ethernet/mellanox/mlx5/core/en_main.c | 2 +-
.../net/ethernet/mellanox/mlx5/core/en_rep.c | 48 ++++++++++++++++++
.../ethernet/mellanox/mlx5/core/en_stats.h | 3 ++
include/linux/ethtool.h | 16 ++++++
include/linux/mlx5/mlx5_ifc.h | 20 +++++++-
include/uapi/linux/ethtool.h | 2 +
include/uapi/linux/ethtool_netlink.h | 10 ++++
net/ethtool/netlink.h | 1 +
net/ethtool/stats.c | 31 ++++++++++++
net/ethtool/strset.c | 5 ++
13 files changed, 190 insertions(+), 32 deletions(-)
--
2.44.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH net-next 1/5] net/mlx5e: Extract checking of FEC support for a link mode
2024-04-04 17:33 [PATCH net-next 0/5] mlx5e rc2 misc patches Tariq Toukan
@ 2024-04-04 17:33 ` Tariq Toukan
2024-04-04 17:33 ` [PATCH net-next 2/5] net/mlx5e: Support FEC settings for 100G/lane modes Tariq Toukan
` (5 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Tariq Toukan @ 2024-04-04 17:33 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
Cc: netdev, Saeed Mahameed, Gal Pressman, Leon Romanovsky,
Cosmin Ratiu, Tariq Toukan
From: Cosmin Ratiu <cratiu@nvidia.com>
The check of whether a given FEC mode is supported in a given link mode
is about to get more complicated, so extract it in a separate function
to avoid code duplication.
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
.../net/ethernet/mellanox/mlx5/core/en/port.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c
index dbe2b19a9570..b4681a93807d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c
@@ -308,6 +308,14 @@ enum mlx5e_fec_supported_link_mode {
*_policy = MLX5_GET(pplm_reg, _buf, fec_override_admin_##link); \
} while (0)
+/* Returns true if FEC can be set for a given link mode. */
+static bool mlx5e_is_fec_supported_link_mode(struct mlx5_core_dev *dev,
+ enum mlx5e_fec_supported_link_mode link_mode)
+{
+ return link_mode < MLX5E_FEC_FIRST_50G_PER_LANE_MODE ||
+ MLX5_CAP_PCAM_FEATURE(dev, fec_50G_per_lane_in_pplm);
+}
+
/* get/set FEC admin field for a given speed */
static int mlx5e_fec_admin_field(u32 *pplm, u16 *fec_policy, bool write,
enum mlx5e_fec_supported_link_mode link_mode)
@@ -389,7 +397,6 @@ static int mlx5e_get_fec_cap_field(u32 *pplm, u16 *fec_cap,
bool mlx5e_fec_in_caps(struct mlx5_core_dev *dev, int fec_policy)
{
- bool fec_50g_per_lane = MLX5_CAP_PCAM_FEATURE(dev, fec_50G_per_lane_in_pplm);
u32 out[MLX5_ST_SZ_DW(pplm_reg)] = {};
u32 in[MLX5_ST_SZ_DW(pplm_reg)] = {};
int sz = MLX5_ST_SZ_BYTES(pplm_reg);
@@ -407,7 +414,7 @@ bool mlx5e_fec_in_caps(struct mlx5_core_dev *dev, int fec_policy)
for (i = 0; i < MLX5E_MAX_FEC_SUPPORTED_LINK_MODE; i++) {
u16 fec_caps;
- if (i >= MLX5E_FEC_FIRST_50G_PER_LANE_MODE && !fec_50g_per_lane)
+ if (!mlx5e_is_fec_supported_link_mode(dev, i))
break;
mlx5e_get_fec_cap_field(out, &fec_caps, i);
@@ -420,7 +427,6 @@ bool mlx5e_fec_in_caps(struct mlx5_core_dev *dev, int fec_policy)
int mlx5e_get_fec_mode(struct mlx5_core_dev *dev, u32 *fec_mode_active,
u16 *fec_configured_mode)
{
- bool fec_50g_per_lane = MLX5_CAP_PCAM_FEATURE(dev, fec_50G_per_lane_in_pplm);
u32 out[MLX5_ST_SZ_DW(pplm_reg)] = {};
u32 in[MLX5_ST_SZ_DW(pplm_reg)] = {};
int sz = MLX5_ST_SZ_BYTES(pplm_reg);
@@ -445,7 +451,7 @@ int mlx5e_get_fec_mode(struct mlx5_core_dev *dev, u32 *fec_mode_active,
*fec_configured_mode = 0;
for (i = 0; i < MLX5E_MAX_FEC_SUPPORTED_LINK_MODE; i++) {
- if (i >= MLX5E_FEC_FIRST_50G_PER_LANE_MODE && !fec_50g_per_lane)
+ if (!mlx5e_is_fec_supported_link_mode(dev, i))
break;
mlx5e_fec_admin_field(out, fec_configured_mode, 0, i);
@@ -489,7 +495,7 @@ int mlx5e_set_fec_mode(struct mlx5_core_dev *dev, u16 fec_policy)
u16 conf_fec = fec_policy;
u16 fec_caps = 0;
- if (i >= MLX5E_FEC_FIRST_50G_PER_LANE_MODE && !fec_50g_per_lane)
+ if (!mlx5e_is_fec_supported_link_mode(dev, i))
break;
/* RS fec in ethtool is mapped to MLX5E_FEC_RS_528_514
--
2.44.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 2/5] net/mlx5e: Support FEC settings for 100G/lane modes
2024-04-04 17:33 [PATCH net-next 0/5] mlx5e rc2 misc patches Tariq Toukan
2024-04-04 17:33 ` [PATCH net-next 1/5] net/mlx5e: Extract checking of FEC support for a link mode Tariq Toukan
@ 2024-04-04 17:33 ` Tariq Toukan
2024-04-04 17:33 ` [PATCH net-next 3/5] ethtool: add interface to read representor Rx statistics Tariq Toukan
` (4 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Tariq Toukan @ 2024-04-04 17:33 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
Cc: netdev, Saeed Mahameed, Gal Pressman, Leon Romanovsky,
Cosmin Ratiu, Tariq Toukan
From: Cosmin Ratiu <cratiu@nvidia.com>
This consists of:
1. Expose the 100G/lane capability bit in the PCAM reg.
2. Expose the per link mode FEC capability masks in the PPLM reg.
3. Set the overrides according to ethtool parameters.
FEC for new modes is set if and only if the PCAM 100G/lane capability is
advertised and the capability mask for a given link mode reports that it
can accept the requested FEC mode.
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
.../net/ethernet/mellanox/mlx5/core/en/port.c | 36 +++++++++++++++++--
include/linux/mlx5/mlx5_ifc.h | 20 +++++++++--
2 files changed, 52 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c
index b4681a93807d..b4efc780e297 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/port.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/port.c
@@ -292,10 +292,15 @@ enum mlx5e_fec_supported_link_mode {
MLX5E_FEC_SUPPORTED_LINK_MODE_100G_2X,
MLX5E_FEC_SUPPORTED_LINK_MODE_200G_4X,
MLX5E_FEC_SUPPORTED_LINK_MODE_400G_8X,
+ MLX5E_FEC_SUPPORTED_LINK_MODE_100G_1X,
+ MLX5E_FEC_SUPPORTED_LINK_MODE_200G_2X,
+ MLX5E_FEC_SUPPORTED_LINK_MODE_400G_4X,
+ MLX5E_FEC_SUPPORTED_LINK_MODE_800G_8X,
MLX5E_MAX_FEC_SUPPORTED_LINK_MODE,
};
#define MLX5E_FEC_FIRST_50G_PER_LANE_MODE MLX5E_FEC_SUPPORTED_LINK_MODE_50G_1X
+#define MLX5E_FEC_FIRST_100G_PER_LANE_MODE MLX5E_FEC_SUPPORTED_LINK_MODE_100G_1X
#define MLX5E_FEC_OVERRIDE_ADMIN_POLICY(buf, policy, write, link) \
do { \
@@ -313,7 +318,10 @@ static bool mlx5e_is_fec_supported_link_mode(struct mlx5_core_dev *dev,
enum mlx5e_fec_supported_link_mode link_mode)
{
return link_mode < MLX5E_FEC_FIRST_50G_PER_LANE_MODE ||
- MLX5_CAP_PCAM_FEATURE(dev, fec_50G_per_lane_in_pplm);
+ (link_mode < MLX5E_FEC_FIRST_100G_PER_LANE_MODE &&
+ MLX5_CAP_PCAM_FEATURE(dev, fec_50G_per_lane_in_pplm)) ||
+ (link_mode >= MLX5E_FEC_FIRST_100G_PER_LANE_MODE &&
+ MLX5_CAP_PCAM_FEATURE(dev, fec_100G_per_lane_in_pplm));
}
/* get/set FEC admin field for a given speed */
@@ -348,6 +356,18 @@ static int mlx5e_fec_admin_field(u32 *pplm, u16 *fec_policy, bool write,
case MLX5E_FEC_SUPPORTED_LINK_MODE_400G_8X:
MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 400g_8x);
break;
+ case MLX5E_FEC_SUPPORTED_LINK_MODE_100G_1X:
+ MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 100g_1x);
+ break;
+ case MLX5E_FEC_SUPPORTED_LINK_MODE_200G_2X:
+ MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 200g_2x);
+ break;
+ case MLX5E_FEC_SUPPORTED_LINK_MODE_400G_4X:
+ MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 400g_4x);
+ break;
+ case MLX5E_FEC_SUPPORTED_LINK_MODE_800G_8X:
+ MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 800g_8x);
+ break;
default:
return -EINVAL;
}
@@ -389,6 +409,18 @@ static int mlx5e_get_fec_cap_field(u32 *pplm, u16 *fec_cap,
case MLX5E_FEC_SUPPORTED_LINK_MODE_400G_8X:
*fec_cap = MLX5E_GET_FEC_OVERRIDE_CAP(pplm, 400g_8x);
break;
+ case MLX5E_FEC_SUPPORTED_LINK_MODE_100G_1X:
+ *fec_cap = MLX5E_GET_FEC_OVERRIDE_CAP(pplm, 100g_1x);
+ break;
+ case MLX5E_FEC_SUPPORTED_LINK_MODE_200G_2X:
+ *fec_cap = MLX5E_GET_FEC_OVERRIDE_CAP(pplm, 200g_2x);
+ break;
+ case MLX5E_FEC_SUPPORTED_LINK_MODE_400G_4X:
+ *fec_cap = MLX5E_GET_FEC_OVERRIDE_CAP(pplm, 400g_4x);
+ break;
+ case MLX5E_FEC_SUPPORTED_LINK_MODE_800G_8X:
+ *fec_cap = MLX5E_GET_FEC_OVERRIDE_CAP(pplm, 800g_8x);
+ break;
default:
return -EINVAL;
}
@@ -501,7 +533,7 @@ int mlx5e_set_fec_mode(struct mlx5_core_dev *dev, u16 fec_policy)
/* RS fec in ethtool is mapped to MLX5E_FEC_RS_528_514
* to link modes up to 25G per lane and to
* MLX5E_FEC_RS_544_514 in the new link modes based on
- * 50 G per lane
+ * 50G or 100G per lane
*/
if (conf_fec == (1 << MLX5E_FEC_RS_528_514) &&
i >= MLX5E_FEC_FIRST_50G_PER_LANE_MODE)
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index cc159d8563d1..35ffc9b9f241 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -9817,7 +9817,21 @@ struct mlx5_ifc_pplm_reg_bits {
u8 fec_override_admin_100g_2x[0x10];
u8 fec_override_admin_50g_1x[0x10];
- u8 reserved_at_140[0x140];
+ u8 fec_override_cap_800g_8x[0x10];
+ u8 fec_override_cap_400g_4x[0x10];
+
+ u8 fec_override_cap_200g_2x[0x10];
+ u8 fec_override_cap_100g_1x[0x10];
+
+ u8 reserved_at_180[0xa0];
+
+ u8 fec_override_admin_800g_8x[0x10];
+ u8 fec_override_admin_400g_4x[0x10];
+
+ u8 fec_override_admin_200g_2x[0x10];
+ u8 fec_override_admin_100g_1x[0x10];
+
+ u8 reserved_at_260[0x20];
};
struct mlx5_ifc_ppcnt_reg_bits {
@@ -10189,7 +10203,9 @@ struct mlx5_ifc_mtutc_reg_bits {
};
struct mlx5_ifc_pcam_enhanced_features_bits {
- u8 reserved_at_0[0x68];
+ u8 reserved_at_0[0x48];
+ u8 fec_100G_per_lane_in_pplm[0x1];
+ u8 reserved_at_49[0x1f];
u8 fec_50G_per_lane_in_pplm[0x1];
u8 reserved_at_69[0x4];
u8 rx_icrc_encapsulated_counter[0x1];
--
2.44.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 3/5] ethtool: add interface to read representor Rx statistics
2024-04-04 17:33 [PATCH net-next 0/5] mlx5e rc2 misc patches Tariq Toukan
2024-04-04 17:33 ` [PATCH net-next 1/5] net/mlx5e: Extract checking of FEC support for a link mode Tariq Toukan
2024-04-04 17:33 ` [PATCH net-next 2/5] net/mlx5e: Support FEC settings for 100G/lane modes Tariq Toukan
@ 2024-04-04 17:33 ` Tariq Toukan
2024-04-06 4:53 ` Jakub Kicinski
2024-04-04 17:33 ` [PATCH net-next 4/5] net/mlx5e: Expose the VF/SF RX drop counter on the representor Tariq Toukan
` (3 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Tariq Toukan @ 2024-04-04 17:33 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
Cc: netdev, Saeed Mahameed, Gal Pressman, Leon Romanovsky,
Carolina Jubran, Rahul Rameshbabu, Tariq Toukan
From: Carolina Jubran <cjubran@nvidia.com>
Implement common representor port statistics in
a rep_port_stats struct_group, introducing a new
'out of buffer' stats for when packets are dropped
due to a lack of receive buffers in RX queue.
The port statistics represent the statistics of the
function with which the representor is associated.
Print the representor port stats when the
--groups rep-port or --all-groups are used.
Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
include/linux/ethtool.h | 16 ++++++++++++++
include/uapi/linux/ethtool.h | 2 ++
include/uapi/linux/ethtool_netlink.h | 10 +++++++++
net/ethtool/netlink.h | 1 +
net/ethtool/stats.c | 31 ++++++++++++++++++++++++++++
net/ethtool/strset.c | 5 +++++
6 files changed, 65 insertions(+)
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 9901e563f706..6f2a6c78d41d 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -480,6 +480,17 @@ struct ethtool_rmon_stats {
);
};
+/**
+ * struct ethtool_rep_port_stats - representor port statistics
+ * @rep_port_stats: struct group for representor port
+ * @out_of_buf: Number of packets were dropped due to buffer exhaustion.
+ */
+struct ethtool_rep_port_stats {
+ struct_group(rep_port_stats,
+ u64 out_of_buf;
+ );
+};
+
#define ETH_MODULE_EEPROM_PAGE_LEN 128
#define ETH_MODULE_MAX_I2C_ADDRESS 0x7f
@@ -804,6 +815,8 @@ struct ethtool_rxfh_param {
* @get_eth_ctrl_stats: Query some of the IEEE 802.3 MAC Ctrl statistics.
* @get_rmon_stats: Query some of the RMON (RFC 2819) statistics.
* Set %ranges to a pointer to zero-terminated array of byte ranges.
+ * @get_rep_port_stats: Query the representor port statistics.
+ * Returns zero on success.
* @get_module_power_mode: Get the power mode policy for the plug-in module
* used by the network device and its operational power mode, if
* plugged-in.
@@ -940,6 +953,9 @@ struct ethtool_ops {
void (*get_rmon_stats)(struct net_device *dev,
struct ethtool_rmon_stats *rmon_stats,
const struct ethtool_rmon_hist_range **ranges);
+ int (*get_rep_port_stats)(struct net_device *dev,
+ struct ethtool_rep_port_stats *rep_port_stats,
+ struct netlink_ext_ack *extack);
int (*get_module_power_mode)(struct net_device *dev,
struct ethtool_module_power_mode_params *params,
struct netlink_ext_ack *extack);
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 11fc18988bc2..a3bc96e7e958 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -681,6 +681,7 @@ enum ethtool_link_ext_substate_module {
* @ETH_SS_STATS_ETH_MAC: names of IEEE 802.3 MAC statistics
* @ETH_SS_STATS_ETH_CTRL: names of IEEE 802.3 MAC Control statistics
* @ETH_SS_STATS_RMON: names of RMON statistics
+ * @ETH_SS_STATS_REP_PORT: names of representor port statistics
*
* @ETH_SS_COUNT: number of defined string sets
*/
@@ -706,6 +707,7 @@ enum ethtool_stringset {
ETH_SS_STATS_ETH_MAC,
ETH_SS_STATS_ETH_CTRL,
ETH_SS_STATS_RMON,
+ ETH_SS_STATS_REP_PORT,
/* add new constants above here */
ETH_SS_COUNT
diff --git a/include/uapi/linux/ethtool_netlink.h b/include/uapi/linux/ethtool_netlink.h
index accbb1a231df..0257103a001a 100644
--- a/include/uapi/linux/ethtool_netlink.h
+++ b/include/uapi/linux/ethtool_netlink.h
@@ -764,6 +764,7 @@ enum {
ETHTOOL_STATS_ETH_MAC,
ETHTOOL_STATS_ETH_CTRL,
ETHTOOL_STATS_RMON,
+ ETHTOOL_STATS_REP_PORT,
/* add new constants above here */
__ETHTOOL_STATS_CNT
@@ -879,6 +880,15 @@ enum {
ETHTOOL_A_STATS_RMON_MAX = (__ETHTOOL_A_STATS_RMON_CNT - 1)
};
+enum {
+ /* out_of_buf */
+ ETHTOOL_A_STATS_REP_PORT_OUT_OF_BUF,
+
+ /* add new constants above here */
+ __ETHTOOL_A_STATS_REP_PORT_CNT,
+ ETHTOOL_A_STATS_REP_PORT_MAX = (__ETHTOOL_A_STATS_REP_PORT_CNT - 1)
+};
+
/* MODULE */
enum {
diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h
index 9a333a8d04c1..f1568fa788f2 100644
--- a/net/ethtool/netlink.h
+++ b/net/ethtool/netlink.h
@@ -454,5 +454,6 @@ extern const char stats_eth_phy_names[__ETHTOOL_A_STATS_ETH_PHY_CNT][ETH_GSTRING
extern const char stats_eth_mac_names[__ETHTOOL_A_STATS_ETH_MAC_CNT][ETH_GSTRING_LEN];
extern const char stats_eth_ctrl_names[__ETHTOOL_A_STATS_ETH_CTRL_CNT][ETH_GSTRING_LEN];
extern const char stats_rmon_names[__ETHTOOL_A_STATS_RMON_CNT][ETH_GSTRING_LEN];
+extern const char stats_rep_port_names[__ETHTOOL_A_STATS_REP_PORT_CNT][ETH_GSTRING_LEN];
#endif /* _NET_ETHTOOL_NETLINK_H */
diff --git a/net/ethtool/stats.c b/net/ethtool/stats.c
index 912f0c4fff2f..84b05d9a2fc1 100644
--- a/net/ethtool/stats.c
+++ b/net/ethtool/stats.c
@@ -20,6 +20,7 @@ struct stats_reply_data {
struct ethtool_eth_mac_stats mac_stats;
struct ethtool_eth_ctrl_stats ctrl_stats;
struct ethtool_rmon_stats rmon_stats;
+ struct ethtool_rep_port_stats rep_port_stats;
);
const struct ethtool_rmon_hist_range *rmon_ranges;
};
@@ -32,6 +33,7 @@ const char stats_std_names[__ETHTOOL_STATS_CNT][ETH_GSTRING_LEN] = {
[ETHTOOL_STATS_ETH_MAC] = "eth-mac",
[ETHTOOL_STATS_ETH_CTRL] = "eth-ctrl",
[ETHTOOL_STATS_RMON] = "rmon",
+ [ETHTOOL_STATS_REP_PORT] = "rep-port",
};
const char stats_eth_phy_names[__ETHTOOL_A_STATS_ETH_PHY_CNT][ETH_GSTRING_LEN] = {
@@ -76,6 +78,10 @@ const char stats_rmon_names[__ETHTOOL_A_STATS_RMON_CNT][ETH_GSTRING_LEN] = {
[ETHTOOL_A_STATS_RMON_JABBER] = "etherStatsJabbers",
};
+const char stats_rep_port_names[__ETHTOOL_A_STATS_REP_PORT_CNT][ETH_GSTRING_LEN] = {
+ [ETHTOOL_A_STATS_REP_PORT_OUT_OF_BUF] = "out_of_buf",
+};
+
const struct nla_policy ethnl_stats_get_policy[ETHTOOL_A_STATS_SRC + 1] = {
[ETHTOOL_A_STATS_HEADER] =
NLA_POLICY_NESTED(ethnl_header_policy),
@@ -158,6 +164,15 @@ static int stats_prepare_data(const struct ethnl_req_info *req_base,
dev->ethtool_ops->get_rmon_stats)
dev->ethtool_ops->get_rmon_stats(dev, &data->rmon_stats,
&data->rmon_ranges);
+ if (test_bit(ETHTOOL_STATS_REP_PORT, req_info->stat_mask) &&
+ dev->ethtool_ops->get_rep_port_stats) {
+ ret = dev->ethtool_ops->get_rep_port_stats(dev, &data->rep_port_stats,
+ info->extack);
+ if (ret) {
+ ethnl_ops_complete(dev);
+ return ret;
+ }
+ }
ethnl_ops_complete(dev);
return 0;
@@ -194,6 +209,10 @@ static int stats_reply_size(const struct ethnl_req_info *req_base,
nla_total_size(4)) * /* _A_STATS_GRP_HIST_BKT_HI */
ETHTOOL_RMON_HIST_MAX * 2;
}
+ if (test_bit(ETHTOOL_STATS_REP_PORT, req_info->stat_mask)) {
+ n_stats += sizeof(struct ethtool_rep_port_stats) / sizeof(u64);
+ n_grps++;
+ }
len += n_grps * (nla_total_size(0) + /* _A_STATS_GRP */
nla_total_size(4) + /* _A_STATS_GRP_ID */
@@ -370,6 +389,15 @@ static int stats_put_rmon_stats(struct sk_buff *skb,
return 0;
}
+static int stats_put_rep_port_stats(struct sk_buff *skb,
+ const struct stats_reply_data *data)
+{
+ if (stat_put(skb, ETHTOOL_A_STATS_REP_PORT_OUT_OF_BUF, data->rep_port_stats.out_of_buf))
+ return -EMSGSIZE;
+
+ return 0;
+}
+
static int stats_put_stats(struct sk_buff *skb,
const struct stats_reply_data *data,
u32 id, u32 ss_id,
@@ -423,6 +451,9 @@ static int stats_fill_reply(struct sk_buff *skb,
if (!ret && test_bit(ETHTOOL_STATS_RMON, req_info->stat_mask))
ret = stats_put_stats(skb, data, ETHTOOL_STATS_RMON,
ETH_SS_STATS_RMON, stats_put_rmon_stats);
+ if (!ret && test_bit(ETHTOOL_STATS_REP_PORT, req_info->stat_mask))
+ ret = stats_put_stats(skb, data, ETHTOOL_STATS_REP_PORT,
+ ETH_SS_STATS_REP_PORT, stats_put_rep_port_stats);
return ret;
}
diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c
index c678b484a079..01d7a6fd9471 100644
--- a/net/ethtool/strset.c
+++ b/net/ethtool/strset.c
@@ -105,6 +105,11 @@ static const struct strset_info info_template[] = {
.count = __ETHTOOL_A_STATS_RMON_CNT,
.strings = stats_rmon_names,
},
+ [ETH_SS_STATS_REP_PORT] = {
+ .per_dev = false,
+ .count = __ETHTOOL_A_STATS_REP_PORT_CNT,
+ .strings = stats_rep_port_names,
+ },
};
struct strset_req_info {
--
2.44.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 4/5] net/mlx5e: Expose the VF/SF RX drop counter on the representor
2024-04-04 17:33 [PATCH net-next 0/5] mlx5e rc2 misc patches Tariq Toukan
` (2 preceding siblings ...)
2024-04-04 17:33 ` [PATCH net-next 3/5] ethtool: add interface to read representor Rx statistics Tariq Toukan
@ 2024-04-04 17:33 ` Tariq Toukan
2024-04-04 17:33 ` [PATCH net-next 5/5] net/mlx5e: Un-expose functions in en.h Tariq Toukan
` (2 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Tariq Toukan @ 2024-04-04 17:33 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
Cc: netdev, Saeed Mahameed, Gal Pressman, Leon Romanovsky,
Carolina Jubran, Rahul Rameshbabu, Tariq Toukan
From: Carolina Jubran <cjubran@nvidia.com>
Q counters are device-level counters that track specific
events, among which are out_of_buffer events. These events
occur when packets are dropped due to a lack of receive
buffer in the RX queue.
Expose the total number of rx_out_of_buffer events on the
VF/SF to their respective representor, using the
"ethtool -S devname --all-groups|--groups rep-port" under the
name of "rep-port-out_of_buf".
The "rep-port-out_of_buf" equals the sum of all
Q counters rx_out_of_buffer values allocated on the VF/SF.
Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
.../net/ethernet/mellanox/mlx5/core/en_rep.c | 48 +++++++++++++++++++
.../ethernet/mellanox/mlx5/core/en_stats.h | 3 ++
2 files changed, 51 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index a74ee698671c..691f6d7fe0c6 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -273,6 +273,44 @@ static MLX5E_DECLARE_STATS_GRP_OP_UPDATE_STATS(vport_rep)
kvfree(out);
}
+static int mlx5e_rep_query_q_counter(struct mlx5_core_dev *mdev, int vport, void *out)
+{
+ u32 in[MLX5_ST_SZ_DW(query_q_counter_in)] = {};
+
+ MLX5_SET(query_q_counter_in, in, opcode, MLX5_CMD_OP_QUERY_Q_COUNTER);
+ MLX5_SET(query_q_counter_in, in, other_vport, 1);
+ MLX5_SET(query_q_counter_in, in, vport_number, vport);
+ MLX5_SET(query_q_counter_in, in, aggregate, 1);
+
+ return mlx5_cmd_exec_inout(mdev, query_q_counter, in, out);
+}
+
+int mlx5e_stats_rep_port_get(struct mlx5e_priv *priv,
+ struct ethtool_rep_port_stats *rep_port_stats,
+ struct netlink_ext_ack *extack)
+{
+ u32 out[MLX5_ST_SZ_DW(query_q_counter_out)] = {};
+ struct mlx5e_rep_priv *rpriv = priv->ppriv;
+ struct mlx5_eswitch_rep *rep = rpriv->rep;
+ int err;
+
+ if (!MLX5_CAP_GEN(priv->mdev, q_counter_other_vport) ||
+ !MLX5_CAP_GEN(priv->mdev, q_counter_aggregation)) {
+ NL_SET_ERR_MSG_MOD(extack,
+ "Representor port stats is not supported on this device");
+ return -EOPNOTSUPP;
+ }
+
+ err = mlx5e_rep_query_q_counter(priv->mdev, rep->vport, out);
+ if (err) {
+ NL_SET_ERR_MSG_MOD(extack, "Failed reading stats on vport");
+ return err;
+ }
+ rep_port_stats->out_of_buf = MLX5_GET(query_q_counter_out, out, out_of_buffer);
+
+ return 0;
+}
+
static void mlx5e_rep_get_strings(struct net_device *dev,
u32 stringset, u8 *data)
{
@@ -377,6 +415,15 @@ static u32 mlx5e_rep_get_rxfh_indir_size(struct net_device *netdev)
return mlx5e_ethtool_get_rxfh_indir_size(priv);
}
+static int mlx5e_rep_get_port_stats(struct net_device *netdev,
+ struct ethtool_rep_port_stats *rep_port_stats,
+ struct netlink_ext_ack *extack)
+{
+ struct mlx5e_priv *priv = netdev_priv(netdev);
+
+ return mlx5e_stats_rep_port_get(priv, rep_port_stats, extack);
+}
+
static const struct ethtool_ops mlx5e_rep_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
ETHTOOL_COALESCE_MAX_FRAMES |
@@ -394,6 +441,7 @@ static const struct ethtool_ops mlx5e_rep_ethtool_ops = {
.set_coalesce = mlx5e_rep_set_coalesce,
.get_rxfh_key_size = mlx5e_rep_get_rxfh_key_size,
.get_rxfh_indir_size = mlx5e_rep_get_rxfh_indir_size,
+ .get_rep_port_stats = mlx5e_rep_get_port_stats,
};
static void mlx5e_sqs2vport_stop(struct mlx5_eswitch *esw,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
index b71e3fdf92c5..ffddbe4d6543 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
@@ -128,6 +128,9 @@ void mlx5e_stats_eth_ctrl_get(struct mlx5e_priv *priv,
void mlx5e_stats_rmon_get(struct mlx5e_priv *priv,
struct ethtool_rmon_stats *rmon,
const struct ethtool_rmon_hist_range **ranges);
+int mlx5e_stats_rep_port_get(struct mlx5e_priv *priv,
+ struct ethtool_rep_port_stats *rep_port_stats,
+ struct netlink_ext_ack *extack);
void mlx5e_get_link_ext_stats(struct net_device *dev,
struct ethtool_link_ext_stats *stats);
--
2.44.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH net-next 5/5] net/mlx5e: Un-expose functions in en.h
2024-04-04 17:33 [PATCH net-next 0/5] mlx5e rc2 misc patches Tariq Toukan
` (3 preceding siblings ...)
2024-04-04 17:33 ` [PATCH net-next 4/5] net/mlx5e: Expose the VF/SF RX drop counter on the representor Tariq Toukan
@ 2024-04-04 17:33 ` Tariq Toukan
2024-04-05 5:53 ` Kalesh Anakkur Purayil
2024-04-06 4:56 ` [PATCH net-next 0/5] mlx5e rc2 misc patches Jakub Kicinski
2024-04-06 5:00 ` patchwork-bot+netdevbpf
6 siblings, 1 reply; 12+ messages in thread
From: Tariq Toukan @ 2024-04-04 17:33 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
Cc: netdev, Saeed Mahameed, Gal Pressman, Leon Romanovsky,
Tariq Toukan
Un-expose functions that are not used outside of their c file.
Make them static.
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en.h | 12 ----------
.../ethernet/mellanox/mlx5/core/en_ethtool.c | 22 +++++++++----------
.../net/ethernet/mellanox/mlx5/core/en_main.c | 2 +-
3 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index f5a3ac40f6e3..2acd1ebb0888 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -1143,7 +1143,6 @@ void mlx5e_close_drop_rq(struct mlx5e_rq *drop_rq);
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_update_nic_rx(struct mlx5e_priv *priv);
void mlx5e_update_carrier(struct mlx5e_priv *priv);
int mlx5e_close(struct net_device *netdev);
int mlx5e_open(struct net_device *netdev);
@@ -1180,23 +1179,12 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv,
struct ethtool_coalesce *coal,
struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack);
-int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
- struct ethtool_link_ksettings *link_ksettings);
-int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
- const struct ethtool_link_ksettings *link_ksettings);
-int mlx5e_get_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh);
-int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
- struct netlink_ext_ack *extack);
u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv);
u32 mlx5e_ethtool_get_rxfh_indir_size(struct mlx5e_priv *priv);
int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv,
struct ethtool_ts_info *info);
int mlx5e_ethtool_flash_device(struct mlx5e_priv *priv,
struct ethtool_flash *flash);
-void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
- struct ethtool_pauseparam *pauseparam);
-int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
- struct ethtool_pauseparam *pauseparam);
/* mlx5e generic netdev management API */
static inline bool
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 69f6a6aa7c55..93a13a478c11 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -996,8 +996,8 @@ static void get_lp_advertising(struct mlx5_core_dev *mdev, u32 eth_proto_lp,
ptys2ethtool_adver_link(lp_advertising, eth_proto_lp, ext);
}
-int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
- struct ethtool_link_ksettings *link_ksettings)
+static int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
+ struct ethtool_link_ksettings *link_ksettings)
{
struct mlx5_core_dev *mdev = priv->mdev;
u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {};
@@ -1167,8 +1167,8 @@ static bool ext_requested(u8 autoneg, const unsigned long *adver, bool ext_suppo
return autoneg == AUTONEG_ENABLE ? ext_link_mode : ext_supported;
}
-int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
- const struct ethtool_link_ksettings *link_ksettings)
+static int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
+ const struct ethtool_link_ksettings *link_ksettings)
{
struct mlx5_core_dev *mdev = priv->mdev;
struct mlx5_port_eth_proto eproto;
@@ -1268,7 +1268,7 @@ static u32 mlx5e_get_rxfh_indir_size(struct net_device *netdev)
return mlx5e_ethtool_get_rxfh_indir_size(priv);
}
-int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
+static int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
{
struct mlx5e_priv *priv = netdev_priv(netdev);
u32 rss_context = rxfh->rss_context;
@@ -1281,8 +1281,8 @@ int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
return err;
}
-int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
- struct netlink_ext_ack *extack)
+static int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
+ struct netlink_ext_ack *extack)
{
struct mlx5e_priv *priv = netdev_priv(dev);
u32 *rss_context = &rxfh->rss_context;
@@ -1411,8 +1411,8 @@ static void mlx5e_get_pause_stats(struct net_device *netdev,
mlx5e_stats_pause_get(priv, pause_stats);
}
-void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
- struct ethtool_pauseparam *pauseparam)
+static void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
+ struct ethtool_pauseparam *pauseparam)
{
struct mlx5_core_dev *mdev = priv->mdev;
int err;
@@ -1433,8 +1433,8 @@ static void mlx5e_get_pauseparam(struct net_device *netdev,
mlx5e_ethtool_get_pauseparam(priv, pauseparam);
}
-int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
- struct ethtool_pauseparam *pauseparam)
+static int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
+ struct ethtool_pauseparam *pauseparam)
{
struct mlx5_core_dev *mdev = priv->mdev;
int err;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 81e1c1e401f9..a0d3af96dcb1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -5562,7 +5562,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv)
mlx5e_ipsec_cleanup(priv);
}
-int mlx5e_update_nic_rx(struct mlx5e_priv *priv)
+static int mlx5e_update_nic_rx(struct mlx5e_priv *priv)
{
return mlx5e_refresh_tirs(priv, false, false);
}
--
2.44.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH net-next 5/5] net/mlx5e: Un-expose functions in en.h
2024-04-04 17:33 ` [PATCH net-next 5/5] net/mlx5e: Un-expose functions in en.h Tariq Toukan
@ 2024-04-05 5:53 ` Kalesh Anakkur Purayil
0 siblings, 0 replies; 12+ messages in thread
From: Kalesh Anakkur Purayil @ 2024-04-05 5:53 UTC (permalink / raw)
To: Tariq Toukan
Cc: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet,
netdev, Saeed Mahameed, Gal Pressman, Leon Romanovsky
[-- Attachment #1: Type: text/plain, Size: 6965 bytes --]
On Thu, Apr 4, 2024 at 11:05 PM Tariq Toukan <tariqt@nvidia.com> wrote:
>
> Un-expose functions that are not used outside of their c file.
> Make them static.
>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en.h | 12 ----------
> .../ethernet/mellanox/mlx5/core/en_ethtool.c | 22 +++++++++----------
> .../net/ethernet/mellanox/mlx5/core/en_main.c | 2 +-
> 3 files changed, 12 insertions(+), 24 deletions(-)
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
> index f5a3ac40f6e3..2acd1ebb0888 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
> @@ -1143,7 +1143,6 @@ void mlx5e_close_drop_rq(struct mlx5e_rq *drop_rq);
> 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_update_nic_rx(struct mlx5e_priv *priv);
> void mlx5e_update_carrier(struct mlx5e_priv *priv);
> int mlx5e_close(struct net_device *netdev);
> int mlx5e_open(struct net_device *netdev);
> @@ -1180,23 +1179,12 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv,
> struct ethtool_coalesce *coal,
> struct kernel_ethtool_coalesce *kernel_coal,
> struct netlink_ext_ack *extack);
> -int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
> - struct ethtool_link_ksettings *link_ksettings);
> -int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
> - const struct ethtool_link_ksettings *link_ksettings);
> -int mlx5e_get_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh);
> -int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
> - struct netlink_ext_ack *extack);
> u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv);
> u32 mlx5e_ethtool_get_rxfh_indir_size(struct mlx5e_priv *priv);
> int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv,
> struct ethtool_ts_info *info);
> int mlx5e_ethtool_flash_device(struct mlx5e_priv *priv,
> struct ethtool_flash *flash);
> -void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
> - struct ethtool_pauseparam *pauseparam);
> -int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
> - struct ethtool_pauseparam *pauseparam);
>
> /* mlx5e generic netdev management API */
> static inline bool
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> index 69f6a6aa7c55..93a13a478c11 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
> @@ -996,8 +996,8 @@ static void get_lp_advertising(struct mlx5_core_dev *mdev, u32 eth_proto_lp,
> ptys2ethtool_adver_link(lp_advertising, eth_proto_lp, ext);
> }
>
> -int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
> - struct ethtool_link_ksettings *link_ksettings)
> +static int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
> + struct ethtool_link_ksettings *link_ksettings)
> {
> struct mlx5_core_dev *mdev = priv->mdev;
> u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {};
> @@ -1167,8 +1167,8 @@ static bool ext_requested(u8 autoneg, const unsigned long *adver, bool ext_suppo
> return autoneg == AUTONEG_ENABLE ? ext_link_mode : ext_supported;
> }
>
> -int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
> - const struct ethtool_link_ksettings *link_ksettings)
> +static int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
> + const struct ethtool_link_ksettings *link_ksettings)
> {
> struct mlx5_core_dev *mdev = priv->mdev;
> struct mlx5_port_eth_proto eproto;
> @@ -1268,7 +1268,7 @@ static u32 mlx5e_get_rxfh_indir_size(struct net_device *netdev)
> return mlx5e_ethtool_get_rxfh_indir_size(priv);
> }
>
> -int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
> +static int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
> {
> struct mlx5e_priv *priv = netdev_priv(netdev);
> u32 rss_context = rxfh->rss_context;
> @@ -1281,8 +1281,8 @@ int mlx5e_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
> return err;
> }
>
> -int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
> - struct netlink_ext_ack *extack)
> +static int mlx5e_set_rxfh(struct net_device *dev, struct ethtool_rxfh_param *rxfh,
> + struct netlink_ext_ack *extack)
> {
> struct mlx5e_priv *priv = netdev_priv(dev);
> u32 *rss_context = &rxfh->rss_context;
> @@ -1411,8 +1411,8 @@ static void mlx5e_get_pause_stats(struct net_device *netdev,
> mlx5e_stats_pause_get(priv, pause_stats);
> }
>
> -void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
> - struct ethtool_pauseparam *pauseparam)
> +static void mlx5e_ethtool_get_pauseparam(struct mlx5e_priv *priv,
> + struct ethtool_pauseparam *pauseparam)
> {
> struct mlx5_core_dev *mdev = priv->mdev;
> int err;
> @@ -1433,8 +1433,8 @@ static void mlx5e_get_pauseparam(struct net_device *netdev,
> mlx5e_ethtool_get_pauseparam(priv, pauseparam);
> }
>
> -int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
> - struct ethtool_pauseparam *pauseparam)
> +static int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
> + struct ethtool_pauseparam *pauseparam)
> {
> struct mlx5_core_dev *mdev = priv->mdev;
> int err;
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index 81e1c1e401f9..a0d3af96dcb1 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -5562,7 +5562,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv)
> mlx5e_ipsec_cleanup(priv);
> }
>
> -int mlx5e_update_nic_rx(struct mlx5e_priv *priv)
> +static int mlx5e_update_nic_rx(struct mlx5e_priv *priv)
> {
> return mlx5e_refresh_tirs(priv, false, false);
> }
> --
> 2.44.0
>
>
--
Regards,
Kalesh A P
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4239 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net-next 3/5] ethtool: add interface to read representor Rx statistics
2024-04-04 17:33 ` [PATCH net-next 3/5] ethtool: add interface to read representor Rx statistics Tariq Toukan
@ 2024-04-06 4:53 ` Jakub Kicinski
2024-04-06 5:25 ` Rahul Rameshbabu
0 siblings, 1 reply; 12+ messages in thread
From: Jakub Kicinski @ 2024-04-06 4:53 UTC (permalink / raw)
To: Tariq Toukan, Carolina Jubran, Simon Horman
Cc: David S. Miller, Paolo Abeni, Eric Dumazet, netdev,
Saeed Mahameed, Gal Pressman, Leon Romanovsky, Rahul Rameshbabu
On Thu, 4 Apr 2024 20:33:55 +0300 Tariq Toukan wrote:
> Implement common representor port statistics in
> a rep_port_stats struct_group, introducing a new
> 'out of buffer' stats for when packets are dropped
> due to a lack of receive buffers in RX queue.
>
> The port statistics represent the statistics of the
> function with which the representor is associated.
>
> Print the representor port stats when the
> --groups rep-port or --all-groups are used.
I re-read what Tariq said on v1 and I clearly missed the point,
sorry about that. Looking that his patch makes it pretty obvious.
With the netdev netlink family in place I was hoping we would
only put in ethtool stats for functionality already configured
via ethtool or clearly related to Ethernet.
But before we go to netdev - can you think of more such error stats
that we may need to add? Since it's the equivalent of rtnl rx_missed
I think we should consider putting it in netdev_offload_xstats. Maybe
following the same definition as packet/byte counters? Report sum by
default and CPU ones under IFLA_OFFLOAD_XSTATS_CPU_HIT? Or new enum
entry?
Simon, WDYT?
> +/**
> + * struct ethtool_rep_port_stats - representor port statistics
> + * @rep_port_stats: struct group for representor port
In more trivial remarks - kernel-doc script apparently doesn't want
the group to be documented (any more?)
> + * @out_of_buf: Number of packets were dropped due to buffer exhaustion.
> + */
> +struct ethtool_rep_port_stats {
> + struct_group(rep_port_stats,
> + u64 out_of_buf;
> + );
> +};
> +
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net-next 0/5] mlx5e rc2 misc patches
2024-04-04 17:33 [PATCH net-next 0/5] mlx5e rc2 misc patches Tariq Toukan
` (4 preceding siblings ...)
2024-04-04 17:33 ` [PATCH net-next 5/5] net/mlx5e: Un-expose functions in en.h Tariq Toukan
@ 2024-04-06 4:56 ` Jakub Kicinski
2024-04-06 5:00 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 12+ messages in thread
From: Jakub Kicinski @ 2024-04-06 4:56 UTC (permalink / raw)
To: Tariq Toukan
Cc: David S. Miller, Paolo Abeni, Eric Dumazet, netdev,
Saeed Mahameed, Gal Pressman, Leon Romanovsky
On Thu, 4 Apr 2024 20:33:52 +0300 Tariq Toukan wrote:
> Patches 1-2 by Cosmin implements FEC settings for 100G/lane modes.
> Patch 5 is a simple cleanup.
Don't wanna hold these patches hostage to the stats conversation
so let me take these already. LMK if that's not helpful.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net-next 0/5] mlx5e rc2 misc patches
2024-04-04 17:33 [PATCH net-next 0/5] mlx5e rc2 misc patches Tariq Toukan
` (5 preceding siblings ...)
2024-04-06 4:56 ` [PATCH net-next 0/5] mlx5e rc2 misc patches Jakub Kicinski
@ 2024-04-06 5:00 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-06 5:00 UTC (permalink / raw)
To: Tariq Toukan; +Cc: davem, kuba, pabeni, edumazet, netdev, saeedm, gal, leonro
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 4 Apr 2024 20:33:52 +0300 you wrote:
> Hi,
>
> This patchset includes small features and a cleanup for the mlx5e driver.
>
> Patches 1-2 by Cosmin implements FEC settings for 100G/lane modes.
>
> Patch 3-4 by Carolina adds generic rep-port ethtool stats group and implements
> an mlx5e counter that exposes RX packet drops of VFs/SFs on their representor.
>
> [...]
Here is the summary with links:
- [net-next,1/5] net/mlx5e: Extract checking of FEC support for a link mode
https://git.kernel.org/netdev/net-next/c/d4383ce15f5b
- [net-next,2/5] net/mlx5e: Support FEC settings for 100G/lane modes
https://git.kernel.org/netdev/net-next/c/4aafb8ab2a62
- [net-next,3/5] ethtool: add interface to read representor Rx statistics
(no matching commit)
- [net-next,4/5] net/mlx5e: Expose the VF/SF RX drop counter on the representor
(no matching commit)
- [net-next,5/5] net/mlx5e: Un-expose functions in en.h
https://git.kernel.org/netdev/net-next/c/958f56e48385
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net-next 3/5] ethtool: add interface to read representor Rx statistics
2024-04-06 4:53 ` Jakub Kicinski
@ 2024-04-06 5:25 ` Rahul Rameshbabu
2024-04-06 5:46 ` Jakub Kicinski
0 siblings, 1 reply; 12+ messages in thread
From: Rahul Rameshbabu @ 2024-04-06 5:25 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Tariq Toukan, Carolina Jubran, Simon Horman, David S. Miller,
Paolo Abeni, Eric Dumazet, netdev, Saeed Mahameed, Gal Pressman,
Leon Romanovsky
On Fri, 05 Apr, 2024 21:53:35 -0700 Jakub Kicinski <kuba@kernel.org> wrote:
> On Thu, 4 Apr 2024 20:33:55 +0300 Tariq Toukan wrote:
>> +/**
>> + * struct ethtool_rep_port_stats - representor port statistics
>> + * @rep_port_stats: struct group for representor port
>
> In more trivial remarks - kernel-doc script apparently doesn't want
> the group to be documented (any more?)
>
I took a look, and I believe the behavior of kernel-doc has remained the
same since the struct_group() helper macro was introduced. That said, I
think allowing the documentation of struct_group() would be a reasonable
choice/maybe worth updating the script.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=50d7bd38c3aafc4749e05e8d7fcb616979143602
>> + * @out_of_buf: Number of packets were dropped due to buffer exhaustion.
>> + */
>> +struct ethtool_rep_port_stats {
>> + struct_group(rep_port_stats,
>> + u64 out_of_buf;
>> + );
>> +};
>> +
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH net-next 3/5] ethtool: add interface to read representor Rx statistics
2024-04-06 5:25 ` Rahul Rameshbabu
@ 2024-04-06 5:46 ` Jakub Kicinski
0 siblings, 0 replies; 12+ messages in thread
From: Jakub Kicinski @ 2024-04-06 5:46 UTC (permalink / raw)
To: Rahul Rameshbabu
Cc: Tariq Toukan, Carolina Jubran, Simon Horman, David S. Miller,
Paolo Abeni, Eric Dumazet, netdev, Saeed Mahameed, Gal Pressman,
Leon Romanovsky
On Fri, 05 Apr 2024 22:25:21 -0700 Rahul Rameshbabu wrote:
> > In more trivial remarks - kernel-doc script apparently doesn't want
> > the group to be documented (any more?)
>
> I took a look, and I believe the behavior of kernel-doc has remained the
> same since the struct_group() helper macro was introduced. That said, I
> think allowing the documentation of struct_group() would be a reasonable
> choice/maybe worth updating the script.
Thanks for investigating! Dunno why this started getting hit so much out
of the sudden.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-04-06 5:46 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-04 17:33 [PATCH net-next 0/5] mlx5e rc2 misc patches Tariq Toukan
2024-04-04 17:33 ` [PATCH net-next 1/5] net/mlx5e: Extract checking of FEC support for a link mode Tariq Toukan
2024-04-04 17:33 ` [PATCH net-next 2/5] net/mlx5e: Support FEC settings for 100G/lane modes Tariq Toukan
2024-04-04 17:33 ` [PATCH net-next 3/5] ethtool: add interface to read representor Rx statistics Tariq Toukan
2024-04-06 4:53 ` Jakub Kicinski
2024-04-06 5:25 ` Rahul Rameshbabu
2024-04-06 5:46 ` Jakub Kicinski
2024-04-04 17:33 ` [PATCH net-next 4/5] net/mlx5e: Expose the VF/SF RX drop counter on the representor Tariq Toukan
2024-04-04 17:33 ` [PATCH net-next 5/5] net/mlx5e: Un-expose functions in en.h Tariq Toukan
2024-04-05 5:53 ` Kalesh Anakkur Purayil
2024-04-06 4:56 ` [PATCH net-next 0/5] mlx5e rc2 misc patches Jakub Kicinski
2024-04-06 5:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).