summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.h
diff options
context:
space:
mode:
authorPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>2014-06-04 05:35:54 +0000
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-06-26 04:44:57 -0700
commit3ba3faeb62220411284551a6443395ce7960b17d (patch)
tree63892bf8f4377bb19930813a83ae57e9326c8176 /drivers/net/ethernet/intel/i40e/i40e_lan_hmc.h
parent7a208e83fcedc0b845facc17d05ead0b9b73a967 (diff)
i40e/i40evf: Big endian fixes for handling HMC
Fix HMC handling for big endian architectures. Change-ID: Id8c46fc341815d47bfe0af8b819f0ab9a1e9e515 Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/i40e/i40e_lan_hmc.h')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_lan_hmc.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.h b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.h
index eb65fe23c4a7..e74128db5be5 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.h
@@ -32,16 +32,22 @@ struct i40e_hw;
/* HMC element context information */
-/* Rx queue context data */
+/* Rx queue context data
+ *
+ * The sizes of the variables may be larger than needed due to crossing byte
+ * boundaries. If we do not have the width of the variable set to the correct
+ * size then we could end up shifting bits off the top of the variable when the
+ * variable is at the top of a byte and crosses over into the next byte.
+ */
struct i40e_hmc_obj_rxq {
u16 head;
- u8 cpuid;
+ u16 cpuid; /* bigger than needed, see above for reason */
u64 base;
u16 qlen;
#define I40E_RXQ_CTX_DBUFF_SHIFT 7
- u8 dbuff;
+ u16 dbuff; /* bigger than needed, see above for reason */
#define I40E_RXQ_CTX_HBUFF_SHIFT 6
- u8 hbuff;
+ u16 hbuff; /* bigger than needed, see above for reason */
u8 dtype;
u8 dsize;
u8 crcstrip;
@@ -50,16 +56,22 @@ struct i40e_hmc_obj_rxq {
u8 hsplit_0;
u8 hsplit_1;
u8 showiv;
- u16 rxmax;
+ u32 rxmax; /* bigger than needed, see above for reason */
u8 tphrdesc_ena;
u8 tphwdesc_ena;
u8 tphdata_ena;
u8 tphhead_ena;
- u8 lrxqthresh;
+ u16 lrxqthresh; /* bigger than needed, see above for reason */
u8 prefena; /* NOTE: normally must be set to 1 at init */
};
-/* Tx queue context data */
+/* Tx queue context data
+*
+* The sizes of the variables may be larger than needed due to crossing byte
+* boundaries. If we do not have the width of the variable set to the correct
+* size then we could end up shifting bits off the top of the variable when the
+* variable is at the top of a byte and crosses over into the next byte.
+*/
struct i40e_hmc_obj_txq {
u16 head;
u8 new_context;
@@ -69,7 +81,7 @@ struct i40e_hmc_obj_txq {
u8 fd_ena;
u8 alt_vlan_ena;
u16 thead_wb;
- u16 cpuid;
+ u8 cpuid;
u8 head_wb_ena;
u16 qlen;
u8 tphrdesc_ena;