All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v7 00/16] net: dsa: vsc73xx: Make vsc73xx usable
@ 2024-03-25 20:43 Pawel Dembicki
  2024-03-25 20:43 ` [PATCH net-next v7 01/16] net: dsa: vsc73xx: use read_poll_timeout instead delay loop Pawel Dembicki
                   ` (15 more replies)
  0 siblings, 16 replies; 22+ messages in thread
From: Pawel Dembicki @ 2024-03-25 20:43 UTC (permalink / raw)
  To: netdev
  Cc: Linus Walleij, Simon Horman, Pawel Dembicki, Andrew Lunn,
	Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Claudiu Manoil, Alexandre Belloni,
	UNGLinuxDriver, Russell King, linux-kernel

This patch series focuses on making vsc73xx usable.

The first patch was added in v2; it switches from a poll loop to
read_poll_timeout.

The second patch is a simple conversion to phylink because adjust_link
won't work anymore.

The third patch is preparation for future use. Using the
"phy_interface_mode_is_rgmii" macro allows for the proper recognition
of all RGMII modes.

Patches 4-5 involve some cleanup: The fourth patch introduces
a definition with the maximum number of ports to avoid using
magic numbers. The next one fills in documentation.

The sixth patch implements port state configuration, which is required
for bridge functionality. STP frames are not forwarded at this moment.
BPDU frames are only forwarded from/to the PI/SI interface.
For more information, see chapter 2.7.1 (CPU Forwarding) in the
datasheet.

Patches 7, 12-15 provide a basic implementation of tag_8021q
functionality with QinQ support, without VLAN filtering in
the bridge and simple VLAN awareness in VLAN filtering mode.

Patches 8-11 came from Vladimir Oltean. They prepare for making
tag8021q more common. VSC73XX uses very similar tag recognition,
and some code from tag_sja1105 could be moved to tag_8021q for
common use.

Patch 16 is required to avoid problem with learning on standalone ports.

Pawel Dembicki (12):
  net: dsa: vsc73xx: use read_poll_timeout instead delay loop
  net: dsa: vsc73xx: convert to PHYLINK
  net: dsa: vsc73xx: use macros for rgmii recognition
  net: dsa: vsc73xx: Add define for max num of ports
  net: dsa: vsc73xx: add structure descriptions
  net: dsa: vsc73xx: add port_stp_state_set function
  net: dsa: vsc73xx: Add vlan filtering
  net: dsa: vsc73xx: introduce tag 8021q for vsc73xx
  net: dsa: vsc73xx: Implement the tag_8021q VLAN operations
  net: dsa: Define max num of bridges in tag8021q implementation
  net: dsa: vsc73xx: Add bridge support
  net: dsa: vsc73xx: start treating the BR_LEARNING flag

Vladimir Oltean (4):
  net: dsa: tag_sja1105: absorb logic for not overwriting precise info
    into dsa_8021q_rcv()
  net: dsa: tag_sja1105: absorb entire sja1105_vlan_rcv() into
    dsa_8021q_rcv()
  net: dsa: tag_sja1105: prefer precise source port info on SJA1110 too
  net: dsa: tag_sja1105: refactor skb->dev assignment to
    dsa_tag_8021q_find_user()

 drivers/net/dsa/Kconfig                |   2 +-
 drivers/net/dsa/sja1105/sja1105_main.c |   3 +-
 drivers/net/dsa/vitesse-vsc73xx-core.c | 977 +++++++++++++++++++++----
 drivers/net/dsa/vitesse-vsc73xx.h      |  69 +-
 include/linux/dsa/8021q.h              |   5 +
 include/net/dsa.h                      |   2 +
 net/dsa/Kconfig                        |   6 +
 net/dsa/Makefile                       |   1 +
 net/dsa/tag_8021q.c                    |  81 +-
 net/dsa/tag_8021q.h                    |   7 +-
 net/dsa/tag_ocelot_8021q.c             |   2 +-
 net/dsa/tag_sja1105.c                  |  72 +-
 net/dsa/tag_vsc73xx_8021q.c            |  68 ++
 13 files changed, 1072 insertions(+), 223 deletions(-)
 create mode 100644 net/dsa/tag_vsc73xx_8021q.c

-- 
2.34.1


^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [PATCH net-next v7 07/16] net: dsa: vsc73xx: Add vlan filtering
@ 2024-04-02 17:34 kernel test robot
  0 siblings, 0 replies; 22+ messages in thread
From: kernel test robot @ 2024-04-02 17:34 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20240325204344.2298241-8-paweldembicki@gmail.com>
References: <20240325204344.2298241-8-paweldembicki@gmail.com>
TO: Pawel Dembicki <paweldembicki@gmail.com>
TO: netdev@vger.kernel.org
CC: Linus Walleij <linus.walleij@linaro.org>
CC: Simon Horman <horms@kernel.org>
CC: Pawel Dembicki <paweldembicki@gmail.com>
CC: Andrew Lunn <andrew@lunn.ch>
CC: Florian Fainelli <f.fainelli@gmail.com>
CC: Vladimir Oltean <olteanv@gmail.com>
CC: Eric Dumazet <edumazet@google.com>
CC: Jakub Kicinski <kuba@kernel.org>
CC: Paolo Abeni <pabeni@redhat.com>
CC: Claudiu Manoil <claudiu.manoil@nxp.com>
CC: Alexandre Belloni <alexandre.belloni@bootlin.com>
CC: UNGLinuxDriver@microchip.com
CC: Russell King <linux@armlinux.org.uk>
CC: linux-kernel@vger.kernel.org

Hi Pawel,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Pawel-Dembicki/net-dsa-vsc73xx-use-read_poll_timeout-instead-delay-loop/20240326-053458
base:   net-next/main
patch link:    https://lore.kernel.org/r/20240325204344.2298241-8-paweldembicki%40gmail.com
patch subject: [PATCH net-next v7 07/16] net: dsa: vsc73xx: Add vlan filtering
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago
config: i386-randconfig-141-20240402 (https://download.01.org/0day-ci/archive/20240403/202404030102.Tv5bGJdv-lkp@intel.com/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202404030102.Tv5bGJdv-lkp@intel.com/

smatch warnings:
drivers/net/dsa/vitesse-vsc73xx-core.c:1455 vsc73xx_port_vlan_add() error: uninitialized symbol 'ret'.

vim +/ret +1455 drivers/net/dsa/vitesse-vsc73xx-core.c

cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1380  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1381  static int vsc73xx_port_vlan_add(struct dsa_switch *ds, int port,
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1382  				 const struct switchdev_obj_port_vlan *vlan,
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1383  				 struct netlink_ext_ack *extack)
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1384  {
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1385  	bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1386  	bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1387  	struct dsa_port *dp = dsa_to_port(ds, port);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1388  	enum vsc73xx_port_vlan_conf port_vlan_conf;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1389  	struct vsc73xx_bridge_vlan *vsc73xx_vlan;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1390  	struct vsc73xx_vlan_summary summary;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1391  	struct vsc73xx *vsc = ds->priv;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1392  	bool operate_on_storage;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1393  	int ret;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1394  	u16 vid;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1395  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1396  	/* Be sure to deny alterations to the configuration done by tag_8021q.
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1397  	 */
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1398  	if (vid_is_dsa_8021q(vlan->vid)) {
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1399  		NL_SET_ERR_MSG_MOD(extack,
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1400  				   "Range 3072-4095 reserved for dsa_8021q operation");
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1401  		return -EBUSY;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1402  	}
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1403  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1404  	/* The processed vlan->vid is excluded from the search because the VLAN
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1405  	 * can be re-added with a different set of flags, so it's easiest to
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1406  	 * ignore its old flags from the VLAN database software copy.
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1407  	 */
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1408  	vsc73xx_bridge_vlan_summary(vsc, port, &summary, vlan->vid);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1409  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1410  	/* VSC73XX allow only three untagged states: none, one or all */
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1411  	if ((untagged && summary.num_tagged > 0 && summary.num_untagged > 0) ||
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1412  	    (!untagged && summary.num_untagged > 1)) {
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1413  		NL_SET_ERR_MSG_MOD(extack,
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1414  				   "Port can have only none, one or all untagged vlan");
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1415  		return -EBUSY;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1416  	}
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1417  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1418  	vsc73xx_vlan = vsc73xx_bridge_vlan_find(vsc, vlan->vid);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1419  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1420  	if (!vsc73xx_vlan) {
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1421  		vsc73xx_vlan = kzalloc(sizeof(*vsc73xx_vlan), GFP_KERNEL);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1422  		if (!vsc73xx_vlan)
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1423  			return -ENOMEM;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1424  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1425  		vsc73xx_vlan->vid = vlan->vid;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1426  		vsc73xx_vlan->portmask = 0;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1427  		vsc73xx_vlan->untagged = 0;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1428  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1429  		INIT_LIST_HEAD(&vsc73xx_vlan->list);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1430  		list_add_tail(&vsc73xx_vlan->list, &vsc->vlans);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1431  	}
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1432  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1433  	vsc73xx_vlan->portmask |= BIT(port);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1434  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1435  	if (untagged)
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1436  		vsc73xx_vlan->untagged |= BIT(port);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1437  	else
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1438  		vsc73xx_vlan->untagged &= ~BIT(port);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1439  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1440  	/* CPU port must be always tagged because port separation is based on
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1441  	 * tag_8021q.
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1442  	 */
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1443  	if (port == CPU_PORT)
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1444  		goto update_vlan_table;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1445  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1446  	operate_on_storage = vsc73xx_tag_8021q_active(dp);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1447  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1448  	if (pvid)
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1449  		ret = vsc73xx_vlan_set_pvid(vsc, port, vlan->vid,
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1450  					    operate_on_storage, false);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1451  	else if (vsc73xx_port_get_pvid(vsc, port, &vid, false) &&
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1452  		 vid == vlan->vid)
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1453  		ret = vsc73xx_vlan_clear_pvid(vsc, port, operate_on_storage,
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1454  					      false);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25 @1455  	if (ret)
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1456  		goto err;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1457  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1458  	if (operate_on_storage)
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1459  		goto update_vlan_table;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1460  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1461  	port_vlan_conf = VSC73XX_VLAN_FILTER;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1462  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1463  	if (summary.num_tagged == 0 && untagged)
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1464  		port_vlan_conf = VSC73XX_VLAN_FILTER_UNTAG_ALL;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1465  	vsc73xx_set_vlan_conf(vsc, port, port_vlan_conf);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1466  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1467  	if (port_vlan_conf == VSC73XX_VLAN_FILTER_UNTAG_ALL)
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1468  		goto update_vlan_table;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1469  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1470  	if (untagged) {
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1471  		ret = vsc73xx_vlan_set_untagged_hw(vsc, port, vlan->vid);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1472  	} else if (summary.num_untagged == 1) {
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1473  		vid = vsc73xx_find_first_vlan_untagged(vsc, port);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1474  		ret = vsc73xx_vlan_set_untagged_hw(vsc, port, vid);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1475  	}
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1476  	if (ret)
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1477  		goto err;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1478  
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1479  update_vlan_table:
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1480  	ret = vsc73xx_update_vlan_table(vsc, port, vlan->vid, true);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1481  	if (!ret)
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1482  		return 0;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1483  err:
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1484  	list_del(&vsc73xx_vlan->list);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1485  	kfree(vsc73xx_vlan);
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1486  	return ret;
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1487  }
cb0eaf3f8563b0 Pawel Dembicki 2024-03-25  1488  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2024-04-03  7:59 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-25 20:43 [PATCH net-next v7 00/16] net: dsa: vsc73xx: Make vsc73xx usable Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 01/16] net: dsa: vsc73xx: use read_poll_timeout instead delay loop Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 02/16] net: dsa: vsc73xx: convert to PHYLINK Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 03/16] net: dsa: vsc73xx: use macros for rgmii recognition Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 04/16] net: dsa: vsc73xx: Add define for max num of ports Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 05/16] net: dsa: vsc73xx: add structure descriptions Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 06/16] net: dsa: vsc73xx: add port_stp_state_set function Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 07/16] net: dsa: vsc73xx: Add vlan filtering Pawel Dembicki
2024-03-26 11:03   ` Simon Horman
2024-03-28  1:31   ` kernel test robot
2024-04-03  7:59   ` Dan Carpenter
2024-03-25 20:43 ` [PATCH net-next v7 08/16] net: dsa: tag_sja1105: absorb logic for not overwriting precise info into dsa_8021q_rcv() Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 09/16] net: dsa: tag_sja1105: absorb entire sja1105_vlan_rcv() " Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 10/16] net: dsa: tag_sja1105: prefer precise source port info on SJA1110 too Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 11/16] net: dsa: tag_sja1105: refactor skb->dev assignment to dsa_tag_8021q_find_user() Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 12/16] net: dsa: vsc73xx: introduce tag 8021q for vsc73xx Pawel Dembicki
2024-04-02 13:29   ` Linus Walleij
2024-03-25 20:43 ` [PATCH net-next v7 13/16] net: dsa: vsc73xx: Implement the tag_8021q VLAN operations Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 14/16] net: dsa: Define max num of bridges in tag8021q implementation Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 15/16] net: dsa: vsc73xx: Add bridge support Pawel Dembicki
2024-03-25 20:43 ` [PATCH net-next v7 16/16] net: dsa: vsc73xx: start treating the BR_LEARNING flag Pawel Dembicki
  -- strict thread matches above, loose matches on Subject: below --
2024-04-02 17:34 [PATCH net-next v7 07/16] net: dsa: vsc73xx: Add vlan filtering kernel test robot

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.