cxgb4vf: Update to 128 byte mailbox size for T6 adapter
authorHariprasad Shenai <hariprasad@chelsio.com>
Wed, 23 Dec 2015 17:17:19 +0000 (22:47 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Dec 2015 03:34:45 +0000 (22:34 -0500)
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4vf/t4vf_defs.h
drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c

index b516b12b188459eabf2397f7dcdbfb17279c7a48..f859db3d254cd27527287dca95f9c7d1d3512493 100644 (file)
@@ -54,6 +54,7 @@
 #define T4VF_MPS_BASE_ADDR     0x0100
 #define T4VF_PL_BASE_ADDR      0x0200
 #define T4VF_MBDATA_BASE_ADDR  0x0240
+#define T6VF_MBDATA_BASE_ADDR  0x0280
 #define T4VF_CIM_BASE_ADDR     0x0300
 
 #define T4VF_REGMAP_START      0x0000
index 63dd5fdac5b91a5ba0186961a395d67f2c5cc7b2..b6fa74aafe4771246baf16af218d6a5c7e54670a 100644 (file)
@@ -120,12 +120,19 @@ int t4vf_wr_mbox_core(struct adapter *adapter, const void *cmd, int size,
                1, 1, 3, 5, 10, 10, 20, 50, 100
        };
 
-       u32 v;
+       u32 v, mbox_data;
        int i, ms, delay_idx;
        const __be64 *p;
-       u32 mbox_data = T4VF_MBDATA_BASE_ADDR;
        u32 mbox_ctl = T4VF_CIM_BASE_ADDR + CIM_VF_EXT_MAILBOX_CTRL;
 
+       /* In T6, mailbox size is changed to 128 bytes to avoid
+        * invalidating the entire prefetch buffer.
+        */
+       if (CHELSIO_CHIP_VERSION(adapter->params.chip) <= CHELSIO_T5)
+               mbox_data = T4VF_MBDATA_BASE_ADDR;
+       else
+               mbox_data = T6VF_MBDATA_BASE_ADDR;
+
        /*
         * Commands must be multiples of 16 bytes in length and may not be
         * larger than the size of the Mailbox Data register array.