From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by dpdk.org (Postfix) with ESMTP id 3DFEB1B430 for ; Tue, 10 Jul 2018 11:44:50 +0200 (CEST) Received: by mail-ed1-f67.google.com with SMTP id b10-v6so16084008edi.2 for ; Tue, 10 Jul 2018 02:44:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=c0ZRqQgK6CMzuBKNZmWZp0GlcYG/aLewPwVFbZhEmhQ=; b=gfVy9O4chfd2HZiQm5agNsRXbRSm6ylIF5BBLL8tQ+Pd0id/D0E0CyS79rb+A7wcwO moLp7Iis8EzSo8lnFwRBytbdYR8mSzPCYDfiDslQ0SN9dTnf0/9EMFhMopewJHdlmqoT /25MuKAqgZSWEhO961OU2xh6giT5bCUX2Bh/UItqH+UoscK8ENTIIE9TEmdTvgV76K54 m+h4trsgtknhPxhEUz8bYjOJDaj1zz6tY7RrYhtiZjAxRO/7wj/Wf4FijFGMDmwmNpqH lPqKjobvQCCsM56yuHe20YSqwCGj/AK8ULUv+b9SISu7zMK71xGhREW10dsbFBpGVDYJ 8O8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=c0ZRqQgK6CMzuBKNZmWZp0GlcYG/aLewPwVFbZhEmhQ=; b=W7HcZDb//k4PJ9XOhBpeH0LThpRdXgqc3pWJMhif+YeAN/BjJ3SqrRPsBf+dCysSW5 glM1PgB7huFhftZ4HvDVFHLM+LlFG5OUlM/bfsLDXm45YE50CE3aFL5ZTQxj97D18p03 mXt8wo4IX2qEpG9xT0iVx/wxqJL7TGSRMZhXPqOveJLaIRng+HRgl9RYmoicv/LAS/Ml /gYXiXtFNb27soHkh1TPWJUEahAkEyreb1iBNLL5SF824WH/UwVa/hlrE7M6hQsJ0404 bW6lK3bBYX3WRriVCjkcskjJLVe3Ykh1qrnaPCDNNomFdfewb2TtCS0XiHmqEcjF8Wc2 mI7g== X-Gm-Message-State: APt69E2TobfIBDwZSC71TIgSy/w26JvWeu6T9BLiibOHE221lPh9McBI t5nDOKRvo56hCE73j4N1oWFEUg5XlHMLKrZEJfqm4Q== X-Google-Smtp-Source: AAOMgpctbP7pJQC2gQESCE2ZMNrKKEOM0egNvFkLTsjRS1JfsFQf2OolD/UOmoRZ/hG9SvOgQwzpfTN3e/c3z+VsiO4= X-Received: by 2002:a50:a347:: with SMTP id 65-v6mr23464618edn.299.1531215889004; Tue, 10 Jul 2018 02:44:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a50:b194:0:0:0:0:0 with HTTP; Tue, 10 Jul 2018 02:44:48 -0700 (PDT) In-Reply-To: References: <1530708838-2682-1-git-send-email-alejandro.lucero@netronome.com> <1530708838-2682-3-git-send-email-alejandro.lucero@netronome.com> <5BCBEF5B-AA29-4F18-A95B-D5C5478B0432@redhat.com> From: Alejandro Lucero Date: Tue, 10 Jul 2018 10:44:48 +0100 Message-ID: To: Eelco Chaudron Cc: dev , stable@dpdk.org, "Burakov, Anatoly" , Maxime Coquelin , Ferruh Yigit , Andrew Rybchenko Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3 2/6] ethdev: add function for checking IOVAs by a device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2018 09:44:50 -0000 On Tue, Jul 10, 2018 at 10:42 AM, Alejandro Lucero < alejandro.lucero@netronome.com> wrote: > > > On Tue, Jul 10, 2018 at 9:57 AM, Eelco Chaudron > wrote: > >> >> >> On 4 Jul 2018, at 14:53, Alejandro Lucero wrote: >> >> A PMD should invoke this function for checking memsegs iovas are within >>> the supported range by the device. >>> >>> Signed-off-by: Alejandro Lucero >>> >> >> Agree with Andrew here, why not call rte_eal_check_dma_mask() directly in >> nfp_net_txq_full()? >> >> BTW, IOVA checking can not be done inside PMD functions like that one because that is in the fast path. Any IOVA checking needs to be done at initialization time. > > My idea was to add this indirection for handling dma mask when just part > of the IOVAs are not usable. Now, if the dma mask finds a problem, the PMD > does not make any port initialization. > > Memory management is changing and ideally an app should just allocate > memory safe to be used by the PMD when that memory is going to be used for > sending or receiving data, what is not always the case. > > It is true this indirection is not being used for any purpose by now, so > yes, I could use a direct call the the EAL one. > > >> >> --- >>> lib/librte_ether/rte_ethdev.h | 13 +++++++++++++ >>> lib/librte_ether/rte_ethdev_version.map | 1 + >>> 2 files changed, 14 insertions(+) >>> >>> diff --git a/lib/librte_ether/rte_ethdev.h >>> b/lib/librte_ether/rte_ethdev.h >>> index eba11ca..e51a432 100644 >>> --- a/lib/librte_ether/rte_ethdev.h >>> +++ b/lib/librte_ether/rte_ethdev.h >>> @@ -2799,6 +2799,19 @@ int rte_eth_dev_set_vlan_ether_type(uint16_t >>> port_id, >>> int rte_eth_dev_set_vlan_pvid(uint16_t port_id, uint16_t pvid, int on); >>> >>> /** >>> + * check device dma mask within expected range based on dma mask. >>> + * >>> + * @param maskbits >>> + * mask length in bits >>> + * >>> + */ >>> +static inline int >>> +rte_eth_dev_check_dma_mask(uint8_t maskbits) >>> +{ >>> + return rte_eal_check_dma_mask(maskbits); >>> +} >>> + >>> +/** >>> * >>> * Retrieve a burst of input packets from a receive queue of an Ethernet >>> * device. The retrieved packets are stored in *rte_mbuf* structures >>> whose >>> diff --git a/lib/librte_ether/rte_ethdev_version.map >>> b/lib/librte_ether/rte_ethdev_version.map >>> index e9681ac..0b11b8a 100644 >>> --- a/lib/librte_ether/rte_ethdev_version.map >>> +++ b/lib/librte_ether/rte_ethdev_version.map >>> @@ -191,6 +191,7 @@ DPDK_17.08 { >>> DPDK_17.11 { >>> global: >>> >>> + rte_eth_dev_check_dma_mask; >>> rte_eth_dev_get_sec_ctx; >>> rte_eth_dev_pool_ops_supported; >>> rte_eth_dev_reset; >>> -- >>> 1.9.1 >>> >> >