Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5317590rwb; Wed, 7 Sep 2022 00:24:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4DceUD736dn0jyF8cvWIXGpsfXm8MCEN980DEAm62Rdxt88wqzG44Bu3p9Of0uU3hanJic X-Received: by 2002:a05:6a00:2291:b0:539:d5b8:4ecc with SMTP id f17-20020a056a00229100b00539d5b84eccmr2395410pfe.79.1662535459450; Wed, 07 Sep 2022 00:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662535459; cv=none; d=google.com; s=arc-20160816; b=iWiSzUIVBt/bPG0cuXFT8C7EoPlwQkKrtvshFD5JMGIUDhcMUCb1ieuOIhGXn7uywD 9wEZdJRN5eGej9dDAmhRvO59ulKkQLqmxIWGHi8QDtW+J7Bjf7My7MCAL2dLzNXuOdNE Z4Kkx8gmeU1rEQRLkYizzLodGgDQqoxtiAJ2bp4Qr1xFPvcE/b5dlNN/AV4hp2uNFOdP 7aYFrzc6pOqrNYLM4hTzsB+WEc8lekFcX9zuiqcE8ifxs7Ohc2TcoQNe7d1oChJox/eo A16MOo1ci3GeLz0TOPrqERNkPlhCpHGbROGed0oOuuofWZXXD4C6kLCe/1Pn20FFVykG Fffw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature; bh=uxiqkYILFEE10SEls//zfdxclfvIYtJHN4wQcFOIvkg=; b=pd3gzMcSV8Nh4XkUMxifgu/TPORoSvSid45fsuVGhXqBVrRjOscY4GGX9NKNgwshP2 cSezyxI3tM3LXLah+/4FpF4Gi3phc+T23ARRfpkh5pQ7Kmx5mlY1HuRC4ao2RN/ZZnrk 4iWD+DLO27Lvg7s2jmEiakZMfo9vm0gRcLKpvqDBxQJ5TmjO8c+GiF+hJ7EKGPo3ZpY+ IMobsB+B0+Atg0h8lTOEdXwKUMhVYitBBNRRZO9nPaK4Hvut4NqoSWiViaeZF/qsZDIe a23iE8m9PcFsOx0K8O9NsHQH2g3UkAPpeLPhaJY2YLbCW0ZB1iYLGWqb7neQXpH6jRga SqgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Uxb4gwtR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 144-20020a630096000000b0043494519e69si5534876pga.706.2022.09.07.00.24.07; Wed, 07 Sep 2022 00:24:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Uxb4gwtR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbiIGGoK (ORCPT + 99 others); Wed, 7 Sep 2022 02:44:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbiIGGoI (ORCPT ); Wed, 7 Sep 2022 02:44:08 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D31B4395; Tue, 6 Sep 2022 23:44:07 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 616BA5C0111; Wed, 7 Sep 2022 02:44:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 07 Sep 2022 02:44:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1662533045; x=1662619445; bh=uxiqkYILFEE10SEls//zfdxclfvI YtJHN4wQcFOIvkg=; b=Uxb4gwtROIdhEyw7mFwSLtR5WDWlTWdH87vIJXNkjoR6 DNeSkJ2GHkwqRH9I/tfQvc5eUKcCRoz/O3glVtC5WBg4rBB8XlXCDlAkW041TJWE SfvjS30mYnyJHQvT1eb7wH2XdFRbOiJ2KyllVZ02dFHz3kbKJk61v8afrRECdB3X hZSH4p304O12shHlvyVmqFTblSiXttpkbyz/thDFlJ71z5+5/BItWk8w5Na0FKBL FHlIiiATN6MFsoYjsjHHPIkEPTz4eOOuFVaJJWQ/SSvRnxXBSZoVt+PE6Rw5gMe3 fYSBy+gPHR6ordnGP9nv1EKMRsJODpixR7WH9qBlrA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdelledguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefkugho ucfutghhihhmmhgvlhcuoehiughoshgthhesihguohhstghhrdhorhhgqeenucggtffrrg htthgvrhhnpeefheffgeegffeuffehiedthfektdefleffffejgeettdffgeeijeejueet jeetveenucffohhmrghinhepohhffhhlohgrugdrphihnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepihguohhstghhsehiughoshgthhdrohhr gh X-ME-Proxy: Feedback-ID: i494840e7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 7 Sep 2022 02:44:04 -0400 (EDT) Date: Wed, 7 Sep 2022 09:43:59 +0300 From: Ido Schimmel To: Jie2x Zhou 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 , petrm@nvidia.com Subject: Re: test ./tools/testing/selftests/bpf/test_offload.py failed Message-ID: References: <20220907051657.55597-1-jie2x.zhou@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220907051657.55597-1-jie2x.zhou@intel.com> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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