From patchwork Tue Jan 9 13:55:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Safonov X-Patchwork-Id: 857497 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=arista.com header.i=@arista.com header.b="SdhMP56z"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zGDHp5ZCnz9s75 for ; Wed, 10 Jan 2018 00:58:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758473AbeAIN6M (ORCPT ); Tue, 9 Jan 2018 08:58:12 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:41556 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754494AbeAINzj (ORCPT ); Tue, 9 Jan 2018 08:55:39 -0500 Received: by mail-wm0-f66.google.com with SMTP id g75so20695517wme.0 for ; Tue, 09 Jan 2018 05:55:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8r+pm1ZKSFayI9u6Q8PLvhF6cMQo5S2NlrXZUWwoubk=; b=SdhMP56zzPon5dQmtPrQ1vox9vYeL3rRFeI4smiUbQ1DOISIiF3sBnQDllYnB70gHx 7y88ya+iEwsNTglAVV4ymq88M1FL+5j278/u55jEkbAh8UiMpankYcUrE1QYzaaRclMt vv4vBpo1uwbpzGZ4Lwji5RUj44s8QZyF11UQE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8r+pm1ZKSFayI9u6Q8PLvhF6cMQo5S2NlrXZUWwoubk=; b=ek+w0S8YpugU6G+/fA4A53j68T2UREn0Jm14E9KN5wdaWyV/OgAX4kQ6xTWCdAZkE4 wa2tMjihsMiclvCn28T5nckkFgNrR+pr+OsECexqlRsjgCqhejFSyOC+eOv4Y/9vA2oW 8zORLPabTdj9zvoBIhAzy+emCSg0F8ZS9cMfKwOcj44AeVD1disM0Emb/93QQofgfP+J 1+6gDhkXuwmR7Ds/xA0GNomM7BR6ygW3OJCxQV99wA6PWd331XLqZFGulTk8qRKa3AqZ O20D8j2s5Or2i32d4VvgVqCOwsME9rofquaZQHh8FA0Z8zRhk+h29wDmS7XJpNmzbhNj ZQFA== X-Gm-Message-State: AKGB3mLRMMFFvqZM3/GwCq8HPLIcBw0eGItvOwjJhk70V+3ezwuReYHX vswUMLmfuyV8QfKKQc17NdgEkQ== X-Google-Smtp-Source: ACJfBosLHuKH+Qr/wMIJiLRnKoUSK1WX3pnwtp1N/86UKDiskaYetKBheYG75d6nauo3aijM33jHqw== X-Received: by 10.80.163.153 with SMTP id s25mr21625997edb.7.1515506138436; Tue, 09 Jan 2018 05:55:38 -0800 (PST) Received: from dhcp.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id n49sm1161697edd.37.2018.01.09.05.55.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Jan 2018 05:55:37 -0800 (PST) From: Dmitry Safonov To: linux-kernel@vger.kernel.org Cc: 0x7f454c46@gmail.com, Dmitry Safonov , Arnd Bergmann , "David S. Miller" , David Windsor , Eric Dumazet , Ingo Molnar , Johannes Berg , Mark Rutland , Radu Rendec , "Reshetova, Elena" , netdev@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org Subject: [PATCH 1/5] Documentation/pktgen: Clearify how-to use pktgen samples Date: Tue, 9 Jan 2018 13:55:31 +0000 Message-Id: <20180109135535.15237-2-dima@arista.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180109135535.15237-1-dima@arista.com> References: <20180109135535.15237-1-dima@arista.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org o Change process name in ps output: looks like, these days the process is named kpktgend_, rather than pktgen/. o Use pg_ctrl for start/stop as it can work well with pgset without changes to $(PGDEV) variable. o Clarify a bit needed $(PGDEV) definition for sample scripts and that one needs to `source functions.sh`. o Document how-to unset a behaviour flag, note about history expansion. o Fix pgset spi parameter value. Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Dmitry Safonov --- Documentation/networking/pktgen.txt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Documentation/networking/pktgen.txt b/Documentation/networking/pktgen.txt index 2c4e3354e128..d2fd78f85aa4 100644 --- a/Documentation/networking/pktgen.txt +++ b/Documentation/networking/pktgen.txt @@ -12,8 +12,8 @@ suitable sample script and configure that. On a dual CPU: ps aux | grep pkt -root 129 0.3 0.0 0 0 ? SW 2003 523:20 [pktgen/0] -root 130 0.3 0.0 0 0 ? SW 2003 509:50 [pktgen/1] +root 129 0.3 0.0 0 0 ? SW 2003 523:20 [kpktgend_0] +root 130 0.3 0.0 0 0 ? SW 2003 509:50 [kpktgend_1] For monitoring and control pktgen creates: @@ -113,9 +113,16 @@ Configuring devices =================== This is done via the /proc interface, and most easily done via pgset as defined in the sample scripts. +You need to specify PGDEV environment variable to use functions from sample +scripts, i.e.: +export PGDEV=/proc/net/pktgen/eth4@0 +source samples/pktgen/functions.sh Examples: + pg_ctrl start starts injection. + pg_ctrl stop aborts injection. Also, ^C aborts generator. + pgset "clone_skb 1" sets the number of copies of the same packet pgset "clone_skb 0" use single SKB for all transmits pgset "burst 8" uses xmit_more API to queue 8 copies of the same @@ -165,8 +172,12 @@ Examples: IPSEC # IPsec encapsulation (needs CONFIG_XFRM) NODE_ALLOC # node specific memory allocation NO_TIMESTAMP # disable timestamping + pgset 'flag ![name]' Clear a flag to determine behaviour. + Note that you might need to use single quote in + interactive mode, so that your shell wouldn't expand + the specified flag as a history command. - pgset spi SPI_VALUE Set specific SA used to transform packet. + pgset "spi [SPI_VALUE]" Set specific SA used to transform packet. pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then cycle through the port range. @@ -207,8 +218,6 @@ Examples: pgset "tos XX" set former IPv4 TOS field (e.g. "tos 28" for AF11 no ECN, default 00) pgset "traffic_class XX" set former IPv6 TRAFFIC CLASS (e.g. "traffic_class B8" for EF no ECN, default 00) - pgset stop aborts injection. Also, ^C aborts generator. - pgset "rate 300M" set rate to 300 Mb/s pgset "ratep 1000000" set rate to 1Mpps