Date: Tue, 20 Sep 2016 05:22:59 +0000 From: KrishnamRaju ErapaRaju <Krishna2@chelsio.com> To: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net> Cc: "freebsd-net@freebsd.org" <freebsd-net@freebsd.org> Subject: RE: unable to use BPF Just-In-Time compiler Message-ID: <BN4PR12MB08183E0C966CA63CE3D0F31C94F70@BN4PR12MB0818.namprd12.prod.outlook.com> In-Reply-To: <315A03D6-4E89-4C23-8E37-BC52643B5DC6@lists.zabbadoz.net> References: <BN4PR12MB0818CC41AAD82420B3C3EB3A94F00@BN4PR12MB0818.namprd12.prod.outlook.com> <3F7A8F51-D404-4FEF-910C-8E51DD5061AD@lists.zabbadoz.net> <3f462411-c691-f3b8-35f4-f1904c4b84aa@FreeBSD.org> <315A03D6-4E89-4C23-8E37-BC52643B5DC6@lists.zabbadoz.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[root@taj ~]# sysctl net.bpf_jitter.enable
net.bpf_jitter.enable: 1
It shows '1', but don’t know why the code under "BPF_JITTER" macro not getting executed.
----------------my code snippet-------------
#ifdef BPF_JITTER
printf("JITTER filter\n");
if (policy->flt_tbl[i].jit_filter)
ret = (*(policy->flt_tbl[i].jit_filter->func))(pkt,
pktlen, pktlen);
else
ret = 0;
#else
printf("bpf_filter\n");
ret = bpf_filter(policy->flt_tbl[i].filter_rule.bf_insns, pkt,
pktlen, pktlen);
#endif
Thanks,
Krishna.
-----Original Message-----
From: Bjoern A. Zeeb [mailto:bzeeb-lists@lists.zabbadoz.net]
Sent: Tuesday, September 20, 2016 2:48 AM
To: KrishnamRaju ErapaRaju <Krishna2@chelsio.com>
Cc: freebsd-net@freebsd.org
Subject: Re: unable to use BPF Just-In-Time compiler
On 19 Sep 2016, at 16:04, Jung-uk Kim wrote:
> On 09/17/2016 17:11, Bjoern A. Zeeb wrote:
>> On 15 Sep 2016, at 5:32, KrishnamRaju ErapaRaju wrote:
>>
>>> Hi,
>>>
>>> I want to use BPF JIT Kernel APIs in FreeBSD(like: bpf_jitter(),
>>> etc..), for implementing TCP connection packet filtering.
>>>
>>> I have followed below instructions as specified in:
>>> https://lists.freebsd.org/pipermail/freebsd-current/2005-December/05
>>> 8603.html
>>>
>>>
>>> STEPS followed:
>>> ---------------------
>>> cp /usr/src/sys/amd64/conf/GENERIC /usr/src/sys/amd64/conf/MYKERNEL
>>>
>>> And added below line in MYKERNEL config file.
>>> options BPF_JITTER
>>
>> I think you want
>>
>> device bpf_jitter
>>
>> The options line to my understanding only turns it on by default.
>
> "options BPF_JITTER" works. I don't know why the OP thinks that it
> doesn't work, though.
Ok, let’s see; if you boot your own kernel, what does
sysctl net.bpf_jitter.enable
say?
/bz
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BN4PR12MB08183E0C966CA63CE3D0F31C94F70>
