All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC, net-next 0/3] net: dsa: felix: frame preemption support
@ 2020-10-20  4:04 Xiaoliang Yang
  2020-10-20  4:04 ` [RFC, net-next 1/3] net: dsa: ethtool preempt ops support on slave ports Xiaoliang Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Xiaoliang Yang @ 2020-10-20  4:04 UTC (permalink / raw)
  To: davem, netdev, linux-kernel
  Cc: vinicius.gomes, jhs, xiyou.wangcong, jiri, kuba, Jose.Abreu,
	allan.nielsen, joergen.andreasen, UNGLinuxDriver,
	xiaoliang.yang_1, po.liu, claudiu.manoil, alexandru.marginean,
	vladimir.oltean, leoyang.li, mingkai.hu

VSC9959 supports frame preemption according to 802.1qbu and 802.3br.
This patch series use ethtool to enable and configure frame preemption,
then use tc-taprio preempt set to mark the preempt queues and express
queueus.

This series depends on series: "ethtool: Add support for frame preemption"
link: http://patchwork.ozlabs.org/project/netdev/patch/20201012235642.1384318-2-vinicius.gomes@intel.com/

Xiaoliang Yang (3):
  net: dsa: ethtool preempt ops support on slave ports
  net: dsa: felix: add preempt queues set support for vsc9959
  net: dsa: felix: tc-taprio preempt set support

 drivers/net/dsa/ocelot/felix.c         | 26 +++++++++++
 drivers/net/dsa/ocelot/felix.h         |  4 ++
 drivers/net/dsa/ocelot/felix_vsc9959.c | 65 ++++++++++++++++++++++++++
 include/net/dsa.h                      | 12 +++++
 include/soc/mscc/ocelot.h              | 11 +++++
 include/soc/mscc/ocelot_dev.h          | 23 +++++++++
 net/dsa/slave.c                        | 26 +++++++++++
 7 files changed, 167 insertions(+)

-- 
2.18.4


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [RFC, net-next 1/3] net: dsa: ethtool preempt ops support on slave ports
  2020-10-20  4:04 [RFC, net-next 0/3] net: dsa: felix: frame preemption support Xiaoliang Yang
@ 2020-10-20  4:04 ` Xiaoliang Yang
  2020-10-20  5:53   ` kernel test robot
  2020-10-20  7:25   ` kernel test robot
  2020-10-20  4:04 ` [RFC, net-next 2/3] net: dsa: felix: add preempt queues set support for vsc9959 Xiaoliang Yang
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Xiaoliang Yang @ 2020-10-20  4:04 UTC (permalink / raw)
  To: davem, netdev, linux-kernel
  Cc: vinicius.gomes, jhs, xiyou.wangcong, jiri, kuba, Jose.Abreu,
	allan.nielsen, joergen.andreasen, UNGLinuxDriver,
	xiaoliang.yang_1, po.liu, claudiu.manoil, alexandru.marginean,
	vladimir.oltean, leoyang.li, mingkai.hu

Preempt_set and preempt_get are new functions of ethtool ops, which
is to configure frame preemption according to 802.1qbu and 802.3br.
Add them on slave ports of DSA framework, so that DSA devices can
support to configure frame preemption by using ethtool.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
---
 include/net/dsa.h | 12 ++++++++++++
 net/dsa/slave.c   | 26 ++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/include/net/dsa.h b/include/net/dsa.h
index 35429a140dfa..85b196ade511 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -499,6 +499,18 @@ struct dsa_switch_ops {
 	int	(*get_ts_info)(struct dsa_switch *ds, int port,
 			       struct ethtool_ts_info *ts);
 
+	/*
+	 * ethtool --set-frame-preemption
+	 */
+	int	(*set_preempt)(struct dsa_switch *ds, int port,
+			       struct ethtool_fp *fpcmd);
+
+	/*
+	 * ethtool --show-frame-preemption
+	 */
+	int	(*get_preempt)(struct dsa_switch *ds, int port,
+			       struct ethtool_fp *fpcmd);
+
 	/*
 	 * Suspend and resume
 	 */
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index e7c1d62fde99..f51a1575266c 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1281,6 +1281,30 @@ static int dsa_slave_get_ts_info(struct net_device *dev,
 	return ds->ops->get_ts_info(ds, p->dp->index, ts);
 }
 
+static int dsa_slave_set_preempt(struct net_device *dev,
+				 struct ethtool_fp *fpcmd)
+{
+	struct dsa_slave_priv *p = netdev_priv(dev);
+	struct dsa_switch *ds = p->dp->ds;
+
+	if (!ds->ops->set_preempt)
+		return -EOPNOTSUPP;
+
+	return ds->ops->set_preempt(ds, p->dp->index, fpcmd);
+}
+
+static int dsa_slave_get_preempt(struct net_device *dev,
+				 struct ethtool_fp *fpcmd)
+{
+	struct dsa_slave_priv *p = netdev_priv(dev);
+	struct dsa_switch *ds = p->dp->ds;
+
+	if (!ds->ops->get_preempt)
+		return -EOPNOTSUPP;
+
+	return ds->ops->get_preempt(ds, p->dp->index, fpcmd);
+}
+
 static int dsa_slave_vlan_rx_add_vid(struct net_device *dev, __be16 proto,
 				     u16 vid)
 {
@@ -1571,6 +1595,8 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = {
 	.get_rxnfc		= dsa_slave_get_rxnfc,
 	.set_rxnfc		= dsa_slave_set_rxnfc,
 	.get_ts_info		= dsa_slave_get_ts_info,
+	.set_preempt		= dsa_slave_set_preempt,
+	.get_preempt		= dsa_slave_get_preempt,
 };
 
 /* legacy way, bypassing the bridge *****************************************/
-- 
2.18.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC, net-next 2/3] net: dsa: felix: add preempt queues set support for vsc9959
  2020-10-20  4:04 [RFC, net-next 0/3] net: dsa: felix: frame preemption support Xiaoliang Yang
  2020-10-20  4:04 ` [RFC, net-next 1/3] net: dsa: ethtool preempt ops support on slave ports Xiaoliang Yang
@ 2020-10-20  4:04 ` Xiaoliang Yang
  2020-10-20  6:24   ` kernel test robot
  2020-11-06 15:40   ` Vladimir Oltean
  2020-10-20  4:04 ` [RFC, net-next 3/3] net: dsa: felix: tc-taprio preempt set support Xiaoliang Yang
  2020-10-20 11:04 ` [RFC, net-next 0/3] net: dsa: felix: frame preemption support Vladimir Oltean
  3 siblings, 2 replies; 10+ messages in thread
From: Xiaoliang Yang @ 2020-10-20  4:04 UTC (permalink / raw)
  To: davem, netdev, linux-kernel
  Cc: vinicius.gomes, jhs, xiyou.wangcong, jiri, kuba, Jose.Abreu,
	allan.nielsen, joergen.andreasen, UNGLinuxDriver,
	xiaoliang.yang_1, po.liu, claudiu.manoil, alexandru.marginean,
	vladimir.oltean, leoyang.li, mingkai.hu

VSC9959 support preempt queues according to 802.1qbu and 802.3br. This
patch add ethtool preempt set to configure preemption.

In user space, it can be set like this:
	ethtool --set-frame-preemption swp0 enable min-frag-size 0

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
---
 drivers/net/dsa/ocelot/felix.c         | 26 ++++++++++++++
 drivers/net/dsa/ocelot/felix.h         |  4 +++
 drivers/net/dsa/ocelot/felix_vsc9959.c | 49 ++++++++++++++++++++++++++
 include/soc/mscc/ocelot.h              | 11 ++++++
 include/soc/mscc/ocelot_dev.h          | 23 ++++++++++++
 5 files changed, 113 insertions(+)

diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index f791860d495f..e08effbeb6bf 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -350,6 +350,30 @@ static int felix_get_ts_info(struct dsa_switch *ds, int port,
 	return ocelot_get_ts_info(ocelot, port, info);
 }
 
+static int felix_set_preempt(struct dsa_switch *ds, int port,
+			     struct ethtool_fp *fpcmd)
+{
+	struct ocelot *ocelot = ds->priv;
+	struct felix *felix = ocelot_to_felix(ocelot);
+
+	if (felix->info->port_set_preempt)
+		return felix->info->port_set_preempt(ocelot, port, fpcmd);
+
+	return -EOPNOTSUPP;
+}
+
+static int felix_get_preempt(struct dsa_switch *ds, int port,
+			     struct ethtool_fp *fpcmd)
+{
+	struct ocelot *ocelot = ds->priv;
+	struct felix *felix = ocelot_to_felix(ocelot);
+
+	if (felix->info->port_get_preempt)
+		return felix->info->port_get_preempt(ocelot, port, fpcmd);
+
+	return -EOPNOTSUPP;
+}
+
 static int felix_parse_ports_node(struct felix *felix,
 				  struct device_node *ports_node,
 				  phy_interface_t *port_phy_modes)
@@ -777,6 +801,8 @@ const struct dsa_switch_ops felix_switch_ops = {
 	.get_ethtool_stats	= felix_get_ethtool_stats,
 	.get_sset_count		= felix_get_sset_count,
 	.get_ts_info		= felix_get_ts_info,
+	.set_preempt		= felix_set_preempt,
+	.get_preempt		= felix_get_preempt,
 	.phylink_validate	= felix_phylink_validate,
 	.phylink_mac_config	= felix_phylink_mac_config,
 	.phylink_mac_link_down	= felix_phylink_mac_link_down,
diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h
index 4c717324ac2f..e0c93d4a351d 100644
--- a/drivers/net/dsa/ocelot/felix.h
+++ b/drivers/net/dsa/ocelot/felix.h
@@ -37,6 +37,10 @@ struct felix_info {
 	void	(*port_sched_speed_set)(struct ocelot *ocelot, int port,
 					u32 speed);
 	void	(*xmit_template_populate)(struct ocelot *ocelot, int port);
+	int	(*port_set_preempt)(struct ocelot *ocelot, int port,
+				    struct ethtool_fp *fpcmd);
+	int	(*port_get_preempt)(struct ocelot *ocelot, int port,
+				    struct ethtool_fp *fpcmd);
 };
 
 extern const struct dsa_switch_ops felix_switch_ops;
diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
index 3e925b8d5306..c0e41d499639 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -5,6 +5,7 @@
 #include <linux/fsl/enetc_mdio.h>
 #include <soc/mscc/ocelot_qsys.h>
 #include <soc/mscc/ocelot_vcap.h>
+#include <soc/mscc/ocelot_dev.h>
 #include <soc/mscc/ocelot_ptp.h>
 #include <soc/mscc/ocelot_sys.h>
 #include <soc/mscc/ocelot.h>
@@ -340,6 +341,10 @@ static const u32 vsc9959_dev_gmii_regmap[] = {
 	REG(DEV_MAC_FC_MAC_LOW_CFG,		0x3c),
 	REG(DEV_MAC_FC_MAC_HIGH_CFG,		0x40),
 	REG(DEV_MAC_STICKY,			0x44),
+	REG(DEV_MM_ENABLE_CONFIG,		0x48),
+	REG(DEV_MM_VERIF_CONFIG,		0x4c),
+	REG(DEV_MM_STATUS,			0x50),
+
 	REG_RESERVED(PCS1G_CFG),
 	REG_RESERVED(PCS1G_MODE_CFG),
 	REG_RESERVED(PCS1G_SD_CFG),
@@ -1321,6 +1326,48 @@ static int vsc9959_port_setup_tc(struct dsa_switch *ds, int port,
 	}
 }
 
+static int vsc9959_port_set_preempt(struct ocelot *ocelot, int port,
+				    struct ethtool_fp *fpcmd)
+{
+	struct ocelot_port *ocelot_port = ocelot->ports[port];
+	int mm_fragsize = fpcmd->min_frag_size_mult;
+
+	if (mm_fragsize > 3)
+		return -EINVAL;
+
+	ocelot_port_rmwl(ocelot_port,
+			 (fpcmd->enabled ?
+			  (DEV_MM_CONFIG_ENABLE_CONFIG_MM_RX_ENA |
+			   DEV_MM_CONFIG_ENABLE_CONFIG_MM_TX_ENA) : 0),
+			 DEV_MM_CONFIG_ENABLE_CONFIG_MM_RX_ENA |
+			 DEV_MM_CONFIG_ENABLE_CONFIG_MM_TX_ENA,
+			 DEV_MM_ENABLE_CONFIG);
+
+	ocelot_rmw_rix(ocelot,
+		       QSYS_PREEMPTION_CFG_MM_ADD_FRAG_SIZE(mm_fragsize),
+		       QSYS_PREEMPTION_CFG_MM_ADD_FRAG_SIZE_M,
+		       QSYS_PREEMPTION_CFG,
+		       port);
+
+	return 0;
+}
+
+static int vsc9959_port_get_preempt(struct ocelot *ocelot, int port,
+				    struct ethtool_fp *fpcmd)
+{
+	struct ocelot_port *ocelot_port = ocelot->ports[port];
+	u32 val;
+
+	val = ocelot_port_readl(ocelot_port, DEV_MM_VERIF_CONFIG);
+	val &= DEV_MM_CONFIG_VERIF_CONFIG_PRM_VERIFY_DIS;
+	fpcmd->enabled = (val ? 0 : 1);
+
+	val = ocelot_read(ocelot, QSYS_PREEMPTION_CFG);
+	fpcmd->min_frag_size_mult = QSYS_PREEMPTION_CFG_MM_ADD_FRAG_SIZE_X(val);
+
+	return 0;
+}
+
 static void vsc9959_xmit_template_populate(struct ocelot *ocelot, int port)
 {
 	struct ocelot_port *ocelot_port = ocelot->ports[port];
@@ -1369,6 +1416,8 @@ static const struct felix_info felix_info_vsc9959 = {
 	.prevalidate_phy_mode	= vsc9959_prevalidate_phy_mode,
 	.port_setup_tc		= vsc9959_port_setup_tc,
 	.port_sched_speed_set	= vsc9959_sched_speed_set,
+	.port_set_preempt	= vsc9959_port_set_preempt,
+	.port_get_preempt	= vsc9959_port_get_preempt,
 	.xmit_template_populate	= vsc9959_xmit_template_populate,
 };
 
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h
index 1e9db9577441..5ccfbf193ed9 100644
--- a/include/soc/mscc/ocelot.h
+++ b/include/soc/mscc/ocelot.h
@@ -426,6 +426,9 @@ enum ocelot_reg {
 	DEV_MAC_FC_MAC_LOW_CFG,
 	DEV_MAC_FC_MAC_HIGH_CFG,
 	DEV_MAC_STICKY,
+	DEV_MM_ENABLE_CONFIG,
+	DEV_MM_VERIF_CONFIG,
+	DEV_MM_STATUS,
 	PCS1G_CFG,
 	PCS1G_MODE_CFG,
 	PCS1G_SD_CFG,
@@ -709,6 +712,14 @@ u32 __ocelot_target_read_ix(struct ocelot *ocelot, enum ocelot_target target,
 void __ocelot_target_write_ix(struct ocelot *ocelot, enum ocelot_target target,
 			      u32 val, u32 reg, u32 offset);
 
+static inline void ocelot_port_rmwl(struct ocelot_port *port, u32 val,
+				    u32 mask, u32 reg)
+{
+	u32 cur = ocelot_port_readl(port, reg);
+
+	ocelot_port_writel(port, (cur & (~mask)) | val, reg);
+};
+
 /* Hardware initialization */
 int ocelot_regfields_init(struct ocelot *ocelot,
 			  const struct reg_field *const regfields);
diff --git a/include/soc/mscc/ocelot_dev.h b/include/soc/mscc/ocelot_dev.h
index 0c6021f02fee..cb1d8f5a62ee 100644
--- a/include/soc/mscc/ocelot_dev.h
+++ b/include/soc/mscc/ocelot_dev.h
@@ -93,6 +93,29 @@
 #define DEV_MAC_STICKY_TX_FRM_LEN_OVR_STICKY              BIT(1)
 #define DEV_MAC_STICKY_TX_ABORT_STICKY                    BIT(0)
 
+#define DEV_MM_CONFIG_ENABLE_CONFIG_MM_RX_ENA        BIT(0)
+#define DEV_MM_CONFIG_ENABLE_CONFIG_MM_TX_ENA        BIT(4)
+#define DEV_MM_CONFIG_ENABLE_CONFIG_KEEP_S_AFTER_D   BIT(8)
+
+#define DEV_MM_CONFIG_VERIF_CONFIG_PRM_VERIFY_DIS    BIT(0)
+#define DEV_MM_CONFIG_VERIF_CONFIG_PRM_VERIFY_TIME(x) (((x) << 4) & GENMASK(11, 4))
+#define DEV_MM_CONFIG_VERIF_CONFIG_PRM_VERIFY_TIME_M GENMASK(11, 4)
+#define DEV_MM_CONFIG_VERIF_CONFIG_PRM_VERIFY_TIME_X(x) (((x) & GENMASK(11, 4)) >> 4)
+#define DEV_MM_CONFIG_VERIF_CONFIG_VERIF_TIMER_UNITS(x) (((x) << 12) & GENMASK(13, 12))
+#define DEV_MM_CONFIG_VERIF_CONFIG_VERIF_TIMER_UNITS_M GENMASK(13, 12)
+#define DEV_MM_CONFIG_VERIF_CONFIG_VERIF_TIMER_UNITS_X(x) (((x) & GENMASK(13, 12)) >> 12)
+
+#define DEV_MM_STATISTICS_MM_STATUS_PRMPT_ACTIVE_STATUS BIT(0)
+#define DEV_MM_STATISTICS_MM_STATUS_PRMPT_ACTIVE_STICKY BIT(4)
+#define DEV_MM_STATISTICS_MM_STATUS_PRMPT_VERIFY_STATE(x) (((x) << 8) & GENMASK(10, 8))
+#define DEV_MM_STATISTICS_MM_STATUS_PRMPT_VERIFY_STATE_M GENMASK(10, 8)
+#define DEV_MM_STATISTICS_MM_STATUS_PRMPT_VERIFY_STATE_X(x) (((x) & GENMASK(10, 8)) >> 8)
+#define DEV_MM_STATISTICS_MM_STATUS_UNEXP_RX_PFRM_STICKY BIT(12)
+#define DEV_MM_STATISTICS_MM_STATUS_UNEXP_TX_PFRM_STICKY BIT(16)
+#define DEV_MM_STATISTICS_MM_STATUS_MM_RX_FRAME_STATUS BIT(20)
+#define DEV_MM_STATISTICS_MM_STATUS_MM_TX_FRAME_STATUS BIT(24)
+#define DEV_MM_STATISTICS_MM_STATUS_MM_TX_PRMPT_STATUS BIT(28)
+
 #define PCS1G_CFG_LINK_STATUS_TYPE                        BIT(4)
 #define PCS1G_CFG_AN_LINK_CTRL_ENA                        BIT(1)
 #define PCS1G_CFG_PCS_ENA                                 BIT(0)
-- 
2.18.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [RFC, net-next 3/3] net: dsa: felix: tc-taprio preempt set support
  2020-10-20  4:04 [RFC, net-next 0/3] net: dsa: felix: frame preemption support Xiaoliang Yang
  2020-10-20  4:04 ` [RFC, net-next 1/3] net: dsa: ethtool preempt ops support on slave ports Xiaoliang Yang
  2020-10-20  4:04 ` [RFC, net-next 2/3] net: dsa: felix: add preempt queues set support for vsc9959 Xiaoliang Yang
@ 2020-10-20  4:04 ` Xiaoliang Yang
  2020-10-20  6:52   ` kernel test robot
  2020-10-20 11:04 ` [RFC, net-next 0/3] net: dsa: felix: frame preemption support Vladimir Oltean
  3 siblings, 1 reply; 10+ messages in thread
From: Xiaoliang Yang @ 2020-10-20  4:04 UTC (permalink / raw)
  To: davem, netdev, linux-kernel
  Cc: vinicius.gomes, jhs, xiyou.wangcong, jiri, kuba, Jose.Abreu,
	allan.nielsen, joergen.andreasen, UNGLinuxDriver,
	xiaoliang.yang_1, po.liu, claudiu.manoil, alexandru.marginean,
	vladimir.oltean, leoyang.li, mingkai.hu

After using ethtool to enable and configure frame preemption on
vsc9959, use tc-taprio preempt set to mark the preempt queues and
express queueus.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
---
 drivers/net/dsa/ocelot/felix_vsc9959.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
index c0e41d499639..f2b9a5ee1ff5 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -1310,6 +1310,20 @@ static int vsc9959_qos_port_cbs_set(struct dsa_switch *ds, int port,
 	return 0;
 }
 
+static int vsc9959_port_preempt_queues(struct ocelot *ocelot, int port,
+				       struct tc_preempt_qopt_offload *qopt)
+{
+	u8 p_queues = qopt->preemptible_queues;
+
+	ocelot_rmw_rix(ocelot,
+		       QSYS_PREEMPTION_CFG_P_QUEUES(p_queues),
+		       QSYS_PREEMPTION_CFG_P_QUEUES_M,
+		       QSYS_PREEMPTION_CFG,
+		       port);
+
+	return 0;
+}
+
 static int vsc9959_port_setup_tc(struct dsa_switch *ds, int port,
 				 enum tc_setup_type type,
 				 void *type_data)
@@ -1321,6 +1335,8 @@ static int vsc9959_port_setup_tc(struct dsa_switch *ds, int port,
 		return vsc9959_qos_port_tas_set(ocelot, port, type_data);
 	case TC_SETUP_QDISC_CBS:
 		return vsc9959_qos_port_cbs_set(ds, port, type_data);
+	case TC_SETUP_PREEMPT:
+		return vsc9959_port_preempt_queues(ocelot, port, type_data);
 	default:
 		return -EOPNOTSUPP;
 	}
-- 
2.18.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [RFC, net-next 1/3] net: dsa: ethtool preempt ops support on slave ports
  2020-10-20  4:04 ` [RFC, net-next 1/3] net: dsa: ethtool preempt ops support on slave ports Xiaoliang Yang
@ 2020-10-20  5:53   ` kernel test robot
  2020-10-20  7:25   ` kernel test robot
  1 sibling, 0 replies; 10+ messages in thread
From: kernel test robot @ 2020-10-20  5:53 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6398 bytes --]

Hi Xiaoliang,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Xiaoliang-Yang/net-dsa-felix-frame-preemption-support/20201020-121555
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 105faa8742437c28815b2a3eb8314ebc5fd9288c
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/8793bdc51bda4de1362ea8e74db38e1a93ff6964
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Xiaoliang-Yang/net-dsa-felix-frame-preemption-support/20201020-121555
        git checkout 8793bdc51bda4de1362ea8e74db38e1a93ff6964
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   In file included from net/dsa/dsa_priv.h:14,
                    from net/dsa/dsa.c:24:
>> include/net/dsa.h:506:18: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     506 |           struct ethtool_fp *fpcmd);
         |                  ^~~~~~~~~~
   include/net/dsa.h:512:18: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     512 |           struct ethtool_fp *fpcmd);
         |                  ^~~~~~~~~~
--
   In file included from net/dsa/dsa_priv.h:14,
                    from net/dsa/slave.c:23:
>> include/net/dsa.h:506:18: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     506 |           struct ethtool_fp *fpcmd);
         |                  ^~~~~~~~~~
   include/net/dsa.h:512:18: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     512 |           struct ethtool_fp *fpcmd);
         |                  ^~~~~~~~~~
>> net/dsa/slave.c:1266:13: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
    1266 |      struct ethtool_fp *fpcmd)
         |             ^~~~~~~~~~
   net/dsa/slave.c: In function 'dsa_slave_set_preempt':
>> net/dsa/slave.c:1274:48: error: passing argument 3 of 'ds->ops->set_preempt' from incompatible pointer type [-Werror=incompatible-pointer-types]
    1274 |  return ds->ops->set_preempt(ds, p->dp->index, fpcmd);
         |                                                ^~~~~
         |                                                |
         |                                                struct ethtool_fp *
   net/dsa/slave.c:1274:48: note: expected 'struct ethtool_fp *' but argument is of type 'struct ethtool_fp *'
   net/dsa/slave.c: At top level:
   net/dsa/slave.c:1278:13: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
    1278 |      struct ethtool_fp *fpcmd)
         |             ^~~~~~~~~~
   net/dsa/slave.c: In function 'dsa_slave_get_preempt':
>> net/dsa/slave.c:1286:48: error: passing argument 3 of 'ds->ops->get_preempt' from incompatible pointer type [-Werror=incompatible-pointer-types]
    1286 |  return ds->ops->get_preempt(ds, p->dp->index, fpcmd);
         |                                                ^~~~~
         |                                                |
         |                                                struct ethtool_fp *
   net/dsa/slave.c:1286:48: note: expected 'struct ethtool_fp *' but argument is of type 'struct ethtool_fp *'
   net/dsa/slave.c: At top level:
>> net/dsa/slave.c:1579:3: error: 'const struct ethtool_ops' has no member named 'set_preempt'
    1579 |  .set_preempt  = dsa_slave_set_preempt,
         |   ^~~~~~~~~~~
>> net/dsa/slave.c:1579:18: error: initialization of 'int (*)(struct net_device *, struct ethtool_modinfo *)' from incompatible pointer type 'int (*)(struct net_device *, struct ethtool_fp *)' [-Werror=incompatible-pointer-types]
    1579 |  .set_preempt  = dsa_slave_set_preempt,
         |                  ^~~~~~~~~~~~~~~~~~~~~
   net/dsa/slave.c:1579:18: note: (near initialization for 'dsa_slave_ethtool_ops.get_module_info')
>> net/dsa/slave.c:1580:3: error: 'const struct ethtool_ops' has no member named 'get_preempt'
    1580 |  .get_preempt  = dsa_slave_get_preempt,
         |   ^~~~~~~~~~~
>> net/dsa/slave.c:1580:18: error: initialization of 'int (*)(struct net_device *, struct ethtool_eeprom *, u8 *)' {aka 'int (*)(struct net_device *, struct ethtool_eeprom *, unsigned char *)'} from incompatible pointer type 'int (*)(struct net_device *, struct ethtool_fp *)' [-Werror=incompatible-pointer-types]
    1580 |  .get_preempt  = dsa_slave_get_preempt,
         |                  ^~~~~~~~~~~~~~~~~~~~~
   net/dsa/slave.c:1580:18: note: (near initialization for 'dsa_slave_ethtool_ops.get_module_eeprom')
   cc1: some warnings being treated as errors

vim +1274 net/dsa/slave.c

  1264	
  1265	static int dsa_slave_set_preempt(struct net_device *dev,
> 1266					 struct ethtool_fp *fpcmd)
  1267	{
  1268		struct dsa_slave_priv *p = netdev_priv(dev);
  1269		struct dsa_switch *ds = p->dp->ds;
  1270	
  1271		if (!ds->ops->set_preempt)
  1272			return -EOPNOTSUPP;
  1273	
> 1274		return ds->ops->set_preempt(ds, p->dp->index, fpcmd);
  1275	}
  1276	
  1277	static int dsa_slave_get_preempt(struct net_device *dev,
  1278					 struct ethtool_fp *fpcmd)
  1279	{
  1280		struct dsa_slave_priv *p = netdev_priv(dev);
  1281		struct dsa_switch *ds = p->dp->ds;
  1282	
  1283		if (!ds->ops->get_preempt)
  1284			return -EOPNOTSUPP;
  1285	
> 1286		return ds->ops->get_preempt(ds, p->dp->index, fpcmd);
  1287	}
  1288	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 65141 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC, net-next 2/3] net: dsa: felix: add preempt queues set support for vsc9959
  2020-10-20  4:04 ` [RFC, net-next 2/3] net: dsa: felix: add preempt queues set support for vsc9959 Xiaoliang Yang
@ 2020-10-20  6:24   ` kernel test robot
  2020-11-06 15:40   ` Vladimir Oltean
  1 sibling, 0 replies; 10+ messages in thread
From: kernel test robot @ 2020-10-20  6:24 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 10849 bytes --]

Hi Xiaoliang,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Xiaoliang-Yang/net-dsa-felix-frame-preemption-support/20201020-121555
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 105faa8742437c28815b2a3eb8314ebc5fd9288c
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/0dec712f56c9e925e1603711d1dad831e2820394
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Xiaoliang-Yang/net-dsa-felix-frame-preemption-support/20201020-121555
        git checkout 0dec712f56c9e925e1603711d1dad831e2820394
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   In file included from include/soc/mscc/ocelot.h:12,
                    from include/soc/mscc/ocelot_vcap.h:9,
                    from drivers/net/dsa/ocelot/felix.c:9:
   include/net/dsa.h:506:18: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     506 |           struct ethtool_fp *fpcmd);
         |                  ^~~~~~~~~~
   include/net/dsa.h:512:18: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     512 |           struct ethtool_fp *fpcmd);
         |                  ^~~~~~~~~~
   In file included from drivers/net/dsa/ocelot/felix.c:25:
>> drivers/net/dsa/ocelot/felix.h:41:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
      41 |         struct ethtool_fp *fpcmd);
         |                ^~~~~~~~~~
   drivers/net/dsa/ocelot/felix.h:43:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
      43 |         struct ethtool_fp *fpcmd);
         |                ^~~~~~~~~~
>> drivers/net/dsa/ocelot/felix.c:354:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     354 |         struct ethtool_fp *fpcmd)
         |                ^~~~~~~~~~
   drivers/net/dsa/ocelot/felix.c: In function 'felix_set_preempt':
>> drivers/net/dsa/ocelot/felix.c:360:54: error: passing argument 3 of 'felix->info->port_set_preempt' from incompatible pointer type [-Werror=incompatible-pointer-types]
     360 |   return felix->info->port_set_preempt(ocelot, port, fpcmd);
         |                                                      ^~~~~
         |                                                      |
         |                                                      struct ethtool_fp *
   drivers/net/dsa/ocelot/felix.c:360:54: note: expected 'struct ethtool_fp *' but argument is of type 'struct ethtool_fp *'
   drivers/net/dsa/ocelot/felix.c: At top level:
   drivers/net/dsa/ocelot/felix.c:366:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     366 |         struct ethtool_fp *fpcmd)
         |                ^~~~~~~~~~
   drivers/net/dsa/ocelot/felix.c: In function 'felix_get_preempt':
>> drivers/net/dsa/ocelot/felix.c:372:54: error: passing argument 3 of 'felix->info->port_get_preempt' from incompatible pointer type [-Werror=incompatible-pointer-types]
     372 |   return felix->info->port_get_preempt(ocelot, port, fpcmd);
         |                                                      ^~~~~
         |                                                      |
         |                                                      struct ethtool_fp *
   drivers/net/dsa/ocelot/felix.c:372:54: note: expected 'struct ethtool_fp *' but argument is of type 'struct ethtool_fp *'
   drivers/net/dsa/ocelot/felix.c: At top level:
>> drivers/net/dsa/ocelot/felix.c:804:18: error: initialization of 'int (*)(struct dsa_switch *, int,  struct ethtool_fp *)' from incompatible pointer type 'int (*)(struct dsa_switch *, int,  struct ethtool_fp *)' [-Werror=incompatible-pointer-types]
     804 |  .set_preempt  = felix_set_preempt,
         |                  ^~~~~~~~~~~~~~~~~
   drivers/net/dsa/ocelot/felix.c:804:18: note: (near initialization for 'felix_switch_ops.set_preempt')
   drivers/net/dsa/ocelot/felix.c:805:18: error: initialization of 'int (*)(struct dsa_switch *, int,  struct ethtool_fp *)' from incompatible pointer type 'int (*)(struct dsa_switch *, int,  struct ethtool_fp *)' [-Werror=incompatible-pointer-types]
     805 |  .get_preempt  = felix_get_preempt,
         |                  ^~~~~~~~~~~~~~~~~
   drivers/net/dsa/ocelot/felix.c:805:18: note: (near initialization for 'felix_switch_ops.get_preempt')
   cc1: some warnings being treated as errors
--
   In file included from include/soc/mscc/ocelot.h:12,
                    from include/soc/mscc/ocelot_vcap.h:9,
                    from drivers/net/dsa/ocelot/felix_vsc9959.c:7:
   include/net/dsa.h:506:18: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     506 |           struct ethtool_fp *fpcmd);
         |                  ^~~~~~~~~~
   include/net/dsa.h:512:18: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     512 |           struct ethtool_fp *fpcmd);
         |                  ^~~~~~~~~~
   In file included from drivers/net/dsa/ocelot/felix_vsc9959.c:18:
>> drivers/net/dsa/ocelot/felix.h:41:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
      41 |         struct ethtool_fp *fpcmd);
         |                ^~~~~~~~~~
   drivers/net/dsa/ocelot/felix.h:43:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
      43 |         struct ethtool_fp *fpcmd);
         |                ^~~~~~~~~~
>> drivers/net/dsa/ocelot/felix_vsc9959.c:1330:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
    1330 |         struct ethtool_fp *fpcmd)
         |                ^~~~~~~~~~
   drivers/net/dsa/ocelot/felix_vsc9959.c: In function 'vsc9959_port_set_preempt':
>> drivers/net/dsa/ocelot/felix_vsc9959.c:1333:25: error: dereferencing pointer to incomplete type 'struct ethtool_fp'
    1333 |  int mm_fragsize = fpcmd->min_frag_size_mult;
         |                         ^~
   drivers/net/dsa/ocelot/felix_vsc9959.c: At top level:
   drivers/net/dsa/ocelot/felix_vsc9959.c:1356:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
    1356 |         struct ethtool_fp *fpcmd)
         |                ^~~~~~~~~~
   drivers/net/dsa/ocelot/felix_vsc9959.c: In function 'vsc9959_port_get_preempt':
   drivers/net/dsa/ocelot/felix_vsc9959.c:1363:7: error: dereferencing pointer to incomplete type 'struct ethtool_fp'
    1363 |  fpcmd->enabled = (val ? 0 : 1);
         |       ^~
   drivers/net/dsa/ocelot/felix_vsc9959.c: At top level:
>> drivers/net/dsa/ocelot/felix_vsc9959.c:1419:22: error: initialization of 'int (*)(struct ocelot *, int,  struct ethtool_fp *)' from incompatible pointer type 'int (*)(struct ocelot *, int,  struct ethtool_fp *)' [-Werror=incompatible-pointer-types]
    1419 |  .port_set_preempt = vsc9959_port_set_preempt,
         |                      ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/dsa/ocelot/felix_vsc9959.c:1419:22: note: (near initialization for 'felix_info_vsc9959.port_set_preempt')
   drivers/net/dsa/ocelot/felix_vsc9959.c:1420:22: error: initialization of 'int (*)(struct ocelot *, int,  struct ethtool_fp *)' from incompatible pointer type 'int (*)(struct ocelot *, int,  struct ethtool_fp *)' [-Werror=incompatible-pointer-types]
    1420 |  .port_get_preempt = vsc9959_port_get_preempt,
         |                      ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/dsa/ocelot/felix_vsc9959.c:1420:22: note: (near initialization for 'felix_info_vsc9959.port_get_preempt')
   cc1: some warnings being treated as errors
--
   In file included from include/soc/mscc/ocelot.h:12,
                    from include/soc/mscc/ocelot_vcap.h:9,
                    from drivers/net/dsa/ocelot/seville_vsc9953.c:6:
   include/net/dsa.h:506:18: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     506 |           struct ethtool_fp *fpcmd);
         |                  ^~~~~~~~~~
   include/net/dsa.h:512:18: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     512 |           struct ethtool_fp *fpcmd);
         |                  ^~~~~~~~~~
   In file included from drivers/net/dsa/ocelot/seville_vsc9953.c:13:
>> drivers/net/dsa/ocelot/felix.h:41:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
      41 |         struct ethtool_fp *fpcmd);
         |                ^~~~~~~~~~
   drivers/net/dsa/ocelot/felix.h:43:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
      43 |         struct ethtool_fp *fpcmd);
         |                ^~~~~~~~~~

vim +360 drivers/net/dsa/ocelot/felix.c

   352	
   353	static int felix_set_preempt(struct dsa_switch *ds, int port,
 > 354				     struct ethtool_fp *fpcmd)
   355	{
   356		struct ocelot *ocelot = ds->priv;
   357		struct felix *felix = ocelot_to_felix(ocelot);
   358	
   359		if (felix->info->port_set_preempt)
 > 360			return felix->info->port_set_preempt(ocelot, port, fpcmd);
   361	
   362		return -EOPNOTSUPP;
   363	}
   364	
   365	static int felix_get_preempt(struct dsa_switch *ds, int port,
   366				     struct ethtool_fp *fpcmd)
   367	{
   368		struct ocelot *ocelot = ds->priv;
   369		struct felix *felix = ocelot_to_felix(ocelot);
   370	
   371		if (felix->info->port_get_preempt)
 > 372			return felix->info->port_get_preempt(ocelot, port, fpcmd);
   373	
   374		return -EOPNOTSUPP;
   375	}
   376	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 75985 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC, net-next 3/3] net: dsa: felix: tc-taprio preempt set support
  2020-10-20  4:04 ` [RFC, net-next 3/3] net: dsa: felix: tc-taprio preempt set support Xiaoliang Yang
@ 2020-10-20  6:52   ` kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2020-10-20  6:52 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6917 bytes --]

Hi Xiaoliang,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Xiaoliang-Yang/net-dsa-felix-frame-preemption-support/20201020-121555
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 105faa8742437c28815b2a3eb8314ebc5fd9288c
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/2841111365cae71822d7e9164bf71b651ca6bed2
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Xiaoliang-Yang/net-dsa-felix-frame-preemption-support/20201020-121555
        git checkout 2841111365cae71822d7e9164bf71b651ca6bed2
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   In file included from include/soc/mscc/ocelot.h:12,
                    from include/soc/mscc/ocelot_vcap.h:9,
                    from drivers/net/dsa/ocelot/felix_vsc9959.c:7:
   include/net/dsa.h:506:18: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     506 |           struct ethtool_fp *fpcmd);
         |                  ^~~~~~~~~~
   include/net/dsa.h:512:18: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
     512 |           struct ethtool_fp *fpcmd);
         |                  ^~~~~~~~~~
   In file included from drivers/net/dsa/ocelot/felix_vsc9959.c:18:
   drivers/net/dsa/ocelot/felix.h:41:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
      41 |         struct ethtool_fp *fpcmd);
         |                ^~~~~~~~~~
   drivers/net/dsa/ocelot/felix.h:43:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
      43 |         struct ethtool_fp *fpcmd);
         |                ^~~~~~~~~~
>> drivers/net/dsa/ocelot/felix_vsc9959.c:1314:19: warning: 'struct tc_preempt_qopt_offload' declared inside parameter list will not be visible outside of this definition or declaration
    1314 |            struct tc_preempt_qopt_offload *qopt)
         |                   ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/dsa/ocelot/felix_vsc9959.c: In function 'vsc9959_port_preempt_queues':
>> drivers/net/dsa/ocelot/felix_vsc9959.c:1316:20: error: dereferencing pointer to incomplete type 'struct tc_preempt_qopt_offload'
    1316 |  u8 p_queues = qopt->preemptible_queues;
         |                    ^~
   drivers/net/dsa/ocelot/felix_vsc9959.c: In function 'vsc9959_port_setup_tc':
>> drivers/net/dsa/ocelot/felix_vsc9959.c:1338:7: error: 'TC_SETUP_PREEMPT' undeclared (first use in this function); did you mean 'TC_SETUP_FT'?
    1338 |  case TC_SETUP_PREEMPT:
         |       ^~~~~~~~~~~~~~~~
         |       TC_SETUP_FT
   drivers/net/dsa/ocelot/felix_vsc9959.c:1338:7: note: each undeclared identifier is reported only once for each function it appears in
   drivers/net/dsa/ocelot/felix_vsc9959.c: At top level:
   drivers/net/dsa/ocelot/felix_vsc9959.c:1346:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
    1346 |         struct ethtool_fp *fpcmd)
         |                ^~~~~~~~~~
   drivers/net/dsa/ocelot/felix_vsc9959.c: In function 'vsc9959_port_set_preempt':
   drivers/net/dsa/ocelot/felix_vsc9959.c:1349:25: error: dereferencing pointer to incomplete type 'struct ethtool_fp'
    1349 |  int mm_fragsize = fpcmd->min_frag_size_mult;
         |                         ^~
   drivers/net/dsa/ocelot/felix_vsc9959.c: At top level:
   drivers/net/dsa/ocelot/felix_vsc9959.c:1372:16: warning: 'struct ethtool_fp' declared inside parameter list will not be visible outside of this definition or declaration
    1372 |         struct ethtool_fp *fpcmd)
         |                ^~~~~~~~~~
   drivers/net/dsa/ocelot/felix_vsc9959.c: In function 'vsc9959_port_get_preempt':
   drivers/net/dsa/ocelot/felix_vsc9959.c:1379:7: error: dereferencing pointer to incomplete type 'struct ethtool_fp'
    1379 |  fpcmd->enabled = (val ? 0 : 1);
         |       ^~
   drivers/net/dsa/ocelot/felix_vsc9959.c: At top level:
   drivers/net/dsa/ocelot/felix_vsc9959.c:1435:22: error: initialization of 'int (*)(struct ocelot *, int,  struct ethtool_fp *)' from incompatible pointer type 'int (*)(struct ocelot *, int,  struct ethtool_fp *)' [-Werror=incompatible-pointer-types]
    1435 |  .port_set_preempt = vsc9959_port_set_preempt,
         |                      ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/dsa/ocelot/felix_vsc9959.c:1435:22: note: (near initialization for 'felix_info_vsc9959.port_set_preempt')
   drivers/net/dsa/ocelot/felix_vsc9959.c:1436:22: error: initialization of 'int (*)(struct ocelot *, int,  struct ethtool_fp *)' from incompatible pointer type 'int (*)(struct ocelot *, int,  struct ethtool_fp *)' [-Werror=incompatible-pointer-types]
    1436 |  .port_get_preempt = vsc9959_port_get_preempt,
         |                      ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/dsa/ocelot/felix_vsc9959.c:1436:22: note: (near initialization for 'felix_info_vsc9959.port_get_preempt')
   cc1: some warnings being treated as errors

vim +1316 drivers/net/dsa/ocelot/felix_vsc9959.c

  1312	
  1313	static int vsc9959_port_preempt_queues(struct ocelot *ocelot, int port,
> 1314					       struct tc_preempt_qopt_offload *qopt)
  1315	{
> 1316		u8 p_queues = qopt->preemptible_queues;
  1317	
  1318		ocelot_rmw_rix(ocelot,
  1319			       QSYS_PREEMPTION_CFG_P_QUEUES(p_queues),
  1320			       QSYS_PREEMPTION_CFG_P_QUEUES_M,
  1321			       QSYS_PREEMPTION_CFG,
  1322			       port);
  1323	
  1324		return 0;
  1325	}
  1326	
  1327	static int vsc9959_port_setup_tc(struct dsa_switch *ds, int port,
  1328					 enum tc_setup_type type,
  1329					 void *type_data)
  1330	{
  1331		struct ocelot *ocelot = ds->priv;
  1332	
  1333		switch (type) {
  1334		case TC_SETUP_QDISC_TAPRIO:
  1335			return vsc9959_qos_port_tas_set(ocelot, port, type_data);
  1336		case TC_SETUP_QDISC_CBS:
  1337			return vsc9959_qos_port_cbs_set(ds, port, type_data);
> 1338		case TC_SETUP_PREEMPT:
  1339			return vsc9959_port_preempt_queues(ocelot, port, type_data);
  1340		default:
  1341			return -EOPNOTSUPP;
  1342		}
  1343	}
  1344	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 75985 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC, net-next 1/3] net: dsa: ethtool preempt ops support on slave ports
  2020-10-20  4:04 ` [RFC, net-next 1/3] net: dsa: ethtool preempt ops support on slave ports Xiaoliang Yang
  2020-10-20  5:53   ` kernel test robot
@ 2020-10-20  7:25   ` kernel test robot
  1 sibling, 0 replies; 10+ messages in thread
From: kernel test robot @ 2020-10-20  7:25 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 12924 bytes --]

Hi Xiaoliang,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Xiaoliang-Yang/net-dsa-felix-frame-preemption-support/20201020-121555
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 105faa8742437c28815b2a3eb8314ebc5fd9288c
config: x86_64-randconfig-a001-20201020 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project ea693a162786d933863ab079648d4261ac0ead47)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/8793bdc51bda4de1362ea8e74db38e1a93ff6964
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Xiaoliang-Yang/net-dsa-felix-frame-preemption-support/20201020-121555
        git checkout 8793bdc51bda4de1362ea8e74db38e1a93ff6964
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from net/core/flow_dissector.c:8:
>> include/net/dsa.h:506:18: warning: declaration of 'struct ethtool_fp' will not be visible outside of this function [-Wvisibility]
                                  struct ethtool_fp *fpcmd);
                                         ^
   include/net/dsa.h:512:18: warning: declaration of 'struct ethtool_fp' will not be visible outside of this function [-Wvisibility]
                                  struct ethtool_fp *fpcmd);
                                         ^
   2 warnings generated.
--
   In file included from net/core/dev.c:101:
>> include/net/dsa.h:506:18: warning: declaration of 'struct ethtool_fp' will not be visible outside of this function [-Wvisibility]
                                  struct ethtool_fp *fpcmd);
                                         ^
   include/net/dsa.h:512:18: warning: declaration of 'struct ethtool_fp' will not be visible outside of this function [-Wvisibility]
                                  struct ethtool_fp *fpcmd);
                                         ^
   net/core/dev.c:4932:1: warning: unused function 'sch_handle_ingress' [-Wunused-function]
   sch_handle_ingress(struct sk_buff *skb, struct packet_type **pt_prev, int *ret,
   ^
   net/core/dev.c:5080:19: warning: unused function 'nf_ingress' [-Wunused-function]
   static inline int nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev,
                     ^
   4 warnings generated.

vim +506 include/net/dsa.h

   427	
   428	typedef int dsa_fdb_dump_cb_t(const unsigned char *addr, u16 vid,
   429				      bool is_static, void *data);
   430	struct dsa_switch_ops {
   431		enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds,
   432							  int port,
   433							  enum dsa_tag_protocol mprot);
   434	
   435		int	(*setup)(struct dsa_switch *ds);
   436		void	(*teardown)(struct dsa_switch *ds);
   437		u32	(*get_phy_flags)(struct dsa_switch *ds, int port);
   438	
   439		/*
   440		 * Access to the switch's PHY registers.
   441		 */
   442		int	(*phy_read)(struct dsa_switch *ds, int port, int regnum);
   443		int	(*phy_write)(struct dsa_switch *ds, int port,
   444				     int regnum, u16 val);
   445	
   446		/*
   447		 * Link state adjustment (called from libphy)
   448		 */
   449		void	(*adjust_link)(struct dsa_switch *ds, int port,
   450					struct phy_device *phydev);
   451		void	(*fixed_link_update)(struct dsa_switch *ds, int port,
   452					struct fixed_phy_status *st);
   453	
   454		/*
   455		 * PHYLINK integration
   456		 */
   457		void	(*phylink_validate)(struct dsa_switch *ds, int port,
   458					    unsigned long *supported,
   459					    struct phylink_link_state *state);
   460		int	(*phylink_mac_link_state)(struct dsa_switch *ds, int port,
   461						  struct phylink_link_state *state);
   462		void	(*phylink_mac_config)(struct dsa_switch *ds, int port,
   463					      unsigned int mode,
   464					      const struct phylink_link_state *state);
   465		void	(*phylink_mac_an_restart)(struct dsa_switch *ds, int port);
   466		void	(*phylink_mac_link_down)(struct dsa_switch *ds, int port,
   467						 unsigned int mode,
   468						 phy_interface_t interface);
   469		void	(*phylink_mac_link_up)(struct dsa_switch *ds, int port,
   470					       unsigned int mode,
   471					       phy_interface_t interface,
   472					       struct phy_device *phydev,
   473					       int speed, int duplex,
   474					       bool tx_pause, bool rx_pause);
   475		void	(*phylink_fixed_state)(struct dsa_switch *ds, int port,
   476					       struct phylink_link_state *state);
   477		/*
   478		 * ethtool hardware statistics.
   479		 */
   480		void	(*get_strings)(struct dsa_switch *ds, int port,
   481				       u32 stringset, uint8_t *data);
   482		void	(*get_ethtool_stats)(struct dsa_switch *ds,
   483					     int port, uint64_t *data);
   484		int	(*get_sset_count)(struct dsa_switch *ds, int port, int sset);
   485		void	(*get_ethtool_phy_stats)(struct dsa_switch *ds,
   486						 int port, uint64_t *data);
   487	
   488		/*
   489		 * ethtool Wake-on-LAN
   490		 */
   491		void	(*get_wol)(struct dsa_switch *ds, int port,
   492				   struct ethtool_wolinfo *w);
   493		int	(*set_wol)(struct dsa_switch *ds, int port,
   494				   struct ethtool_wolinfo *w);
   495	
   496		/*
   497		 * ethtool timestamp info
   498		 */
   499		int	(*get_ts_info)(struct dsa_switch *ds, int port,
   500				       struct ethtool_ts_info *ts);
   501	
   502		/*
   503		 * ethtool --set-frame-preemption
   504		 */
   505		int	(*set_preempt)(struct dsa_switch *ds, int port,
 > 506				       struct ethtool_fp *fpcmd);
   507	
   508		/*
   509		 * ethtool --show-frame-preemption
   510		 */
   511		int	(*get_preempt)(struct dsa_switch *ds, int port,
   512				       struct ethtool_fp *fpcmd);
   513	
   514		/*
   515		 * Suspend and resume
   516		 */
   517		int	(*suspend)(struct dsa_switch *ds);
   518		int	(*resume)(struct dsa_switch *ds);
   519	
   520		/*
   521		 * Port enable/disable
   522		 */
   523		int	(*port_enable)(struct dsa_switch *ds, int port,
   524				       struct phy_device *phy);
   525		void	(*port_disable)(struct dsa_switch *ds, int port);
   526	
   527		/*
   528		 * Port's MAC EEE settings
   529		 */
   530		int	(*set_mac_eee)(struct dsa_switch *ds, int port,
   531				       struct ethtool_eee *e);
   532		int	(*get_mac_eee)(struct dsa_switch *ds, int port,
   533				       struct ethtool_eee *e);
   534	
   535		/* EEPROM access */
   536		int	(*get_eeprom_len)(struct dsa_switch *ds);
   537		int	(*get_eeprom)(struct dsa_switch *ds,
   538				      struct ethtool_eeprom *eeprom, u8 *data);
   539		int	(*set_eeprom)(struct dsa_switch *ds,
   540				      struct ethtool_eeprom *eeprom, u8 *data);
   541	
   542		/*
   543		 * Register access.
   544		 */
   545		int	(*get_regs_len)(struct dsa_switch *ds, int port);
   546		void	(*get_regs)(struct dsa_switch *ds, int port,
   547				    struct ethtool_regs *regs, void *p);
   548	
   549		/*
   550		 * Bridge integration
   551		 */
   552		int	(*set_ageing_time)(struct dsa_switch *ds, unsigned int msecs);
   553		int	(*port_bridge_join)(struct dsa_switch *ds, int port,
   554					    struct net_device *bridge);
   555		void	(*port_bridge_leave)(struct dsa_switch *ds, int port,
   556					     struct net_device *bridge);
   557		void	(*port_stp_state_set)(struct dsa_switch *ds, int port,
   558					      u8 state);
   559		void	(*port_fast_age)(struct dsa_switch *ds, int port);
   560		int	(*port_egress_floods)(struct dsa_switch *ds, int port,
   561					      bool unicast, bool multicast);
   562	
   563		/*
   564		 * VLAN support
   565		 */
   566		int	(*port_vlan_filtering)(struct dsa_switch *ds, int port,
   567					       bool vlan_filtering,
   568					       struct switchdev_trans *trans);
   569		int (*port_vlan_prepare)(struct dsa_switch *ds, int port,
   570					 const struct switchdev_obj_port_vlan *vlan);
   571		void (*port_vlan_add)(struct dsa_switch *ds, int port,
   572				      const struct switchdev_obj_port_vlan *vlan);
   573		int	(*port_vlan_del)(struct dsa_switch *ds, int port,
   574					 const struct switchdev_obj_port_vlan *vlan);
   575		/*
   576		 * Forwarding database
   577		 */
   578		int	(*port_fdb_add)(struct dsa_switch *ds, int port,
   579					const unsigned char *addr, u16 vid);
   580		int	(*port_fdb_del)(struct dsa_switch *ds, int port,
   581					const unsigned char *addr, u16 vid);
   582		int	(*port_fdb_dump)(struct dsa_switch *ds, int port,
   583					 dsa_fdb_dump_cb_t *cb, void *data);
   584	
   585		/*
   586		 * Multicast database
   587		 */
   588		int (*port_mdb_prepare)(struct dsa_switch *ds, int port,
   589					const struct switchdev_obj_port_mdb *mdb);
   590		void (*port_mdb_add)(struct dsa_switch *ds, int port,
   591				     const struct switchdev_obj_port_mdb *mdb);
   592		int	(*port_mdb_del)(struct dsa_switch *ds, int port,
   593					const struct switchdev_obj_port_mdb *mdb);
   594		/*
   595		 * RXNFC
   596		 */
   597		int	(*get_rxnfc)(struct dsa_switch *ds, int port,
   598				     struct ethtool_rxnfc *nfc, u32 *rule_locs);
   599		int	(*set_rxnfc)(struct dsa_switch *ds, int port,
   600				     struct ethtool_rxnfc *nfc);
   601	
   602		/*
   603		 * TC integration
   604		 */
   605		int	(*cls_flower_add)(struct dsa_switch *ds, int port,
   606					  struct flow_cls_offload *cls, bool ingress);
   607		int	(*cls_flower_del)(struct dsa_switch *ds, int port,
   608					  struct flow_cls_offload *cls, bool ingress);
   609		int	(*cls_flower_stats)(struct dsa_switch *ds, int port,
   610					    struct flow_cls_offload *cls, bool ingress);
   611		int	(*port_mirror_add)(struct dsa_switch *ds, int port,
   612					   struct dsa_mall_mirror_tc_entry *mirror,
   613					   bool ingress);
   614		void	(*port_mirror_del)(struct dsa_switch *ds, int port,
   615					   struct dsa_mall_mirror_tc_entry *mirror);
   616		int	(*port_policer_add)(struct dsa_switch *ds, int port,
   617					    struct dsa_mall_policer_tc_entry *policer);
   618		void	(*port_policer_del)(struct dsa_switch *ds, int port);
   619		int	(*port_setup_tc)(struct dsa_switch *ds, int port,
   620					 enum tc_setup_type type, void *type_data);
   621	
   622		/*
   623		 * Cross-chip operations
   624		 */
   625		int	(*crosschip_bridge_join)(struct dsa_switch *ds, int tree_index,
   626						 int sw_index, int port,
   627						 struct net_device *br);
   628		void	(*crosschip_bridge_leave)(struct dsa_switch *ds, int tree_index,
   629						  int sw_index, int port,
   630						  struct net_device *br);
   631	
   632		/*
   633		 * PTP functionality
   634		 */
   635		int	(*port_hwtstamp_get)(struct dsa_switch *ds, int port,
   636					     struct ifreq *ifr);
   637		int	(*port_hwtstamp_set)(struct dsa_switch *ds, int port,
   638					     struct ifreq *ifr);
   639		bool	(*port_txtstamp)(struct dsa_switch *ds, int port,
   640					 struct sk_buff *clone, unsigned int type);
   641		bool	(*port_rxtstamp)(struct dsa_switch *ds, int port,
   642					 struct sk_buff *skb, unsigned int type);
   643	
   644		/* Devlink parameters, etc */
   645		int	(*devlink_param_get)(struct dsa_switch *ds, u32 id,
   646					     struct devlink_param_gset_ctx *ctx);
   647		int	(*devlink_param_set)(struct dsa_switch *ds, u32 id,
   648					     struct devlink_param_gset_ctx *ctx);
   649		int	(*devlink_info_get)(struct dsa_switch *ds,
   650					    struct devlink_info_req *req,
   651					    struct netlink_ext_ack *extack);
   652	
   653		/*
   654		 * MTU change functionality. Switches can also adjust their MRU through
   655		 * this method. By MTU, one understands the SDU (L2 payload) length.
   656		 * If the switch needs to account for the DSA tag on the CPU port, this
   657		 * method needs to do so privately.
   658		 */
   659		int	(*port_change_mtu)(struct dsa_switch *ds, int port,
   660					   int new_mtu);
   661		int	(*port_max_mtu)(struct dsa_switch *ds, int port);
   662	};
   663	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33741 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC, net-next 0/3] net: dsa: felix: frame preemption support
  2020-10-20  4:04 [RFC, net-next 0/3] net: dsa: felix: frame preemption support Xiaoliang Yang
                   ` (2 preceding siblings ...)
  2020-10-20  4:04 ` [RFC, net-next 3/3] net: dsa: felix: tc-taprio preempt set support Xiaoliang Yang
@ 2020-10-20 11:04 ` Vladimir Oltean
  3 siblings, 0 replies; 10+ messages in thread
From: Vladimir Oltean @ 2020-10-20 11:04 UTC (permalink / raw)
  To: Xiaoliang Yang
  Cc: davem, netdev, linux-kernel, vinicius.gomes, jhs, xiyou.wangcong,
	jiri, kuba, Jose.Abreu, allan.nielsen, joergen.andreasen,
	UNGLinuxDriver, Po Liu, Claudiu Manoil, Alexandru Marginean,
	Leo Li, Mingkai Hu

Hi Xiaoliang,

On Tue, Oct 20, 2020 at 12:04:55PM +0800, Xiaoliang Yang wrote:
> VSC9959 supports frame preemption according to 802.1qbu and 802.3br.
> This patch series use ethtool to enable and configure frame preemption,
> then use tc-taprio preempt set to mark the preempt queues and express
> queueus.
> 
> This series depends on series: "ethtool: Add support for frame preemption"
> link: http://patchwork.ozlabs.org/project/netdev/patch/20201012235642.1384318-2-vinicius.gomes@intel.com/
> 

Would you be so kind to also provide some feedback to Vinicius on that
series? It's important that we fully agree on the configuration/status
interface first, and that it is acceptable by everybody and gets merged.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC, net-next 2/3] net: dsa: felix: add preempt queues set support for vsc9959
  2020-10-20  4:04 ` [RFC, net-next 2/3] net: dsa: felix: add preempt queues set support for vsc9959 Xiaoliang Yang
  2020-10-20  6:24   ` kernel test robot
@ 2020-11-06 15:40   ` Vladimir Oltean
  1 sibling, 0 replies; 10+ messages in thread
From: Vladimir Oltean @ 2020-11-06 15:40 UTC (permalink / raw)
  To: Xiaoliang Yang
  Cc: davem, netdev, linux-kernel, vinicius.gomes, jhs, xiyou.wangcong,
	jiri, kuba, Jose.Abreu, allan.nielsen, joergen.andreasen,
	UNGLinuxDriver, po.liu, claudiu.manoil, alexandru.marginean,
	vladimir.oltean, leoyang.li, mingkai.hu

On Tue, Oct 20, 2020 at 12:04:57PM +0800, Xiaoliang Yang wrote:
> +static int vsc9959_port_get_preempt(struct ocelot *ocelot, int port,
> +				    struct ethtool_fp *fpcmd)
> +{
> +	struct ocelot_port *ocelot_port = ocelot->ports[port];
> +	u32 val;
> +
> +	val = ocelot_port_readl(ocelot_port, DEV_MM_VERIF_CONFIG);
> +	val &= DEV_MM_CONFIG_VERIF_CONFIG_PRM_VERIFY_DIS;
> +	fpcmd->enabled = (val ? 0 : 1);
> +
> +	val = ocelot_read(ocelot, QSYS_PREEMPTION_CFG);

You have a bug here. This should be:

	val = ocelot_read_rix(ocelot, QSYS_PREEMPTION_CFG, port);

otherwise you're always retrieving the frame preemption configuration of
port 0, regardless of the port passed as argument.

> +	fpcmd->min_frag_size_mult = QSYS_PREEMPTION_CFG_MM_ADD_FRAG_SIZE_X(val);
> +
> +	return 0;
> +}

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-11-06 15:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20  4:04 [RFC, net-next 0/3] net: dsa: felix: frame preemption support Xiaoliang Yang
2020-10-20  4:04 ` [RFC, net-next 1/3] net: dsa: ethtool preempt ops support on slave ports Xiaoliang Yang
2020-10-20  5:53   ` kernel test robot
2020-10-20  7:25   ` kernel test robot
2020-10-20  4:04 ` [RFC, net-next 2/3] net: dsa: felix: add preempt queues set support for vsc9959 Xiaoliang Yang
2020-10-20  6:24   ` kernel test robot
2020-11-06 15:40   ` Vladimir Oltean
2020-10-20  4:04 ` [RFC, net-next 3/3] net: dsa: felix: tc-taprio preempt set support Xiaoliang Yang
2020-10-20  6:52   ` kernel test robot
2020-10-20 11:04 ` [RFC, net-next 0/3] net: dsa: felix: frame preemption support Vladimir Oltean

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.