summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/iavf/iavf.h
diff options
context:
space:
mode:
authorAhmed Zaki <ahmed.zaki@intel.com>2023-04-07 00:35:27 +0300
committerTony Nguyen <anthony.l.nguyen@intel.com>2023-04-07 18:49:50 +0300
commit0c0da0e951053fda20412cd284e2714bbbb31bff (patch)
treed369bff08a4c03ca9bfc2982029d26fd5a8c1bf9 /drivers/net/ethernet/intel/iavf/iavf.h
parentb9881d9a761a7e078c394ff8e30e1659d74f898f (diff)
downloadlinux-0c0da0e951053fda20412cd284e2714bbbb31bff.tar.xz
iavf: refactor VLAN filter states
The VLAN filter states are currently being saved as individual bits. This is error prone as multiple bits might be mistakenly set. Fix by replacing the bits with a single state enum. Also, add an "ACTIVE" state for filters that are accepted by the PF. Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com> Tested-by: Rafal Romanowski <rafal.romanowski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/iavf/iavf.h')
-rw-r--r--drivers/net/ethernet/intel/iavf/iavf.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/iavf/iavf.h b/drivers/net/ethernet/intel/iavf/iavf.h
index 232bc61d9eee..692d6a642118 100644
--- a/drivers/net/ethernet/intel/iavf/iavf.h
+++ b/drivers/net/ethernet/intel/iavf/iavf.h
@@ -158,15 +158,18 @@ struct iavf_vlan {
u16 tpid;
};
+enum iavf_vlan_state_t {
+ IAVF_VLAN_INVALID,
+ IAVF_VLAN_ADD, /* filter needs to be added */
+ IAVF_VLAN_IS_NEW, /* filter is new, wait for PF answer */
+ IAVF_VLAN_ACTIVE, /* filter is accepted by PF */
+ IAVF_VLAN_REMOVE, /* filter needs to be removed */
+};
+
struct iavf_vlan_filter {
struct list_head list;
struct iavf_vlan vlan;
- struct {
- u8 is_new_vlan:1; /* filter is new, wait for PF answer */
- u8 remove:1; /* filter needs to be removed */
- u8 add:1; /* filter needs to be added */
- u8 padding:5;
- };
+ enum iavf_vlan_state_t state;
};
#define IAVF_MAX_TRAFFIC_CLASS 4