tc.h (57390019b68b83f96eb98f490367b9df1f2d77cb) tc.h (0c7fe3b3720ed59219ba3d8079eddc719cb36b35)
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

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

43struct efx_tc_encap_action; /* see tc_encap_actions.h */
44
45/**
46 * struct efx_tc_action_set - collection of tc action fields
47 *
48 * @vlan_push: the number of vlan headers to push
49 * @vlan_pop: the number of vlan headers to pop
50 * @decap: used to indicate a tunnel header decapsulation should take place
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

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

43struct efx_tc_encap_action; /* see tc_encap_actions.h */
44
45/**
46 * struct efx_tc_action_set - collection of tc action fields
47 *
48 * @vlan_push: the number of vlan headers to push
49 * @vlan_pop: the number of vlan headers to pop
50 * @decap: used to indicate a tunnel header decapsulation should take place
51 * @do_nat: perform NAT/NPT with values returned by conntrack match
51 * @do_ttl_dec: used to indicate IP TTL / Hop Limit should be decremented
52 * @deliver: used to indicate a deliver action should take place
53 * @vlan_tci: tci fields for vlan push actions
54 * @vlan_proto: ethernet types for vlan push actions
55 * @count: counter mapping
56 * @encap_md: encap entry in tc_encap_ht table
57 * @encap_user: linked list of encap users (encap_md->users)
58 * @user: owning action-set-list. Only populated if @encap_md is; used by efx_tc_update_encap() fallback handling

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

63 * @fw_id: index of this entry in firmware actions table
64 * @list: linked list of tc actions
65 *
66 */
67struct efx_tc_action_set {
68 u16 vlan_push:2;
69 u16 vlan_pop:2;
70 u16 decap:1;
52 * @do_ttl_dec: used to indicate IP TTL / Hop Limit should be decremented
53 * @deliver: used to indicate a deliver action should take place
54 * @vlan_tci: tci fields for vlan push actions
55 * @vlan_proto: ethernet types for vlan push actions
56 * @count: counter mapping
57 * @encap_md: encap entry in tc_encap_ht table
58 * @encap_user: linked list of encap users (encap_md->users)
59 * @user: owning action-set-list. Only populated if @encap_md is; used by efx_tc_update_encap() fallback handling

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

64 * @fw_id: index of this entry in firmware actions table
65 * @list: linked list of tc actions
66 *
67 */
68struct efx_tc_action_set {
69 u16 vlan_push:2;
70 u16 vlan_pop:2;
71 u16 decap:1;
72 u16 do_nat:1;
71 u16 do_ttl_dec:1;
72 u16 deliver:1;
73 __be16 vlan_tci[2];
74 __be16 vlan_proto[2];
75 struct efx_tc_counter_index *count;
76 struct efx_tc_encap_action *encap_md;
77 struct list_head encap_user;
78 struct efx_tc_action_set_list *user;

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

135 * @EFX_TC_EM_DIRECT: real HW entry in Outer Rule table; not a pseudo.
136 * Hardware index in &struct efx_tc_encap_match.fw_id is valid.
137 * @EFX_TC_EM_PSEUDO_MASK: registered by an encap match which includes a
138 * match on an optional field (currently ip_tos and/or udp_sport),
139 * to prevent an overlapping encap match _without_ optional fields.
140 * The pseudo encap match may be referenced again by an encap match
141 * with different values for these fields, but all masks must match the
142 * first (stored in our child_* fields).
73 u16 do_ttl_dec:1;
74 u16 deliver:1;
75 __be16 vlan_tci[2];
76 __be16 vlan_proto[2];
77 struct efx_tc_counter_index *count;
78 struct efx_tc_encap_action *encap_md;
79 struct list_head encap_user;
80 struct efx_tc_action_set_list *user;

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

137 * @EFX_TC_EM_DIRECT: real HW entry in Outer Rule table; not a pseudo.
138 * Hardware index in &struct efx_tc_encap_match.fw_id is valid.
139 * @EFX_TC_EM_PSEUDO_MASK: registered by an encap match which includes a
140 * match on an optional field (currently ip_tos and/or udp_sport),
141 * to prevent an overlapping encap match _without_ optional fields.
142 * The pseudo encap match may be referenced again by an encap match
143 * with different values for these fields, but all masks must match the
144 * first (stored in our child_* fields).
145 * @EFX_TC_EM_PSEUDO_OR: registered by an fLHS rule that fits in the OR
146 * table. The &struct efx_tc_lhs_rule already holds the HW OR entry.
147 * Only one reference to this encap match may exist.
143 */
144enum efx_tc_em_pseudo_type {
145 EFX_TC_EM_DIRECT,
146 EFX_TC_EM_PSEUDO_MASK,
148 */
149enum efx_tc_em_pseudo_type {
150 EFX_TC_EM_DIRECT,
151 EFX_TC_EM_PSEUDO_MASK,
152 EFX_TC_EM_PSEUDO_OR,
147};
148
149struct efx_tc_encap_match {
150 __be32 src_ip, dst_ip;
151 struct in6_addr src_ip6, dst_ip6;
152 __be16 udp_dport;
153 __be16 udp_sport, udp_sport_mask;
154 u8 ip_tos, ip_tos_mask;

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

178};
179
180struct efx_tc_action_set_list {
181 struct list_head list;
182 u32 fw_id;
183};
184
185struct efx_tc_lhs_action {
153};
154
155struct efx_tc_encap_match {
156 __be32 src_ip, dst_ip;
157 struct in6_addr src_ip6, dst_ip6;
158 __be16 udp_dport;
159 __be16 udp_sport, udp_sport_mask;
160 u8 ip_tos, ip_tos_mask;

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

184};
185
186struct efx_tc_action_set_list {
187 struct list_head list;
188 u32 fw_id;
189};
190
191struct efx_tc_lhs_action {
192 enum efx_encap_type tun_type;
186 struct efx_tc_recirc_id *rid;
187 struct efx_tc_ct_zone *zone;
188 struct efx_tc_counter_index *count;
189};
190
191struct efx_tc_flow_rule {
192 unsigned long cookie;
193 struct rhash_head linkage;

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

198};
199
200struct efx_tc_lhs_rule {
201 unsigned long cookie;
202 struct efx_tc_match match;
203 struct efx_tc_lhs_action lhs_act;
204 struct rhash_head linkage;
205 u32 fw_id;
193 struct efx_tc_recirc_id *rid;
194 struct efx_tc_ct_zone *zone;
195 struct efx_tc_counter_index *count;
196};
197
198struct efx_tc_flow_rule {
199 unsigned long cookie;
200 struct rhash_head linkage;

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

205};
206
207struct efx_tc_lhs_rule {
208 unsigned long cookie;
209 struct efx_tc_match match;
210 struct efx_tc_lhs_action lhs_act;
211 struct rhash_head linkage;
212 u32 fw_id;
213 bool is_ar; /* Action Rule (for OR-AR-CT-AR sequence) */
206};
207
208enum efx_tc_rule_prios {
209 EFX_TC_PRIO_TC, /* Rule inserted by TC */
210 EFX_TC_PRIO_DFLT, /* Default switch rule; one of efx_tc_default_rules */
211 EFX_TC_PRIO__NUM
212};
213

--- 138 unchanged lines hidden ---
214};
215
216enum efx_tc_rule_prios {
217 EFX_TC_PRIO_TC, /* Rule inserted by TC */
218 EFX_TC_PRIO_DFLT, /* Default switch rule; one of efx_tc_default_rules */
219 EFX_TC_PRIO__NUM
220};
221

--- 138 unchanged lines hidden ---