diff options
author | jingleyang <yjyfrombnu@gmail.com> | 2018-12-23 21:59:11 +0800 |
---|---|---|
committer | jingleyang <yjyfrombnu@gmail.com> | 2018-12-23 21:59:11 +0800 |
commit | cf48b4ddc9662c04dae6cc1a73be0bee1f5628a2 (patch) | |
tree | 123c33d128a8e444bcd253785fd13206c402d9a5 /pcap-dpdk.c | |
parent | 67d0b02aa64014902734efc45ddcdff0905d0f5f (diff) |
userland install_bpf_program
Diffstat (limited to 'pcap-dpdk.c')
-rw-r--r-- | pcap-dpdk.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/pcap-dpdk.c b/pcap-dpdk.c index 81e29e92..d53928f1 100644 --- a/pcap-dpdk.c +++ b/pcap-dpdk.c @@ -366,18 +366,6 @@ static void pcap_dpdk_close(pcap_t *p) pcap_cleanup_live_common(p); } -static int pcap_dpdk_setfilter(pcap_t *p, struct bpf_program *fp) -{ - //init bpf for dpdk, only support userspace bfp - struct pcap_dpdk * pd = p->priv; - int ret=0; - ret = install_bpf_program(p, fp); - if (ret==0){ - pd->filter_in_userland = 1; - } - return ret; -} - static void nic_stats_display(struct pcap_dpdk *pd) { uint16_t portid = pd->portid; @@ -729,7 +717,9 @@ static int pcap_dpdk_activate(pcap_t *p) p->selectable_fd = p->fd; p->read_op = pcap_dpdk_dispatch; p->inject_op = pcap_dpdk_inject; - p->setfilter_op = pcap_dpdk_setfilter; + // DPDK only support filter in userland now + pd->filter_in_userland = 1; + p->setfilter_op = install_bpf_program; p->setdirection_op = NULL; p->set_datalink_op = NULL; p->getnonblock_op = pcap_dpdk_getnonblock; |