DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] problem in ixgbe_dev_stats_get
@ 2016-04-11  3:13 guo tie
  0 siblings, 0 replies; only message in thread
From: guo tie @ 2016-04-11  3:13 UTC (permalink / raw)
  To: users

Hi, All

  Recently I found ixgbe_dev_stats_get stat recv bytes is much less then
the real recv bytes.

  My Program is like this:



            ret = rte_eth_stats_get((uint8_t)pid, &stat);
            if (ret < 0) {
                console_printf(env, "PORT: %u rte_eth_stats_get failed:
ret=%d\n", pid, ret);
                continue;
            }
            printf( "=======================PORT:
%u=======================\n", pid);
            printf( "  RX-packets: %-14llu bytes: %-14llu RX-dropped:
%-14llu Rx-errors: %-14llu Bytes/Pkts: %-4llu Drop: %.04f\n"
                                "  RX-[stats]: %-14llu bytes: %-14llu\n"
                                "  TX-packets: %-14llu bytes: %-14llu
TX-dropped: %-14llu\n",
               stat.ipackets, stat.ibytes, stat.imissed, stat.ierrors,
               stat.ipackets > 0 ? stat.ibytes/stat.ipackets : 0,
               (float)(stat.imissed - prev_stats[pid].imissed) * 100.0 /
               (float)(stat.ipackets + stat.imissed -
prev_stats[pid].ipackets - prev_stats[pid].imissed),

               port_stat[pid].ipkts, port_stat[pid].ibytes,
               stat.opackets, stat.obytes, stat.oerrors);


      the port_stat is a structure, defined as follow:

typedef struct {
    uint64_t ipkts;
    uint64_t ibytes;
    uint64_t opkts;
    uint64_t obytes;
} port_stat_t;

When I recv a packet, I add it to the port_stat.


When the program start, I check the recv pkts, recv bytes, avg pkt length
is like this:

=======================PORT: 3=======================
  RX-packets: 90718898       bytes: 16991788261    RX-dropped: 12944395
  Rx-errors: 12944395       Bytes/Pkts: 187  Drop: 0.0000
  RX-[stats]: 90720133       bytes: 16992045753
  TX-packets: 0              bytes: 0              TX-dropped: 0


as the program run about several minute, it is like this:

=======================PORT: 3=======================
  RX-packets: 745618989      bytes: 90272301884    RX-dropped: 12944395
  Rx-errors: 12944395       Bytes/Pkts: 121  Drop: 0.0000
  RX-[stats]: 745620438      bytes: 139656631650
  TX-packets: 0              bytes: 0              TX-dropped: 0

and then:

=======================PORT: 3=======================
  RX-packets: 2597488169     bytes: 171667433069   RX-dropped: 12944395
  Rx-errors: 12944395       Bytes/Pkts: 66   Drop: 0.0000
  RX-[stats]: 2597489450     bytes: 486518389941
  TX-packets: 0              bytes: 0              TX-dropped: 0



-- 
铁哥

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-11  3:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-11  3:13 [dpdk-users] problem in ixgbe_dev_stats_get guo tie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).