From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4601E42570; Mon, 11 Sep 2023 19:53:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6650402D6; Mon, 11 Sep 2023 19:53:26 +0200 (CEST) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by mails.dpdk.org (Postfix) with ESMTP id 55001402CE for ; Mon, 11 Sep 2023 19:53:25 +0200 (CEST) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-9a58dbd5daeso621733966b.2 for ; Mon, 11 Sep 2023 10:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1694454805; x=1695059605; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=0Zl6kvfAyRZa75EaOarncpbjU/ClbcORAlgSKyOpG2o=; b=vfSkN5QrqYd+zYnb+oxWEk6PolxJ6kHeYVEFwtcVHZ1ILa6ZDrZRAEEmoRPfiK3inI FBNcm3+FLr/vKYNv4umnPIdw0Mr+mUfQALCpTQ8s1PNRQFXtTTT2nP1a8rEZGKJsdahA Q3eL6JpI+LdVGDB3gS/ldE054V9y/MTFpGfT+FBBS6RExtRd8GOh3X/y5SsoapWm0VH/ JRAc+BNuSTxMnPYGjaGh/eNQaB4Z050r79E8cekiyzPyr0RvKPcKoZ6Lk40B9KDDvXJW pDHmzQBcsLVnnzkdELQ2JEyQZ9iG0xGjKMp4AigvNdxqHcg/icN4TMaXzpX2QQFchY2Z jLww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694454805; x=1695059605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0Zl6kvfAyRZa75EaOarncpbjU/ClbcORAlgSKyOpG2o=; b=UynaP7D2dnz2arqzxyfhdU0l1SklqGMIxUL6+bvyd/I1PtYontLiVFEL+fhs8Kbnnd u7L+dseqfnoMnR6SrGwdJyw9YBNp044dxlsvVWicnzrqwGmaHp6StpbSVmNZ6KFRmfcl bhdOgcxePGJAB8v+bj8T7nI2sbnj1nFvMBw6FJLgNm71UQQKPl6uKxXZwoXuNtJi8cmT glCct6w47rhZ/rllu70pStMgcoOfyOw8XrgV7WL5qge30UDI9+3DJ7oIQrSZ206GgccR KoPwZw3pQc4uhmecREkPM3NMGnHVS69OTaaBkCZ1Axci0Z/cEflv9Nz5ec3pkD8u/HGz Kgcg== X-Gm-Message-State: AOJu0Yxbjjitb1GHL2W/AQJuQGnotNeBegIbEL9uH8xpMZA0Cb3QnZsC EA0d+K5p2maOWBpveJasOW5bXg== X-Google-Smtp-Source: AGHT+IGYvKu3Nw8/FZutPqi1fW+ta8Y/n3pRCpUKYX0vMIqdBzv8coGhPFHAofxfoI6ee6Er2bXx5w== X-Received: by 2002:a17:906:10cb:b0:9a5:d48f:c906 with SMTP id v11-20020a17090610cb00b009a5d48fc906mr9630235ejv.15.1694454804869; Mon, 11 Sep 2023 10:53:24 -0700 (PDT) Received: from fedora ([79.140.208.123]) by smtp.gmail.com with ESMTPSA id n13-20020a170906b30d00b0099cc36c4681sm5673243ejz.157.2023.09.11.10.53.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 10:53:24 -0700 (PDT) Date: Mon, 11 Sep 2023 10:53:21 -0700 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: "Michael Baum" , , "Ori Kam" , "Aman Singh" , "Yuying Zhang" , "Ferruh Yigit" , "Thomas Monjalon" Subject: Re: [PATCH v2 0/2] ethdev: add random item support Message-ID: <20230911105321.6e17708d@fedora> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87BA0@smartserver.smartshare.dk> References: <20230822090505.3242455-1-michaelba@nvidia.com> <20230911074149.697944-1-michaelba@nvidia.com> <98CBD80474FA8B44BF855DF32C47DC35D87BA0@smartserver.smartshare.dk> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, 11 Sep 2023 18:55:45 +0200 Morten Br=C3=B8rup wrote: > > From: Michael Baum [mailto:michaelba@nvidia.com] > > Sent: Monday, 11 September 2023 08.42 > >=20 > > Add support for matching random value using new > > "rte_flow_item_random" structure. =20 >=20 > I get it. It can be used for things like stochastic sampling. >=20 > However, it doesn't provide support for e.g. 1/100 or 1/500. >=20 > So here's a suggestion: >=20 > Instead of "value" (which is irrelevant) & "mask" (which is what > really controls the probability), wouldn't it be better if "value" > was an inverse probability (and "mask" was irrelevant)? E.g. > value=3D500 means that there is a 1 of 500 probability of a match. >=20 > Would this kind of random item better serve the purpose? >=20 > Or is the random item, in its current form, also required for other > purposes? >=20 For netem (Linux kernel) needed to support expressing a percent in fixed point number. The solution was to express it as: Percent =3D X / UINT32_MAX