[Ntop-misc] pf_ring: Clarification regarding the relation between poll-watermark and poll-duration

2017-10-18 Thread Amir Kaduri
Hi,

I'm using pf_ring 6.6.0 (no ZC) on CentOS 7, on 10G interfaces (ixgbe
drivers).
As far as I understand the relation between poll-watermark and
poll-duration, packets will be queued untill one of comes first: or passing
the poll-watermark packets threshold, or a poll-duration milliseconds has
passed.
I set poll-watermark to the maximum (4096)
(using pfring_set_poll_watermark()) and set poll-duration to the minimum
(1) (using pfring_set_poll_duration()).
I've sent 400 packets to the socket. I see that they are received by the
NIC, but they didn't pass to userland. Only when passing 500 packets, a
chunk of them passed to userland.
I don't quite understand the behavior: since poll-duration is 1
(millisecond I assume), I've expected all the packets to pass to userland
immediately, even though poll-watermark is much higher.

Can anyone shed some light on the above?

Thanks,
Amir
___
Ntop-misc mailing list
Ntop-misc@listgateway.unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-misc

[Ntop-misc] pf_ring: bug fix (rule inactivity)

2017-10-18 Thread Amir Kaduri
Hi Alfredo,

The attached patch includes a fix of a bug that relates to updating the
last time a hash rule was active. I assume that the
pfring_purge_idle_hash_rules()
API doesn't work for this reason.
I also added an enhancement of the API pfring_get_hash_filtering_rule_stats()
to return for how long a hash filtering rule is inactive.
The patch is based on pfring 6.6.0.

Since the fix and the enhancement are pretty short, I put them together in
the same patch.

I'll appreciate getting a feedback on this fix (I already sent it over a
month ago).

Thanks,
Amir
diff -Naur PF_RING-6.6.0-clean/kernel/linux/pf_ring.h 
PF_RING-6.6.0-rule_inactivity/kernel/linux/pf_ring.h
--- PF_RING-6.6.0-clean/kernel/linux/pf_ring.h  2017-04-24 12:53:37.0 
+0300
+++ PF_RING-6.6.0-rule_inactivity/kernel/linux/pf_ring.h2017-09-19 
13:51:42.709946000 +0300
@@ -604,6 +604,7 @@
 typedef struct {
   u_int64_t match;
   u_int64_t miss;
+  u_int32_t rule_inactivity;
 } hash_filtering_rule_stats;
 
 /* * */
diff -Naur PF_RING-6.6.0-clean/kernel/pf_ring.c 
PF_RING-6.6.0-rule_inactivity/kernel/pf_ring.c
--- PF_RING-6.6.0-clean/kernel/pf_ring.c2017-04-24 12:53:37.0 
+0300
+++ PF_RING-6.6.0-rule_inactivity/kernel/pf_ring.c  2017-09-19 
14:04:11.680328000 +0300
@@ -2372,7 +2372,6 @@
 && (hash_bucket->rule.host4_peer_b == rule->host4_peer_a)
 && (hash_bucket->rule.port_peer_a == rule->port_peer_b)
 && (hash_bucket->rule.port_peer_b == rule->port_peer_a {
-hash_bucket->rule.internals.jiffies_last_match = jiffies;
 return(1);
   } else
 return(0);
@@ -3291,6 +3290,7 @@
   while(hash_bucket != NULL) {
 if(hash_bucket_match(hash_bucket, hdr, 0, 0)) {
   hash_bucket->match++;
+  hash_bucket->rule.internals.jiffies_last_match = jiffies;
   hash_found = 1;
   break;
 } else
@@ -7146,6 +7146,7 @@
   hash_filtering_rule_stats hfrs;
   hfrs.match = bucket->match;
   hfrs.miss = pfr->sw_filtering_hash_miss;
+  hfrs.rule_inactivity = (u_int32_t)(jiffies_to_msecs(jiffies - 
bucket->rule.internals.jiffies_last_match) / 1000);
  rc = sizeof(hash_filtering_rule_stats);
   if(copy_to_user(optval, , rc)) {
printk("[PF_RING] copy_to_user() failure\n");
___
Ntop-misc mailing list
Ntop-misc@listgateway.unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-misc

[Ntop-misc] Unable to Configure FIberblaze Card

2017-10-18 Thread Murphy, William
We are setting up an N2DISK box on a very beefy Dell server running RHEL 7.4 
and using a 2x10G Silicom FiberBlaze capture card...  When we follow the 
process from https://github.com/ntop/PF_RING/blob/dev/doc/README.fiberblaze.md 
we get the following error about safe FPGA image being loaded...  Does anyone 
have any ideas how to get around this error?

[root@n2dskaplp001 dschwarz]# cd /opt/fiberblaze/driver; make; ./load_driver.sh 
hugepages='2G'
make -C /lib/modules/3.10.0-693.2.2.el7.x86_64/build M=/opt/fiberblaze/driver 
modules
make[1]: Entering directory `/usr/src/kernels/3.10.0-693.2.2.el7.x86_64'
  CC [M]  /opt/fiberblaze/driver/util.o
  CC [M]  /opt/fiberblaze/driver/fpga.o
  CC [M]  /opt/fiberblaze/driver/sfc.o
  CC [M]  /opt/fiberblaze/driver/dma.o
  CC [M]  /opt/fiberblaze/driver/fb.o
  CC [M]  /opt/fiberblaze/driver/panic.o
  CC [M]  /opt/fiberblaze/driver/statistics.o
  CC [M]  /opt/fiberblaze/driver/fbversion.o
  CC [M]  /opt/fiberblaze/driver/tx.o
  CC [M]  /opt/fiberblaze/driver/memres.o
  CC [M]  /opt/fiberblaze/driver/idseq.o
  CC [M]  /opt/fiberblaze/driver/flash.o
  CC [M]  /opt/fiberblaze/driver/nic.o
  CC [M]  /opt/fiberblaze/driver/fbcommon.o
  LD [M]  /opt/fiberblaze/driver/fbcapture.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC  /opt/fiberblaze/driver/fbcapture.mod.o
  LD [M]  /opt/fiberblaze/driver/fbcapture.ko
make[1]: Leaving directory `/usr/src/kernels/3.10.0-693.2.2.el7.x86_64'
insmod /opt/fiberblaze/driver/fbcapture.ko hugepages=2G
Unable to configure card: Network card /dev/fbcard0 has a safe FPGA image 
loaded.
Error: Retrieving driver version is not possible. - 35
Error: Unable to retrieve driver version. - 35
Unable to configure card: Network card /dev/fbcard0 has a safe FPGA image 
loaded.
Error: Retrieving driver version is not possible. - 35
Error: Unable to retrieve driver version. - 35

Failed to reserve hugepages memory. Unloading driver.

Thanks in advance for any help you can provide...

Bill Murphy
University of Texas Health Science Center at Houston

___
Ntop-misc mailing list
Ntop-misc@listgateway.unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-misc