]> git.baikalelectronics.ru Git - kernel.git/commitdiff
iavf: Refactor iavf_mac_filter struct memory usage
authorJedrzej Jagielski <jedrzej.jagielski@intel.com>
Mon, 30 Aug 2021 08:25:36 +0000 (08:25 +0000)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 30 Nov 2021 16:56:07 +0000 (08:56 -0800)
iavf_mac_filter struct contained couple boolean
flags using up more memory than is necessary.
Change the flags to be bitfields in an anonymous struct
so all the flags now fit in one byte.

Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf.h

index 3789269ce741d40219dbf5202e5eab2dfd0793f5..b5728bdbcf3357ab3be2a0ac7015494f3b4b7b0a 100644 (file)
@@ -137,9 +137,13 @@ struct iavf_q_vector {
 struct iavf_mac_filter {
        struct list_head list;
        u8 macaddr[ETH_ALEN];
-       bool is_new_mac;        /* filter is new, wait for PF decision */
-       bool remove;            /* filter needs to be removed */
-       bool add;               /* filter needs to be added */
+       struct {
+               u8 is_new_mac:1;    /* filter is new, wait for PF decision */
+               u8 remove:1;        /* filter needs to be removed */
+               u8 add:1;           /* filter needs to be added */
+               u8 is_primary:1;    /* filter is a default VF MAC */
+               u8 padding:4;
+       };
 };
 
 struct iavf_vlan_filter {