]> The Tcpdump Group git mirrors - libpcap/commitdiff
userland install_bpf_program
authorjingleyang <[email protected]>
Sun, 23 Dec 2018 13:59:11 +0000 (21:59 +0800)
committerjingleyang <[email protected]>
Sun, 23 Dec 2018 13:59:11 +0000 (21:59 +0800)
pcap-dpdk.c

index 81e29e92ae2fcc97360bea578765f31ea4d108db..d53928f159034dd4a3eb62de30861b2df8a20b8e 100644 (file)
@@ -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;