From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8B2D1BF24 for ; Fri, 1 Nov 2024 20:15:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730492134; cv=none; b=n0I5EUhibU4ctvWKDdmaunNMx2DTBw5tmMm/Xyv2jtahSnhRGx18wbJq9HkesyowX8Zbdd44X82sW/IAyeqFr03uISx7l39BmImch0I4Vmw/oEmZaGkzV0FUF+CQQ8l8LvAlBIDvSLAXOiUREfTu4hdv/uFy+Eu0tZojHiGo9W4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730492134; c=relaxed/simple; bh=KojzClBS51NXZHtfP/ssEPl81S3kAgFdoobwtV9/FUM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PaKMIbIc3YUSrmebuGzcrOMtCyrbs/dRaIee3PgqbFizPPHBFTpliMqkOkFzoN9oMBQIYv54EVJZ19rPF2S8FOjttjtzLTxZM6Od9Zm8u1rfxAZhJ+xQWYedW8CcXpLwAlVDuKoeoJqg38pL15vTMjkoMYLxgLXuxu86z2AT5xQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com; spf=pass smtp.mailfrom=fastly.com; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b=VkE7DZG7; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastly.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="VkE7DZG7" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-20ca388d242so24791315ad.2 for ; Fri, 01 Nov 2024 13:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1730492132; x=1731096932; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=4rOWj5wq1SGCaCslB1TWBLOjmfXZ4GP9FgmX1YHf/NE=; b=VkE7DZG7bce/7rzDqfgjd5v6gbe0xL3pHMErjgPQSgLnHfYJ8Twqdt7N0w7x9p/GxC yeF3Cb0VSlusfkQEcgIl/EQpQ7Oyg8peMEhOkOCqig36yMlaZDpzlOOyzKUaqKQzSJck ZShtvq9BGrYanVAb179nR+AfPE59ZQGhXkgE8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730492132; x=1731096932; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4rOWj5wq1SGCaCslB1TWBLOjmfXZ4GP9FgmX1YHf/NE=; b=qa/uaG4+fwW5kaRbp0uwqMRwMt7vZXKmoFCfpicgcOrTA5g4iClVgt0X/+ouGQ93ra 9lEBMwtMVPEsigSdYjm+7Pgmj50jhhWCM9OdLTsniXPzm6e8D/+mKwzV/WRMzXtEh4o2 eAJRS2R32l0Y9CmcwFkAq/nKtO7mxHW19bGrID1U0BQ09R3kakifttI5F/x3OCRbsyk0 rks8AiYi+6OWkDq+HUG5iu7dyda8pq4e7gWe46DMorrqMBKmzbTQWp7aqpMJ0W9oFj6P MyohtF6I80MF30O1diNi/5oMXd0FqhPO5bfpYhXjA1AwH4S0CUrx0wA+odcfpMPDpw5y ZL0Q== X-Gm-Message-State: AOJu0Yz/syV7P6CiRRiw1vIYaCOQdZlaxnHttnWHNV7Y0HM2ElZ+3S8H ih7BY9dtjlav3yZdjo2nwsRt8oBs48yV+C97ZYCQGxz0Xgi7q/g4Xbd8KayHT0Q= X-Google-Smtp-Source: AGHT+IGLQMQLNv4xaq8DqBOYiAGWYiXP+moKivQ5tFF9FFk0WRRRqQkt0/6YXC6frC7khIREMn44nQ== X-Received: by 2002:a17:90b:2e42:b0:2e9:4967:244 with SMTP id 98e67ed59e1d1-2e94c2e4c29mr6924981a91.24.1730492131974; Fri, 01 Nov 2024 13:15:31 -0700 (PDT) Received: from LQ3V64L9R2 (c-24-6-151-244.hsd1.ca.comcast.net. [24.6.151.244]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa2603fsm5316018a91.17.2024.11.01.13.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2024 13:15:31 -0700 (PDT) Date: Fri, 1 Nov 2024 13:15:28 -0700 From: Joe Damato To: Jakub Kicinski Cc: netdev@vger.kernel.org, pabeni@redhat.com, namangulati@google.com, edumazet@google.com, amritha.nambiar@intel.com, sridhar.samudrala@intel.com, sdf@fomichev.me, peter@typeblog.net, m2shafiei@uwaterloo.ca, bjorn@rivosinc.com, hch@infradead.org, willy@infradead.org, willemdebruijn.kernel@gmail.com, skhawaja@google.com, Martin Karsten , "David S. Miller" , Simon Horman , Shuah Khan , open list , "open list:KERNEL SELFTEST FRAMEWORK" Subject: Re: [PATCH net-next v3 6/7] selftests: net: Add busy_poll_test Message-ID: Mail-Followup-To: Joe Damato , Jakub Kicinski , netdev@vger.kernel.org, pabeni@redhat.com, namangulati@google.com, edumazet@google.com, amritha.nambiar@intel.com, sridhar.samudrala@intel.com, sdf@fomichev.me, peter@typeblog.net, m2shafiei@uwaterloo.ca, bjorn@rivosinc.com, hch@infradead.org, willy@infradead.org, willemdebruijn.kernel@gmail.com, skhawaja@google.com, Martin Karsten , "David S. Miller" , Simon Horman , Shuah Khan , open list , "open list:KERNEL SELFTEST FRAMEWORK" References: <20241101004846.32532-1-jdamato@fastly.com> <20241101004846.32532-7-jdamato@fastly.com> <20241101063426.2e1423a8@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241101063426.2e1423a8@kernel.org> On Fri, Nov 01, 2024 at 06:34:26AM -0700, Jakub Kicinski wrote: > On Fri, 1 Nov 2024 00:48:33 +0000 Joe Damato wrote: > > + ip netns exec nscl nc -N 192.168.1.1 48675 < $tmp_file > > Thanks a lot for adding the test. Thanks for the review. > Could you replace nc with socat or > a similar tool? There are multiple incompatible implementations of > netcat packaged by various distros, we get: > > # selftests: net: busy_poll_test.sh > # nc: invalid option -- 'N' > # Ncat: Try `--help' or man(1) ncat for more information, usage options and help. QUITTING. > > nc is a known PITA. OK, I've replaced with socat for the v4 I am working on. I've also added some additional documentation to the FAQ in the cover letter and the kernel documentation to help answer Sridhar's question because it may be a question others have as well. > > + # set the suspend parameter for the server via its IFIDX > > + > > + DUMP_CMD="${YNL_PATH} --spec ${SPEC_PATH} --dump napi-get --json=\"{\\\"ifindex\\\": ${NSIM_DEV_1_IFIDX}}\" --output-json" > > + NSIM_DEV_1_NAPIID=$(ip netns exec nssv bash -c "$DUMP_CMD") > > + NSIM_DEV_1_NAPIID=$(echo $NSIM_DEV_1_NAPIID | jq '.[] | .id') > > + > > + SUSPEND_CMD="${YNL_PATH} --spec ${SPEC_PATH} --do napi-set --json=\"{\\\"id\\\": ${NSIM_DEV_1_NAPIID}, \\\"irq-suspend-timeout\\\": 20000000, \\\"gro-flush-timeout\\\": 50000, \\\"defer-hard-irqs\\\": 100}\"" > > + NSIM_DEV_1_SETCONFIG=$(ip netns exec nssv bash -c "$SUSPEND_CMD") > > Can you try to run this test in installed mode? > > https://docs.kernel.org/dev-tools/kselftest.html#install-selftests > > IIRC YNL moves around when we install, you'd either need to do > autodetection of the path (see tools/testing/selftests/net/lib/py/ynl.py > and if you go down this route please move the helper which exports the > YNL variables to lib.sh so other tests can reuse); or teach the C code > to do the setup, you can link against YNL fairly easily (look at where > ncdevmem is added in the Makefile, it uses YNL) I think I'm going to go the C route. Just to make sure I'm following how to do this properly: - I've added busy_poller to YNL_GEN_FILES (and removed it from TEST_GEN_FILES) - It still needs to be run via the script (which sets up netdevsim etc), so I am leaving that script (busy_poll_test.sh) in TEST_PROGS. busy_poller is not intended to be run on its own for selftest purposes. I am not sure if YNL_GEN_FILES are expected to run standalone when invoked or if this will work as I expect it to (busy_poll_test.sh is run): [...] TEST_PROGS += busy_poll_test.sh # YNL files, must be before "include ..lib.mk" YNL_GEN_FILES := ncdevmem busy_poller [...] Doing the above: I am hoping that busy_poll_test.sh will be run (which will use busy_poller) and that busy_poller won't be run on its own. Thanks for the guidance.