Skip to content

Commit b60da3b

Browse files
committed
Add a ff_rss_tbl_init log.
1 parent f699326 commit b60da3b

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

lib/ff_config.h

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,36 @@ extern char *dpdk_argv[DPDK_CONFIG_NUM + 1];
7979
#define FF_RSS_TBL_MAX_ENTRIES (FF_RSS_TBL_MAX_SADDR_SPORT_ENTRIES * FF_RSS_TBL_MAX_DADDR)
8080
#define FF_RSS_TBL_MAX_ENTRIES_MASK (FF_RSS_TBL_MAX_ENTRIES - 1)
8181

82+
#ifndef NIPQUAD
83+
#define NIPQUAD_FMT "%u.%u.%u.%u"
84+
#define NIPQUAD(addr) \
85+
(unsigned)((unsigned char *)&addr)[0], \
86+
(unsigned)((unsigned char *)&addr)[1], \
87+
(unsigned)((unsigned char *)&addr)[2], \
88+
(unsigned)((unsigned char *)&addr)[3]
89+
#endif
90+
91+
#ifndef NIP6
92+
#define NIP6_FMT "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x"
93+
#define NIP6(addr) \
94+
(unsigned)((addr).s6_addr[0]), \
95+
(unsigned)((addr).s6_addr[1]), \
96+
(unsigned)((addr).s6_addr[2]), \
97+
(unsigned)((addr).s6_addr[3]), \
98+
(unsigned)((addr).s6_addr[4]), \
99+
(unsigned)((addr).s6_addr[5]), \
100+
(unsigned)((addr).s6_addr[6]), \
101+
(unsigned)((addr).s6_addr[7]), \
102+
(unsigned)((addr).s6_addr[8]), \
103+
(unsigned)((addr).s6_addr[9]), \
104+
(unsigned)((addr).s6_addr[10]), \
105+
(unsigned)((addr).s6_addr[11]), \
106+
(unsigned)((addr).s6_addr[12]), \
107+
(unsigned)((addr).s6_addr[13]), \
108+
(unsigned)((addr).s6_addr[14]), \
109+
(unsigned)((addr).s6_addr[15])
110+
#endif
111+
82112
struct ff_hw_features {
83113
uint8_t rx_csum;
84114
uint8_t rx_lro;
@@ -311,7 +341,7 @@ struct ff_config {
311341
uint16_t enable;
312342
uint16_t snap_len;
313343
uint32_t save_len;
314-
char* save_path;
344+
char* save_path;
315345
} pcap;
316346
};
317347

lib/ff_dpdk_if.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,12 +2474,10 @@ ff_rss_tbl_init(void)
24742474
struct ff_dpdk_if_context ctx;
24752475

24762476
memset(ff_rss_tbl, 0, sizeof(ff_rss_tbl));
2477-
//ff_rss_tbl.init = FF_RSS_TBL_INITING;
24782477

24792478
sc = ff_veth_get_softc(&ctx);
24802479
if (sc == NULL) {
24812480
printf("ff_veth_get_softc failed\n");
2482-
//ff_rss_tbl.init = FF_RSS_TBL_INIT_FAILED;
24832481
return -1;
24842482
}
24852483

@@ -2520,7 +2518,6 @@ ff_rss_tbl_init(void)
25202518
" idx %d, port_id %u, daddr %u, saddr %u, sport %u\n",
25212519
FF_RSS_TBL_MAX_SADDR_SPORT_ENTRIES, FF_RSS_TBL_MAX_SADDR, FF_RSS_TBL_MAX_SPORT,
25222520
i, ctx.port_id, daddr, saddr, sport);
2523-
//ff_rss_tbl.init = FF_RSS_TBL_INIT_FAILED;
25242521
goto IGNORE;
25252522
//ff_veth_free_softc(sc);
25262523
//return -1;
@@ -2586,13 +2583,18 @@ ff_rss_tbl_init(void)
25862583
ff_rss_tbl[idx].sport = sport;
25872584
ff_rss_tbl[idx].num++;
25882585

2586+
printf("Inited one ff_rss_tbl success, port_id %u, daddr "NIPQUAD_FMT
2587+
", saddr "NIPQUAD_FMT", sport %u,"
2588+
" last idx %u, available lport num %u\n",
2589+
ctx.port_id, NIPQUAD(daddr), NIPQUAD(saddr), htons(sport),
2590+
ff_rss_tbl[idx].dip_tbl[daddr_idx].last_idx,
2591+
ff_rss_tbl[idx].dip_tbl[daddr_idx].num);
2592+
25892593
IGNORE:
25902594
// do nothing
25912595
;
25922596
}
25932597

2594-
//ff_rss_tbl.init = FF_RSS_TBL_INITED;
2595-
25962598
ff_veth_free_softc(sc);
25972599

25982600
return 0;

0 commit comments

Comments
 (0)