aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>2018-05-16 10:21:15 -0400
committerDavid S. Miller <davem@davemloft.net>2018-05-16 15:01:30 -0400
commit8e725f7caafb8e820e05707fe9853023375438cf (patch)
tree75f41345441dc5a8d35a1f4f3a5e26f9cd1671ad
parent7e360d9d3149afdd54158b72cb92da271f6bd07f (diff)
cxgb4: update LE-TCAM collection for T6
For T6, clip table is separated from main TCAM. So, update LE-TCAM collection logic to collect clip table TCAM as well. IPv6 takes 4 entries in clip table TCAM compared to 2 entries in main TCAM. Also, in case of errors, keep LE-TCAM collected so far and set the status to partial dump. Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h3
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h1
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c40
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_regs.h1
4 files changed, 37 insertions, 8 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h b/drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h
index b57acb8dc35b..740a18ba4229 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h
@@ -235,6 +235,9 @@ struct cudbg_vpd_data {
235}; 235};
236 236
237#define CUDBG_MAX_TCAM_TID 0x800 237#define CUDBG_MAX_TCAM_TID 0x800
238#define CUDBG_T6_CLIP 1536
239#define CUDBG_MAX_TID_COMP_EN 6144
240#define CUDBG_MAX_TID_COMP_DIS 3072
238 241
239enum cudbg_le_entry_types { 242enum cudbg_le_entry_types {
240 LE_ET_UNKNOWN = 0, 243 LE_ET_UNKNOWN = 0,
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h b/drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h
index 8568a51f6414..215fe6260fd7 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_if.h
@@ -24,6 +24,7 @@
24#define CUDBG_STATUS_NOT_IMPLEMENTED -28 24#define CUDBG_STATUS_NOT_IMPLEMENTED -28
25#define CUDBG_SYSTEM_ERROR -29 25#define CUDBG_SYSTEM_ERROR -29
26#define CUDBG_STATUS_CCLK_NOT_DEFINED -32 26#define CUDBG_STATUS_CCLK_NOT_DEFINED -32
27#define CUDBG_STATUS_PARTIAL_DATA -41
27 28
28#define CUDBG_MAJOR_VERSION 1 29#define CUDBG_MAJOR_VERSION 1
29#define CUDBG_MINOR_VERSION 14 30#define CUDBG_MINOR_VERSION 14
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
index 9da6f57901a9..4feb7eca0acf 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
@@ -2366,8 +2366,11 @@ void cudbg_fill_le_tcam_info(struct adapter *padap,
2366 value = t4_read_reg(padap, LE_DB_ROUTING_TABLE_INDEX_A); 2366 value = t4_read_reg(padap, LE_DB_ROUTING_TABLE_INDEX_A);
2367 tcam_region->routing_start = value; 2367 tcam_region->routing_start = value;
2368 2368
2369 /*Get clip table index */ 2369 /* Get clip table index. For T6 there is separate CLIP TCAM */
2370 value = t4_read_reg(padap, LE_DB_CLIP_TABLE_INDEX_A); 2370 if (is_t6(padap->params.chip))
2371 value = t4_read_reg(padap, LE_DB_CLCAM_TID_BASE_A);
2372 else
2373 value = t4_read_reg(padap, LE_DB_CLIP_TABLE_INDEX_A);
2371 tcam_region->clip_start = value; 2374 tcam_region->clip_start = value;
2372 2375
2373 /* Get filter table index */ 2376 /* Get filter table index */
@@ -2392,8 +2395,16 @@ void cudbg_fill_le_tcam_info(struct adapter *padap,
2392 tcam_region->tid_hash_base; 2395 tcam_region->tid_hash_base;
2393 } 2396 }
2394 } else { /* hash not enabled */ 2397 } else { /* hash not enabled */
2395 tcam_region->max_tid = CUDBG_MAX_TCAM_TID; 2398 if (is_t6(padap->params.chip))
2399 tcam_region->max_tid = (value & ASLIPCOMPEN_F) ?
2400 CUDBG_MAX_TID_COMP_EN :
2401 CUDBG_MAX_TID_COMP_DIS;
2402 else
2403 tcam_region->max_tid = CUDBG_MAX_TCAM_TID;
2396 } 2404 }
2405
2406 if (is_t6(padap->params.chip))
2407 tcam_region->max_tid += CUDBG_T6_CLIP;
2397} 2408}
2398 2409
2399int cudbg_collect_le_tcam(struct cudbg_init *pdbg_init, 2410int cudbg_collect_le_tcam(struct cudbg_init *pdbg_init,
@@ -2423,18 +2434,31 @@ int cudbg_collect_le_tcam(struct cudbg_init *pdbg_init,
2423 for (i = 0; i < tcam_region.max_tid; ) { 2434 for (i = 0; i < tcam_region.max_tid; ) {
2424 rc = cudbg_read_tid(pdbg_init, i, tid_data); 2435 rc = cudbg_read_tid(pdbg_init, i, tid_data);
2425 if (rc) { 2436 if (rc) {
2426 cudbg_err->sys_err = rc; 2437 cudbg_err->sys_warn = CUDBG_STATUS_PARTIAL_DATA;
2427 cudbg_put_buff(pdbg_init, &temp_buff); 2438 /* Update tcam header and exit */
2428 return rc; 2439 tcam_region.max_tid = i;
2440 memcpy(temp_buff.data, &tcam_region,
2441 sizeof(struct cudbg_tcam));
2442 goto out;
2429 } 2443 }
2430 2444
2431 /* ipv6 takes two tids */ 2445 if (cudbg_is_ipv6_entry(tid_data, tcam_region)) {
2432 cudbg_is_ipv6_entry(tid_data, tcam_region) ? i += 2 : i++; 2446 /* T6 CLIP TCAM: ipv6 takes 4 entries */
2447 if (is_t6(padap->params.chip) &&
2448 i >= tcam_region.clip_start &&
2449 i < tcam_region.clip_start + CUDBG_T6_CLIP)
2450 i += 4;
2451 else /* Main TCAM: ipv6 takes two tids */
2452 i += 2;
2453 } else {
2454 i++;
2455 }
2433 2456
2434 tid_data++; 2457 tid_data++;
2435 bytes += sizeof(struct cudbg_tid_data); 2458 bytes += sizeof(struct cudbg_tid_data);
2436 } 2459 }
2437 2460
2461out:
2438 return cudbg_write_and_release_buff(pdbg_init, &temp_buff, dbg_buff); 2462 return cudbg_write_and_release_buff(pdbg_init, &temp_buff, dbg_buff);
2439} 2463}
2440 2464
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h b/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
index 843f8cada1de..6b55aa2eb2a5 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
@@ -2999,6 +2999,7 @@
2999#define LE_DB_HASH_TID_BASE_A 0x19c30 2999#define LE_DB_HASH_TID_BASE_A 0x19c30
3000#define LE_DB_HASH_TBL_BASE_ADDR_A 0x19c30 3000#define LE_DB_HASH_TBL_BASE_ADDR_A 0x19c30
3001#define LE_DB_INT_CAUSE_A 0x19c3c 3001#define LE_DB_INT_CAUSE_A 0x19c3c
3002#define LE_DB_CLCAM_TID_BASE_A 0x19df4
3002#define LE_DB_TID_HASHBASE_A 0x19df8 3003#define LE_DB_TID_HASHBASE_A 0x19df8
3003#define T6_LE_DB_HASH_TID_BASE_A 0x19df8 3004#define T6_LE_DB_HASH_TID_BASE_A 0x19df8
3004 3005