Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp941888lqs; Fri, 14 Jun 2024 09:51:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXG9ct5zUoIg6bRrAf0hMkQZ7IeJqKA1xKdoqfVUqnui1OMtnf0PtkqKMzfeHgmhtNcZsQWwYlKIyl63D0+DU55394H6+OSBLrS/bBrSQ== X-Google-Smtp-Source: AGHT+IEhrCwA8+ZvMENOuvTD9VzCNtGh2RIxL5l0SZANXlNjXL51c8WBtCI51oH4zqUY6xLWwVfm X-Received: by 2002:a05:6a00:234c:b0:704:147b:d768 with SMTP id d2e1a72fcca58-705d71d0e4cmr3826794b3a.24.1718383882589; Fri, 14 Jun 2024 09:51:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718383882; cv=pass; d=google.com; s=arc-20160816; b=fe4qoNR0XOdgsXEsO4jdar/Uab18vW57PX83qcBky0e7T4CISPrp4QqrLCYHzkNvRk vcYcmzkZ7NgBRMFJnyH0JkztYSgEh+XMZcNkyfiW7RUCtFy3mhxdbml5I2r9NalQldTE zvlpSqQwnkmtF9YjYg2q0w/rwW2GgV6HEOoRKBbEJFRheQavr1ah9/j2SE4RFp68HvRn FKNPeA/kSQFDakA5an/Qzh4iIoKMmqKUcifzvfwzttxSzHeyApc/bMsycGnReN4VXfCu +LY+IG6fPKBI6JP7fulvuv0oTBl9W8PXOx+rPXoqQYcvAIDumWNGeednDg0LS/SGeWxq O1YA== 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=i2Up8q1L0yAKeRTkxwvDjdjMyttjyOXkJuHIu19/xLg=; fh=aF4U2B0WVM1FjgtPNhqvPFQuT8YVQ7go+0UC1tIXtjM=; b=wYZxPr2UrU+F/1YxUvXdCLmCGzXV5FWzWhoTplX21vKyEMtt+O9H9/O70KXsN6L+SW 34cZD9s+R4AMv6Hd62JJxgfth1lXOlJgzdJCAeBao59TnD37Xzly2nPqJm4Byf4ZNyhv zDlhK//528PmXfLnV9Hx2NOrVO8OVQBJBHl9cCYGn/dIRS4PN2FkRcgPUM0U6CZLZ4eo 1KAuTvNZqCa8s7IwKmWxqHloNJGK0imhRwc/GOJ46GjNJQfd5HJseiqOHJKQzOsF0bP/ bHn32MbRTgPgq8OUFTYXXO69oBXHHo80Rw9ZjP9jah8QuxsaC62JxFelAX5FiSzx9a/b exEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WKUjiGpb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215218-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-705cc8f9a4csi3913016b3a.51.2024.06.14.09.51.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 09:51:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WKUjiGpb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215218-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 9E55FB22EB2 for ; Fri, 14 Jun 2024 16:17:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 09037181B91; Fri, 14 Jun 2024 16:17:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WKUjiGpb" 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 2D82616D9CF; Fri, 14 Jun 2024 16:17:12 +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=1718381833; cv=none; b=J4x+ln88W5SBviZmVlgpoXKsjLU3lrYeN/8lSOGVogVFCR+DBOjpXj1XiZksTftNp3qb8jp8MRhgprGBF86aPm+phV951uJYXsUj7t7N+retJVlgU/Y65sXxMfOLfLWtLBp21UUANEe47MDsyGs/QbucEc1+VNdjzDIGxHzfX4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718381833; c=relaxed/simple; bh=rUDbAwt/h0GLgZcxweo77P+njhdjO7sRzKJA4DU7QAQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tSdn8C3TYUA9q+HUOmlyDb8g2rVqEdE7k7DTOmR7/JobzfLHthNRST9egObZkqKOeHseuqn9WAAfo0RirOQWZTH3FCdYOfBCYgTn5s2HdhNLb09IktO/W2BuuRkrTOLaHX3mxl3jvJzXQo80W1PLhpJLuxIvy3Hij3TdgBQc75s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WKUjiGpb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53C72C32786; Fri, 14 Jun 2024 16:17:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718381832; bh=rUDbAwt/h0GLgZcxweo77P+njhdjO7sRzKJA4DU7QAQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WKUjiGpbQ6vSgDikdQrtYjmcjpk5Y6w5mtfEOsK+zcO/QlUYDq49zp1kT4Nk3exJb 4FZpwSLehgZQIIaS8Fzvd3K4TjM3m97afoydWqtCD7nNxTZuKP3R7nFPvlwp/s6B2R eTXNWfcad4lxtI0m9stOKdpQ1fe9dZWkKyrvlyU053KI0RxoWxMZ9mfrRnmB7hs0g3 h7UH5g7UtACMfBFCq330U8BiXlR6zR11zLrlBnoggnwwxWwGftWpHXyPpv8oobpsDp EGh/4vaZAwS5p0ekOYbjG23g2J9gD1LDrH1quUzwpLz5Ux8K+pblsKZ0S89UnNSllr dG7BQG286BijA== Date: Fri, 14 Jun 2024 17:17:08 +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 , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2 7/9] net: openvswitch: do not notify drops inside sample Message-ID: <20240614161708.GU8447@kernel.org> References: <20240603185647.2310748-1-amorenoz@redhat.com> <20240603185647.2310748-8-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-8-amorenoz@redhat.com> On Mon, Jun 03, 2024 at 08:56:41PM +0200, Adrian Moreno wrote: > The OVS_ACTION_ATTR_SAMPLE action is, in essence, > observability-oriented. > > Apart from some corner case in which it's used a replacement of clone() > for old kernels, it's really only used for sFlow, IPFIX and now, > local emit_sample. > > With this in mind, it doesn't make much sense to report > OVS_DROP_LAST_ACTION inside sample actions. > > For instance, if the flow: > > actions:sample(..,emit_sample(..)),2 > > triggers a OVS_DROP_LAST_ACTION skb drop event, it would be extremely > confusing for users since the packet did reach its destination. > > This patch makes internal action execution silently consume the skb > instead of notifying a drop for this case. > > Unfortunately, this patch does not remove all potential sources of > confusion since, if the sample action itself is the last action, e.g: > > actions:sample(..,emit_sample(..)) > > we actually _should_ generate a OVS_DROP_LAST_ACTION event, but we aren't. > > Sadly, this case is difficult to solve without breaking the > optimization by which the skb is not cloned on last sample actions. > But, given explicit drop actions are now supported, OVS can just add one > after the last sample() and rewrite the flow as: > > actions:sample(..,emit_sample(..)),drop > > Signed-off-by: Adrian Moreno Reviewed-by: Simon Horman