Commit 075e3d30 authored by Pawel Dembicki's avatar Pawel Dembicki Committed by Paolo Abeni

net: dsa: vsc73xx: implement FDB operations

This commit introduces implementations of three functions:
.port_fdb_dump
.port_fdb_add
.port_fdb_del

The FDB database organization is the same as in other old Vitesse chips:
It has 2048 rows and 4 columns (buckets). The row index is calculated by
the hash function 'vsc73xx_calc_hash' and the FDB entry must be placed
exactly into row[hash]. The chip selects the bucket number by itself.
Signed-off-by: default avatarPawel Dembicki <paweldembicki@gmail.com>
Link: https://patch.msgid.link/20240827123938.582789-1-paweldembicki@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent da4f3b72
This diff is collapsed.
...@@ -45,6 +45,7 @@ struct vsc73xx_portinfo { ...@@ -45,6 +45,7 @@ struct vsc73xx_portinfo {
* @vlans: List of configured vlans. Contains port mask and untagged status of * @vlans: List of configured vlans. Contains port mask and untagged status of
* every vlan configured in port vlan operation. It doesn't cover tag_8021q * every vlan configured in port vlan operation. It doesn't cover tag_8021q
* vlans. * vlans.
* @fdb_lock: Mutex protects fdb access
*/ */
struct vsc73xx { struct vsc73xx {
struct device *dev; struct device *dev;
...@@ -57,6 +58,7 @@ struct vsc73xx { ...@@ -57,6 +58,7 @@ struct vsc73xx {
void *priv; void *priv;
struct vsc73xx_portinfo portinfo[VSC73XX_MAX_NUM_PORTS]; struct vsc73xx_portinfo portinfo[VSC73XX_MAX_NUM_PORTS];
struct list_head vlans; struct list_head vlans;
struct mutex fdb_lock;
}; };
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment