Skip to content

Commit 39f5426

Browse files
committed
Merge branch 'eth-fbnic-support-rss-contexts-and-ntuple-filters'
Jakub Kicinski says: ==================== eth: fbnic: support RSS contexts and ntuple filters Add support for RSS contexts and ntuple filters in fbnic. The device has only one context, intended for use by TCP zero-copy Rx. First two patches add a check we seem to be missing in the core, to avoid having to copy it to all drivers. $ ./drivers/net/hw/rss_ctx.py KTAP version 1 1..16 ok 1 rss_ctx.test_rss_key_indir ok 2 rss_ctx.test_rss_queue_reconfigure ok 3 rss_ctx.test_rss_resize ok 4 rss_ctx.test_hitless_key_update ok 5 rss_ctx.test_rss_context # Failed to create context 2, trying to test what we got ok 6 rss_ctx.test_rss_context4 # SKIP Tested only 1 contexts, wanted 4 # Increasing queue count 44 -> 66 # Failed to create context 2, trying to test what we got ok 7 rss_ctx.test_rss_context32 # SKIP Tested only 1 contexts, wanted 32 # Added only 1 out of 3 contexts ok 8 rss_ctx.test_rss_context_dump # Driver does not support rss + queue offset ok 9 rss_ctx.test_rss_context_queue_reconfigure ok 10 rss_ctx.test_rss_context_overlap ok 11 rss_ctx.test_rss_context_overlap2 # SKIP Test requires at least 2 contexts, but device only has 1 ok 12 rss_ctx.test_rss_context_out_of_order # SKIP Test requires at least 4 contexts, but device only has 1 # Failed to create context 2, trying to test what we got ok 13 rss_ctx.test_rss_context4_create_with_cfg # SKIP Tested only 1 contexts, wanted 4 ok 14 rss_ctx.test_flow_add_context_missing ok 15 rss_ctx.test_delete_rss_context_busy ok 16 rss_ctx.test_rss_ntuple_addition # SKIP Ntuple filter with RSS and nonzero action not supported # Totals: pass:10 fail:0 xfail:0 xpass:0 skip:6 error:0 ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 34c84b3 + 5797d3c commit 39f5426

File tree

9 files changed

+1294
-11
lines changed

9 files changed

+1294
-11
lines changed

drivers/net/ethernet/meta/fbnic/fbnic.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ struct fbnic_dev {
6060
u8 mac_addr_boundary;
6161
u8 tce_tcam_last;
6262

63+
/* IP TCAM */
64+
struct fbnic_ip_addr ip_src[FBNIC_RPC_TCAM_IP_ADDR_NUM_ENTRIES];
65+
struct fbnic_ip_addr ip_dst[FBNIC_RPC_TCAM_IP_ADDR_NUM_ENTRIES];
66+
struct fbnic_ip_addr ipo_src[FBNIC_RPC_TCAM_IP_ADDR_NUM_ENTRIES];
67+
struct fbnic_ip_addr ipo_dst[FBNIC_RPC_TCAM_IP_ADDR_NUM_ENTRIES];
68+
6369
/* Number of TCQs/RCQs available on hardware */
6470
u16 max_num_queues;
6571

drivers/net/ethernet/meta/fbnic/fbnic_csr.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,11 @@ enum {
605605
FBNIC_RPC_ACT_TBL0_DEST_EI = 4,
606606
};
607607

608+
#define FBNIC_RPC_ACT_TBL0_Q_SEL CSR_BIT(4)
609+
#define FBNIC_RPC_ACT_TBL0_Q_ID CSR_GENMASK(15, 8)
608610
#define FBNIC_RPC_ACT_TBL0_DMA_HINT CSR_GENMASK(24, 16)
609611
#define FBNIC_RPC_ACT_TBL0_TS_ENA CSR_BIT(28)
612+
#define FBNIC_RPC_ACT_TBL0_ACT_TBL_IDX CSR_BIT(29)
610613
#define FBNIC_RPC_ACT_TBL0_RSS_CTXT_ID CSR_BIT(30)
611614

612615
#define FBNIC_RPC_ACT_TBL1_DEFAULT 0x0840b /* 0x2102c */
@@ -677,6 +680,9 @@ enum {
677680

678681
#define FBNIC_RPC_TCAM_OUTER_IPSRC(m, n)\
679682
(0x08c00 + 0x08 * (n) + (m)) /* 0x023000 + 32*n + 4*m */
683+
#define FBNIC_RPC_TCAM_IP_ADDR_VALUE CSR_GENMASK(15, 0)
684+
#define FBNIC_RPC_TCAM_IP_ADDR_MASK CSR_GENMASK(31, 16)
685+
680686
#define FBNIC_RPC_TCAM_OUTER_IPDST(m, n)\
681687
(0x08c48 + 0x08 * (n) + (m)) /* 0x023120 + 32*n + 4*m */
682688
#define FBNIC_RPC_TCAM_IPSRC(m, n)\

drivers/net/ethernet/meta/fbnic/fbnic_debugfs.c

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,132 @@ static int fbnic_dbg_mac_addr_show(struct seq_file *s, void *v)
4444
}
4545
DEFINE_SHOW_ATTRIBUTE(fbnic_dbg_mac_addr);
4646

47+
static int fbnic_dbg_tce_tcam_show(struct seq_file *s, void *v)
48+
{
49+
struct fbnic_dev *fbd = s->private;
50+
int i, tcam_idx = 0;
51+
char hdr[80];
52+
53+
/* Generate Header */
54+
snprintf(hdr, sizeof(hdr), "%3s %s %-17s %s\n",
55+
"Idx", "S", "TCAM Bitmap", "Addr/Mask");
56+
seq_puts(s, hdr);
57+
fbnic_dbg_desc_break(s, strnlen(hdr, sizeof(hdr)));
58+
59+
for (i = 0; i < ARRAY_SIZE(fbd->mac_addr); i++) {
60+
struct fbnic_mac_addr *mac_addr = &fbd->mac_addr[i];
61+
62+
/* Verify BMC bit is set */
63+
if (!test_bit(FBNIC_MAC_ADDR_T_BMC, mac_addr->act_tcam))
64+
continue;
65+
66+
if (tcam_idx == FBNIC_TCE_TCAM_NUM_ENTRIES)
67+
break;
68+
69+
seq_printf(s, "%02d %d %64pb %pm\n",
70+
tcam_idx, mac_addr->state, mac_addr->act_tcam,
71+
mac_addr->value.addr8);
72+
seq_printf(s, " %pm\n",
73+
mac_addr->mask.addr8);
74+
tcam_idx++;
75+
}
76+
77+
return 0;
78+
}
79+
DEFINE_SHOW_ATTRIBUTE(fbnic_dbg_tce_tcam);
80+
81+
static int fbnic_dbg_act_tcam_show(struct seq_file *s, void *v)
82+
{
83+
struct fbnic_dev *fbd = s->private;
84+
char hdr[80];
85+
int i;
86+
87+
/* Generate Header */
88+
snprintf(hdr, sizeof(hdr), "%3s %s %-55s %-4s %s\n",
89+
"Idx", "S", "Value/Mask", "RSS", "Dest");
90+
seq_puts(s, hdr);
91+
fbnic_dbg_desc_break(s, strnlen(hdr, sizeof(hdr)));
92+
93+
for (i = 0; i < FBNIC_RPC_TCAM_ACT_NUM_ENTRIES; i++) {
94+
struct fbnic_act_tcam *act_tcam = &fbd->act_tcam[i];
95+
96+
seq_printf(s, "%02d %d %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %08x\n",
97+
i, act_tcam->state,
98+
act_tcam->value.tcam[10], act_tcam->value.tcam[9],
99+
act_tcam->value.tcam[8], act_tcam->value.tcam[7],
100+
act_tcam->value.tcam[6], act_tcam->value.tcam[5],
101+
act_tcam->value.tcam[4], act_tcam->value.tcam[3],
102+
act_tcam->value.tcam[2], act_tcam->value.tcam[1],
103+
act_tcam->value.tcam[0], act_tcam->rss_en_mask,
104+
act_tcam->dest);
105+
seq_printf(s, " %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x\n",
106+
act_tcam->mask.tcam[10], act_tcam->mask.tcam[9],
107+
act_tcam->mask.tcam[8], act_tcam->mask.tcam[7],
108+
act_tcam->mask.tcam[6], act_tcam->mask.tcam[5],
109+
act_tcam->mask.tcam[4], act_tcam->mask.tcam[3],
110+
act_tcam->mask.tcam[2], act_tcam->mask.tcam[1],
111+
act_tcam->mask.tcam[0]);
112+
}
113+
114+
return 0;
115+
}
116+
DEFINE_SHOW_ATTRIBUTE(fbnic_dbg_act_tcam);
117+
118+
static int fbnic_dbg_ip_addr_show(struct seq_file *s,
119+
struct fbnic_ip_addr *ip_addr)
120+
{
121+
char hdr[80];
122+
int i;
123+
124+
/* Generate Header */
125+
snprintf(hdr, sizeof(hdr), "%3s %s %-17s %s %s\n",
126+
"Idx", "S", "TCAM Bitmap", "V", "Addr/Mask");
127+
seq_puts(s, hdr);
128+
fbnic_dbg_desc_break(s, strnlen(hdr, sizeof(hdr)));
129+
130+
for (i = 0; i < FBNIC_RPC_TCAM_IP_ADDR_NUM_ENTRIES; i++, ip_addr++) {
131+
seq_printf(s, "%02d %d %64pb %d %pi6\n",
132+
i, ip_addr->state, ip_addr->act_tcam,
133+
ip_addr->version, &ip_addr->value);
134+
seq_printf(s, " %pi6\n",
135+
&ip_addr->mask);
136+
}
137+
138+
return 0;
139+
}
140+
141+
static int fbnic_dbg_ip_src_show(struct seq_file *s, void *v)
142+
{
143+
struct fbnic_dev *fbd = s->private;
144+
145+
return fbnic_dbg_ip_addr_show(s, fbd->ip_src);
146+
}
147+
DEFINE_SHOW_ATTRIBUTE(fbnic_dbg_ip_src);
148+
149+
static int fbnic_dbg_ip_dst_show(struct seq_file *s, void *v)
150+
{
151+
struct fbnic_dev *fbd = s->private;
152+
153+
return fbnic_dbg_ip_addr_show(s, fbd->ip_dst);
154+
}
155+
DEFINE_SHOW_ATTRIBUTE(fbnic_dbg_ip_dst);
156+
157+
static int fbnic_dbg_ipo_src_show(struct seq_file *s, void *v)
158+
{
159+
struct fbnic_dev *fbd = s->private;
160+
161+
return fbnic_dbg_ip_addr_show(s, fbd->ipo_src);
162+
}
163+
DEFINE_SHOW_ATTRIBUTE(fbnic_dbg_ipo_src);
164+
165+
static int fbnic_dbg_ipo_dst_show(struct seq_file *s, void *v)
166+
{
167+
struct fbnic_dev *fbd = s->private;
168+
169+
return fbnic_dbg_ip_addr_show(s, fbd->ipo_dst);
170+
}
171+
DEFINE_SHOW_ATTRIBUTE(fbnic_dbg_ipo_dst);
172+
47173
static int fbnic_dbg_pcie_stats_show(struct seq_file *s, void *v)
48174
{
49175
struct fbnic_dev *fbd = s->private;
@@ -84,6 +210,18 @@ void fbnic_dbg_fbd_init(struct fbnic_dev *fbd)
84210
&fbnic_dbg_pcie_stats_fops);
85211
debugfs_create_file("mac_addr", 0400, fbd->dbg_fbd, fbd,
86212
&fbnic_dbg_mac_addr_fops);
213+
debugfs_create_file("tce_tcam", 0400, fbd->dbg_fbd, fbd,
214+
&fbnic_dbg_tce_tcam_fops);
215+
debugfs_create_file("act_tcam", 0400, fbd->dbg_fbd, fbd,
216+
&fbnic_dbg_act_tcam_fops);
217+
debugfs_create_file("ip_src", 0400, fbd->dbg_fbd, fbd,
218+
&fbnic_dbg_ip_src_fops);
219+
debugfs_create_file("ip_dst", 0400, fbd->dbg_fbd, fbd,
220+
&fbnic_dbg_ip_dst_fops);
221+
debugfs_create_file("ipo_src", 0400, fbd->dbg_fbd, fbd,
222+
&fbnic_dbg_ipo_src_fops);
223+
debugfs_create_file("ipo_dst", 0400, fbd->dbg_fbd, fbd,
224+
&fbnic_dbg_ipo_dst_fops);
87225
}
88226

89227
void fbnic_dbg_fbd_exit(struct fbnic_dev *fbd)

0 commit comments

Comments
 (0)