From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com [209.85.218.47]) by dpdk.org (Postfix) with ESMTP id B74D12BCE for ; Mon, 11 Apr 2016 05:13:59 +0200 (CEST) Received: by mail-oi0-f47.google.com with SMTP id y204so192918550oie.3 for ; Sun, 10 Apr 2016 20:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=MTZu9DNlBLd4U4VDQ3d8u9yeB31H2yq2ooxDWl1Sac0=; b=vcRl9/D0hJ535hYDHrKr4QeDavsjiNArUfy79LMG9geYtoAOBtfQwFQyYrTIqrZ97g Zw69JdZ3BWDaksFP48+V086QPu0pNM+bNNrbCosI1x1db/Qg+gq5ujrwJ28Iw46Uye6x //xzFzb4DR7vaJffyWTTbpFYc7N96Ggu/Yu5bCtLLvSRuBRfxnJVKxnGY70nDb5hllW8 k1p2LFUoNhHFsNG9i6l+Y5C+yQu8ZGpQx952uBClqo9PTiNrKVLihGJJ4Bz60kwEwmx5 2XZc4p8pD2IlkDcse9eeMGuJCEo5+tz7SEEmaoqg0fncrOYt+pwdJ5xDMYWNK156Lmsi IhnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=MTZu9DNlBLd4U4VDQ3d8u9yeB31H2yq2ooxDWl1Sac0=; b=PT/VeD8eF7uUtDQ1A5TNbBIhwUx00ckBY/knAc/Em05YucXf4CdnnW58PjcprykKB1 1u1Bu3JFgzDaWLzmNJdY8AyaqXEfXL/W7LvNULCO4yePsIa29B/XUf9DDvUFxB9zRMiA /y3HaKjCd/EbToDxhXfTzSXHr7XG8Muoq907ypziUmbyKsNXcxQSP3P38jWnZT5mAz+t A0/6H7EaEnTpmML6xy1QkBHxiBiLFAmCs7jcCDvqS8mO+Or0T3rWQRnwQ6rKf1U211+R NwQAbeh4cTtXBIHah3o4VO7CY4ysBz5+A7e6Yv2cxBQbiA3zk8SA88s0tXxlSBITy6AN 4MMg== X-Gm-Message-State: AD7BkJKyAxZfqjNlCzO3P+ecrmwIpvEZ932TunY4enpmgM0Z17r2btOl82L547vz6Giw/hzxxb3pDH69QzoVRg== MIME-Version: 1.0 X-Received: by 10.157.17.93 with SMTP id p29mr9579612otp.174.1460344439030; Sun, 10 Apr 2016 20:13:59 -0700 (PDT) Received: by 10.202.211.83 with HTTP; Sun, 10 Apr 2016 20:13:59 -0700 (PDT) Date: Mon, 11 Apr 2016 11:13:59 +0800 Message-ID: From: guo tie To: users@dpdk.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] problem in ixgbe_dev_stats_get X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2016 03:14:00 -0000 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 =3D rte_eth_stats_get((uint8_t)pid, &stat); if (ret < 0) { console_printf(env, "PORT: %u rte_eth_stats_get failed: ret=3D%d\n", pid, ret); continue; } printf( "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3DPORT: %u=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\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: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DPORT: = 3=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DPORT: = 3=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DPORT: = 3=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 --=20 =E9=93=81=E5=93=A5