Add configuration item: vlan_strip

dev
logwang 2017-08-09 16:52:16 +08:00
parent 5825eee0c3
commit 64abcf71e3
6 changed files with 12 additions and 4 deletions

View File

@ -119,7 +119,7 @@ static int inited;
#define SYSCALL(func) \
({ \
if (!real_##func) { \
if (unlikely(!real_##func)) { \
real_##func = dlsym(RTLD_NEXT, #func); \
} \
real_##func; \

View File

@ -11,6 +11,8 @@ promiscuous=1
numa_on=1
## TCP segment offload, default: disabled.
tso=0
## HW vlan strip, default: enabled.
vlan_strip=1
## Port config section
## According to dpdk.nb_ports: port0, port1...

View File

@ -272,6 +272,8 @@ ini_parse_handler(void* user, const char* section, const char* name,
pconfig->dpdk.numa_on = atoi(value);
} else if (MATCH("dpdk", "tso")) {
pconfig->dpdk.tso = atoi(value);
} else if (MATCH("dpdk", "vlan_strip")) {
pconfig->dpdk.vlan_strip = atoi(value);
} else if (MATCH("kni", "enable")) {
pconfig->kni.enable= atoi(value);
} else if (MATCH("kni", "method")) {

View File

@ -83,6 +83,7 @@ struct ff_config {
int promiscuous;
int numa_on;
int tso;
int vlan_strip;
/* list of proc-lcore */
uint16_t *proc_lcore;
struct ff_port_cfg *port_cfgs;

View File

@ -612,8 +612,10 @@ init_port_start(void)
port_conf.rx_adv_conf.rss_conf.rss_key_len = 40;
/* Set Rx VLAN stripping */
if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_VLAN_STRIP) {
port_conf.rxmode.hw_vlan_strip = 1;
if (ff_global_cfg.dpdk.vlan_strip) {
if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_VLAN_STRIP) {
port_conf.rxmode.hw_vlan_strip = 1;
}
}
/* Enable HW CRC stripping */

View File

@ -120,7 +120,8 @@ ff_freebsd_init(void)
cur->value, cur->vlen, NULL, 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;