Skip to content

Commit b6692e6

Browse files
committed
Remove the code for rte_kni.ko, only retain virtio.
1 parent 5f3768c commit b6692e6

File tree

7 files changed

+37
-200
lines changed

7 files changed

+37
-200
lines changed

config.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,7 @@ rss_tbl=0 192.168.1.1 192.168.2.1 80;0 192.168.1.1 192.168.2.1 443
251251
# all packets that do not belong to the following tcp_port and udp_port
252252
# will transmit to kernel; if method=accept, all packets that belong to
253253
# the following tcp_port and udp_port will transmit to kernel.
254-
# type: exception path type, 0 means kni(must set meson -Ddisable_libs=flow_classif to re-enable kni in DPDK first), 1 means virtio_user(linux only)
255254
#[kni]
256-
#type=1
257255
#enable=1
258256
#method=reject
259257
# The format is same as port_list

lib/Makefile

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#
1+
#
22
# Copyright (c) 2013 Patrick Kelsey. All rights reserved.
33
# Copyright (C) 2017-2021 THL A29 Limited, a Tencent company.
44
# All rights reserved.
@@ -31,9 +31,9 @@ HOST_OS:=$(shell uname -s)
3131
#DEBUG=-O0 -gdwarf-2 -g3 -Wno-format-truncation
3232

3333
# No DPDK KNI support on FreeBSD
34+
# Enable KNI, via viritio only, no longer support rte_kni.ko.
3435
ifneq ($(TGT_OS),FreeBSD)
3536
FF_KNI=1
36-
#FF_KNI_KNI=1
3737
endif
3838

3939
#FF_FLOW_ISOLATE=1
@@ -79,17 +79,13 @@ endif
7979
ifndef DEBUG
8080
HOST_CFLAGS = -O2 -frename-registers -funswitch-loops -fweb -Wno-format-truncation
8181
else
82-
HOST_CFLAGS = ${DEBUG}
82+
HOST_CFLAGS = ${DEBUG}
8383
endif
8484

8585
ifdef FF_KNI
8686
HOST_CFLAGS+= -DFF_KNI
8787
endif
8888

89-
ifdef FF_KNI_KNI
90-
HOST_CFLAGS+= -DFF_KNI_KNI
91-
endif
92-
9389
HOST_CFLAGS+= ${DPDK_CFLAGS}
9490
HOST_CFLAGS+= ${CONF_CFLAGS}
9591

@@ -124,7 +120,7 @@ CFLAGS+= -DINET
124120
GCCVERGE10 = $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 10)
125121
ifeq "$(GCCVERGE10)" "1"
126122
CFLAGS+= -Wno-error=stringop-overflow
127-
endif
123+
endif
128124

129125
GCCVERGE11 = $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 11)
130126
ifeq "$(GCCVERGE11)" "1"
@@ -288,7 +284,7 @@ FF_HOST_SRCS+= \
288284
ff_dpdk_pcap.c \
289285
ff_epoll.c \
290286
ff_log.c \
291-
ff_init.c
287+
ff_init.c
292288

293289
ifdef FF_KNI
294290
FF_HOST_SRCS+= \
@@ -578,7 +574,7 @@ EXTRA_TCP_STACKS_SRCS+= \
578574
bbr.c
579575
endif
580576

581-
577+
582578
ifneq ($(TGT_OS),FreeBSD)
583579
ifndef FF_KNI
584580
FF_HOST_SRCS+= \
@@ -677,7 +673,7 @@ all: libfstack.a
677673
libfstack.a: machine_includes ff_api.symlist ${MHEADERS} ${MSRCS} ${HOST_OBJS} ${ASM_OBJS} ${OBJS}
678674
${LD} -d -r -o $*.ro ${ASM_OBJS} ${OBJS}
679675
nm $*.ro | grep -v ' U ' | cut -d ' ' -f 3 > $*_localize_list.tmp
680-
objcopy --localize-symbols=$*_localize_list.tmp $*.ro
676+
objcopy --localize-symbols=$*_localize_list.tmp $*.ro
681677
rm $*_localize_list.tmp
682678
objcopy --globalize-symbols=ff_api.symlist $*.ro
683679
rm -f $@

lib/ff_config.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -988,8 +988,6 @@ ini_parse_handler(void* user, const char* section, const char* name,
988988
pconfig->dpdk.symmetric_rss = atoi(value);
989989
} else if (MATCH("kni", "enable")) {
990990
pconfig->kni.enable= atoi(value);
991-
} else if (MATCH("kni", "type")) {
992-
pconfig->kni.type= atoi(value);
993991
} else if (MATCH("kni", "console_packets_ratelimit")) {
994992
pconfig->kni.console_packets_ratelimit= atoi(value);
995993
} else if (MATCH("kni", "general_packets_ratelimit")) {
@@ -1311,12 +1309,6 @@ ff_check_config(struct ff_config *cfg)
13111309
lcore_id, pc->port_id);
13121310
return -1;
13131311
}
1314-
1315-
if (cfg->kni.type != KNI_TYPE_KNI && cfg->kni.type != KNI_TYPE_VIRTIO) {
1316-
fprintf(stderr,
1317-
"kni type value must be 0 or 1, now is:%d\n", cfg->kni.type);
1318-
return -1;
1319-
}
13201312
}
13211313
}
13221314

lib/ff_config.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ extern char *dpdk_argv[DPDK_CONFIG_NUM + 1];
5757

5858
#define VIP_MAX_NUM 64
5959

60-
/* exception path(KNI) type */
61-
#define KNI_TYPE_KNI 0
62-
#define KNI_TYPE_VIRTIO 1
63-
6460
/* ff_rss_check table args */
6561
/* remote IP:PORT */
6662
#define FF_RSS_TBL_MAX_SADDR (4)
@@ -313,7 +309,6 @@ struct ff_config {
313309

314310
struct {
315311
int enable;
316-
int type;
317312
int console_packets_ratelimit;
318313
int general_packets_ratelimit;
319314
int kernel_packets_ratelimit;

lib/ff_dpdk_if.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ init_kni(void)
545545

546546
knictl_action = get_kni_action(ff_global_cfg.kni.kni_action);
547547

548-
ff_kni_init(nb_ports, ff_global_cfg.kni.type, ff_global_cfg.kni.tcp_port,
548+
ff_kni_init(nb_ports, ff_global_cfg.kni.tcp_port,
549549
ff_global_cfg.kni.udp_port);
550550

551551
unsigned socket_id = lcore_conf.socket_id;
@@ -555,7 +555,7 @@ init_kni(void)
555555
int i, ret;
556556
for (i = 0; i < nb_ports; i++) {
557557
uint16_t port_id = ff_global_cfg.dpdk.portid_list[i];
558-
ff_kni_alloc(port_id, socket_id, ff_global_cfg.kni.type, i, mbuf_pool, KNI_QUEUE_SIZE);
558+
ff_kni_alloc(port_id, socket_id, i, KNI_QUEUE_SIZE);
559559
}
560560

561561
return 0;
@@ -601,12 +601,7 @@ init_port_start(void)
601601
total_nb_ports = nb_ports;
602602
#ifdef FF_KNI
603603
if (enable_kni && rte_eal_process_type() == RTE_PROC_PRIMARY) {
604-
#ifdef FF_KNI_KNI
605-
if (ff_global_cfg.kni.type == KNI_TYPE_VIRTIO)
606-
#endif
607-
{
608604
total_nb_ports *= 2; /* one more virtio_user port for kernel per port */
609-
}
610605
}
611606
#endif
612607

0 commit comments

Comments
 (0)