Mailing List Archive

zcount displays less packets in zc mode
Hi Everyone, I'm experiencing a weird situation where I'm running zcount twice: 1. zcount -i zc:em1 2. zcount -i em1 the first execution (zc mode) produces a count value of about 0.5 gbps while the 2nd execution (non zc mode) produces a value of about 4.5 gbps. How is that possible ? what am I doing wrong ? i'm using version 6.4.1-stable with 4096 ring slots and an intel 10g device (intel ixgbe 82599) on ubuntu 14.04. Thanks in advance
Re: zcount displays less packets in zc mode [ In reply to ]
Hi Moshe
do you have RSS enabled perhaps?
Please read the documents below:

https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS <https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS>
https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages <https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages>

Alfredo

> On 2 Nov 2016, at 11:00, Moshe Danielli <moshe.dani@walla.co.il> wrote:
>
>
> Hi Everyone,
>
> I'm experiencing a weird situation where I'm running zcount twice:
>
> 1. zcount -i zc:em1
> 2. zcount -i em1
>
> the first execution (zc mode) produces a count value of about 0.5 gbps while the 2nd execution (non zc mode) produces a value of about 4.5 gbps.
>
> How is that possible ? what am I doing wrong ?
>
> i'm using version 6.4.1-stable with 4096 ring slots and an intel 10g device (intel ixgbe 82599) on ubuntu 14.04.
>
> Thanks in advance
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
Re: zcount displays less packets in zc mode [ In reply to ]
Hi Alfredo,

1. You were abosutely right - that was the exact reason. Once I switched to single queue mode, everything worked as expected. 2. Given Intel's RSS functionality - what is zbalance_irq doing different ? Why should I use it instead of making use of RSS ? Thanks !

On Nov 2, 2016 12:03, Alfredo Cardigliano wrote:
Hi Moshedo you have RSS enabled perhaps?Please read the documents below:
https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS"]https://github.com/ntop/PF_RING/blob/dev/doc/README.RSShttps://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages"]https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages
Alfredo
On 2 Nov 2016, at 11:00, Moshe Danielli <moshe.dani@walla.co.il> wrote:
Hi Everyone, I'm experiencing a weird situation where I'm running zcount twice: 1. zcount -i zc:em1 2. zcount -i em1 the first execution (zc mode) produces a count value of about 0.5 gbps while the 2nd execution (non zc mode) produces a value of about 4.5 gbps. How is that possible ? what am I doing wrong ? i'm using version 6.4.1-stable with 4096 ring slots and an intel 10g device (intel ixgbe 82599) on ubuntu 14.04. Thanks in advance _______________________________________________
Ntop-misc mailing list
Ntop-misc@listgateway.unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-misc"]http://listgateway.unipi.it/mailman/listinfo/ntop-misc




_______________________________________________
Ntop-misc mailing list
Ntop-misc@listgateway.unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-misc"]http://listgateway.unipi.it/mailman/listinfo/ntop-misc
Re: zcount displays less packets in zc mode [ In reply to ]
Hi Moshe
RSS is an IP-based (IP+port for TCP) hw hash, if you need something more flexibly (e.g. a custom hash function) then you need zbalance_ipc.

Alfredo

> On 2 Nov 2016, at 14:06, Moshe Danielli <moshe.dani@walla.co.il> wrote:
>
> Hi Alfredo,
>
>
> 1. You were abosutely right - that was the exact reason. Once I switched to single queue mode, everything worked as expected.
>
> 2. Given Intel's RSS functionality - what is zbalance_irq doing different ? Why should I use it instead of making use of RSS ?
>
> Thanks !
>
>
> On Nov 2, 2016 12:03, Alfredo Cardigliano wrote:
> Hi Moshe
> do you have RSS enabled perhaps?
> Please read the documents below:
>
> https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS <https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS>
> https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages <https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages>
>
> Alfredo
>
>> On 2 Nov 2016, at 11:00, Moshe Danielli <moshe.dani@walla.co.il <mailto:moshe.dani@walla.co.il>> wrote:
>>
>> Hi Everyone,
>> I'm experiencing a weird situation where I'm running zcount twice:
>> 1. zcount -i zc:em1 <zc:em1>
>> 2. zcount -i em1
>> the first execution (zc mode) produces a count value of about 0.5 gbps while the 2nd execution (non zc mode) produces a value of about 4.5 gbps.
>> How is that possible ? what am I doing wrong ?
>> i'm using version 6.4.1-stable with 4096 ring slots and an intel 10g device (intel ixgbe 82599) on ubuntu 14.04.
>> Thanks in advance
>> _______________________________________________
>> Ntop-misc mailing list
>> Ntop-misc@listgateway.unipi.it <mailto:Ntop-misc@listgateway.unipi.it>
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it <mailto:misc@listgateway.unipi.it>
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
Re: zcount displays less packets in zc mode [ In reply to ]
I understand... However, can we control the irq / core distribution of flows as we can with RSS (using smp_affinity)?

On Nov 2, 2016 15:56, Alfredo Cardigliano wrote:
Hi Moshe RSS is an IP-based (IP+port for TCP) hw hash, if you need something more flexibly (e.g. a custom hash function) then you need zbalance_ipc. Alfredo
On 2 Nov 2016, at 14:06, Moshe Danielli <moshe.dani@walla.co.il> wrote:
Hi Alfredo,

1. You were abosutely right - that was the exact reason. Once I switched to single queue mode, everything worked as expected. 2. Given Intel's RSS functionality - what is zbalance_irq doing different ? Why should I use it instead of making use of RSS ? Thanks !

On Nov 2, 2016 12:03, Alfredo Cardigliano wrote:
Hi Moshe do you have RSS enabled perhaps? Please read the documents below: https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS"]https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages"]https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages Alfredo
On 2 Nov 2016, at 11:00, Moshe Danielli <moshe.dani@walla.co.il> wrote:
Hi Everyone, I'm experiencing a weird situation where I'm running zcount twice: 1. zcount -i zc:em1 2. zcount -i em1 the first execution (zc mode) produces a count value of about 0.5 gbps while the 2nd execution (non zc mode) produces a value of about 4.5 gbps. How is that possible ? what am I doing wrong ? i'm using version 6.4.1-stable with 4096 ring slots and an intel 10g device (intel ixgbe 82599) on ubuntu 14.04. Thanks in advance _______________________________________________
Ntop-misc mailing list
Ntop-misc@listgateway.unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-misc"]http://listgateway.unipi.it/mailman/listinfo/ntop-misc




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




_______________________________________________
Ntop-misc mailing list
Ntop-misc@listgateway.unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-misc"]http://listgateway.unipi.it/mailman/listinfo/ntop-misc
Re: zcount displays less packets in zc mode [ In reply to ]
Hi Moshe
please note you can just ignore interrupts with ZC, just make sure you application threads are bound to the correct CPU cores in order to correctly spread the load.

Alfredo

> On 2 Nov 2016, at 15:38, Moshe Danielli <moshe.dani@walla.co.il> wrote:
>
> I understand... However, can we control the irq / core distribution of flows as we can with RSS (using smp_affinity)?
>
>
>
>
> On Nov 2, 2016 15:56, Alfredo Cardigliano wrote:
> Hi Moshe
> RSS is an IP-based (IP+port for TCP) hw hash, if you need something more flexibly (e.g. a custom hash function) then you need zbalance_ipc.
>
> Alfredo
>
> On 2 Nov 2016, at 14:06, Moshe Danielli <moshe.dani@walla.co.il <mailto:moshe.dani@walla.co.il>> wrote:
>
> Hi Alfredo,
>
> 1. You were abosutely right - that was the exact reason. Once I switched to single queue mode, everything worked as expected.
> 2. Given Intel's RSS functionality - what is zbalance_irq doing different ? Why should I use it instead of making use of RSS ?
> Thanks !
>
> On Nov 2, 2016 12:03, Alfredo Cardigliano wrote:
> Hi Moshe
> do you have RSS enabled perhaps?
> Please read the documents below:
>
> https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS <https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS>
> https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages <https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages>
>
> Alfredo
>
> On 2 Nov 2016, at 11:00, Moshe Danielli <moshe.dani@walla.co.il <mailto:moshe.dani@walla.co.il>> wrote:
>
> Hi Everyone,
> I'm experiencing a weird situation where I'm running zcount twice:
> 1. zcount -i zc:em1 <zc:em1>
> 2. zcount -i em1
> the first execution (zc mode) produces a count value of about 0.5 gbps while the 2nd execution (non zc mode) produces a value of about 4.5 gbps.
> How is that possible ? what am I doing wrong ?
> i'm using version 6.4.1-stable with 4096 ring slots and an intel 10g device (intel ixgbe 82599) on ubuntu 14.04.
> Thanks in advance
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it <mailto:Ntop-misc@listgateway.unipi.it>
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it <mailto:misc@listgateway.unipi.it>
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>_______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it <mailto:Ntop-misc@listgateway.unipi.it>
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it <mailto:misc@listgateway.unipi.it>
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>_______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
Re: zcount displays less packets in zc mode [ In reply to ]
Hi Alfredo,

1. There's no point in distributing the interrupts as the user threads read directly from the NIC's memory ? 2. Can you give an example / reference to bounding the threads to different cpu cores ? Thanks again !

On Nov 3, 2016 17:54, Alfredo Cardigliano wrote:
Hi Mosheplease note you can just ignore interrupts with ZC, just make sure you application threads are bound to the correct CPU cores in order to correctly spread the load.
Alfredo
On 2 Nov 2016, at 15:38, Moshe Danielli <moshe.dani@walla.co.il> wrote:
I understand... However, can we control the irq / core distribution of flows as we can with RSS (using smp_affinity)?

On Nov 2, 2016 15:56, Alfredo Cardigliano wrote:
Hi Moshe RSS is an IP-based (IP+port for TCP) hw hash, if you need something more flexibly (e.g. a custom hash function) then you need zbalance_ipc. Alfredo
On 2 Nov 2016, at 14:06, Moshe Danielli <moshe.dani@walla.co.il> wrote:
Hi Alfredo,

1. You were abosutely right - that was the exact reason. Once I switched to single queue mode, everything worked as expected. 2. Given Intel's RSS functionality - what is zbalance_irq doing different ? Why should I use it instead of making use of RSS ? Thanks !

On Nov 2, 2016 12:03, Alfredo Cardigliano wrote:
Hi Moshe do you have RSS enabled perhaps? Please read the documents below: https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS"]https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages"]https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages Alfredo
On 2 Nov 2016, at 11:00, Moshe Danielli <moshe.dani@walla.co.il> wrote:
Hi Everyone, I'm experiencing a weird situation where I'm running zcount twice: 1. zcount -i zc:em1 2. zcount -i em1 the first execution (zc mode) produces a count value of about 0.5 gbps while the 2nd execution (non zc mode) produces a value of about 4.5 gbps. How is that possible ? what am I doing wrong ? i'm using version 6.4.1-stable with 4096 ring slots and an intel 10g device (intel ixgbe 82599) on ubuntu 14.04. Thanks in advance _______________________________________________
Ntop-misc mailing list
Ntop-misc@listgateway.unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-misc"]http://listgateway.unipi.it/mailman/listinfo/ntop-misc




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




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




_______________________________________________
Ntop-misc mailing list
Ntop-misc@listgateway.unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-misc"]http://listgateway.unipi.it/mailman/listinfo/ntop-misc
Re: zcount displays less packets in zc mode [ In reply to ]
> On 3 Nov 2016, at 18:07, Moshe Danielli <moshe.dani@walla.co.il> wrote:
>
> Hi Alfredo,
>
>
> 1. There's no point in distributing the interrupts as the user threads read directly from the NIC's memory ?

Yes, we avoid using poll/interrupts, and the application is directly accessing NIC’s memory without going through the kernel with ZC, thus you should not worry much about interrupts.

>
> 2. Can you give an example / reference to bounding the threads to different cpu cores ?

Sure, take a look at https://github.com/ntop/PF_RING/blob/dev/userland/examples_zc/zbalance.c <https://github.com/ntop/PF_RING/blob/dev/userland/examples_zc/zbalance.c>
-r and -g options, or search for bind2core() inside the code.

Alfredo

>
> Thanks again !
>
>
>
>
> On Nov 3, 2016 17:54, Alfredo Cardigliano wrote:
> Hi Moshe
> please note you can just ignore interrupts with ZC, just make sure you application threads are bound to the correct CPU cores in order to correctly spread the load.
>
> Alfredo
>
>> On 2 Nov 2016, at 15:38, Moshe Danielli <moshe.dani@walla.co.il <mailto:moshe.dani@walla.co.il>> wrote:
>>
>> I understand... However, can we control the irq / core distribution of flows as we can with RSS (using smp_affinity)?
>>
>> On Nov 2, 2016 15:56, Alfredo Cardigliano wrote:
>> Hi Moshe
>> RSS is an IP-based (IP+port for TCP) hw hash, if you need something more flexibly (e.g. a custom hash function) then you need zbalance_ipc.
>>
>> Alfredo
>>
>> On 2 Nov 2016, at 14:06, Moshe Danielli <moshe.dani@walla.co.il <mailto:moshe.dani@walla.co.il>> wrote:
>>
>> Hi Alfredo,
>>
>> 1. You were abosutely right - that was the exact reason. Once I switched to single queue mode, everything worked as expected.
>> 2. Given Intel's RSS functionality - what is zbalance_irq doing different ? Why should I use it instead of making use of RSS ?
>> Thanks !
>>
>> On Nov 2, 2016 12:03, Alfredo Cardigliano wrote:
>> Hi Moshe
>> do you have RSS enabled perhaps?
>> Please read the documents below:
>>
>> https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS <https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS>
>> https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages <https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages>
>>
>> Alfredo
>>
>> On 2 Nov 2016, at 11:00, Moshe Danielli <moshe.dani@walla.co.il <mailto:moshe.dani@walla.co.il>> wrote:
>>
>> Hi Everyone,
>> I'm experiencing a weird situation where I'm running zcount twice:
>> 1. zcount -i zc:em1 <zc:em1>
>> 2. zcount -i em1
>> the first execution (zc mode) produces a count value of about 0.5 gbps while the 2nd execution (non zc mode) produces a value of about 4.5 gbps.
>> How is that possible ? what am I doing wrong ?
>> i'm using version 6.4.1-stable with 4096 ring slots and an intel 10g device (intel ixgbe 82599) on ubuntu 14.04.
>> Thanks in advance
>> _______________________________________________
>> Ntop-misc mailing list
>> Ntop-misc@listgateway.unipi.it <mailto:Ntop-misc@listgateway.unipi.it>
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>>
>> _______________________________________________
>> Ntop-misc mailing list
>> Ntop-misc@listgateway.unipi.it <mailto:misc@listgateway.unipi.it>
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>_______________________________________________
>> Ntop-misc mailing list
>> Ntop-misc@listgateway.unipi.it <mailto:Ntop-misc@listgateway.unipi.it>
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>>
>> _______________________________________________
>> Ntop-misc mailing list
>> Ntop-misc@listgateway.unipi.it <mailto:misc@listgateway.unipi.it>
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>_______________________________________________
>> Ntop-misc mailing list
>> Ntop-misc@listgateway.unipi.it <mailto:Ntop-misc@listgateway.unipi.it>
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it <mailto:misc@listgateway.unipi.it>
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
Re: zcount displays less packets in zc mode [ In reply to ]
Hi Alfredo,

Thanks for the info ! A few follow up questions, if I may: 1. Out of curiosity, if interrupts aren't a part of the game in ZC, how are packets dequeued from the shared memory ? on-going polling / NAPI (hope I'm using the right technical term) ? 2. Thanks for the reference ! What should I do in case I'm using a 3rd party IDS app, whose source code isn't available ? should I use taskset to pin the process to a specific core ? Your help is much appreciated !

On Nov 3, 2016 19:39, Alfredo Cardigliano wrote:

On 3 Nov 2016, at 18:07, Moshe Danielli <moshe.dani@walla.co.il> wrote:
Hi Alfredo,

1. There's no point in distributing the interrupts as the user threads read directly from the NIC's memory ?

Yes, we avoid using poll/interrupts, and the application is directly accessing NIC’s memory without going through the kernel with ZC, thus you should not worry much about interrupts.
2. Can you give an example / reference to bounding the threads to different cpu cores ?

Sure, take a look at https://github.com/ntop/PF_RING/blob/dev/userland/examples_zc/zbalance.c"]https://github.com/ntop/PF_RING/blob/dev/userland/examples_zc/zbalance.c-r and -g options, or search for bind2core() inside the code.
Alfredo
Thanks again !

On Nov 3, 2016 17:54, Alfredo Cardigliano wrote:
Hi Mosheplease note you can just ignore interrupts with ZC, just make sure you application threads are bound to the correct CPU cores in order to correctly spread the load.
Alfredo
On 2 Nov 2016, at 15:38, Moshe Danielli <moshe.dani@walla.co.il> wrote:
I understand... However, can we control the irq / core distribution of flows as we can with RSS (using smp_affinity)?

On Nov 2, 2016 15:56, Alfredo Cardigliano wrote:
Hi Moshe RSS is an IP-based (IP+port for TCP) hw hash, if you need something more flexibly (e.g. a custom hash function) then you need zbalance_ipc. Alfredo
On 2 Nov 2016, at 14:06, Moshe Danielli <moshe.dani@walla.co.il> wrote:
Hi Alfredo,

1. You were abosutely right - that was the exact reason. Once I switched to single queue mode, everything worked as expected. 2. Given Intel's RSS functionality - what is zbalance_irq doing different ? Why should I use it instead of making use of RSS ? Thanks !

On Nov 2, 2016 12:03, Alfredo Cardigliano wrote:
Hi Moshe do you have RSS enabled perhaps? Please read the documents below: https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS"]https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages"]https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages Alfredo
On 2 Nov 2016, at 11:00, Moshe Danielli <moshe.dani@walla.co.il> wrote:
Hi Everyone, I'm experiencing a weird situation where I'm running zcount twice: 1. zcount -i zc:em1 2. zcount -i em1 the first execution (zc mode) produces a count value of about 0.5 gbps while the 2nd execution (non zc mode) produces a value of about 4.5 gbps. How is that possible ? what am I doing wrong ? i'm using version 6.4.1-stable with 4096 ring slots and an intel 10g device (intel ixgbe 82599) on ubuntu 14.04. Thanks in advance _______________________________________________
Ntop-misc mailing list
Ntop-misc@listgateway.unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-misc"]http://listgateway.unipi.it/mailman/listinfo/ntop-misc




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




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




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

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




_______________________________________________
Ntop-misc mailing list
Ntop-misc@listgateway.unipi.it
http://listgateway.unipi.it/mailman/listinfo/ntop-misc"]http://listgateway.unipi.it/mailman/listinfo/ntop-misc
Re: zcount displays less packets in zc mode [ In reply to ]
> On 6 Nov 2016, at 12:10, Moshe Danielli <moshe.dani@walla.co.il> wrote:
>
> Hi Alfredo,
>
>
> Thanks for the info !
>
> A few follow up questions, if I may:
>
> 1. Out of curiosity, if interrupts aren't a part of the game in ZC, how are packets dequeued from the shared memory ? on-going polling / NAPI (hope I'm using the right technical term) ?

NAPI is not used as it’s part of the standard kernel mechanisms, using ZC the application checks the card RX ring for new packets, sleeping microseconds in case there is no packet (or spinning in case you use active wait). Poll (using IRQs is also an option but we usually avoid that).

> 2. Thanks for the reference ! What should I do in case I'm using a 3rd party IDS app, whose source code isn't available ? should I use taskset to pin the process to a specific core ?

Correct, taskset is the way.

Alfredo

>
> Your help is much appreciated !
>
>
>
> On Nov 3, 2016 19:39, Alfredo Cardigliano wrote:
>
>> On 3 Nov 2016, at 18:07, Moshe Danielli <moshe.dani@walla.co.il <mailto:moshe.dani@walla.co.il>> wrote:
>>
>> Hi Alfredo,
>>
>> 1. There's no point in distributing the interrupts as the user threads read directly from the NIC's memory ?
>
> Yes, we avoid using poll/interrupts, and the application is directly accessing NIC’s memory without going through the kernel with ZC, thus you should not worry much about interrupts.
>
>> 2. Can you give an example / reference to bounding the threads to different cpu cores ?
>
> Sure, take a look at https://github.com/ntop/PF_RING/blob/dev/userland/examples_zc/zbalance.c <https://github.com/ntop/PF_RING/blob/dev/userland/examples_zc/zbalance.c>
> -r and -g options, or search for bind2core() inside the code.
>
> Alfredo
>
>> Thanks again !
>>
>> On Nov 3, 2016 17:54, Alfredo Cardigliano wrote:
>> Hi Moshe
>> please note you can just ignore interrupts with ZC, just make sure you application threads are bound to the correct CPU cores in order to correctly spread the load.
>>
>> Alfredo
>>
>>> On 2 Nov 2016, at 15:38, Moshe Danielli <moshe.dani@walla.co.il <mailto:moshe.dani@walla.co.il>> wrote:
>>>
>>> I understand... However, can we control the irq / core distribution of flows as we can with RSS (using smp_affinity)?
>>>
>>> On Nov 2, 2016 15:56, Alfredo Cardigliano wrote:
>>> Hi Moshe
>>> RSS is an IP-based (IP+port for TCP) hw hash, if you need something more flexibly (e.g. a custom hash function) then you need zbalance_ipc.
>>>
>>> Alfredo
>>>
>>> On 2 Nov 2016, at 14:06, Moshe Danielli <moshe.dani@walla.co.il <mailto:moshe.dani@walla.co.il>> wrote:
>>>
>>> Hi Alfredo,
>>>
>>> 1. You were abosutely right - that was the exact reason. Once I switched to single queue mode, everything worked as expected.
>>> 2. Given Intel's RSS functionality - what is zbalance_irq doing different ? Why should I use it instead of making use of RSS ?
>>> Thanks !
>>>
>>> On Nov 2, 2016 12:03, Alfredo Cardigliano wrote:
>>> Hi Moshe
>>> do you have RSS enabled perhaps?
>>> Please read the documents below:
>>>
>>> https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS <https://github.com/ntop/PF_RING/blob/dev/doc/README.RSS>
>>> https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages <https://github.com/ntop/PF_RING/blob/dev/doc/README.apt_rpm_packages>
>>>
>>> Alfredo
>>>
>>> On 2 Nov 2016, at 11:00, Moshe Danielli <moshe.dani@walla.co.il <mailto:moshe.dani@walla.co.il>> wrote:
>>>
>>> Hi Everyone,
>>> I'm experiencing a weird situation where I'm running zcount twice:
>>> 1. zcount -i zc:em1 <zc:em1>
>>> 2. zcount -i em1
>>> the first execution (zc mode) produces a count value of about 0.5 gbps while the 2nd execution (non zc mode) produces a value of about 4.5 gbps.
>>> How is that possible ? what am I doing wrong ?
>>> i'm using version 6.4.1-stable with 4096 ring slots and an intel 10g device (intel ixgbe 82599) on ubuntu 14.04.
>>> Thanks in advance
>>> _______________________________________________
>>> Ntop-misc mailing list
>>> Ntop-misc@listgateway.unipi.it <mailto:Ntop-misc@listgateway.unipi.it>
>>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>>>
>>> _______________________________________________
>>> Ntop-misc mailing list
>>> Ntop-misc@listgateway.unipi.it <mailto:misc@listgateway.unipi.it>
>>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>_______________________________________________
>>> Ntop-misc mailing list
>>> Ntop-misc@listgateway.unipi.it <mailto:Ntop-misc@listgateway.unipi.it>
>>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>>>
>>> _______________________________________________
>>> Ntop-misc mailing list
>>> Ntop-misc@listgateway.unipi.it <mailto:misc@listgateway.unipi.it>
>>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>_______________________________________________
>>> Ntop-misc mailing list
>>> Ntop-misc@listgateway.unipi.it <mailto:Ntop-misc@listgateway.unipi.it>
>>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>>
>> _______________________________________________
>> Ntop-misc mailing list
>> Ntop-misc@listgateway.unipi.it <mailto:misc@listgateway.unipi.it>
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>>
>> _______________________________________________
>> Ntop-misc mailing list
>> Ntop-misc@listgateway.unipi.it <mailto:Ntop-misc@listgateway.unipi.it>
>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it <mailto:misc@listgateway.unipi.it>
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>
>
> _______________________________________________
> Ntop-misc mailing list
> Ntop-misc@listgateway.unipi.it <mailto:Ntop-misc@listgateway.unipi.it>
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc <http://listgateway.unipi.it/mailman/listinfo/ntop-misc>