Merge tag 'boards-for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / intel / i40evf / i40e_lan_hmc.h
index d6f762241537804be777b97ad5f29616f990058f..a5d79877354cc6be02cd7777ffd1577b468f9cc3 100644 (file)
@@ -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;
+       u cpuid;
        u8  head_wb_ena;
        u16 qlen;
        u8  tphrdesc_ena;