Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp848433pxk; Wed, 9 Sep 2020 23:18:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQ+OBePy76ObcnzmVpj/vRBLYKQzn0GxrRBD9/eGL+1DCwEcYbw2IgGhzUgVAGPL7pLiGb X-Received: by 2002:a17:907:648:: with SMTP id wq8mr7534046ejb.291.1599718725229; Wed, 09 Sep 2020 23:18:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599718725; cv=none; d=google.com; s=arc-20160816; b=LWqyYpf6Bx3q3FIuTJt7Dg3CZnN5AGu5OI2EfIUlGhyxVSzD+/Cj0Z6iuYlcQchonu Bv5nu6AmqJcjwhEKCIPCBEdpWAVDP3aACZRnvOurhRvaL2CDnS3gy2aST6atJwjNXutq Ol1ob5+kpLcJTpiItG438RXK6Vl6UgsGWITMfh4GCzoUeXcfT+hlDOS+euZk5BFksODW eV6WZdGWpBkGG9jZsc7d4sIIj1oVrmt2y/PEdD/z7xwW61H+f1ugZ+I6ZM72M+EzoN8e 7OJibJnT3JR2d0KD2TnU5osZGjckWLRq5AkGxgvxxcwgJoJcAM4M1SGzN4AtIWmw0N55 Tdzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=YxbgwqDeiWqJCCQqAzriGr+eKT1ynNKp9QHvOJFUUps=; b=hKTs4kHQuPmd2ZgXUzJWsySBNkZRZPz0JaunXZMhwqTB0cPx4bK4jrtZDeF/oZ6VWB tkYdBYIE23zqhMk8bd1ygC+mV27XVzhB7XOl3jIJocuiz5hQ8tSpK89NDLi6kR4+nnWm YUzcQIpf90YElh942schilDUS+cf/ezAvQFM4q6YYr+HsIzF3BAfK3nJeN7TRop0dBFh 031jZbjgNNeYG5J2w7Lk8k3WvOqgOQgRXQQ3kQvevuXJGwDVyp1c/YeguwG/CyDOdWvW Mj9eRSGF+lEC6CLpT23bnC9PdzP+uKiUdz75/cnsjU0JH+FR21miMjVC1E9b2PzhlPGp DaXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=cHgbb3Lp; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si2887292ejk.665.2020.09.09.23.18.22; Wed, 09 Sep 2020 23:18:45 -0700 (PDT) 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=@nvidia.com header.s=n1 header.b=cHgbb3Lp; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726494AbgIJGRG (ORCPT + 99 others); Thu, 10 Sep 2020 02:17:06 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:8640 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725971AbgIJGRE (ORCPT ); Thu, 10 Sep 2020 02:17:04 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 09 Sep 2020 23:16:20 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Wed, 09 Sep 2020 23:17:04 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Wed, 09 Sep 2020 23:17:04 -0700 Received: from [172.27.13.224] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 10 Sep 2020 06:16:49 +0000 Subject: Re: [PATCH net-next RFC v1 2/4] devlink: Add devlink traps under devlink_ports context To: Jiri Pirko , Ido Schimmel CC: Aya Levin , "David S. Miller" , Jakub Kicinski , Jiri Pirko , , Moshe Shemesh , Eran Ben Elisha , Ido Schimmel , References: <1599060734-26617-1-git-send-email-ayal@mellanox.com> <1599060734-26617-3-git-send-email-ayal@mellanox.com> <20200906154428.GA2431016@shredder> <20200908140409.GN2997@nanopsycho.orion> From: Aya Levin Message-ID: <6aeba5b9-201f-2abc-05fb-0efdd6394b65@nvidia.com> Date: Thu, 10 Sep 2020 09:16:41 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200908140409.GN2997@nanopsycho.orion> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1599718580; bh=YxbgwqDeiWqJCCQqAzriGr+eKT1ynNKp9QHvOJFUUps=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=cHgbb3LpBxfAtWg6QGLgvHvTpTbu6kf4CDNqo1s9OqQ/7bT5cHFRH1us26xGx4Q9i tdh1Ai1OG0LsiJywouRtnFkKnDA8ShusF1fGWlLoOLNkOA+X6R7rzyJN5h15GBNugq iSWet/F5SkSN3R9hAGthHNEXdgyloV/6AbU13nD+kTS3KEAK2hdjS1w0Gkoy//ljXY 3rLYbWhcBwOVn3uYZ0D6A1Tzoe7JGElRilEJvzljDLxjHxjHDm9IPUeiR6lZxUl1jW YFp7QMsW7xAHOC0LdCFIG18TAmPx4t5HAfEQDS/NCxz58F5F3/YzoSbPWWyjyC9llo 6YiddSEs/hYDA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/8/2020 5:04 PM, Jiri Pirko wrote: > Sun, Sep 06, 2020 at 05:44:28PM CEST, idosch@idosch.org wrote: >> On Wed, Sep 02, 2020 at 06:32:12PM +0300, Aya Levin wrote: > > [...] > >> >> I understand how this struct allows you to re-use a lot of code between >> per-device and per-port traps, but it's mainly enabled by the fact that >> you use the same netlink commands for both per-device and per-port >> traps. Is this OK? >> >> I see this is already done for health reporters, but it's inconsistent >> with the devlink-param API: >> >> DEVLINK_CMD_PARAM_GET >> DEVLINK_CMD_PARAM_SET >> DEVLINK_CMD_PARAM_NEW >> DEVLINK_CMD_PARAM_DEL >> >> DEVLINK_CMD_PORT_PARAM_GET >> DEVLINK_CMD_PORT_PARAM_SET >> DEVLINK_CMD_PORT_PARAM_NEW >> DEVLINK_CMD_PORT_PARAM_DEL >> >> And also with the general device/port commands: >> >> DEVLINK_CMD_GET >> DEVLINK_CMD_SET >> DEVLINK_CMD_NEW >> DEVLINK_CMD_DEL >> >> DEVLINK_CMD_PORT_GET >> DEVLINK_CMD_PORT_SET >> DEVLINK_CMD_PORT_NEW >> DEVLINK_CMD_PORT_DEL >> >> Wouldn't it be cleaner to add new commands? >> >> DEVLINK_CMD_PORT_TRAP_GET >> DEVLINK_CMD_PORT_TRAP_SET >> DEVLINK_CMD_PORT_TRAP_NEW >> DEVLINK_CMD_PORT_TRAP_DEL >> >> I think the health API is the exception in this case and therefore might >> not be the best thing to mimic. IIUC, existing per-port health reporters >> were exposed as per-device and later moved to be exposed as per-port >> [1]: >> >> "This patchset comes to fix a design issue as some health reporters >> report on errors and run recovery on device level while the actual >> functionality is on port level. As for the current implemented devlink >> health reporters it is relevant only to Tx and Rx reporters of mlx5, >> which has only one port, so no real effect on functionality, but this >> should be fixed before more drivers will use devlink health reporters." > > Yeah, this slipped trough my fingers unfortunatelly :/ But with > introduction of per-port health reporters, we could introduce new > commands, that would be no problem. Pity :/ > > >> >> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ac4cd4781eacd1fd185c85522e869bd5d3254b96 >> >> Since we still don't have per-port traps, we can design it better from >> the start. > > I agree. Let's have a separate commands for per-port. Thanks for your input I'm preparing V2 > > > [...] >