Open
bjdudu
opened this issue 7 years ago
•
15 comments
firstly, when I use zcount -i zc:enp4s0f0, it works well
secondly, when use pfring but no zc mode, it also works well
but when I use zc mode, the suricata shows error:
[2348] 20/12/2018 -- 20:02:39 - (runmode-pfring.c:278) (ParsePfringConfig) -- ZC interface detected, not setting cluster-id for PF_RING (iface zc:enp4s0f0@0)
[2348] 20/12/2018 -- 20:02:39 - (runmode-pfring.c:326) (ParsePfringConfig) -- ZC interface detected, not setting cluster type for PF_RING (iface zc:enp4s0f0@0)
[2348] 20/12/2018 -- 20:02:39 - (util-ioctl.c:296) (GetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:enp4s0f0@0': No such device (19)
[2348] 20/12/2018 -- 20:02:39 - (util-ioctl.c:296) (GetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:enp4s0f0@0': No such device (19)
[2348] 20/12/2018 -- 20:02:39 - (util-ioctl.c:296) (GetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:enp4s0f0@0': No such device (19)
[2348] 20/12/2018 -- 20:02:39 - (util-ioctl.c:296) (GetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:enp4s0f0@0': No such device (19)
[2348] 20/12/2018 -- 20:02:39 - (util-ioctl.c:296) (GetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:enp4s0f0@0': No such device (19)
[2348] 20/12/2018 -- 20:02:39 - (util-runmodes.c:297) (RunModeSetLiveCaptureWorkersForDevice) -- Going to use 1 thread(s)
#########################################################################
ERROR: You do not seem to have a valid PF_RING ZC license 7.2.0.180613 for enp4s0f0 [Intel 10 Gbit ixgbe 82599-based]
We're now working in demo mode with packet capture and
transmission limited to 5 minutes
#########################################################################
[2395] 20/12/2018 -- 20:02:40 - (source-pfring.c:581) (ReceivePfringThreadInit) -- ZC interface detected, not adding thread to cluster
[2348] 20/12/2018 -- 20:02:40 - (runmode-pfring.c:278) (ParsePfringConfig) -- ZC interface detected, not setting cluster-id for PF_RING (iface zc:enp4s0f0@1)
[2348] 20/12/2018 -- 20:02:40 - (runmode-pfring.c:326) (ParsePfringConfig) -- ZC interface detected, not setting cluster type for PF_RING (iface zc:enp4s0f0@1)
[2348] 20/12/2018 -- 20:02:40 - (util-ioctl.c:296) (GetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:enp4s0f0@1': No such device (19)
[2348] 20/12/2018 -- 20:02:40 - (util-ioctl.c:296) (GetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:enp4s0f0@1': No such device (19)
[2348] 20/12/2018 -- 20:02:40 - (util-ioctl.c:296) (GetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:enp4s0f0@1': No such device (19)
[2348] 20/12/2018 -- 20:02:40 - (util-ioctl.c:296) (GetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:enp4s0f0@1': No such device (19)
[2348] 20/12/2018 -- 20:02:40 - (util-ioctl.c:296) (GetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:enp4s0f0@1': No such device (19)
[2348] 20/12/2018 -- 20:02:40 - (util-runmodes.c:297) (RunModeSetLiveCaptureWorkersForDevice) -- Going to use 1 thread(s)
=============ignoring some similar infos=======================
@bjdudu it seems the first issue is due to suricata calling ioctl on a "zc:" interface which is not recognized by the kernel, we need to check if this is a misconfiguration or some change is needed in the pf_ring support in suricata to avoid that.
As of the panic, that should not happen in any case, first of all I recommend you to update pf_ring as in late august we fixed some kernel panic in the drivers and this could be related. Thank you.
Now I am using the latest pfring, and centos version(kernel 3.10.0-957), but the problem also exists.
And I have found that suricata will shorten the interface name at the beginning of starting process, just like "zc:e..f0@8" in the error message. I also found "Failure when trying to get feature via ioctl for 'zc:enp4s0f0@1': No such device (19)" in the error message, it use the full interface name here, so I decide to change my interface name to a shorter one, just try to test whether it works well. I will update the issue when finish the test.
After changing the interface name, the error still exists.
And now I found that when I use only one receiving thread, suricata and pf_ring zc worked, the error [4412] 7/1/2019 -- 01:22:59 - (util-ioctl.c:296) <Warning> (GetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:eth3': No such device (19) seemed to have no effect with it. But when I use multiple receiving threads, It caused the error Message from syslogd@localhost at Jan 7 00:54:29 ...
kernel:NMI watchdog: BUG: soft lockup - CPU#4 stuck for 22s! [W#01-zc:eth3@1:19303], and sometimes it caused kernel panic directly.
@bjdudu, please note that you cannot use multiple capture threads on the same zc interface as zc sockets are single-consumer (using multiple capture threads leads to corruptions). If you need multiple capture threads you should use RSS, configuring multiple interfaces (zc:enp4s0f0@0, zc:enp4s0f0@1, and so on) with one thread each in suricata.
Our lab had this same problem. The zbalance_ipc binary was out of date using older PF_RING. During the PF_RING upgrade our system prevented the install of a new binary while it is currently running.
Because of seeing the error message "AER: Multiple Uncorrected (Non-Fatal) error received: id=0010", I changed the kernel parameter, add "pci=noaer", and then the pf_ring zc worked in multithread mode. The problem seemed to be solved, but during the suricata initialization, the warnning message [4412] 7/1/2019 -- 01:22:59 - (util-ioctl.c:296) <Warning> (GetEthtoolValue) -- [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:eth3@0': No such device (19) still exists.
Suricata tries to open a socket on "zc:eth3@0" for reading interface information, however "zc:eth3@0" isn't a linux interface (this is a ZC queue), thus the failure. In this case Suricata usually falls back to a default value, and it is likely this error can be ignored, however this should be checked as it is not clear what it is trying to read with this trace.
[root@localhost pf_ring]# PF_RING_FT_CONF=/etc/pf_ring/ft-rules.conf suricata --pfring-int=zc:eno1 -c /etc/suricata/suricata.yaml -vvv
27/3/2019 -- 14:53:31 - - This is Suricata version 4.1.3 RELEASE
27/3/2019 -- 14:53:31 - - CPUs/cores online: 96
27/3/2019 -- 14:53:31 - - luajit states preallocated: 128
27/3/2019 -- 14:53:31 - - 'default' server has 'request-body-minimal-inspect-size' set to 33152 and 'request-body-inspect-window' set to 4220 after randomization.
27/3/2019 -- 14:53:31 - - 'default' server has 'response-body-minimal-inspect-size' set to 42445 and 'response-body-inspect-window' set to 16775 after randomization.
27/3/2019 -- 14:53:31 - - SMB stream depth: 0
...
27/3/2019 -- 14:53:39 - - AppLayer MPM "toserver http_host": 2
27/3/2019 -- 14:53:39 - - AppLayer MPM "toclient http_stat_code": 1
27/3/2019 -- 14:53:39 - - AppLayer MPM "toserver dns_query": 4
27/3/2019 -- 14:53:39 - - AppLayer MPM "toserver tls_sni": 2
27/3/2019 -- 14:53:39 - - AppLayer MPM "toclient tls_cert_issuer": 2
27/3/2019 -- 14:53:39 - - AppLayer MPM "toclient tls_cert_subject": 1
27/3/2019 -- 14:53:39 - - AppLayer MPM "toclient tls_cert_serial": 1
27/3/2019 -- 14:53:39 - - AppLayer MPM "toserver ssh_protocol": 1
27/3/2019 -- 14:53:39 - - AppLayer MPM "toserver file_data": 1
27/3/2019 -- 14:53:39 - - AppLayer MPM "toclient file_data": 5
27/3/2019 -- 14:53:45 - - ZC interface detected, not setting cluster-id for PF_RING (iface zc:eno1)
27/3/2019 -- 14:53:45 - - ZC interface detected, not setting cluster type for PF_RING (iface zc:eno1)
27/3/2019 -- 14:53:45 - - [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:eno1': No such device (19)
27/3/2019 -- 14:53:45 - - [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:eno1': No such device (19)
27/3/2019 -- 14:53:45 - - [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:eno1': No such device (19)
27/3/2019 -- 14:53:45 - - [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:eno1': No such device (19)
27/3/2019 -- 14:53:45 - - [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:eno1': No such device (19)
27/3/2019 -- 14:53:45 - - Going to use 1 thread(s)
27/3/2019 -- 14:53:45 - - Enabling zero-copy for zc:eno1
27/3/2019 -- 14:53:45 - - ZC interface detected, not adding thread to cluster
27/3/2019 -- 14:53:45 - - (W#01-zc:eno1) Using PF_RING v.7.4.0, interface zc:eno1, cluster-id 1, single-pfring-thread
27/3/2019 -- 14:53:45 - - RunModeIdsPfringWorkers initialised
27/3/2019 -- 14:53:45 - - using 1 flow manager threads
27/3/2019 -- 14:53:45 - - using 1 flow recycler threads
27/3/2019 -- 14:53:45 - - Running in live mode, activating unix socket
27/3/2019 -- 14:53:45 - - Using unix socket file '/var/run/suricata/suricata-command.socket'
27/3/2019 -- 14:53:45 - - all 1 packet processing threads, 2 management threads initialized, engine started.
^C27/3/2019 -- 14:54:41 - - Signal Received. Stopping engine.
27/3/2019 -- 14:54:41 - - 0 new flows, 0 established flows were timed out, 0 flows in closed state
27/3/2019 -- 14:54:41 - - [ERRCODE: SC_ERR_PF_RING_RECV(31)] - pfring_recv error -1
27/3/2019 -- 14:54:41 - - time elapsed 55.579s
27/3/2019 -- 14:54:41 - - 0 flows processed
27/3/2019 -- 14:54:41 - - (W#01-zc:eno1) Kernel: Packets 0, dropped 0
27/3/2019 -- 14:54:41 - - (W#01-zc:eno1) Packets 0, bytes 0
27/3/2019 -- 14:54:41 - - Alerts: 0
27/3/2019 -- 14:54:41 - - ippair memory usage: 414144 bytes, maximum: 16777216
27/3/2019 -- 14:54:41 - - host memory usage: 398144 bytes, maximum: 33554432
27/3/2019 -- 14:54:41 - - cleaning up signature grouping structure... complete
27/3/2019 -- 14:54:41 - - Stats for 'zc:eno1': pkts: 0, drop: 0 (-nan%), invalid chksum: 0
27/3/2019 -- 14:54:41 - - Cleaning up Hyperscan global scratch
27/3/2019 -- 14:54:41 - - Clearing Hyperscan database cache
And also it cause bug when using redis.(It did not connect to redis server)
Start std out is below.
[root@hp-devel logstash]# PF_RING_FT_CONF=/etc/pf_ring/ft-rules.conf suricata -i ens1f0 -c /etc/suricata/suricata.yaml
5/4/2019 -- 18:59:46 - - This is Suricata version 4.1.3 RELEASE
5/4/2019 -- 19:00:09 - - all 4 packet processing threads, 2 management threads initialized, engine started.
5/4/2019 -- 19:00:09 - - Trying to connect to Redis
5/4/2019 -- 19:00:09 - - Connected to Redis.
^C5/4/2019 -- 19:00:14 - - Signal Received. Stopping engine.
5/4/2019 -- 19:00:15 - - Stats for 'ens1f0': pkts: 7030, drop: 0 (0.00%), invalid chksum: 0
[root@hp-devel logstash]# PF_RING_FT_CONF=/etc/pf_ring/ft-rules.conf suricata --pfring-int=zc:ens1f0 -c /etc/suricata/suricata.yaml
5/4/2019 -- 19:01:00 - - This is Suricata version 4.1.3 RELEASE
5/4/2019 -- 19:01:21 - - [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:ens1f0': No such device (19)
5/4/2019 -- 19:01:21 - - [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:ens1f0': No such device (19)
5/4/2019 -- 19:01:21 - - [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:ens1f0': No such device (19)
5/4/2019 -- 19:01:21 - - [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:ens1f0': No such device (19)
5/4/2019 -- 19:01:21 - - [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get feature via ioctl for 'zc:ens1f0': No such device (19)
5/4/2019 -- 19:01:22 - - all 1 packet processing threads, 2 management threads initialized, engine started.
^C5/4/2019 -- 19:03:01 - - Signal Received. Stopping engine.
5/4/2019 -- 19:03:01 - - Stats for 'zc:ens1f0': pkts: 128606, drop: 0 (0.00%), invalid chksum: 0
Is this error massage can be ignore for pf_ring zc? ===> [ERRCODE: SC_ERR_SYSCALL(50)]
I guess you can ignore this, Suricata is trying to get info like MTU using zc:ens1f0@1 as interface name, which is not a valid linux interface (it should actually use "ens1f0"), and it should fallback to default values.
where is the config for this errror? ===> Unable to find pfring config for interface zc:ens1f0@1, using default value or 1.0 configuration system.
I am not sure that this is doing actually, please ask to the Suricata support.