From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754859AbeDTNAf (ORCPT ); Fri, 20 Apr 2018 09:00:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:48404 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754591AbeDTNAe (ORCPT ); Fri, 20 Apr 2018 09:00:34 -0400 Subject: Re: [PATCH 2/3] xen netback: add fault injection facility To: staskins@amazon.com Cc: jakub.kicinski@netronome.com, hpa@zytor.com, mcroce@redhat.com, tglx@linutronix.de, ggarcia@abra.uab.cat, daniel@iogearbox.net, x86@kernel.org, mingo@redhat.com, xen-devel@lists.xenproject.org, axboe@kernel.dk, konrad.wilk@oracle.com, amir.jer.levy@intel.com, paul.durrant@citrix.com, stefanha@redhat.com, dsa@cumulusnetworks.com, boris.ostrovsky@oracle.com, linux-block@vger.kernel.org, wei.liu2@citrix.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, dwmw@amazon.co.uk, roger.pau@citrix.com References: <20180420104603.17823.31095.stgit@dev-dsk-staskins-1a-ca5afbf2.eu-west-1.amazon.com> <20180420104731.17823.97617.stgit@dev-dsk-staskins-1a-ca5afbf2.eu-west-1.amazon.com> <909fd3b2-19e8-8c13-6ede-cfd6051c6f1d@amazon.com> From: Juergen Gross Message-ID: <5c4e4f3d-03ce-b517-d451-3229c0d542c0@suse.com> Date: Fri, 20 Apr 2018 15:00:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <909fd3b2-19e8-8c13-6ede-cfd6051c6f1d@amazon.com> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/04/18 14:52, staskins@amazon.com wrote: > On 04/20/18 13:25, Juergen Gross wrote: >> On 20/04/18 12:47, Stanislav Kinsburskii wrote: >>> +    for (fi = 0; fi < XENVIF_FI_MAX; fi++) { >>> +        vfi->faults[fi] = xen_fi_dir_add(vfi->dir, >>> +                xenvif_fi_names[fi]); >> How does this work? xenvif_fi_names[] is an empty array and this is the >> only reference to it. Who is allocating the memory for that array? > > Well, it works in the way one adds a var to enum (which is used as a key > later) and a corresponding string into the array (which is used as a > name for the fault directory in sysfs). Then you should size the array via XENVIF_FI_MAX. Juergen