From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next 0/9] devlink: Add support for region access Date: Fri, 30 Mar 2018 12:21:00 +0200 Message-ID: <20180330102100.GA3313@nanopsycho> References: <1522339672-18273-1-git-send-email-valex@mellanox.com> <20180329171359.GA12150@lunn.ch> <962b56c1-d471-97ec-e8e9-18252e809dfe@mellanox.com> <20180329195154.GB15565@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alex Vesker , "David S. Miller" , netdev@vger.kernel.org, Tariq Toukan , Jiri Pirko To: Andrew Lunn Return-path: Received: from mail-wr0-f194.google.com ([209.85.128.194]:38835 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750802AbeC3KVC (ORCPT ); Fri, 30 Mar 2018 06:21:02 -0400 Received: by mail-wr0-f194.google.com with SMTP id m13so7681264wrj.5 for ; Fri, 30 Mar 2018 03:21:01 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180329195154.GB15565@lunn.ch> Sender: netdev-owner@vger.kernel.org List-ID: Thu, Mar 29, 2018 at 09:51:54PM CEST, andrew@lunn.ch wrote: >> >>Show all of the exposed regions with region sizes: >> >>$ devlink region show >> >>pci/0000:00:05.0/cr-space: size 1048576 snapshot [1 2] >> >So you have 2Mbytes of snapshot data. Is this held in the device, or >> >kernel memory? >> This is allocated in devlink, the maximum number of snapshots is set by the >> driver. > >And it seems to want contiguous pages. How well does that work after >the system has been running for a while and memory is fragmented? > >> >>Dump a snapshot: >> >>$ devlink region dump pci/0000:00:05.0/fw-health snapshot 1 >> >>0000000000000000 0014 95dc 0014 9514 0035 1670 0034 db30 >> >>0000000000000010 0000 0000 ffff ff04 0029 8c00 0028 8cc8 >> >>0000000000000020 0016 0bb8 0016 1720 0000 0000 c00f 3ffc >> >>0000000000000030 bada cce5 bada cce5 bada cce5 bada cce5 >> >> >> >>Read a specific part of a snapshot: >> >>$ devlink region read pci/0000:00:05.0/fw-health snapshot 1 address 0 >> >> length 16 >> >>0000000000000000 0014 95dc 0014 9514 0035 1670 0034 db30 >> >Why a separate command? It seems to be just a subset of dump. >> >> This is useful when debugging values on specific addresses, this also >> brings the API one step closer for a read and write API. > >The functionality is useful, yes. But why two commands? Why not one >command, dump, which takes optional parameters? Between userspace and kernel, this is implemented as a single command. So this is just a userspace wrapper. I think it is nice to provide clear commands to the user so he is not confused about what is he doing. Also, as Alex mentioned, we plan to have write command which will have same command like args as read. These 2 should be in sync. > >Also, i doubt write support will be accepted. That sounds like the >start of an API to allow a user space driver. We discussed that on netconf in Seoul and was agreed it is needed. We have 2 options: Some out of tree crap utils and access via /dev/mem, or something which is well defined and implemented by in-tree drivers. Writes will serve for debugging purposes, even tuning and bug hunting on in production. For that, we need a standard way to do it.