Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2854975pxt; Mon, 9 Aug 2021 10:23:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgl9A90Tzhh0gn15hg69yb6P5qgBRsDrkGf25Ehd5DBR6+39m7UWQyaua6ME+73R0muI7A X-Received: by 2002:a02:850a:: with SMTP id g10mr7079703jai.134.1628529825688; Mon, 09 Aug 2021 10:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628529825; cv=none; d=google.com; s=arc-20160816; b=kgH2uj/bVWFXycHP/btNQxg/i3CKARI7OZoP/xL3XLrTQtCq4+S9a1/JGcaEYNyeEx uHCegVbqrMcwzJl8foGSMzOovqDr4OW4oc5whDILP8D7n0OhHNce25BjnT3lBlR9dGvp IfZ5Tuce3eHK4tSdha0h5JzTy144eQadAhyjhKyxDIiBli64xHg2TsOQtLTdrbV3EMiP F20weSw09IagPhJe+plMAdRdeTzgX9qozV3kvjVkDeiiZlmm4FSca16RYFDm421m2bxn vOOg58tsMYTMwHFpJF4D6JNO5eDbCWJGtS2DpdL+QvlVrVG16/+oLqvPbzRhf0s+CKL6 3gKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=Xcvol7SaEf5nEJ4TIhNgU4+/eKyMOxhUuZoxthy3jEs=; b=yLtcu6xOp2vt9dm+EQDNmCh0F1C1/6wkmmwdS+fBa/y2smpZ5vPGy1/xJ60MWYE6aX SzsLhViHwP9eKfWvBsrKwPRqffkr1CkkksBMVlmWzYB5VBmcVW+7rHPohYpeBshP+iNb cPPGbxRi+IGafz75oG/Lh0376MLmiw3xj84WXM0EOfFyH/y41j54i0QNIQJXuJvaFbqW mh91E8ydKYxwA9ZRRuQ5wf9IDCLKac3avJqyH51+C7q7SOhRd56Gk7Qo/wbP2mhQrWkM P7mhqOPSHgGgBcJzVJ77XsJjl8csn8E+cl5pFJF+ETOjstjoiRvXSj/foCFfMAMriUik DTQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="fYl/S4P1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id az34si19193294jab.63.2021.08.09.10.23.32; Mon, 09 Aug 2021 10:23:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="fYl/S4P1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234056AbhHIRW6 (ORCPT + 99 others); Mon, 9 Aug 2021 13:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233817AbhHIRW5 (ORCPT ); Mon, 9 Aug 2021 13:22:57 -0400 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D47EC061796 for ; Mon, 9 Aug 2021 10:22:37 -0700 (PDT) Received: by mail-qv1-xf4a.google.com with SMTP id b2-20020a0cc9820000b0290352b2c7d7e1so3649295qvk.9 for ; Mon, 09 Aug 2021 10:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=Xcvol7SaEf5nEJ4TIhNgU4+/eKyMOxhUuZoxthy3jEs=; b=fYl/S4P1NIh2MYIlfqgl72NRDM0lxRXloBDtiD8Qa+o8CfCffKEeMu8z+6YjTeuFN8 8D/m2Nq4EXJEZTGw6m+Q4v3riPs2kKn1W49g3pQZ1ySREQ/ej7BwSfwZ/esSbTvAFRjd BjMdI7Na4vj4+/eOfGLZ6qnA7o6//dvDRj8Z+4AGm/WpYqXKOh1yS4M1hCrjh39j4oOW rgDIMZIhNlh3aW5gdMsVnfXJLp8ElGk7DPwRhbcTGyk+4W1XvvFuMFu7npurnmMQzeUy yecTyiRF8c1Ct8aMNXdGSiqCn3h+p6F2aQEEct7TbMLsVU40xyrBKLJnFwIGe4+NFcyS vZXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=Xcvol7SaEf5nEJ4TIhNgU4+/eKyMOxhUuZoxthy3jEs=; b=SZUK1hxfkNLtlA6iQtoexmN7EgeLE41pZ1fwurzYlcgssTEX1SF//4ALbcvVu6KuHO 7Nc7HAqrMoQ21RgW0F31fWzDwjrzGrijMxabWKxDcE4RDH70Vuu6gcszaaKnWe4fd3+h yIhUH87bGRQ9mSD7soe73soLKpvlSP1CsXm+aMlPEeuJT+VDi3jXxQYOPhKrGQa+EIi1 EVH4hr3rKTnzcqsdUgm0jw+pyw/ATTUHbWVV+isUZe9K7KsC3vN493zpaysbW1e7Sy/g Hn8JolPSNsLubSPqr/VTACctc3jiR9iHZFB/QMmVzUft4VmRLs/Lgfr5VRHwIduiQA1/ Vz3Q== X-Gm-Message-State: AOAM53071ovGwzP8StKLus4XslUYpx8TL27PgA3zAVtyaC/WbR7glU3e x5Hst3UVcf5ZMKESf1kZ/SIygvdzJ54WSJa2hoGwXg== X-Received: from mustash.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:337b]) (user=richardsonnick job=sendgmr) by 2002:ad4:498a:: with SMTP id t10mr6749325qvx.8.1628529756242; Mon, 09 Aug 2021 10:22:36 -0700 (PDT) Date: Mon, 9 Aug 2021 17:22:01 +0000 Message-Id: <20210809172207.3890697-1-richardsonnick@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.32.0.605.g8dce9f2422-goog Subject: [PATCH 0/3] Add IMIX mode From: Nicholas Richardson To: davem@davemloft.net, kuba@kernel.org Cc: nrrichar@ncsu.edu, arunkaly@google.com, Nick Richardson , "Gustavo A. R. Silva" , Yejune Deng , Di Zhu , Ye Bin , Leesoo Ahn , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nick Richardson Adds internet mix (IMIX) mode to pktgen. Internet mix is included in many user-space network perf testing tools. It allows for the user to specify a distribution of discrete packet sizes to be generated. This type of test is common among vendors when perf testing their devices. [RFC link: https://datatracker.ietf.org/doc/html/rfc2544#section-9.1] This allows users to get a more complete picture of how their device will perform in the real-world. This feature adds a command that allows users to specify an imix distribution in the following format: imix_weights size_1,weight_1 size_2,weight_2 ... size_n,weight_n The distribution of packets with size_i will be (weight_i / total_weights) where total_weights = weight_1 + weight_2 + ... + weight_n For example: imix_weights 40,7 576,4 1500,1 The pkt_size "40" will account for 7 / (7 + 4 + 1) = ~58% of the total packets sent. This patch was tested with the following: 1. imix_weights = 40,7 576,4 1500,1 2. imix_weights = 0,7 576,4 1500,1 - Packet size of 0 is resized to the minimum, 42 3. imix_weights = 40,7 576,4 1500,1 count = 0 - Zero count. - Runs until user stops pktgen. Invalid Configurations 1. clone_skb = 200 imix_weights = 40,7 576,4 1500,1 - Returns error code -524 (-ENOTSUPP) when setting imix_weights 2. len(imix_weights) > MAX_IMIX_ENTRIES - Returns -7 (-E2BIG) This patch is split into three parts, each provide different aspects of required functionality: 1. Parse internet mix input. 2. Add IMIX Distribution representation. 3. Process and output IMIX results. Nick Richardson (3): pktgen: Parse internet mix (imix) input pktgen: Add imix distribution bins pktgen: Add output for imix results net/core/pktgen.c | 163 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 162 insertions(+), 1 deletion(-) -- 2.32.0.605.g8dce9f2422-goog