Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp859362pxb; Fri, 22 Jan 2021 00:34:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmVEqC2q+BCa60bc0Zxx0d0gSZ0z01WXii1/JCdyfWWjAS12Q0iPKofdNos6ksaGUd2MdJ X-Received: by 2002:a05:6402:2c4:: with SMTP id b4mr2317174edx.49.1611304485517; Fri, 22 Jan 2021 00:34:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1611304485; cv=pass; d=google.com; s=arc-20160816; b=rmtIBYhi7O6CoGQ1rXt7CqUkrrB0PGYDeDRNfxmarTOqfp8uABAg2fwfFDZOTZiHMx g/X1io7Jjge55ZkFLt58TKpkdjQT/Z3YQLM0iIwcJiIPYAdKl8W7V+Z+9r26TzqgDkiL LANsbghELfkobaVYoamqIv5Jg/cvhpX5hFZQyvpC/UhmiNZrLqefPIXWQWFt+Mh7yt33 b2FrNH8aYjJN6DwSPZyXYnbRvltyKrclSFHhVnSEFTJbqxryv/MFUS1AN4YGf8zfWyb5 FxeesI0mm4F1tKhN5r5jgGemMQOW+ZAVYyzJmyxTlrFxFEkWnSMnNj9l5Lu5fGjvh4V8 MAkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=rzedn+iwMDbiTrrkznjtnuBE8akfCB4zt6+4Hpd+6QE=; b=b/cRXCYbQ5L/0330HvUs7/+siiOBn2Mh9AeAm4H/6FtP8iFcLlZ70WOCKsgC7yL1aH 2FR2ecmvDFbAV/gmKGxhL/COnKZ73zlSZuRJNaU7sEQzPpzBD+YKWOvIiIMSRstYtui4 qT1rOLKPkAw356I5i6si7QsSKLyAPKlubtSyefug9sbhnBiLY6zjbzRy2egOoXR4uAab WF3Cy5NxNX2h3TZmj4DD9mTH7mePR62vc2sTjYioosZGi7QjntSKC+eqyxlju0dodvAY 75Ly8GehLWjqiYHz7MIqXvDuwB1xfAcr2GC0hY+sNgHlFpGFfjHOMpEE8sT15Fevygyy 2cnA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@plvision.eu header.s=selector2 header.b=kWdeG7BV; arc=pass (i=1 spf=pass spfdomain=plvision.eu dkim=pass dkdomain=plvision.eu dmarc=pass fromdomain=plvision.eu); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=plvision.eu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si3165545edx.267.2021.01.22.00.34.20; Fri, 22 Jan 2021 00:34:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@plvision.eu header.s=selector2 header.b=kWdeG7BV; arc=pass (i=1 spf=pass spfdomain=plvision.eu dkim=pass dkdomain=plvision.eu dmarc=pass fromdomain=plvision.eu); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=plvision.eu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726445AbhAVIbj (ORCPT + 99 others); Fri, 22 Jan 2021 03:31:39 -0500 Received: from mail-eopbgr140134.outbound.protection.outlook.com ([40.107.14.134]:64414 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726167AbhAVIbC (ORCPT ); Fri, 22 Jan 2021 03:31:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NkWlY4CGXzYNk2Lyp6wPGYk2P0Pdw1Z8U+MngNz4OiWGzONl4y5EI/4jj+/4CXobdn6oafHayKZ9H0OgPvMbGSJxny2HYo5oIQQr1LFkRCCWyLjUbRqfPZVB64JTe7dQUd5pMq9SgJm55aseFM8TG5sQyKyOEjiWGg/nqLkHyn8WIEcTk7MLtE5VrR2OEHwaJw6SjAHwN4CEdFmn2RpoEiNjn6FxAapNDYY9o3eds9l/0WE/S6sRleyCDMD4C2thvymtNe/9MEZpCPQxsWAuVG7+McAwxdGv2SHYFPHk0JdKemvbTOFokxzTx6SpXWhbiCG5FRkFs971SVFhzloadg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rzedn+iwMDbiTrrkznjtnuBE8akfCB4zt6+4Hpd+6QE=; b=jD5SGDoN0JiYuq7RAa73/Pez01QWecsgkuKmKPZdaC8jEHMI/+qKJd75VtVgZ4NoHuiCC4QQXvxp/FbkuQEARsQbACy/U2UNbJS1FIV3PTX2MW4NvX8ZHgrN3gbzXspke3kxKWtkK6Qdh+57+bUGersMRZgOrd4hGUOItZKcFjWXxj72TADS4b2o+me59g3HY+k9fkZe2ojfkF5kt/z0JDIRTICYajc9fKBSPzsrMkuG4A3iYvH2Kr20j87LGsVGPyUBXjri5cUvPFFG+7MFrRsWFwRV4B9+Tb0kqppUbaX/buUd9/CSuL+Gi3QrTkR5cv16TiQ6JGMnrqnBPiD6fg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=plvision.eu; dmarc=pass action=none header.from=plvision.eu; dkim=pass header.d=plvision.eu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plvision.eu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rzedn+iwMDbiTrrkznjtnuBE8akfCB4zt6+4Hpd+6QE=; b=kWdeG7BV5C6U/kHTzDzexivmowMhFbOsA6yPR/NLK4+GSIHxULe5uQYZaT94+WJFvrERGyTpFn8f8kOlxdTNlzVLUYd/PwggGQLL38WG/nhhc/dnHDpDEUZW0nWoCJAC01uO65VzNKJz7Q7O5j2t5eHWCdMb2hhpUru4uaAcMUo= Received: from AM0P190MB0738.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:19b::9) by AM9P190MB1282.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:26d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10; Fri, 22 Jan 2021 08:30:13 +0000 Received: from AM0P190MB0738.EURP190.PROD.OUTLOOK.COM ([fe80::3011:87e8:b505:d066]) by AM0P190MB0738.EURP190.PROD.OUTLOOK.COM ([fe80::3011:87e8:b505:d066%9]) with mapi id 15.20.3784.015; Fri, 22 Jan 2021 08:30:13 +0000 From: Oleksandr Mazur To: Ido Schimmel CC: "netdev@vger.kernel.org" , "jiri@nvidia.com" , "davem@davemloft.net" , "linux-kernel@vger.kernel.org" , "kuba@kernel.org" Subject: Re: [PATCH net-next] net: core: devlink: add new trap action HARD_DROP Thread-Topic: [PATCH net-next] net: core: devlink: add new trap action HARD_DROP Thread-Index: AQHW7+i5SANyTFamkUKbFKKw5ahdBKoyAC0AgAFQP3o= Date: Fri, 22 Jan 2021 08:30:13 +0000 Message-ID: References: <20210121112937.30989-1-oleksandr.mazur@plvision.eu>,<20210121122152.GA2647590@shredder.lan> In-Reply-To: <20210121122152.GA2647590@shredder.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: idosch.org; dkim=none (message not signed) header.d=none;idosch.org; dmarc=none action=none header.from=plvision.eu; x-originating-ip: [185.219.76.174] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 225e31f9-962c-4c66-8177-08d8beaff097 x-ms-traffictypediagnostic: AM9P190MB1282: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tXaXbrSxDDHPsnHmHgr5sRt1duGLjPQmVs49j0D8bFMaWAyBPB4KsE8RhppH+GBAF7QG7xinrAr3ZA4mmLgSt6sOSxVLykxGXuqAOvizw7ou2d075BO/3HGMJxMn6AGS0PflDl4pTanQIqJi3dLOUt0rMxEuwM8yQuelxkTY1g/Ik01AzoWH5YRkqkjVKKjTtyFgspWzt6w4bUefoRK8idC8zuo37u41oj2Unq9rfZ75hsu9PeDeEaKDfBPg4KjKe2t67i98DHw9mBXsF1uThardK94l/D5DZj2GF7v+kRocx6075V+EiAUsAjbn154KmJ1k2GTNDNSkz436I3SNnqLNVT+3vFHuGT5EQGtEqWHHs9fxC3Ngs2UvW2nvljp6w2ybbey5vrdHeXa4fv4P3g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0P190MB0738.EURP190.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(376002)(136003)(346002)(396003)(39830400003)(366004)(44832011)(86362001)(9686003)(6916009)(76116006)(6506007)(66946007)(33656002)(52536014)(2906002)(66556008)(55016002)(478600001)(91956017)(4326008)(8936002)(186003)(8676002)(66476007)(83380400001)(64756008)(26005)(53546011)(7696005)(5660300002)(66446008)(71200400001)(316002)(54906003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?Windows-1252?Q?ExT4+pXBjKoKSIiCj4cphorJIRaPcpWomytMysSNCbCuQr1FmBoIlUg+?= =?Windows-1252?Q?zKdT/kZydMrPyjNsf0V/k/7sjc53tYRYuVaSvjMQmSVBWfwGmXK0Prs7?= =?Windows-1252?Q?KFKJpZldZfrb+mTmZnpUuS4hebAZ+q/F5ejRkUEdhmte8faHtyhkwKJO?= =?Windows-1252?Q?8DeenLGvDd5s4ad+P+b2Tr+WwzSDfd9M7DxJnNxkHb95ahaH8DPtm40I?= =?Windows-1252?Q?zyQ/COV+l8W4nJcB2dcBTmRGBCuGH/+QxAp16d/7cqDowlXBywvmO7a3?= =?Windows-1252?Q?Feq5fsZJYEeUnvDlFPXUboM5xZvLHr5vs6ouMnW+BStvYLzcc3PpKjqE?= =?Windows-1252?Q?tjUIqXvUqbpCyRhcx4JVV3/04vmKMhLBEKdypBV1dMpjP5QF/ymQLNqv?= =?Windows-1252?Q?cq/yyO9nMAOjY5VoSUORX0uVTOah0He/bWbyALXH7jDKYj5FzMeq1WXj?= =?Windows-1252?Q?s/P2EG7ILYJYpyR2K1n6/f+Z7Mzk/wiLzakhBRw2DfQDvw/QitaL4EPh?= =?Windows-1252?Q?BdkkelIuwPBnqUcMkaSqdkGI3pWRqIOSuZzzNC/MHY0SNzmiiwj7puGG?= =?Windows-1252?Q?QWrc9yEkx0tUYEmD33TL0oMZ7ynwkxd9cFRMZksc8SCQgVVvjQKTCBdc?= =?Windows-1252?Q?e2OqqjQERkrYmwRyw6c+l+zX/y4Kaw4pDPQgpP8IZRg7Db+PYRZYYBr0?= =?Windows-1252?Q?xuRBP/JQQmZqv/Kt7m06W29rAtrpRrFHb5TsMhCwbcdBBkAAzTEIi61j?= =?Windows-1252?Q?zADb3Oh3ZT3GmEqQVnE8Fr4rB/KRpukjK4CXcB5C5KKjhKIiSBuLHloI?= =?Windows-1252?Q?u+Ys6g2BUhG3IausrQeJWyT5KwI2t+GxPg8aA/i2OzwdEMLjTqVebPwy?= =?Windows-1252?Q?UE733o1nMJ8XuyFSmu+hYWt2G4DcBZtTrD2iHM/IV2nnyHmp0Ywxvtmo?= =?Windows-1252?Q?HBMszdVPGU9qwmLOMDsyEJ0EFPtFg9EtgefYeJD4aQpkWRiOWqmHvb+G?= =?Windows-1252?Q?ORZIGbB705c2JQzFkzmdhFLUPQvYoZLklTkjkcAGjM/THbQypvlFlh0Y?= =?Windows-1252?Q?ZHxA16L0KWIANJvxTj+otmjYlH8PH0z8x0iyKMDSxB5XkwynyResCC2v?= =?Windows-1252?Q?PsQ=3D?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: plvision.eu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0P190MB0738.EURP190.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 225e31f9-962c-4c66-8177-08d8beaff097 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jan 2021 08:30:13.7492 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 03707b74-30f3-46b6-a0e0-ff0a7438c9c4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xsSigI7vBWfrSdw89A6cUVBqVcflMfqLdUovCG/oVide+1Pp6LP0Ak4ezUJ6dtFz+To1vhCeGMU8VLucGSsrXDoXMbVqJ2nijFX52Y7aupQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P190MB1282 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ido Schimmel =0A= Sent: Thursday, January 21, 2021 2:21 PM=0A= To: Oleksandr Mazur =0A= Cc: netdev@vger.kernel.org ; jiri@nvidia.com ; davem@davemloft.net ; linux-kernel@vger.k= ernel.org ; kuba@kernel.org = =0A= Subject: Re: [PATCH net-next] net: core: devlink: add new trap action HARD_= DROP =0A= =A0=0A= On Thu, Jan 21, 2021 at 01:29:37PM +0200, Oleksandr Mazur wrote:=0A= >> Add new trap action HARD_DROP, which can be used by the=0A= >> drivers to register traps, where it's impossible to get=0A= >> packet reported to the devlink subsystem by the device=0A= >> driver, because it's impossible to retrieve dropped packet=0A= >> from the device itself.=0A= >> In order to use this action, driver must also register=0A= >> additional devlink operation - callback that is used=0A= >> to retrieve number of packets that have been dropped by=0A= >> the device.=0A= =0A= >Are these global statistics about number of packets the hardware dropped= =0A= > for a specific reason or are these per-port statistics?=0A= =0A= Global statistics. Basically, it=92s the DROP action, with the only differe= nce that device might be unable to post the packet to the devlink subsystem= .=0A= Also, as this is an action, it could also be altered: e.g. changed to =91mi= rror=92 or else.=0A= =0A= > Anyway, this patch really needs to be marked as "RFC" since we cannot=0A= > add infrastructure without anyone using it.=0A= =0A= Will do.=0A= Also, should I make a V2 patch, that will already hold the RFC tag and the = changes (which include the commentaries fixes)?=0A= =0A= > Additionally, the documentation=0A= > (Documentation/networking/devlink/devlink-trap.rst) needs to be updated,= =0A= > netdevsim needs to be patched and the test over netdevsim=0A= > (tools/testing/selftests/drivers/net/netdevsim/devlink_trap.sh) needs to= =0A= > be extended to cover the new functionality.=0A= =0A= Okay. Will do.=0A= =0A= >> @@ -9876,6 +9915,9 @@ void devlink_trap_report(struct devlink *devlink, = struct sk_buff *skb,=0A= >> {=0A= >> struct devlink_trap_item *trap_item =3D trap_ctx;=0A= >> =0A= >> + if (trap_item->action =3D=3D DEVLINK_TRAP_ACTION_HARD_DROP)=0A= >> + return;=0A= =0A= >How can this happen?=0A= =0A= My bad. Will get removed in V2.=