Commit c7e4358a authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller

ixgbe: Move ring features into an enum, allowing easier future maintenance

From: Shannon Nelson <shannon.nelson@intel.com>

The ring_feature member of ixgbe_adapter is statically allocated based on
the supported features of the device.  When a new feature is added, we need
to manually update the static allocation.  This patch makes the feature
list an enum, eliminating the need for multiple updates to the code when
adding a new feature.
Signed-off-by: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5325a7bf
...@@ -148,9 +148,15 @@ struct ixgbe_ring { ...@@ -148,9 +148,15 @@ struct ixgbe_ring {
u16 rx_buf_len; u16 rx_buf_len;
}; };
#define RING_F_DCB 0 enum ixgbe_ring_f_enum {
#define RING_F_VMDQ 1 RING_F_NONE = 0,
#define RING_F_RSS 2 RING_F_DCB,
RING_F_VMDQ,
RING_F_RSS,
RING_F_ARRAY_SIZE /* must be last in enum set */
};
#define IXGBE_MAX_DCB_INDICES 8 #define IXGBE_MAX_DCB_INDICES 8
#define IXGBE_MAX_RSS_INDICES 16 #define IXGBE_MAX_RSS_INDICES 16
#define IXGBE_MAX_VMDQ_INDICES 16 #define IXGBE_MAX_VMDQ_INDICES 16
...@@ -249,7 +255,7 @@ struct ixgbe_adapter { ...@@ -249,7 +255,7 @@ struct ixgbe_adapter {
u64 non_eop_descs; u64 non_eop_descs;
int num_msix_vectors; int num_msix_vectors;
int max_msix_q_vectors; /* true count of q_vectors for device */ int max_msix_q_vectors; /* true count of q_vectors for device */
struct ixgbe_ring_feature ring_feature[3]; struct ixgbe_ring_feature ring_feature[RING_F_ARRAY_SIZE];
struct msix_entry *msix_entries; struct msix_entry *msix_entries;
u64 rx_hdr_split; u64 rx_hdr_split;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment