netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Jie2x Zhou <jie2x.zhou@intel.com>
Cc: andrii@kernel.org, mykolal@fb.com, ast@kernel.org,
	daniel@iogearbox.net, martin.lau@linux.dev, davem@davemloft.net,
	kuba@kernel.org, hawk@kernel.org, netdev@vger.kernel.org,
	bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, Philip Li <philip.li@intel.com>,
	petrm@nvidia.com
Subject: Re: test ./tools/testing/selftests/bpf/test_offload.py failed
Date: Wed, 7 Sep 2022 09:43:59 +0300	[thread overview]
Message-ID: <Yxg9r37w1Wg3mvxy@shredder> (raw)
In-Reply-To: <20220907051657.55597-1-jie2x.zhou@intel.com>

On Wed, Sep 07, 2022 at 01:16:57PM +0800, Jie2x Zhou wrote:
> I found that "disable_ifindex" file do not set read function, so return -EINVAL when do read.
> Is it a bug in test_offload.py?

Most likely a bug in netdevsim itself as it sets the mode of this file
as "rw" instead of "w". The test actually knows to skip such files:

            p = os.path.join(path, f)
            if not os.stat(p).st_mode & stat.S_IRUSR:
                continue

Can you test the following patch?

diff --git a/drivers/net/netdevsim/hwstats.c b/drivers/net/netdevsim/hwstats.c
index 605a38e16db0..0e58aa7f0374 100644
--- a/drivers/net/netdevsim/hwstats.c
+++ b/drivers/net/netdevsim/hwstats.c
@@ -433,11 +433,11 @@ int nsim_dev_hwstats_init(struct nsim_dev *nsim_dev)
                goto err_remove_hwstats_recursive;
        }
 
-       debugfs_create_file("enable_ifindex", 0600, hwstats->l3_ddir, hwstats,
+       debugfs_create_file("enable_ifindex", 0200, hwstats->l3_ddir, hwstats,
                            &nsim_dev_hwstats_l3_enable_fops.fops);
-       debugfs_create_file("disable_ifindex", 0600, hwstats->l3_ddir, hwstats,
+       debugfs_create_file("disable_ifindex", 0200, hwstats->l3_ddir, hwstats,
                            &nsim_dev_hwstats_l3_disable_fops.fops);
-       debugfs_create_file("fail_next_enable", 0600, hwstats->l3_ddir, hwstats,
+       debugfs_create_file("fail_next_enable", 0200, hwstats->l3_ddir, hwstats,
                            &nsim_dev_hwstats_l3_fail_fops.fops);
 
        INIT_DELAYED_WORK(&hwstats->traffic_dw,

> 
> test output:
>  selftests: bpf: test_offload.py
>  Test destruction of generic XDP...
> ......
>      raise Exception("Command failed: %s\n%s" % (proc.args, stderr))
>  Exception: Command failed: cat /sys/kernel/debug/netdevsim/netdevsim0//ports/0/dev/hwstats/l3/disable_ifindex
>  
>  cat: /sys/kernel/debug/netdevsim/netdevsim0//ports/0/dev/hwstats/l3/disable_ifindex: Invalid argument
>  not ok 20 selftests: bpf: test_offload.py # exit=1

  reply	other threads:[~2022-09-07  6:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07  5:16 test ./tools/testing/selftests/bpf/test_offload.py failed Jie2x Zhou
2022-09-07  6:43 ` Ido Schimmel [this message]
2022-09-07  8:51   ` Zhou, Jie2X
2022-09-07 16:08     ` Ido Schimmel
2022-09-08  3:10       ` Zhou, Jie2X
2022-09-08  6:23         ` Ido Schimmel
2022-09-08  7:44           ` Zhou, Jie2X
2022-09-08  8:03             ` Ido Schimmel
2022-09-09  9:11               ` Zhou, Jie2X

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=Yxg9r37w1Wg3mvxy@shredder \
    --to=idosch@idosch.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=jie2x.zhou@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mykolal@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    --cc=philip.li@intel.com \
    /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).