Add configuration item: vlan_strip
parent
5825eee0c3
commit
64abcf71e3
|
@ -119,7 +119,7 @@ static int inited;
|
||||||
|
|
||||||
#define SYSCALL(func) \
|
#define SYSCALL(func) \
|
||||||
({ \
|
({ \
|
||||||
if (!real_##func) { \
|
if (unlikely(!real_##func)) { \
|
||||||
real_##func = dlsym(RTLD_NEXT, #func); \
|
real_##func = dlsym(RTLD_NEXT, #func); \
|
||||||
} \
|
} \
|
||||||
real_##func; \
|
real_##func; \
|
||||||
|
|
|
@ -11,6 +11,8 @@ promiscuous=1
|
||||||
numa_on=1
|
numa_on=1
|
||||||
## TCP segment offload, default: disabled.
|
## TCP segment offload, default: disabled.
|
||||||
tso=0
|
tso=0
|
||||||
|
## HW vlan strip, default: enabled.
|
||||||
|
vlan_strip=1
|
||||||
|
|
||||||
## Port config section
|
## Port config section
|
||||||
## According to dpdk.nb_ports: port0, port1...
|
## According to dpdk.nb_ports: port0, port1...
|
||||||
|
|
|
@ -272,6 +272,8 @@ ini_parse_handler(void* user, const char* section, const char* name,
|
||||||
pconfig->dpdk.numa_on = atoi(value);
|
pconfig->dpdk.numa_on = atoi(value);
|
||||||
} else if (MATCH("dpdk", "tso")) {
|
} else if (MATCH("dpdk", "tso")) {
|
||||||
pconfig->dpdk.tso = atoi(value);
|
pconfig->dpdk.tso = atoi(value);
|
||||||
|
} else if (MATCH("dpdk", "vlan_strip")) {
|
||||||
|
pconfig->dpdk.vlan_strip = atoi(value);
|
||||||
} else if (MATCH("kni", "enable")) {
|
} else if (MATCH("kni", "enable")) {
|
||||||
pconfig->kni.enable= atoi(value);
|
pconfig->kni.enable= atoi(value);
|
||||||
} else if (MATCH("kni", "method")) {
|
} else if (MATCH("kni", "method")) {
|
||||||
|
|
|
@ -83,6 +83,7 @@ struct ff_config {
|
||||||
int promiscuous;
|
int promiscuous;
|
||||||
int numa_on;
|
int numa_on;
|
||||||
int tso;
|
int tso;
|
||||||
|
int vlan_strip;
|
||||||
/* list of proc-lcore */
|
/* list of proc-lcore */
|
||||||
uint16_t *proc_lcore;
|
uint16_t *proc_lcore;
|
||||||
struct ff_port_cfg *port_cfgs;
|
struct ff_port_cfg *port_cfgs;
|
||||||
|
|
|
@ -612,8 +612,10 @@ init_port_start(void)
|
||||||
port_conf.rx_adv_conf.rss_conf.rss_key_len = 40;
|
port_conf.rx_adv_conf.rss_conf.rss_key_len = 40;
|
||||||
|
|
||||||
/* Set Rx VLAN stripping */
|
/* Set Rx VLAN stripping */
|
||||||
if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_VLAN_STRIP) {
|
if (ff_global_cfg.dpdk.vlan_strip) {
|
||||||
port_conf.rxmode.hw_vlan_strip = 1;
|
if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_VLAN_STRIP) {
|
||||||
|
port_conf.rxmode.hw_vlan_strip = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enable HW CRC stripping */
|
/* Enable HW CRC stripping */
|
||||||
|
|
|
@ -120,7 +120,8 @@ ff_freebsd_init(void)
|
||||||
cur->value, cur->vlen, NULL, 0);
|
cur->value, cur->vlen, NULL, 0);
|
||||||
|
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
printf("kernel_sysctlbyname failed: %s=%s\n", cur->name, cur->str);
|
printf("kernel_sysctlbyname failed: %s=%s, error:%d\n",
|
||||||
|
cur->name, cur->str, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
|
|
Loading…
Reference in New Issue