From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-21.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAEFCC4320A for ; Mon, 9 Aug 2021 17:22:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 980476105A for ; Mon, 9 Aug 2021 17:22:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233656AbhHIRW7 (ORCPT ); Mon, 9 Aug 2021 13:22:59 -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-Google-Smtp-Source: ABdhPJx4Y6ZEwN5YeJJLko9DVHdYfNRD0QB2UZW2bQjvIauG2uZeJC3L2Tg6y4dLnB919OKLgKb8wKCH7o60FyM+hfqiEQ== 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