Received: by 10.213.65.68 with SMTP id h4csp3197981imn; Tue, 3 Apr 2018 00:05:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/2oekvXb/akid+hEnU+1cwGdrtd5LHVuOVKG03c8vDKnEmtWPofo47tMYmAQzAqW3bKp56 X-Received: by 2002:a17:902:8304:: with SMTP id bd4-v6mr12968065plb.70.1522739144173; Tue, 03 Apr 2018 00:05:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522739144; cv=none; d=google.com; s=arc-20160816; b=rm4rRdqawJ6lc3+Pf2wipA6yOFdMtNAKWfAkIvVIo39hlB9t9o8XlZ3GrPj/WQZj90 0qew8BDUr8Ot9tq3sxev2mrxhDW+EU7Yz5Ub+HPlt4FCd1NXu+b7I3hNmVLU5sLXoQsv /B3lJwVb6+vrf0U+pItsyKVyxatxApvb2ZO7zmTAtvNWGI//5IOulnavXDaKFW1gHdt0 uIQgcn6TtWFSZwli4+dHnymTcY4nkVD02y8IfPg/m10Godb5JEvBeMtaTLJXMoxVYGok OC7lHU7dZvD5idgDP71jcgRRG5uk/ydaAX7L3GjNcdEuGz7VIJTvzyIBpXtf9eceY1Ye QfwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=dN4NswZ/t+qpMR2yRGK6S/hFWS77x0bK+tYSmKHpskg=; b=v3jhPNeb6gMacIzMC8kXW6mHda53CeG3BVcgKkHeUW4eVWijEpjRZNhNGvIscsj6v1 U5RdKbSZ+Km8G7GHDe8J+WhOAuV6JuHPlBijk8lujoy5n6qRFwXz/PQPBZ4l29bX0cem YtG1d5v7IWiVnEj7LbZV65Mh1AByPn/je8wkzN8rE0htdQbo8A3T3mdcwWiJ/g3FmImv uoAnurHE0hqSBZK69QNH8lKrgEzmQKlAog747rL8/hwGlmvSnUub/k9uEi2rrmcBFr+f eXw3u3kLtKCmJ7vz10OyWqvQ5Fx3CuPmw5jSxO85xuNTHgJLu8r//Vd12rMMIKMRxvh+ WZfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=oyFX1q2d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f78si1666642pfa.79.2018.04.03.00.05.28; Tue, 03 Apr 2018 00:05:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=oyFX1q2d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753250AbeDCHER (ORCPT + 99 others); Tue, 3 Apr 2018 03:04:17 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:40558 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752173AbeDCHEP (ORCPT ); Tue, 3 Apr 2018 03:04:15 -0400 Received: by mail-wm0-f43.google.com with SMTP id x4so32417548wmh.5 for ; Tue, 03 Apr 2018 00:04:14 -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:content-transfer-encoding:in-reply-to :user-agent; bh=dN4NswZ/t+qpMR2yRGK6S/hFWS77x0bK+tYSmKHpskg=; b=oyFX1q2dPjFFuidhIUbRSwKAFCl/OkkoDa/rtxJhS/K5K6eMABxC1xelO+DEl0MdCp 3X+XUBWZeRmaTPKUxYD7GG0yJEWYLyakGmDnn8P1JO4dOqejD6gWdCxWlNiQ6vpqFTFM S0hHz9HUpDEmavpbj9ogr5J9+MIaoa+aJNhRGLM1te+k5YNEUEJTlRMFK0vQBlRAZMM1 RuK335pMiPIpxVVHIY6v9KatiJbWfevNHi2jZ7wXKM6UObPLxaVV64w6nhO+Z/UISczL atdm0DSGkQfMwxWTYxjlVAM8Qo6sgAPuSeXbln/PYtsYeKuAFdaBjH10kWq8K46n0ZU+ RbZw== 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:content-transfer-encoding :in-reply-to:user-agent; bh=dN4NswZ/t+qpMR2yRGK6S/hFWS77x0bK+tYSmKHpskg=; b=exJM+QY288ozSYqwfIWRKqdGBcLY2d96DcYqN1RHzPBciJE7ohcDHnMqfS4o3UuI2S syYPv9TyIMeYMfiS/lecnFfHjgxLfTpTHBAUl9FHlhdbaPdvgN4rNv4Npjp2b3PCcDXD z1j4R3RRsnakYNVzyNv0EeWdnxz500bvizNw0rnFJx84ALObo5H4PgBejyFnaN1V0y+N yTB7rEo8vide1xygkkkhJ461Kb40jq/MqMslzfWOKx8tDQ9IXATQ7+udAzWg6ixhCe50 A6tDQMgSB3XJkDrJ7OtQbhGeOsN6wveh8l/bMWP/HaQUUVtEv9BHQ34EiPDDJ2kR/IaJ O06g== X-Gm-Message-State: AElRT7HysnjNDc2yeDEjaybB7L/mtY03pm0Fk1YwkpdERiBjvnnS3OEK na+bwbCQQxY3c0F2mlvXpdNNIg== X-Received: by 10.28.109.146 with SMTP id b18mr2933616wmi.95.1522739053689; Tue, 03 Apr 2018 00:04:13 -0700 (PDT) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id m71sm1972464wmd.6.2018.04.03.00.04.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Apr 2018 00:04:12 -0700 (PDT) Date: Tue, 3 Apr 2018 09:04:12 +0200 From: Jiri Pirko To: Rahul Lakkireddy Cc: "Eric W. Biederman" , "netdev@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "davem@davemloft.net" , "viro@zeniv.linux.org.uk" , "stephen@networkplumber.org" , "akpm@linux-foundation.org" , "torvalds@linux-foundation.org" , Ganesh GR , Nirranjan Kirubaharan , Indranil Choudhury Subject: Re: [PATCH net-next v2 1/2] fs/crashdd: add API to collect hardware dump in second kernel Message-ID: <20180403070412.GH3313@nanopsycho> References: <296ffbd47fd4f30238689e636bd2480683224227.1521888444.git.rahul.lakkireddy@chelsio.com> <20180330103907.GC3313@nanopsycho> <20180330105156.GA24344@chelsio.com> <87k1tt2yo7.fsf@xmission.com> <20180402091143.GD3313@nanopsycho> <20180402123044.GA31231@chelsio.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180402123044.GA31231@chelsio.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mon, Apr 02, 2018 at 02:30:45PM CEST, rahul.lakkireddy@chelsio.com wrote: >On Monday, April 04/02/18, 2018 at 14:41:43 +0530, Jiri Pirko wrote: >> Fri, Mar 30, 2018 at 08:42:00PM CEST, ebiederm@xmission.com wrote: >> >Rahul Lakkireddy writes: >> > >> >> On Friday, March 03/30/18, 2018 at 16:09:07 +0530, Jiri Pirko wrote: >> >>> Sat, Mar 24, 2018 at 11:56:33AM CET, rahul.lakkireddy@chelsio.com wrote: >> >>> >Add a new module crashdd that exports the /sys/kernel/crashdd/ >> >>> >directory in second kernel, containing collected hardware/firmware >> >>> >dumps. >> >>> > >> >>> >The sequence of actions done by device drivers to append their device >> >>> >specific hardware/firmware logs to /sys/kernel/crashdd/ directory are >> >>> >as follows: >> >>> > >> >>> >1. During probe (before hardware is initialized), device drivers >> >>> >register to the crashdd module (via crashdd_add_dump()), with >> >>> >callback function, along with buffer size and log name needed for >> >>> >firmware/hardware log collection. >> >>> > >> >>> >2. Crashdd creates a driver's directory under >> >>> >/sys/kernel/crashdd/. Then, it allocates the buffer with >> >>> >> >>> This smells. I need to identify the exact ASIC instance that produced >> >>> the dump. To identify by driver name does not help me if I have multiple >> >>> instances of the same driver. This looks wrong to me. This looks like >> >>> a job for devlink where you have 1 devlink instance per 1 ASIC instance. >> >>> >> >>> Please see: >> >>> http://patchwork.ozlabs.org/project/netdev/list/?series=36524 >> >>> >> >>> I bevieve that the solution in the patchset could be used for >> >>> your usecase too. >> >>> >> >>> >> >> >> >> The sysfs approach proposed here had been dropped in favour exporting >> >> the dumps as ELF notes in /proc/vmcore. >> >> >> >> Will be posting the new patches soon. >> > >> >The concern was actually how you identify which device that came from. >> >Where you read the identifier changes but sysfs or /proc/vmcore the >> >change remains valid. >> >> Yeah. I still don't see how you link the dump and the device. > >In our case, the dump and the device are being identified by the >driver’s name followed by its corresponding pci bus id. I’ve posted an >example in my v3 series: > >https://www.spinics.net/lists/netdev/msg493781.html > >Here’s an extract from the link above: > ># readelf -n /proc/vmcore > >Displaying notes found at file offset 0x00001000 with length 0x04003288: >Owner Data size Description >VMCOREDD_cxgb4_0000:02:00.4 0x02000fd8 Unknown note type:(0x00000700) >VMCOREDD_cxgb4_0000:04:00.4 0x02000fd8 Unknown note type:(0x00000700) >CORE 0x00000150 NT_PRSTATUS (prstatus structure) >CORE 0x00000150 NT_PRSTATUS (prstatus structure) >CORE 0x00000150 NT_PRSTATUS (prstatus structure) >CORE 0x00000150 NT_PRSTATUS (prstatus structure) >CORE 0x00000150 NT_PRSTATUS (prstatus structure) >CORE 0x00000150 NT_PRSTATUS (prstatus structure) >CORE 0x00000150 NT_PRSTATUS (prstatus structure) >CORE 0x00000150 NT_PRSTATUS (prstatus structure) >VMCOREINFO 0x0000074f Unknown note type: (0x00000000) > >Here, for my two devices, the dump’s names are >VMCOREDD_cxgb4_0000:02:00.4 and VMCOREDD_cxgb4_0000:04:00.4. > >It’s really up to the callers to write their own unique name for the >dump. The name is appended to “VMCOREDD_” string. > >> Rahul, did you look at the patchset I pointed out? > >For devlink, I think the dump name would be identified by >bus_type/device_name; i.e. “pci/0000:02:00.4” for my example. >Is my understanding correct? Yes. > >Thanks, >Rahul