Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4062685pxk; Tue, 8 Sep 2020 09:43:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGstYO+2djNiCGyP0fVg1iJq/xNIbP3nBpRw4jlKn22Wq5ryAhvY1Ez393+OYBCBkH5M9V X-Received: by 2002:a17:906:f9d3:: with SMTP id lj19mr26232886ejb.346.1599583388608; Tue, 08 Sep 2020 09:43:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599583388; cv=none; d=google.com; s=arc-20160816; b=fGuiUGHe+75KSwxVHOorz8vUC2W/2WagPoWa56Z/cPiq+jUkVjSRm0vUuzwZ1lf+5D dqVR/HkKU/xTdmE7P7VJhi5MedfUW0GvZyNlK2cYLacYCmu4xj+lfhr6yWalDg1w5TJa 7PjaHctH+UqMwfmGzqeWVCNTgB8sWl75luoEiuGIuWJ8REmMJfC1CODEiJU3e62/xmT8 XY6IEqA/WiMyI38A2ES4rVC8O+9XqAN4C/pMbhumVc/XeKhDsKYSCsv8VRIldfo2Ia27 DXP0m5CNbteqeFcuEuvzmvgQCMvdQ1KOgykTBNy47lwgyV5KIAtf0fQwpRUJJG+V7gBR KTug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=pFSueD/PsgBNg5dRi4zohukePJNmnDKu8o6l7DjyJKo=; b=OvdPEiYNImtbZ+/tDTfAxze/v45KVixfdlESHtwcw6JdfQ6X9XKkVPZELn3ZBoKohE WziaSnakqn+6wzYfONsc1gvP1PGoI49wCcLw5zEDCSMk8SMrkrMEP5Vmqn4pWMX4t8uX X8UdPcKHkYYtkRvCham3hOk1jnc1mya+UJno+gkKrE1eADY+KUOfdfvJf/59ynAwEPXD 3kTqmcbF4EWbq70mUGezYn6yFsk5NOUztw8bUgfvFUcTlYNkpo7SKIkfYkCYwOWBlvFQ DjgX+hJ60UQi593trsCOLLpOa7SGgWaRwYXORcBoFgP2ii6KJ4j9xHJj8M/UisuYWPGI FMxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=NDNqSTa7; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx16si12084104edb.575.2020.09.08.09.42.46; Tue, 08 Sep 2020 09:43:08 -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=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=NDNqSTa7; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732047AbgIHQlX (ORCPT + 99 others); Tue, 8 Sep 2020 12:41:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732042AbgIHQhP (ORCPT ); Tue, 8 Sep 2020 12:37:15 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02372C061A0E for ; Tue, 8 Sep 2020 07:04:14 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id t16so11314375edw.7 for ; Tue, 08 Sep 2020 07:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pFSueD/PsgBNg5dRi4zohukePJNmnDKu8o6l7DjyJKo=; b=NDNqSTa7fZTWmXjbEiT8n88ebqol0L6AQtiZu/8Oqe+mwkyHcxNQJF45p8QJ0vEHmj 7vURBe4Ohu2fjAEu7i/ry1GBIIfFl5TaPBxPz79QVbYcSu/nefGedb+ubeX8CBrtqttl vRGrgNRtPpVQZ+TMKn4V+lOBfVl8T3XmT0sIYxxoJEu8HiVHdWijgtU1BxjViT0f9tcH voD1jgHdPNU8GQLdGstctvcCBJ8Zt6MVhQfE/PW9Z+rDarmVbuJR0lGYHgfbnujN7om3 y37QDLUOfw5y6g0/x4GMg5xEeVirg0uNqjcdA2LuSj5fJgji6JndSYaglSRH3naDUxq7 R8/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pFSueD/PsgBNg5dRi4zohukePJNmnDKu8o6l7DjyJKo=; b=JJCgCG5XR+x2Qasdzm1tAvGGvP7apT4KclppTUL/85VuzBZWRdAJhLTHaQzIsqdeKj UXpxVptG+54YU5ijLuuK5LpI7HeNyfpaBFIOt+GCbtF8J7ZQvLywcQpUmoP/7VyU8Dfz tlA1vvh7vKA9A6DJuPoCDM6wV1Y0CjpJsLK4w/XFtSEGWZDM2kiH90uIk/VLB8BaMGRb XPJQ4QrRD6lRbqL1ZbTFDB5KRux9DqkRv5Irpxa25flMR6YYCn0mwbM5LNRN8ZHENyMS BXA26wFdLEGb++S7Ff97NgKmqGo8picCjnJD8A03tqVpOC9QiiPQni8YrFEuZTtxTm3q yg9g== X-Gm-Message-State: AOAM533siiGgx2fn95nv/AHbvv7gvv3eKdVLayfdIvpEnJzmOfvO6wz6 6uOYOSQMeMaP8UHWIZIFr0HgrQ== X-Received: by 2002:a50:8e17:: with SMTP id 23mr26671696edw.42.1599573851439; Tue, 08 Sep 2020 07:04:11 -0700 (PDT) Received: from localhost ([86.61.181.4]) by smtp.gmail.com with ESMTPSA id v4sm17839598eje.39.2020.09.08.07.04.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 07:04:10 -0700 (PDT) Date: Tue, 8 Sep 2020 16:04:09 +0200 From: Jiri Pirko To: Ido Schimmel Cc: Aya Levin , "David S. Miller" , Jakub Kicinski , Jiri Pirko , netdev@vger.kernel.org, Moshe Shemesh , Eran Ben Elisha , Ido Schimmel , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next RFC v1 2/4] devlink: Add devlink traps under devlink_ports context Message-ID: <20200908140409.GN2997@nanopsycho.orion> References: <1599060734-26617-1-git-send-email-ayal@mellanox.com> <1599060734-26617-3-git-send-email-ayal@mellanox.com> <20200906154428.GA2431016@shredder> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200906154428.GA2431016@shredder> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. [...]