realtek: otto_table: add the RTL9310 L3 table descriptors

The RTL9310 L3 tables all sit on the table access register that is
already OTTO_REG_9310_2, the one LAG and PORT_ISO_CTRL use, and none of
them is wider than its six word data window, so they need no new access
register - only these descriptors.

Type, width and row count come from the Realtek GPL SDK's own metadata:
rtk_mango_table_list[] describes every table as plain data, 24 bytes
each, {access set, type, rows, words, field count, field array}. Reading
the same array for the RTL9300 (rtk_longan_table_list[]) reproduces the
type, width and row count of all six L3 tables already defined here,
host route included with its 6144 rows, which is what says the array is
being read right.

The row counts are address spaces rather than usable entries, as on the
RTL9300: the host and prefix route tables overlay the flow table, whose
FT_L3_HASH and FT_L3_TCAM views carry the same type and width.

Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/26192
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
This commit is contained in:
Carlo Szelinsky authored and Markus Stockhausen committed 2026-10-25 21:35:35 +01:00
1 parent 9154fd858f
commit 6c9452a35b
2 files changed
+19

No files matched your search

@@ -257,6 +257,18 @@ static const struct otto_table_map otto_table_maps[OTTO_TBL_COUNT] = {
TBL_MAP(RTL9310_TBL_LAG, OTTO_REG_9310_2, 0, 3, 128, 0),
TBL_MAP(RTL9310_TBL_PORT_ISO_CTRL, OTTO_REG_9310_2, 1, 2, 1024, 0),
/* The L3 tables share this access register with the two above. Their
* row counts are address spaces: the host and prefix route tables
* overlay the flow table, whose RTL9310_TBL_FT_L3_* views carry the
* same type and width (Realtek GPL SDK, rtk_mango_table_list).
*/
TBL_MAP(RTL9310_TBL_L3_ROUTER_MAC, OTTO_REG_9310_2, 2, 5, 1024, 0),
TBL_MAP(RTL9310_TBL_L3_HOST_ROUTE_IPUC, OTTO_REG_9310_2, 3, 4, 12288, 0),
TBL_MAP(RTL9310_TBL_L3_PREFIX_ROUTE_IPUC, OTTO_REG_9310_2, 4, 6, 12288, 0),
TBL_MAP(RTL9310_TBL_L3_NEXTHOP, OTTO_REG_9310_2, 6, 1, 8192, 0),
TBL_MAP(RTL9310_TBL_L3_IGR_INTF, OTTO_REG_9310_2, 7, 2, 1024, 0),
TBL_MAP(RTL9310_TBL_L3_EGR_INTF, OTTO_REG_9310_2, 8, 4, 1024, 0),
TBL_MAP(RTL9310_TBL_VLAN_UNTAG, OTTO_REG_9310_3, 0, 2, 4096, 0),
TBL_MAP(RTL9310_TBL_STAT_PORT_MIB_CNTR, OTTO_REG_9310_5, 0, 53, 57, 0),
@@ -145,6 +145,13 @@ enum otto_table_id {
RTL9310_TBL_LAG,
RTL9310_TBL_PORT_ISO_CTRL,
RTL9310_TBL_L3_ROUTER_MAC,
RTL9310_TBL_L3_HOST_ROUTE_IPUC,
RTL9310_TBL_L3_PREFIX_ROUTE_IPUC,
RTL9310_TBL_L3_NEXTHOP,
RTL9310_TBL_L3_IGR_INTF,
RTL9310_TBL_L3_EGR_INTF,
RTL9310_TBL_VLAN_UNTAG,
RTL9310_TBL_STAT_PORT_MIB_CNTR,