Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trex-console doesn't report xstats when len(values) doesn't match len(names) #1111

Open
Civil opened this issue Feb 27, 2024 · 0 comments · May be fixed by #1112
Open

trex-console doesn't report xstats when len(values) doesn't match len(names) #1111

Civil opened this issue Feb 27, 2024 · 0 comments · May be fixed by #1112

Comments

@Civil
Copy link
Contributor

Civil commented Feb 27, 2024

In DPDK 23.03 (and later), it is possible that Length of xstats_name doesn't match lenth of xstats_values:

https://doc.dpdk.org/api-23.03/rte__ethdev_8h.html#a300d75b583c1f5acfe5b162a5d8c0ac1

There is an assumption that 'xstat_names' and 'xstats' arrays are matched by array index: xstats_names[i].name => xstats[i].value

This is exactly what happens in my case:

trex>stats -x

stats - Length of get_xstats_names: 79 and get_port_xstats_values: 63

https://github.com/cisco-system-traffic-generator/trex-core/blob/master/scripts/automation/trex_control_plane/interactive/trex/common/stats/trex_port_stats.py#L226-L227

Simple workaround would be to do:

        names = self.names[:len(values)]
        if len(values) != len(names):
            raise TRexError('Length of get_xstats_names: %s and get_port_xstats_values: %s' % (len(self.names), len(values)))

And that would make stats -x working again even if you combine multiple generations of connectx cards:
CleanShot 2024-02-27 at 19 35 46

Civil added a commit to Civil/trex-core that referenced this issue Feb 27, 2024
At least in DPDK 23.03 (and later) xstats_names might return more names
than xstats_values and that is considered normal.

See https://doc.dpdk.org/api-23.03/rte__ethdev_8h.html#a300d75b583c1f5acfe5b162a5d8c0ac1

In this case it seems appropriate to force names to be same length as
values

Fixes cisco-system-traffic-generator#1111
@Civil Civil linked a pull request Feb 27, 2024 that will close this issue
Civil added a commit to Civil/trex-core that referenced this issue Mar 14, 2024
At least in DPDK 23.03 (and later) xstats_names might return more names
than xstats_values and that is considered normal.

See https://doc.dpdk.org/api-23.03/rte__ethdev_8h.html#a300d75b583c1f5acfe5b162a5d8c0ac1

In this case it seems appropriate to force names to be same length as
values

Fixes cisco-system-traffic-generator#1111
Civil added a commit to Civil/trex-core that referenced this issue Mar 31, 2024
At least in DPDK 23.03 (and later) xstats_names might return more names
than xstats_values and that is considered normal.

See https://doc.dpdk.org/api-23.03/rte__ethdev_8h.html#a300d75b583c1f5acfe5b162a5d8c0ac1

In this case it seems appropriate to force names to be same length as
values

Fixes cisco-system-traffic-generator#1111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant