@@ -168,6 +168,12 @@ static int netmap_open(odp_pktio_t id ODP_UNUSED, pktio_entry_t *pktio_entry,
if (err)
goto error;
+ /* netmap uses only ethtool to get statistics counters */
+ pktio_entry->s.use_ethtool = 1;
+ err = sock_stats_reset(pktio_entry);
+ if (err != 0)
+ goto error;
+
/* Wait for the link to come up */
for (i = 0; i < NM_OPEN_RETRIES; i++) {
err = netmap_do_ioctl(pktio_entry, SIOCETHTOOL, ETHTOOL_GLINK);
@@ -313,6 +319,8 @@ const pktio_if_ops_t netmap_pktio_ops = {
.close = netmap_close,
.start = NULL,
.stop = NULL,
+ .stats = sock_stats,
+ .stats_reset = sock_stats_reset,
.recv = netmap_recv,
.send = netmap_send,
.mtu_get = netmap_mtu_get,
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> --- platform/linux-generic/pktio/netmap.c | 8 ++++++++ 1 file changed, 8 insertions(+)