Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Mar 2018 21:23:25 +0200
From:      Vincenzo Maffione <v.maffione@gmail.com>
To:        Ming Fu <Ming.Fu@esentire.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>, Giuseppe Lettieri <g.lettieri@iet.unipi.it>
Subject:   Re: netmap: How the buf_num of buffers is used by driver and monitor app
Message-ID:  <CA%2B_eA9if7UN7uebxNDugQdDq04WDEHFXJv97_RX9L46Z-Ao0Ng@mail.gmail.com>
In-Reply-To: <abc1c7da14d64c04bdce467825d0af44@mbx01cmb01p.esentire.local>
References:  <abc1c7da14d64c04bdce467825d0af44@mbx01cmb01p.esentire.local>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,


2018-03-30 6:00 GMT+02:00 Ming Fu <Ming.Fu@esentire.com>:

> Hi,
>
> I am wondering about the netmap module parameters buf_num. The default
> buf_num 163840 seems fairly big compare to intel 10G ixgbe of max 4096
> queue size. A full queue of the interface can only use a very small portion
> of the buf_num. Can the netmap enabled driver like ixgbe use more buffers
> than the "ethtool -G" configured rx/tx queue size?
>

No, netmap will just the same number of buffers as configured with ethtool
-G. The default buf_num is just a default that covers many things that you
can do.
First of all you would need 4096 for each TX and RX ring (so typically
2*8*4096). Then you need additional 2*4096 buffers for the host rings.
If you create netmap pipes like 'netmap:eth0{1' you need more buffers for
the pipe TX and RX ring.
If you know how many netmap buffers you really need for your purpose you
can just lower buf_num to the minimun number that won't cause your
application to fail with ENOMEM.


>
> I need to feed packages captured from netmap device to a few traffic
> monitors on the same box. The monitor application attach to the device as
> netmap monitor with the /r at the end of device name. My question is if the
> primary read of the device calls poll(), the netmap buffer is synced with
> the kernel. Can the other monitor application still access the packet that
> the primary read just returned to the kernel? If one of the monitor on the
> netmap device is slow, will it cause trouble for the primary reader and
> other monitors? How can I cache a lot of packets in the buffer in case one
> of the monitor application had a temporary slow down?
>

If you use copy-based monitor (no 'z') each monitor will receive an
independent copy of the traffic going through monitored rings. So I think
if one of the monitoring applications slows down there should
be no effect on the others. If you use zerocopy monitor, the same
intercepted buffer is passed between the various monitoring applications
(and the main application), so I think if one
stops or slows down, then all the monitors will stop.
There is some explanation in the comment here
https://github.com/luigirizzo/netmap/blob/master/sys/dev/netmap/netmap_monitor.c#L30-L69
Feel free to open a ticket on github (
https://github.com/luigirizzo/netmap/issues) if you have a more specific
question.

Cheers,
  Vincenzo


>
> Thanks,
> Ming
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>



-- 
Vincenzo Maffione



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B_eA9if7UN7uebxNDugQdDq04WDEHFXJv97_RX9L46Z-Ao0Ng>