Re: [xdp-hints] [PATCH bpf-next v2 8/8] selftests/bpf: Simple program to dump XDP RX metadata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 23, 2022 at 6:26 AM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote:
>
> Stanislav Fomichev <sdf@xxxxxxxxxx> writes:
>
> > +static int rxq_num(const char *ifname)
> > +{
> > +     struct ethtool_channels ch = {
> > +             .cmd = ETHTOOL_GCHANNELS,
> > +     };
> > +
> > +     struct ifreq ifr = {
> > +             .ifr_data = (void *)&ch,
> > +     };
> > +     strcpy(ifr.ifr_name, ifname);
> > +     int fd, ret;
> > +
> > +     fd = socket(AF_UNIX, SOCK_DGRAM, 0);
> > +     if (fd < 0)
> > +             error(-1, errno, "socket");
> > +
> > +     ret = ioctl(fd, SIOCETHTOOL, &ifr);
> > +     if (ret < 0)
> > +             error(-1, errno, "socket");
> > +
> > +     close(fd);
> > +
> > +     return ch.rx_count;
> > +}
>
> mlx5 uses 'combined' channels, so this returns 0. Changing it to just:
>
> return ch.rx_count ?: ch.combined_count;
>
> works though :)

Perfect, will do the same :-) Thank you for running and testing!

> -Toke
>




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux