From: guo tie <guotie.9@gmail.com>
To: users@dpdk.org
Subject: [dpdk-users] problem in ixgbe_dev_stats_get
Date: Mon, 11 Apr 2016 11:13:59 +0800 [thread overview]
Message-ID: <CAGWteyitRB72fbx=NjpaFf9ttWKWuyREpMnv0jg39ew+H4vQmg@mail.gmail.com> (raw)
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
--
铁哥
reply other threads:[~2016-04-11 3:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGWteyitRB72fbx=NjpaFf9ttWKWuyREpMnv0jg39ew+H4vQmg@mail.gmail.com' \
--to=guotie.9@gmail.com \
--cc=users@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).