net: microchip: sparx5: Add TC template list to a port
authorSteen Hegelund <steen.hegelund@microchip.com>
Tue, 7 Mar 2023 13:41:01 +0000 (14:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Mar 2023 13:19:43 +0000 (13:19 +0000)
This adds a list that is used to collect the templates that are active on a
port.

This allows the template creation to change the port configuration
and the template destruction to change it back.

Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/microchip/sparx5/sparx5_main.c
drivers/net/ethernet/microchip/sparx5/sparx5_main.h

index 42b77ba9b5721ebe20e8c0ef22a2ec3aa3c69012..a7edf524eedbc9b0bdb38c735ffa3316a7cd03f3 100644 (file)
@@ -282,6 +282,7 @@ static int sparx5_create_port(struct sparx5 *sparx5,
        spx5_port->phylink_pcs.poll = true;
        spx5_port->phylink_pcs.ops = &sparx5_phylink_pcs_ops;
        spx5_port->is_mrouter = false;
+       INIT_LIST_HEAD(&spx5_port->tc_templates);
        sparx5->ports[config->portno] = spx5_port;
 
        err = sparx5_port_init(sparx5, spx5_port, &config->conf);
index 72e7928912eb11fbd8b33e458d76554ef6d80c18..62c85463b634e49562a6ac4d05ee9886aed58356 100644 (file)
@@ -192,6 +192,7 @@ struct sparx5_port {
        u16 ts_id;
        struct sk_buff_head tx_skbs;
        bool is_mrouter;
+       struct list_head tc_templates; /* list of TC templates on this port */
 };
 
 enum sparx5_core_clockfreq {