Skip to contentSkip to conversation

bnx2x: Set cache line based on build configuration

PATCH Superseded Chas Williams 4 participants 4 messages Jul 11, 2016 – Sep 30, 2016 Network drivers

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/10 bnx2x: Set cache line based on build configuration

Correctly hint the cache line size. Remove unused macros associated with the cache line size.

Fixes 540a211084a7 ("bnx2x: driver core")
---
 drivers/net/bnx2x/bnx2x.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/bnx2x/bnx2x.h +1 -4
index 135a6eb..852ec94 100644
@@ -302,10 +302,7 @@ struct bnx2x_device_type {
 /* TCP with Timestamp Option (32) + IPv6 (40) */
 
 /* max supported alignment is 256 (8 shift) */
-#define BNX2X_RX_ALIGN_SHIFT 8
-/* FW uses 2 cache lines alignment for start packet and size  */
-#define BNX2X_FW_RX_ALIGN_START (1 << BNX2X_RX_ALIGN_SHIFT)
-#define BNX2X_FW_RX_ALIGN_END   (1 << BNX2X_RX_ALIGN_SHIFT)
+#define BNX2X_RX_ALIGN_SHIFT	RTE_MAX(6, min(8, RTE_CACHE_LINE_SIZE_LOG2))
 
 #define BNX2X_PXP_DRAM_ALIGN (BNX2X_RX_ALIGN_SHIFT - 5)
 
Signature · 1 line
2.5.5
Acked-by on v1 1/10
#1 lore raw
Quoted 31 lines

Correctly hint the cache line size. Remove unused macros associated with the cache line size.

Fixes 540a211084a7 ("bnx2x: driver core")

---
drivers/net/bnx2x/bnx2x.h | 5 +----

1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/bnx2x/bnx2x.h +1 -4
index 135a6eb..852ec94 100644
@@ -302,10 +302,7 @@ struct bnx2x_device_type {
 /* TCP with Timestamp Option (32) + IPv6 (40) */
 
 /* max supported alignment is 256 (8 shift) */
-#define BNX2X_RX_ALIGN_SHIFT 8
-/* FW uses 2 cache lines alignment for start packet and size  */
-#define BNX2X_FW_RX_ALIGN_START (1 << BNX2X_RX_ALIGN_SHIFT)
-#define BNX2X_FW_RX_ALIGN_END   (1 << BNX2X_RX_ALIGN_SHIFT)
+#define BNX2X_RX_ALIGN_SHIFT	RTE_MAX(6, min(8, RTE_CACHE_LINE_SIZE_LOG2))
 
 #define BNX2X_PXP_DRAM_ALIGN (BNX2X_RX_ALIGN_SHIFT - 5)
 
Signature · 1 line
2.5.5
#2 lore raw

Hi Harish,

Quoted 25 lines · Harish Patil
Quoted 25 lines

Correctly hint the cache line size. Remove unused macros associated with the cache line size.

Fixes 540a211084a7 ("bnx2x: driver core")

---
drivers/net/bnx2x/bnx2x.h | 5 +----

1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/bnx2x/bnx2x.h +1 -4
index 135a6eb..852ec94 100644
@@ -302,10 +302,7 @@ struct bnx2x_device_type {
 /* TCP with Timestamp Option (32) + IPv6 (40) */
 
 /* max supported alignment is 256 (8 shift) */
-#define BNX2X_RX_ALIGN_SHIFT 8
-/* FW uses 2 cache lines alignment for start packet and size  */
-#define BNX2X_FW_RX_ALIGN_START (1 << BNX2X_RX_ALIGN_SHIFT)
-#define BNX2X_FW_RX_ALIGN_END   (1 << BNX2X_RX_ALIGN_SHIFT)
+#define BNX2X_RX_ALIGN_SHIFT  RTE_MAX(6, min(8, RTE_CACHE_LINE_SIZE_LOG2))
 
Quoted 9 lines
Quoted 6 lines
drivers/net/bnx2x/bnx2x.h +0 -1
 #define BNX2X_PXP_DRAM_ALIGN (BNX2X_RX_ALIGN_SHIFT - 5)
 
--

2.5.5

Is the Ack for this patch (01/10) or for the series?

Thanks,
ferruh

#3 lore raw
Quoted 41 lines

Hi Harish,

Quoted 26 lines · Harish Patil
Quoted 26 lines

Correctly hint the cache line size. Remove unused macros associated with the cache line size.

Fixes 540a211084a7 ("bnx2x: driver core")

---
drivers/net/bnx2x/bnx2x.h | 5 +----

1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/bnx2x/bnx2x.h +1 -4
index 135a6eb..852ec94 100644
@@ -302,10 +302,7 @@ struct bnx2x_device_type {
 /* TCP with Timestamp Option (32) + IPv6 (40) */
 
 /* max supported alignment is 256 (8 shift) */
-#define BNX2X_RX_ALIGN_SHIFT 8
-/* FW uses 2 cache lines alignment for start packet and size  */
-#define BNX2X_FW_RX_ALIGN_START (1 << BNX2X_RX_ALIGN_SHIFT)
-#define BNX2X_FW_RX_ALIGN_END   (1 << BNX2X_RX_ALIGN_SHIFT)
+#define BNX2X_RX_ALIGN_SHIFT  RTE_MAX(6, min(8,
 RTE_CACHE_LINE_SIZE_LOG2))
 
Quoted 9 lines
Quoted 6 lines
drivers/net/bnx2x/bnx2x.h +0 -1
 #define BNX2X_PXP_DRAM_ALIGN (BNX2X_RX_ALIGN_SHIFT - 5)
 
--

2.5.5

Quoted 6 lines

Is the Ack for this patch (01/10) or for the series?

Thanks,
ferruh

Hi Ferruh,
I meant it for only this patch.
Let me scan thru’ for the series and ack.
Thanks,
Harish