Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#6666 closed defect (fixed)

ethtool -S msh0 returning noise

Reported by: carrano Owned by: dwmw2
Priority: normal Milestone:
Component: wireless Version:
Keywords: Cc: michailis, jcardona, luisca
Blocked By: Blocking:
Deployments affected: Action Needed:
Verified: yes

Description

Update.1 695 build:

ethtool -S mesh0 returns hard-to-believe numbers:

A few minutes after the XO was turned on (no other wireless device active around)

NIC statistics:

drop_duplicate_bcast: 14271818866540658400
drop_ttl_zero: 13853585344929181604
drop_no_fwd_route: 13865403755020258924
drop_no_buffers: 13865404854531886832
fwded_unicast_cnt: 4294967296
fwded_bcast_cnt: 256
drop_blind_table: 0
tx_failed_cnt: 0

and ten seconds later...

NIC statistics:

drop_duplicate_bcast: 14273070385650974432
drop_ttl_zero: 13853585344929472996
drop_no_fwd_route: 13865403754901622380
drop_no_buffers: 13865404854413250288
fwded_unicast_cnt: 4294967296
fwded_bcast_cnt: 256
drop_blind_table: 0
tx_failed_cnt: 0

Attachments (1)

6666_fix.patch (2.0 KB) - added by luisca 7 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 7 years ago by carrano

Quoting Javier Cardona:

Ah, meshy5 looks good, meshy9 does not.

meshy9:

# ethtool -S msh0

NIC statistics:

drop_duplicate_bcast: 14276115740606423632

drop_ttl_zero: 281930243244072

drop_no_fwd_route: 7953764896595678813

drop_no_buffers: 3544386092954776938

fwded_unicast_cnt: 3472325006316286006

fwded_bcast_cnt: 7092454079664568112

drop_blind_table: 7020267838408109619

tx_failed_cnt: 277172579205235

-bash-3.2# cat /boot/olpc_build

update.1 691

-bash-3.2# ethtool -i msh0

driver: libertas

version: COMM-USB8388-323.p0-dbg

firmware-version: 5.110.22.p1

meshy5:

# cat /boot/olpc_build

656

-bash-3.2# ethtool -i msh0

driver: libertas

version: COMM-USB8388-322.p1-dbg

firmware-version: 5.110.20.p47

bus-info:

-bash-3.2# ethtool -S msh0

NIC statistics:

drop_duplicate_bcast: 2745450

drop_ttl_zero: 81097

drop_no_fwd_route: 0

drop_no_buffers: 17769

fwded_unicast_cnt: 0

fwded_bcast_cnt: 316545

drop_blind_table: 0

tx_failed_cnt: 0

... i updated the firmware on meshy5, and the stats continue to work.

meshy5:

-bash-3.2# ethtool -S msh0

NIC statistics:

drop_duplicate_bcast: 1328

drop_ttl_zero: 76

drop_no_fwd_route: 0

drop_no_buffers: 52

fwded_unicast_cnt: 1

fwded_bcast_cnt: 300

drop_blind_table: 0

tx_failed_cnt: 0

-bash-3.2# cat /boot/olpc_build

656

-bash-3.2# ethtool -i msh0

driver: libertas

version: COMM-USB8388-322.p1-dbg

firmware-version: 5.110.22.p1

Looks like a driver problem in build update.1 691.

Changed 7 years ago by luisca

comment:2 Changed 7 years ago by luisca

  • Cc michailis jcardona added
  • Resolution set to fixed
  • Status changed from new to closed

Fix attached. Tested on update.1-703. All counters start at 0 and in presence of another XO in the same mesh pinging a link-local non-existant address, fwded_bcast_cnt increases as expected.

On commit e38af7a7 (sync with libertas-2.6/master), CMD_MESH_ACCESS command was removed from the switch(cmd) in lbs_prepare_and_send_command. No idea if there was a reason for that. Access to the mesh statistics is a subcommand of CMD_MESH_ACCESS and was thus failing. struct cmd_ds_mesh_access is also changed, when its format must match the one coming from the firmware. Probably some other stuff was also broken. Looks like syncing with libertas-2.6 made a bit of a mess.

I have not gone very deep on commit e38af7a7, but I noticed it also removed CMD_SET_BOOT2_VER. Do not know whether that is still supposed to be used in the XOs.

comment:3 Changed 7 years ago by luisca

  • Cc luisca added

comment:4 follow-up: Changed 7 years ago by dwmw2

lbs_prepare_and_send_command() is going away, and we've been making it handle fewer and fewer commands over time. The important one in this case was commit a5e53b72 -- but it looks like I missed one user of lbs_prepare_and_send_command(...CMD_MESH_ACCESS...). This should fix it:

--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -116,9 +116,7 @@ static void lbs_ethtool_get_stats(struct net_device * dev,
        lbs_deb_enter(LBS_DEB_ETHTOOL);
 
        /* Get Mesh Statistics */
-       ret = lbs_prepare_and_send_command(priv,
-                       CMD_MESH_ACCESS, CMD_ACT_MESH_GET_STATS,
-                       CMD_OPTION_WAITFORRSP, 0, &mesh_access);
+       ret = lbs_mesh_access(priv, CMD_ACT_MESH_GET_STATS, &mesh_access);
 
        if (ret)
                return;

comment:5 in reply to: ↑ 4 Changed 7 years ago by ashish

Replying to dwmw2:

lbs_prepare_and_send_command() is going away, and we've been making it handle fewer and fewer commands over time. The important one in this case was commit a5e53b72 -- but it looks like I missed one user of lbs_prepare_and_send_command(...CMD_MESH_ACCESS...). This should fix it:

--- a/drivers/net/wireless/libertas/ethtool.c
+++ b/drivers/net/wireless/libertas/ethtool.c
@@ -116,9 +116,7 @@ static void lbs_ethtool_get_stats(struct net_device * dev,
        lbs_deb_enter(LBS_DEB_ETHTOOL);
 
        /* Get Mesh Statistics */
-       ret = lbs_prepare_and_send_command(priv,
-                       CMD_MESH_ACCESS, CMD_ACT_MESH_GET_STATS,
-                       CMD_OPTION_WAITFORRSP, 0, &mesh_access);
+       ret = lbs_mesh_access(priv, CMD_ACT_MESH_GET_STATS, &mesh_access);
 
        if (ret)
                return;

Yes. It works.

comment:6 Changed 7 years ago by carrano

  • Verified set

Confirming fix and registering commit in the stable branch.
http://dev.laptop.org/git?p=olpc-2.6;a=commit;h=de2a86ff3b60edcfed8e3927f61bd6da69f03288

comment:7 Changed 6 years ago by gregorio

  • Milestone Never Assigned deleted

Milestone Never Assigned deleted

Note: See TracTickets for help on using tickets.