Skip to content

Commit e284fc2

Browse files
Avinash DayanandJeff Kirsher
authored andcommitted
i40e: Add and delete cloud filter
This patch provides support to add or delete cloud filter for queue channels created for ADq on VF. We are using the HW's cloud filter feature and programming it to act as a TC filter applied to a group of queues. There are two possible modes for a VF when applying a cloud filter 1. Basic Mode: Intended to apply filters that don't need a VF to be Trusted. This would include the following Dest MAC + L4 port Dest MAC + VLAN + L4 port 2. Advanced Mode: This mode is only for filters with combination that requires VF to be Trusted. Dest IP + L4 port When cloud filters are applied on a trusted VF and for some reason the same VF is later made as untrusted then all cloud filters will be deleted. All cloud filters has to be re-applied in such a case. Cloud filters are also deleted when queue channel is deleted. Testing-Hints: ============= 1. Adding Basic Mode filter should be possible on a VF in Non-Trusted mode. 2. In Advanced mode all filters should be able to be created. Steps: ====== 1. Enable ADq and create TCs using TC mqprio command 2. Apply cloud filter. 3. Turn-off the spoof check. 4. Pass traffic. Example: ======== 1. tc qdisc add dev enp4s2 root mqprio num_tc 4 map 0 0 0 0 1 2 2 3\ queues 2@0 2@2 1@4 1@5 hw 1 mode channel 2. tc qdisc add dev enp4s2 ingress 3. ethtool -K enp4s2 hw-tc-offload on 4. ip link set ens261f0 vf 0 spoofchk off 5. tc filter add dev enp4s2 protocol ip parent ffff: prio 1 flower\ dst_ip 192.168.3.5/32 ip_proto udp dst_port 25 skip_sw hw_tc 2 Signed-off-by: Avinash Dayanand <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 0075fa0 commit e284fc2

File tree

4 files changed

+470
-12
lines changed

4 files changed

+470
-12
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,4 +1109,10 @@ static inline bool i40e_enabled_xdp_vsi(struct i40e_vsi *vsi)
11091109

11101110
int i40e_create_queue_channel(struct i40e_vsi *vsi, struct i40e_channel *ch);
11111111
int i40e_set_bw_limit(struct i40e_vsi *vsi, u16 seid, u64 max_tx_rate);
1112+
int i40e_add_del_cloud_filter(struct i40e_vsi *vsi,
1113+
struct i40e_cloud_filter *filter,
1114+
bool add);
1115+
int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
1116+
struct i40e_cloud_filter *filter,
1117+
bool add);
11121118
#endif /* _I40E_H_ */

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ static int i40e_reset(struct i40e_pf *pf);
6969
static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired);
7070
static void i40e_fdir_sb_setup(struct i40e_pf *pf);
7171
static int i40e_veb_get_bw_info(struct i40e_veb *veb);
72-
static int i40e_add_del_cloud_filter(struct i40e_vsi *vsi,
73-
struct i40e_cloud_filter *filter,
74-
bool add);
75-
static int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
76-
struct i40e_cloud_filter *filter,
77-
bool add);
7872
static int i40e_get_capabilities(struct i40e_pf *pf,
7973
enum i40e_admin_queue_opc list_type);
8074

@@ -6841,8 +6835,8 @@ i40e_set_cld_element(struct i40e_cloud_filter *filter,
68416835
* Add or delete a cloud filter for a specific flow spec.
68426836
* Returns 0 if the filter were successfully added.
68436837
**/
6844-
static int i40e_add_del_cloud_filter(struct i40e_vsi *vsi,
6845-
struct i40e_cloud_filter *filter, bool add)
6838+
int i40e_add_del_cloud_filter(struct i40e_vsi *vsi,
6839+
struct i40e_cloud_filter *filter, bool add)
68466840
{
68476841
struct i40e_aqc_cloud_filters_element_data cld_filter;
68486842
struct i40e_pf *pf = vsi->back;
@@ -6908,9 +6902,9 @@ static int i40e_add_del_cloud_filter(struct i40e_vsi *vsi,
69086902
* Add or delete a cloud filter for a specific flow spec using big buffer.
69096903
* Returns 0 if the filter were successfully added.
69106904
**/
6911-
static int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
6912-
struct i40e_cloud_filter *filter,
6913-
bool add)
6905+
int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,
6906+
struct i40e_cloud_filter *filter,
6907+
bool add)
69146908
{
69156909
struct i40e_aqc_cloud_filters_element_bb cld_filter;
69166910
struct i40e_pf *pf = vsi->back;

0 commit comments

Comments
 (0)