tc.h (b4da4235dc69427fbdb66c9fbdf094ac76cdf745) tc.h (7e5e7d800011adf4aeda615f8a1bc31c0c1e2bb9)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/****************************************************************************
3 * Driver for Solarflare network controllers and boards
4 * Copyright 2019 Solarflare Communications Inc.
5 * Copyright 2020-2022 Xilinx Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published

--- 22 unchanged lines hidden (view full) ---

31 u16 vlan_push:2;
32 u16 vlan_pop:2;
33 u16 decap:1;
34 u16 deliver:1;
35 __be16 vlan_tci[2]; /* TCIs for vlan_push */
36 __be16 vlan_proto[2]; /* Ethertypes for vlan_push */
37 struct efx_tc_counter_index *count;
38 struct efx_tc_encap_action *encap_md; /* entry in tc_encap_ht table */
1/* SPDX-License-Identifier: GPL-2.0-only */
2/****************************************************************************
3 * Driver for Solarflare network controllers and boards
4 * Copyright 2019 Solarflare Communications Inc.
5 * Copyright 2020-2022 Xilinx Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published

--- 22 unchanged lines hidden (view full) ---

31 u16 vlan_push:2;
32 u16 vlan_pop:2;
33 u16 decap:1;
34 u16 deliver:1;
35 __be16 vlan_tci[2]; /* TCIs for vlan_push */
36 __be16 vlan_proto[2]; /* Ethertypes for vlan_push */
37 struct efx_tc_counter_index *count;
38 struct efx_tc_encap_action *encap_md; /* entry in tc_encap_ht table */
39 struct list_head encap_user; /* entry on encap_md->users list */
40 struct efx_tc_action_set_list *user; /* Only populated if encap_md */
39 u32 dest_mport;
40 u32 fw_id; /* index of this entry in firmware actions table */
41 struct list_head list;
42};
43
44struct efx_tc_match_fields {
45 /* L1 */
46 u32 ingress_port;

--- 99 unchanged lines hidden (view full) ---

146 * @caps: MAE capabilities reported by MCDI
147 * @block_list: List of &struct efx_tc_block_binding
148 * @mutex: Used to serialise operations on TC hashtables
149 * @counter_ht: Hashtable of TC counters (FW IDs and counter values)
150 * @counter_id_ht: Hashtable mapping TC counter cookies to counters
151 * @encap_ht: Hashtable of TC encap actions
152 * @encap_match_ht: Hashtable of TC encap matches
153 * @match_action_ht: Hashtable of TC match-action rules
41 u32 dest_mport;
42 u32 fw_id; /* index of this entry in firmware actions table */
43 struct list_head list;
44};
45
46struct efx_tc_match_fields {
47 /* L1 */
48 u32 ingress_port;

--- 99 unchanged lines hidden (view full) ---

148 * @caps: MAE capabilities reported by MCDI
149 * @block_list: List of &struct efx_tc_block_binding
150 * @mutex: Used to serialise operations on TC hashtables
151 * @counter_ht: Hashtable of TC counters (FW IDs and counter values)
152 * @counter_id_ht: Hashtable mapping TC counter cookies to counters
153 * @encap_ht: Hashtable of TC encap actions
154 * @encap_match_ht: Hashtable of TC encap matches
155 * @match_action_ht: Hashtable of TC match-action rules
156 * @neigh_ht: Hashtable of neighbour watches (&struct efx_neigh_binder)
154 * @reps_mport_id: MAE port allocated for representor RX
155 * @reps_filter_uc: VNIC filter for representor unicast RX (promisc)
156 * @reps_filter_mc: VNIC filter for representor multicast RX (allmulti)
157 * @reps_mport_vport_id: vport_id for representor RX filters
158 * @flush_counters: counters have been stopped, waiting for drain
159 * @flush_gen: final generation count per type array as reported by
160 * MC_CMD_MAE_COUNTERS_STREAM_STOP
161 * @seen_gen: most recent generation count per type as seen by efx_tc_rx()

--- 14 unchanged lines hidden (view full) ---

176 struct mae_caps *caps;
177 struct list_head block_list;
178 struct mutex mutex;
179 struct rhashtable counter_ht;
180 struct rhashtable counter_id_ht;
181 struct rhashtable encap_ht;
182 struct rhashtable encap_match_ht;
183 struct rhashtable match_action_ht;
157 * @reps_mport_id: MAE port allocated for representor RX
158 * @reps_filter_uc: VNIC filter for representor unicast RX (promisc)
159 * @reps_filter_mc: VNIC filter for representor multicast RX (allmulti)
160 * @reps_mport_vport_id: vport_id for representor RX filters
161 * @flush_counters: counters have been stopped, waiting for drain
162 * @flush_gen: final generation count per type array as reported by
163 * MC_CMD_MAE_COUNTERS_STREAM_STOP
164 * @seen_gen: most recent generation count per type as seen by efx_tc_rx()

--- 14 unchanged lines hidden (view full) ---

179 struct mae_caps *caps;
180 struct list_head block_list;
181 struct mutex mutex;
182 struct rhashtable counter_ht;
183 struct rhashtable counter_id_ht;
184 struct rhashtable encap_ht;
185 struct rhashtable encap_match_ht;
186 struct rhashtable match_action_ht;
187 struct rhashtable neigh_ht;
184 u32 reps_mport_id, reps_mport_vport_id;
185 s32 reps_filter_uc, reps_filter_mc;
186 bool flush_counters;
187 u32 flush_gen[EFX_TC_COUNTER_TYPE_MAX];
188 u32 seen_gen[EFX_TC_COUNTER_TYPE_MAX];
189 wait_queue_head_t flush_wq;
190 struct {
191 struct efx_tc_flow_rule pf;

--- 4 unchanged lines hidden (view full) ---

196 struct efx_tc_action_set_list reps;
197 } facts;
198 bool up;
199};
200
201struct efx_rep;
202
203enum efx_encap_type efx_tc_indr_netdev_type(struct net_device *net_dev);
188 u32 reps_mport_id, reps_mport_vport_id;
189 s32 reps_filter_uc, reps_filter_mc;
190 bool flush_counters;
191 u32 flush_gen[EFX_TC_COUNTER_TYPE_MAX];
192 u32 seen_gen[EFX_TC_COUNTER_TYPE_MAX];
193 wait_queue_head_t flush_wq;
194 struct {
195 struct efx_tc_flow_rule pf;

--- 4 unchanged lines hidden (view full) ---

200 struct efx_tc_action_set_list reps;
201 } facts;
202 bool up;
203};
204
205struct efx_rep;
206
207enum efx_encap_type efx_tc_indr_netdev_type(struct net_device *net_dev);
208struct efx_rep *efx_tc_flower_lookup_efv(struct efx_nic *efx,
209 struct net_device *dev);
210s64 efx_tc_flower_external_mport(struct efx_nic *efx, struct efx_rep *efv);
204int efx_tc_configure_default_rule_rep(struct efx_rep *efv);
205void efx_tc_deconfigure_default_rule(struct efx_nic *efx,
206 struct efx_tc_flow_rule *rule);
207int efx_tc_flower(struct efx_nic *efx, struct net_device *net_dev,
208 struct flow_cls_offload *tc, struct efx_rep *efv);
209
210int efx_tc_insert_rep_filters(struct efx_nic *efx);
211void efx_tc_remove_rep_filters(struct efx_nic *efx);
212
213int efx_init_tc(struct efx_nic *efx);
214void efx_fini_tc(struct efx_nic *efx);
215
216int efx_init_struct_tc(struct efx_nic *efx);
217void efx_fini_struct_tc(struct efx_nic *efx);
218
219#endif /* EFX_TC_H */
211int efx_tc_configure_default_rule_rep(struct efx_rep *efv);
212void efx_tc_deconfigure_default_rule(struct efx_nic *efx,
213 struct efx_tc_flow_rule *rule);
214int efx_tc_flower(struct efx_nic *efx, struct net_device *net_dev,
215 struct flow_cls_offload *tc, struct efx_rep *efv);
216
217int efx_tc_insert_rep_filters(struct efx_nic *efx);
218void efx_tc_remove_rep_filters(struct efx_nic *efx);
219
220int efx_init_tc(struct efx_nic *efx);
221void efx_fini_tc(struct efx_nic *efx);
222
223int efx_init_struct_tc(struct efx_nic *efx);
224void efx_fini_struct_tc(struct efx_nic *efx);
225
226#endif /* EFX_TC_H */