Skip to content

Commit f988008

Browse files
Ganesh Goudardavem330
authored andcommitted
cxgb4: RSS table is 4k for T6
RSS table is 4k for T6 and later cards, add check for the same. Signed-off-by: Ganesh Goudar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1df94c3 commit f988008

File tree

6 files changed

+36
-23
lines changed

6 files changed

+36
-23
lines changed

drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,9 +1004,10 @@ int cudbg_collect_rss(struct cudbg_init *pdbg_init,
10041004
{
10051005
struct adapter *padap = pdbg_init->adap;
10061006
struct cudbg_buffer temp_buff = { 0 };
1007-
int rc;
1007+
int rc, nentries;
10081008

1009-
rc = cudbg_get_buff(dbg_buff, RSS_NENTRIES * sizeof(u16), &temp_buff);
1009+
nentries = t4_chip_rss_size(padap);
1010+
rc = cudbg_get_buff(dbg_buff, nentries * sizeof(u16), &temp_buff);
10101011
if (rc)
10111012
return rc;
10121013

drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,7 @@ int t4_init_portinfo(struct port_info *pi, int mbox,
15281528
int port, int pf, int vf, u8 mac[]);
15291529
int t4_port_init(struct adapter *adap, int mbox, int pf, int vf);
15301530
void t4_fatal_err(struct adapter *adapter);
1531+
unsigned int t4_chip_rss_size(struct adapter *adapter);
15311532
int t4_config_rss_range(struct adapter *adapter, int mbox, unsigned int viid,
15321533
int start, int n, const u16 *rspq, unsigned int nrspq);
15331534
int t4_config_glbl_rss(struct adapter *adapter, int mbox, unsigned int mode,

drivers/net/ethernet/chelsio/cxgb4/cxgb4_cudbg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static u32 cxgb4_get_entity_length(struct adapter *adap, u32 entity)
179179
len = cudbg_mbytes_to_bytes(len);
180180
break;
181181
case CUDBG_RSS:
182-
len = RSS_NENTRIES * sizeof(u16);
182+
len = t4_chip_rss_size(adap) * sizeof(u16);
183183
break;
184184
case CUDBG_RSS_VF_CONF:
185185
len = adap->params.arch.vfcount *

drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,11 +2021,12 @@ static int rss_show(struct seq_file *seq, void *v, int idx)
20212021

20222022
static int rss_open(struct inode *inode, struct file *file)
20232023
{
2024-
int ret;
2025-
struct seq_tab *p;
20262024
struct adapter *adap = inode->i_private;
2025+
int ret, nentries;
2026+
struct seq_tab *p;
20272027

2028-
p = seq_open_tab(file, RSS_NENTRIES / 8, 8 * sizeof(u16), 0, rss_show);
2028+
nentries = t4_chip_rss_size(adap);
2029+
p = seq_open_tab(file, nentries / 8, 8 * sizeof(u16), 0, rss_show);
20292030
if (!p)
20302031
return -ENOMEM;
20312032

drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4927,6 +4927,14 @@ void t4_intr_disable(struct adapter *adapter)
49274927
t4_set_reg_field(adapter, PL_INT_MAP0_A, 1 << pf, 0);
49284928
}
49294929

4930+
unsigned int t4_chip_rss_size(struct adapter *adap)
4931+
{
4932+
if (CHELSIO_CHIP_VERSION(adap->params.chip) <= CHELSIO_T5)
4933+
return RSS_NENTRIES;
4934+
else
4935+
return T6_RSS_NENTRIES;
4936+
}
4937+
49304938
/**
49314939
* t4_config_rss_range - configure a portion of the RSS mapping table
49324940
* @adapter: the adapter
@@ -5065,10 +5073,11 @@ static int rd_rss_row(struct adapter *adap, int row, u32 *val)
50655073
*/
50665074
int t4_read_rss(struct adapter *adapter, u16 *map)
50675075
{
5076+
int i, ret, nentries;
50685077
u32 val;
5069-
int i, ret;
50705078

5071-
for (i = 0; i < RSS_NENTRIES / 2; ++i) {
5079+
nentries = t4_chip_rss_size(adapter);
5080+
for (i = 0; i < nentries / 2; ++i) {
50725081
ret = rd_rss_row(adapter, i, &val);
50735082
if (ret)
50745083
return ret;

drivers/net/ethernet/chelsio/cxgb4/t4_hw.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,22 @@
3838
#include <linux/types.h>
3939

4040
enum {
41-
NCHAN = 4, /* # of HW channels */
42-
MAX_MTU = 9600, /* max MAC MTU, excluding header + FCS */
43-
EEPROMSIZE = 17408, /* Serial EEPROM physical size */
44-
EEPROMVSIZE = 32768, /* Serial EEPROM virtual address space size */
45-
EEPROMPFSIZE = 1024, /* EEPROM writable area size for PFn, n>0 */
46-
RSS_NENTRIES = 2048, /* # of entries in RSS mapping table */
47-
TCB_SIZE = 128, /* TCB size */
48-
NMTUS = 16, /* size of MTU table */
49-
NCCTRL_WIN = 32, /* # of congestion control windows */
50-
NTX_SCHED = 8, /* # of HW Tx scheduling queues */
51-
PM_NSTATS = 5, /* # of PM stats */
52-
T6_PM_NSTATS = 7, /* # of PM stats in T6 */
53-
MBOX_LEN = 64, /* mailbox size in bytes */
54-
TRACE_LEN = 112, /* length of trace data and mask */
55-
FILTER_OPT_LEN = 36, /* filter tuple width for optional components */
41+
NCHAN = 4, /* # of HW channels */
42+
MAX_MTU = 9600, /* max MAC MTU, excluding header + FCS */
43+
EEPROMSIZE = 17408,/* Serial EEPROM physical size */
44+
EEPROMVSIZE = 32768,/* Serial EEPROM virtual address space size */
45+
EEPROMPFSIZE = 1024, /* EEPROM writable area size for PFn, n>0 */
46+
RSS_NENTRIES = 2048, /* # of entries in RSS mapping table */
47+
T6_RSS_NENTRIES = 4096, /* # of entries in RSS mapping table */
48+
TCB_SIZE = 128, /* TCB size */
49+
NMTUS = 16, /* size of MTU table */
50+
NCCTRL_WIN = 32, /* # of congestion control windows */
51+
NTX_SCHED = 8, /* # of HW Tx scheduling queues */
52+
PM_NSTATS = 5, /* # of PM stats */
53+
T6_PM_NSTATS = 7, /* # of PM stats in T6 */
54+
MBOX_LEN = 64, /* mailbox size in bytes */
55+
TRACE_LEN = 112, /* length of trace data and mask */
56+
FILTER_OPT_LEN = 36, /* filter tuple width for optional components */
5657
};
5758

5859
enum {

0 commit comments

Comments
 (0)