Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp526053lqr; Wed, 5 Jun 2024 12:52:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUV2ScKyt4vkf8oA0Wm4719hGVcNk9ATnk/Vb+dXr3DUsKoCDon1qVApQNBSPOziXrICIVlR7F19Eu77Vb9zLxYz2ezwnUVvSE6eeYUeg== X-Google-Smtp-Source: AGHT+IHDGLfewA10nRoiqfwtlWrTlFoEJDhgkqnSqgE3CyjVzEh6iToStYqPA54BLo1s8lnEyoFA X-Received: by 2002:a17:90a:9a8:b0:2b9:fc72:547e with SMTP id 98e67ed59e1d1-2c2999d8736mr838433a91.18.1717617152131; Wed, 05 Jun 2024 12:52:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717617152; cv=pass; d=google.com; s=arc-20160816; b=lMzT/WzLQe1I3K8MrVHZ9aqB+EdniJrosyZqd5rOSOqjINYC0YXeK1wAER2n4WmRma hUBWzYurLQfZE7utM+OGg9XbQaJLFRJl46HBHJLfePUGZz4eE0k6RUBhmsYafE83Y+1J UX1gCBoWzxdFngPgEuNOuDR1GcM27ut/dV3ALteJZgkv2mrXsQkLpBjegOhjfSQ81WSj IKFsWq1Jc7YqonJMM96Y0C8QHJttIgPH9IWm77rFpKk2dVQuzod+Pg8jayFhc6PeCxBn iU5m1u+9MrX80tB4ApCdNG+U8uOlskKqtRl0PIEV2vWGd2zv9k4ykHUZGxSgmNkAERVa tbmg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=v6NrxsZoTJjUvCjqEjMB8/SI+eX/wauHmU4jDuVRny4=; fh=Jo2sGH8dTFAs5EVKQ/ttSU+X/bb6d/C2ZHiFTL2AYRI=; b=aRaX1sHkaRa8Fi+XpQAkZN3m7FacLCnu2AZO0mgQS9CN9+GLbjQXs6LAL/mhifgs1z elJVLvCmhANNeqL1K2hnJbwxoSdDGdUctpx28rIXGLu969PtoXvionCiSZL91zGpJJcd g2YWLl62Q0fl3JxDuGDqTy630NNyaO4l22cBW6M9OV7aXNBO+K/q5mQZn4Gbn2WvglK3 GBQjZXjvQxHV3Yrh5WzcOthcCrgXoKJ0yXxDUzfHHN5776yPycT+O78SvOMRIW/RBXKF q6b9+D7+77lGTDb3cxb2G8XtIlDu9PL2lSjr6jLg4GIJrvVaNq6wUL0HFuhzv9WIw5zP AYDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kKaN2IFJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203118-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203118-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c2806ae0f4si1677063a91.173.2024.06.05.12.52.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 12:52:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203118-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kKaN2IFJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-203118-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203118-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 63371B23478 for ; Wed, 5 Jun 2024 19:43:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7CBB0152E1C; Wed, 5 Jun 2024 19:43:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kKaN2IFJ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F99314EC56; Wed, 5 Jun 2024 19:43:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717616600; cv=none; b=cUWfsP0Ij+nD/CQ4akf1cGsQcNAusInooZ7geKp0cueu1APzxT2r72yaA5OXVq6vhXIawiv4LZVajRS8pPjLJlV3nI7czodvRGgyOLG1vCsGUlaeANiPPL/VZg2iVmGB1pPWf1no0PGQa8nbpSSRQTKBBkKOcQhObU98hX15Pvs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717616600; c=relaxed/simple; bh=KIGvffMFmtiF6JY2kPrxSLeoIMqNOQ0IhOPnWoh89qY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bmQADH7JhkeLHgrSVCmfhl21f1n2MheQ2A5uSsSIcRRZYUU2kIbWPaiqzFWdHAUilx/YfZYBsmldwxvC5P5ihB5ssFbQWasMvhkN5LDiIM8xl6AORqvD+1st1wYk+Rnmw1eeqfLwHi2aUtO5whGZhJfcQnfL8Ev9bpeR4n7NKr0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kKaN2IFJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A240C2BD11; Wed, 5 Jun 2024 19:43:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717616600; bh=KIGvffMFmtiF6JY2kPrxSLeoIMqNOQ0IhOPnWoh89qY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kKaN2IFJMH56DTxD6b+6O+4kWa3g6aTqMvBPs6i1mT30xPAXQPUWafP+1Jx1JdDsC 62zCdOLvk+B+4F47V9wIoc4DqvdEWSHFK+QqmcbTq0LZ0D5jYCqLP8ob+kf6OYoYoR SYmUAgt2Tw+bgeAonl4E6Pf3lnr23fao+Y7cuT/IYfMYYQsuw4WLnkmJ5fTGuHESzo 9v/9c4r9cjc1eD+pKoGANyTxd6Te+w5st6/Od/mlfu1aWfdjQZraJX/bo0Sgu7BAlz ScrGVKjA/5dCdATM/KN94ntYghEYAx5Wi7+NwWJFDzrmyX6yh6T/S40w6t4URGkR94 nbYzdHe8ST2dw== Date: Wed, 5 Jun 2024 20:43:14 +0100 From: Simon Horman To: Adrian Moreno Cc: netdev@vger.kernel.org, aconole@redhat.com, echaudro@redhat.com, i.maximets@ovn.org, dev@openvswitch.org, Pravin B Shelar , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2 9/9] selftests: openvswitch: add emit_sample test Message-ID: <20240605194314.GX791188@kernel.org> References: <20240603185647.2310748-1-amorenoz@redhat.com> <20240603185647.2310748-10-amorenoz@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <20240603185647.2310748-10-amorenoz@redhat.com> On Mon, Jun 03, 2024 at 08:56:43PM +0200, Adrian Moreno wrote: > Add a test to verify sampling packets via psample works. > > In order to do that, create a subcommand in ovs-dpctl.py to listen to > on the psample multicast group and print samples. > > In order to also test simultaneous sFlow and psample actions and > packet truncation, add missing parsing support for "userspace" and > "trunc" actions. > > Signed-off-by: Adrian Moreno ... > @@ -803,6 +819,25 @@ class ovsactions(nla): > self["attrs"].append(["OVS_ACTION_ATTR_EMIT_SAMPLE", emitact]) > parsed = True > > + elif parse_starts_block(actstr, "userspace(", False): > + uact = self.userspace() > + actstr = uact.parse(actstr[len("userpsace(") : ]) nit: userspace Flagged by checkpatch.pl --codespell > + self["attrs"].append(["OVS_ACTION_ATTR_USERSPACE", uact]) > + parsed = True > + > + elif parse_starts_block(actstr, "trunc", False): > + parencount += 1 > + actstr, val = parse_extract_field( > + actstr, > + "trunc(", > + r"([0-9]+)", > + int, > + False, > + None, > + ) > + self["attrs"].append(["OVS_ACTION_ATTR_TRUNC", val]) > + parsed = True > + > actstr = actstr[strspn(actstr, ", ") :] > while parencount > 0: > parencount -= 1