Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5251486rwb; Tue, 6 Sep 2022 22:53:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Md6FF5mjSbvAtlwSOs9Q+PCxpYKNpyG44dFaXYnCN0kH+9qpxidRP1Zo4c8n+4LB6F0uN X-Received: by 2002:a17:907:7204:b0:749:7839:4dd2 with SMTP id dr4-20020a170907720400b0074978394dd2mr1162552ejc.714.1662530013314; Tue, 06 Sep 2022 22:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662530013; cv=none; d=google.com; s=arc-20160816; b=IxWhhLNLROvoxrWRnlWKPqbiwBCRVJbs0IoHvfrlrnwUN1NZ42HhfLVuU/hBz8zUlA 0LyQE70RjAyViTl19R9GJHVwlKmmaQqliIRX11MkvVKnblTk6s7TZiGpPLqvu85NxM26 P8CXd1+UYK2P9k3VqAoYkUD7LLyOKLCE5rVKj4FDWC7lXjHkFgTiZSS2dMKZI/vHgF21 jQhA5eR8itwi2Zac9IZAMi1EFw9YipXJNUXMLU2kwRgzVUDBMYfOjWp+AJy7/Zc/SKr6 IFSdUBtQ+GpyE1+7UPROm9MsQ2GuyvWflKMn66oSPS2UE5gdyoVu2mzpwpjOC0igrhdp 1gdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ruYaOPV1rGfrVqYmtdANZss1sUjdNCOJHLXUWKQgwN4=; b=wsj578irMSYDFv6z0kzuJ5FwzOL89ptxYMETJTjLc12EHgSk0GN8GX5f0/IW8uWzZh K0MNt/FgoLSbPNWAWstOzXZX86i1ZAAw6eSXpHXWrDg39JGvpYrHCK0Rr2p5u0iSDYRR EBW3xGFcSptRGpoRXI+UrV5cXmab6lm446nTub1+dMDEpb95LvBVOkUf1pYv5sw9PVxj C1nbw+ap8NHR9Ht1MOSWtxJA7YyThbSw3fBiAJuA62Qs8H/9CznuamFjefTWeS4vtzxS LU+HGO1f4LRkolhkOSZHujqEwRleaLcRNzHgIZnjExZMsKE/jEwYK/d/y7vg6noMHVjD rAhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XBDz7rhh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt9-20020a1709072d8900b0073d8cfa8070si12050628ejc.271.2022.09.06.22.53.07; Tue, 06 Sep 2022 22:53:33 -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=@intel.com header.s=Intel header.b=XBDz7rhh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229631AbiIGFSq (ORCPT + 99 others); Wed, 7 Sep 2022 01:18:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbiIGFSo (ORCPT ); Wed, 7 Sep 2022 01:18:44 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40B319C8D9; Tue, 6 Sep 2022 22:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662527924; x=1694063924; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ramvOUtx8XnHZKzNv1q3piGUCQeF1ndHFRzBHtiRrN8=; b=XBDz7rhh1E5PVC1p3wV/K/zqk2IUKiZwVVuYmQZCkJnXIn31l6uR7v+w smBzqMnGZLLHeAlySRNgHfLFSHJkuaz7sp5oVUdW3AJWW1tZszkPfukda rBt3XZmY1BX7pYP+yJF0To3xHgSDrqCowHotR3tf0NyKPB6u5Tr+OeOsO NXq+cXewilfag1FBoKou+ce1gw6XTZ63GnPDdlzPCPZ7U4osVRp+r3rxz KA6V57hiE7BagW3l3jKpBXtLsPMAV75AIDmPQCPluGGbND2dbBAUVeZde HVvAfJmtxeRZwLKh2lx4/cEfG2oG0JnGoH8PFlVzF+lgIcLmXz2MkHgGz g==; X-IronPort-AV: E=McAfee;i="6500,9779,10462"; a="360728973" X-IronPort-AV: E=Sophos;i="5.93,295,1654585200"; d="scan'208";a="360728973" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 22:18:43 -0700 X-IronPort-AV: E=Sophos;i="5.93,295,1654585200"; d="scan'208";a="644464015" Received: from jiebi-mobl1.ccr.corp.intel.com (HELO jiezho4x-mobl1.ccr.corp.intel.com) ([10.255.30.104]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 22:18:39 -0700 From: Jie2x Zhou To: jie2x.zhou@intel.com, 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 Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Philip Li Subject: test ./tools/testing/selftests/bpf/test_offload.py failed Date: Wed, 7 Sep 2022 13:16:57 +0800 Message-Id: <20220907051657.55597-1-jie2x.zhou@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 hi, I try to know why output following error? 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? 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 source code: In drivers/net/netdevsim/hwstats.c: define NSIM_DEV_HWSTATS_FOPS(ACTION, TYPE) \ { \ .fops = { \ .open = simple_open, \ .write = nsim_dev_hwstats_do_write, \ .llseek = generic_file_llseek, \ .owner = THIS_MODULE, \ }, \ .action = ACTION, \ .type = TYPE, \ } static const struct nsim_dev_hwstats_fops nsim_dev_hwstats_l3_disable_fops = NSIM_DEV_HWSTATS_FOPS(NSIM_DEV_HWSTATS_DO_DISABLE, NETDEV_OFFLOAD_XSTATS_TYPE_L3); debugfs_create_file("disable_ifindex", 0600, hwstats->l3_ddir, hwstats, &nsim_dev_hwstats_l3_disable_fops.fops); In fs/read_write.c: ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) { ...... if (file->f_op->read) ret = file->f_op->read(file, buf, count, pos); else if (file->f_op->read_iter) ret = new_sync_read(file, buf, count, pos); else ret = -EINVAL; ...... } best regards,