Documentation/networking/device_drivers/ethernet/ti/cpsw_switchdev.rst

Source file repositories/reference/linux-study-clean/Documentation/networking/device_drivers/ethernet/ti/cpsw_switchdev.rst

File Facts

System
Linux kernel
Corpus path
Documentation/networking/device_drivers/ethernet/ti/cpsw_switchdev.rst
Extension
.rst
Size
6416 bytes
Lines
243
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

.. SPDX-License-Identifier: GPL-2.0

======================================================
Texas Instruments CPSW switchdev based ethernet driver
======================================================

:Version: 2.0

Port renaming
=============

On older udev versions renaming of ethX to swXpY will not be automatically
supported

In order to rename via udev::

    ip -d link show dev sw0p1 | grep switchid

    SUBSYSTEM=="net", ACTION=="add", ATTR{phys_switch_id}==<switchid>, \
	    ATTR{phys_port_name}!="", NAME="sw0$attr{phys_port_name}"


Dual mac mode
=============

- The new (cpsw_new.c) driver is operating in dual-emac mode by default, thus
  working as 2 individual network interfaces. Main differences from legacy CPSW
  driver are:

 - optimized promiscuous mode: The P0_UNI_FLOOD (both ports) is enabled in
   addition to ALLMULTI (current port) instead of ALE_BYPASS.
   So, Ports in promiscuous mode will keep possibility of mcast and vlan
   filtering, which is provides significant benefits when ports are joined
   to the same bridge, but without enabling "switch" mode, or to different
   bridges.
 - learning disabled on ports as it make not too much sense for
   segregated ports - no forwarding in HW.
 - enabled basic support for devlink.

   ::

	devlink dev show
		platform/48484000.switch

	devlink dev param show
	platform/48484000.switch:
	name switch_mode type driver-specific
	values:
		cmode runtime value false
	name ale_bypass type driver-specific
	values:
		cmode runtime value false

Devlink configuration parameters
================================

See Documentation/networking/devlink/ti-cpsw-switch.rst

Bridging in dual mac mode
=========================

The dual_mac mode requires two vids to be reserved for internal purposes,
which, by default, equal CPSW Port numbers. As result, bridge has to be
configured in vlan unaware mode or default_pvid has to be adjusted::

	ip link add name br0 type bridge
	ip link set dev br0 type bridge vlan_filtering 0
	echo 0 > /sys/class/net/br0/bridge/default_pvid
	ip link set dev sw0p1 master br0
	ip link set dev sw0p2 master br0

Annotation

Implementation Notes