From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796127534; b=KpzXxqAPH8QWq/ZZuNxFwEmpbexRl5fpZ8F9c7BISTqRxp0RdbY2R+/RM28V8m7z4dLO 0PdVMNP7qla6ab0UaSMQoNXcvEScG8+cmYB0iEpZP2wZXtMuwT7gosT44A43eGASOjnGC OtzoOFgdAkoENadkn88XdPMdY7sZ5Fnv83x2je1EtRVZtVzB2ouWnohVI7MkmwPwjDttm u1vChoj7F7ECgqvoCCujpChZhagzng3uiYbCM3JzqJV6k/XNMRpt3VgxfMtaVzinxKN2H XFfzBmODYHAKmqFnccYJ/ahARpUTlyW4C8oFo1AJX/MvdafP6wpyluKjssifsrF9ZMQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796127534; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:Message-ID:Date:MIME-Version:User-Agent:Subject: To:Cc:References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=kaCWkPSegj+y4F7N9muT5kiKkv5yHGCsnte3MKCiHsQ=; b=fknaRnUEpqP7wSgqn7QpwJLhiPLgtAVbAXPI9jZ/ExCGIjFRIvno7SK7mu/HmrLa6+2n qR94NJLsxkrtWQI/Gj2puVl9hlziG4gYHL9EVd+YVj5OHdBRFF2nE1qWx+51mX805fwY5 OpdZqVlhua1Ve6N+PfjWzB+s373d56idMpJSp8A/eIYPTh2TnYjSVrbJoal/NoxZWDc+U nqEKRYA5yJgW6d1NHB1WLGRlhvd62lYU0/uTV0UDjT/DoUoMq4pycR1PRejwqCHcZMxcM nhazXCEgValbc2qgHGmSf8yDfTYdC3VLYpVUurKQaBHYEFINSMgQ7A9ON6Kbu99JHmA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CSmRcVJP; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=T1mwx07a; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECD22606A320 for ; Tue, 1 Dec 2026 12:18:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ECD22606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CSmRcVJP; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=T1mwx07a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796127532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kaCWkPSegj+y4F7N9muT5kiKkv5yHGCsnte3MKCiHsQ=; b=CSmRcVJPpWXBxlZkDiu5vWyglCRtWRJIbjD42V92MM88nLYS7fnIrYgM9FRjk7lMIyhqdQ jr0IUpgTzE0tvrPhySm9bv4JRcVbO6pfb3TT/Yb2fDi1dK2eiCrr60ieWPE9brMBUrH2p/ lhy9rgxFT4wrxhV4S/yGMiysV+aBJ48= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-662-ZR1vbSBBMaqAkI_WZdYVOA-1; Tue, 1 Dec 2026 12:18:51 +0000 X-MC-Unique: ZR1vbSBBMaqAkI_WZdYVOA-1 X-Mimecast-MFC-AGG-ID: ZR1vbSBBMaqAkI_WZdYVOA_1796127530 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4a80bd45e1cso64798365e9.3 for ; Tue, 01 Dec 2026 04:18:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796127530; x=1796732330; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=kaCWkPSegj+y4F7N9muT5kiKkv5yHGCsnte3MKCiHsQ=; b=T1mwx07aseDl0ZPQzDOu7Gofgqzx4A5bpdth89DXCmSe2SARjMpFbsIA2SPksnq8bH IuVLlQpQ4s8AKbrNnPs9oVTPuBL1oLqezs6lMMHAybePePsfWbPY+87K9VveFz5A7WHb QZwtbn5QlMIcv062SSRzalgfOObAcX5h82w6oXg05owwoXM2PFxlwGZ08b19YVutZCvS dlzdPplYgbF0Tj0T1iLnr6Ocekyd9CMVckjUvfEOyipQZLfqBua298jbxZLCI7hSCkzD UIuqQlRZ/icPBt+w4aniaMXOdMh2S11HC1Hy3Xmf2kN6sbxJZ6MyL3nTW7ihyISPM1cM 890Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796127530; x=1796732330; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kaCWkPSegj+y4F7N9muT5kiKkv5yHGCsnte3MKCiHsQ=; b=Reqg+GOKpLcvwWpc92kTHCdgSTmotylmdQVjbQOSm4L7e3HDFaDy55ofr7+Kw9TMXC wPeawYmwgSYEbaHb7WXeGhosB9ZC4HxAqLtk6YtbxxNX2JrVV2w844pwTs9KB2zjERVW iNYJ6Y4E3IFFxhJb4uehjZkHJcroqjrPmzzGbMNYFGNXJ1qXlgdd4KJRaXXQIqxKdpPA oM5W5DGsZFmfxkjZOMvOkUu1uGvN8dXYwrYVRtlmAZx1cnXOr95cfo5TrOb55glYjJhY g0vmMEmYtGcCIzstqdpt9FDHyhIG2k2L1Wi1i5Toqx9ZicGUf+fh0Jle/iayBBLkALV4 IjMA== X-Forwarded-Encrypted: i=1; AL+hErExgmoYj4CCa5mASkzKBjiheJct8aVb8qB0eXUuXDmWNgrQPf2MsA3exPYhRQH+62eR5P1NKMJIxdO9/Bg=@vger.kernel.org X-Gm-Message-State: APuU4Z+jyIiotF+VgP451FVyXk1D9PbiOlSVeidUOnNvp8/ZkYPxGRBq 5WW5c2/gSfw2EHAsYbII3JJ6gyTCfVlj9DEw0Tt1ucSrNuYB05ihmIFk6m+UGgfvgjdb1FpMTBA HU/ejGEfK7A/QXPeagAwiWPWhRMb5fe5OJEyu6UedVFpofB5BPqE+KSUfxFBS8afd5A== X-Gm-Gg: AZFdTZfilki5UKlWCK0+X+WXtg7xvIrlq9W9n1/M6ld5EzygEWN2F+RVRRueTBIV1GX kB5Q8Yr4KoYsTAAUxWhe+6zIkha98R1O4WEKnPnO4mirYr1H9N6MCYwYUBJU7TwH+rtDv2pZrCp SrB1lcPZkE3XmBaQ0wkgsRJDPVMOnV7tDpGltNK2Wa/CM/CYVFsWzHOAAyjHHixKgs1d6BAiKVw TjTUgzPPyzhlhia7yc1au5zq80Cg22jPA2Q+np63kFQgLfbHKsycj3XkjdaQ6TC3wPGwAgS6K2R C1QxZHQpmDjouQuroFkWD6PmRb/BpCiVnAxXPsCqC9Wb24ay5BDE69eLn2XU0jIT49PPZN3Jr2n tqrQ1eGBrw88R+qQTLxkvsGf7bJJgsYJQhndM0+Tykz/agLWWmpfmZCV/SRCy2xmRjFKD6AcBEL sAHCrpipDScJy8iwZuqM+rHzbajswuQvujYM5FPhSLC3Y= X-Received: by 2002:a05:600c:3b98:b0:4bb:7033:c92f with SMTP id 5b1f17b1804b1-4bb88826810mr730169185e9.11.1796127530078; Tue, 01 Dec 2026 04:18:50 -0800 (PST) X-Received: by 2002:a05:600c:3b98:b0:4bb:7033:c92f with SMTP id 5b1f17b1804b1-4bb88826810mr730168595e9.11.1796127529677; Tue, 01 Dec 2026 04:18:49 -0800 (PST) Received: from [192.168.88.30] (ip231-128-192-82.pool-bba.aruba.it. [82.192.128.231]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bba6a0d65fsm531105825e9.3.2026.12.01.04.18.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 04:18:49 -0800 (PST) Message-ID: Date: Tue, 1 Dec 2026 13:18:48 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v3] net: mlx5: Allow police as the last action of a TC rule To: Mohsin Bashir , netdev@vger.kernel.org Cc: saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com, mbloch@nvidia.com, cjubran@nvidia.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261124220251.776944-1-mohsin.bashr@gmail.com> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20261124220251.776944-1-mohsin.bashr@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/24/26 23:02, Mohsin Bashir wrote: > From: Mohsin Bashir > > In switchdev mode, mlx5 does not offload a rule where police is the last > action, although TC needs no other action for such a rule. The upcoming > selftest series relies on these rules. With nothing after police, the > police result alone decides where the packet goes, so each result must > be offloaded as TC executes it. The driver does not do that today. An ok > result is handled as pipe and runs the actions after police, a pipe > result always returns to the post action table, and a jump is counted > from police while TC counts it from the start of the action list. A rate > police is also rejected by verify_attr_actions(), as its forward to the > post meter table is added only after the check. > > Make the offloaded rule behave as it does in TC. An ok result ends > processing in TC. A pipe result does the same when police is the last > action. Send both to the end of the TC chains as the driver already does > for gact ok. For jump, offload only the simple case where police is the > first action and the skipped actions are all drop or all ok. Reject the > rest. Existing rules where police is followed by other actions also > change. An ok result now accepts the packet instead of running those > actions. Finally set the forward to the post meter table while parsing > police. This is already done for police with mtu and lets a police-only > rule pass verify_attr_actions(). > > Tested on a ConnectX-7 in switchdev mode with the commands below. The > hardware drop counter showed that the rules are offloaded and limit the > traffic to the configured rate, that the second police only sees the > packets conforming to the first, and that the jump lands on its target. > > tc filter add dev eth0 ingress pref 100 protocol ipv6 flower skip_sw \ > ip_proto udp dst_port 5201 \ > action police rate 100mbit burst 1m conform-exceed drop/ok > > tc filter add dev eth0 ingress pref 100 protocol ipv6 flower skip_sw \ > ip_proto udp dst_port 5201 \ > action police rate 200mbit burst 1m conform-exceed drop/pipe \ > action police rate 100mbit burst 1m conform-exceed drop/pipe > > tc filter add dev eth0 ingress pref 100 protocol ipv6 flower skip_sw \ > ip_proto udp dst_port 5201 \ > action police rate 100mbit burst 1m conform-exceed drop / jump 2 \ > action drop action ok > > Cc: Carolina Jubran > Signed-off-by: Mohsin Bashir @nvidia: could you please TAL here? Thanks, Paolo