From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 959A2A0547; Thu, 28 Oct 2021 18:38:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6657140E25; Thu, 28 Oct 2021 18:38:29 +0200 (CEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id 8B95C40DDB for ; Thu, 28 Oct 2021 18:38:28 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id i5so4830729pla.5 for ; Thu, 28 Oct 2021 09:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lAESI3p5i0iu/9+ZmBRhykYdSDEoFylNV/dUoFE9PhQ=; b=jGFOW33iJAriishOIqjMy9BILKaH626Hs3f3Ch35kduXUeAUU4nSYF4UMnKWrKR3Kq RGV0pls4fmoA/zlTV7Q9jC3gaZ5QdTOSFNRfue6OVqU7CD6B2QdFPDPinB1Oxa/dlhlc ZO5MtDchZhz2IdXWUaGYI0j65un6WGv3lRcCUvlYQ5Pm+2I/Ntkdw0Cf16AphIihq+7A hTYBak+8ZX/0KVczine6IBNHLY8I8B/HaunhP3S2y2xSbfbqQrBSH0DxOo/ZSOWk7jiE Mi+vEnTLRYodufEuL9zRoPl+RasqEOb4ufRG6OoAEo3eYeeHU5PbsjxjRiDVhgGaJXdy HeRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lAESI3p5i0iu/9+ZmBRhykYdSDEoFylNV/dUoFE9PhQ=; b=o2i2LMpKTZNQK+bQMTAUw0C4xBrEpkyBlZ8Zv4szc3vgb5GdDUw2p+opa6G7Z6KrxG uQc8PoD+T3JNAEs1IKcQ9/bTKhYneWnCpwbtZf8at63CVkWBrh2oRbjMBZbzSE2FJO35 Sn/8tsroYkd21UJ2/0lVn23xGKwTUDdCHFaKU46H/0kjhG8JZEJK/+BxU350DxY96jKw VzBy7MnCo/4PWmCLWwW0JhLjPa6iLQEpHz4Thp5JotAjEqk80/6ArjSBzuejv7cbZqji CbIdFsZ7NSRJN6wsFWETCpyRWyq7MaotVRTqtSAL91UkIKRvlLepGx8c1qJXN2TmZi4m cwxg== X-Gm-Message-State: AOAM532U5kuZtrPm5ylwZEIqaQo6/NfB5hkL3Cb0Qo6dJmOzrhNs8vht 6k9uVhQiB1yjw+hekLbedRNkPA== X-Google-Smtp-Source: ABdhPJyBtfanWfcJtMond5/rqFXDkuxWeq65jQULQ0uuLu+XYb1v8Osr5Szr2CUJx7bwpKY6Dp2jNA== X-Received: by 2002:a17:903:1248:b0:13f:cd7d:69eb with SMTP id u8-20020a170903124800b0013fcd7d69ebmr4810862plh.23.1635439107712; Thu, 28 Oct 2021 09:38:27 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id g7sm3061116pgp.17.2021.10.28.09.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 09:38:27 -0700 (PDT) Date: Thu, 28 Oct 2021 09:38:24 -0700 From: Stephen Hemminger To: "Burakov, Anatoly" Cc: Thomas Monjalon , "Xia, Chenbo" , David Marchand , "Ferruh Yigit" , "dev@dpdk.org" Message-ID: <20211028093824.39232a46@hermes.local> In-Reply-To: <3db19e94-dd25-e9ca-80ee-e4fea233f1cd@intel.com> References: <25dd76eca01ec57d64be9c0a78ac2752f602984f.1631788595.git.anatoly.burakov@intel.com> <632abf1f-e912-4732-0c4e-893eb8679024@intel.com> <9347411.UhhQB40C69@thomas> <3db19e94-dd25-e9ca-80ee-e4fea233f1cd@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v1 1/2] vfio: make API return values consistent X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 28 Oct 2021 16:40:28 +0100 "Burakov, Anatoly" wrote: > On 28-Oct-21 3:53 PM, Thomas Monjalon wrote: > > 28/10/2021 13:32, Ferruh Yigit: > >> On 10/28/2021 12:11 PM, Xia, Chenbo wrote: > >>>> -----Original Message----- > >>>> From: Burakov, Anatoly > >>>> Sent: Thursday, October 28, 2021 6:30 PM > >>>> To: Xia, Chenbo ; dev@dpdk.org > >>>> Subject: Re: [dpdk-dev] [PATCH v1 1/2] vfio: make API return values consistent > >>>> > >>>> Hi Chenbo, > >>>> > >>>>> And do we need backport? As 'return -1' does not align with the API doxygen. > >>>>> > >>>>> Thanks, > >>>>> Chenbo > >>>>> > >>>> Maybe it's the FreeBSD implementation that needs to be adjusted then, > >>>> because none of those functions are valid on FreeBSD, and the > >>>> documentation for VFIO functions explicitly mentions that on FreeBSD, > >>>> they should return an error. I went with adjusting Linux implementation > >>>> to minimize the amount of changes we have to make (and only change code > >>>> path that no one uses in the first place), but maybe that was a wrong > >>>> decision. > >>>> > >>>> I'm not sure if changing the API return value to match what was > >>>> documented counts as an API change, so maybe backport to stable is not > >>>> advised here. > >>> > >>> It's not a API change. My point is whether VFIO is present, users just use > >>> the API to check if vfio support is there. In a kernel version that does not > >>> support VFIO, he uses 'if(rte_vfio_is_enabled(XXX))' to check as the doxygen > >>> says its return value should be 1 as true or 0 as false. He will get true (-1) > >>> but VFIO is not there. That's why I think it's a bug and should be backported. > >>> > >>> But I think we can first discuss if we should drop the dummy implementation > >>> as DPDK requires Linux kernel version >= 4.4 now so VFIO is always present. > >>> I think it depends on by saying 'DPDK requires kernel version >= 4.4'. It's > >>> a real _requirement_ or only a recommendation? > >>> > >>> Ferruh, David & Thomas, What do you think? > >>> > >> > >> My understanding is, it is a requirement. DPDK does not guarantee support for > >> kernels < 4.4. > > > > Do we have a kernel version check at runtime? > > I think we should add a warning if running too old kernel. > > > > Perhaps we should (there's a `uname()` call, should be fairly > straightforward to implement), but obviously this would be outside the > scope for this patchset. > Checking kernel version at runtime with uname() is a bad idea because enterprise distro vendors support things without updating the kernel version. It is always better to try for the feature and handle errors that could be reported by older kernels. Also DPDK System Requirements says kernel >= 4.4 on Linux.