From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 3E8DFA48F for ; Mon, 15 Jan 2018 16:32:24 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id r78so2812025wme.0 for ; Mon, 15 Jan 2018 07:32:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.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=8vMM8T49m0sMM72x3DF01UV09SxiEjXg8UFC6slDXxM=; b=vWSV1kbYyT0ZeAwO6eV0m8t7fbQC7iwtlAp95AtZO6+ZeTz++hsHhMIVPskNcO/p0+ er90LJtssdYXlsg2ph2NNZGk9ZOoofB6c6vg05PAUlBsfLHcpRn5nTMreTkEL5rIzrvl r/QGjIQ9Yzq3u4CYMiW2UF5UOTbafDKSxABFG9HhgXSbdWEw3yc0q+r+9x/awzB1EJ4g jbpwEdpXr5g2Z0cdRSn1otvSE9TRtcOshShvUBgjvUr18rWfrFEP27ZyIHynuSZ41I/O QvjQKTL5TViL/hmn40ozL1KpDPhne3HIOsE4QaJK/YftWNMk3WkcjA8+jnA9+XAsRjSs l0bA== 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=8vMM8T49m0sMM72x3DF01UV09SxiEjXg8UFC6slDXxM=; b=NxwQdwJYg5Pdm+8V9BfuOWq/PO3tesgmljAdco7xnn4gas6FiljEDJLOICluoE1y4V mo4GrrpySAW/nydj6PdrDFKJJJQZKAKGHJ95xvurngOrBQytSepjFFaapw6bZ8WTSvZM e1MYtpTKDPWyib2caU7nQ4Rsz/hVIwB+NGLoMpHQ2RUBN3FB8E/7ynTgTM9uIUNAuw5+ jZdFDx3aC1ja01q+jqB4ug3NADeRnekdluRXx4Hp9vkxHXuDooSsS6Cw3BKLmsn4ksKn tf+1nSIKuS4hrxfbSZqajhscq9QVk11xV/r256tMxGRYsKUdqB4AVwODWxrV5mPZEU+T DeKg== X-Gm-Message-State: AKwxytfouTSnN9SJ6Z9ZbCF+K3KFxrPbPi2xcCrLICFGTWqqGa6Fj/Oi ZpufnfFL277MmMKimtXVZKkm X-Google-Smtp-Source: ACJfBou291jfAsL3ndsYL4hgzxR6ANUrp7vIbi7ZYYLeZF6GlNA/vDUn0wi51rrvamTFCICeILf4XQ== X-Received: by 10.28.62.202 with SMTP id l193mr9915300wma.73.1516030343713; Mon, 15 Jan 2018 07:32:23 -0800 (PST) Received: from shalom (lan31-h07-89-80-147-20.dsl.sta.abo.bbox.fr. [89.80.147.20]) by smtp.gmail.com with ESMTPSA id o16sm276230wmi.29.2018.01.15.07.32.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Jan 2018 07:32:23 -0800 (PST) Date: Mon, 15 Jan 2018 16:33:39 +0100 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Xueming Li Cc: Shahaf Shuler , dev@dpdk.org Message-ID: <20180115153339.zu742z6n6tljoqte@shalom> References: <20180115065420.44065-1-xuemingl@mellanox.com> <20180115065420.44065-2-xuemingl@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180115065420.44065-2-xuemingl@mellanox.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH 2/4] net/mlx5: forbid MR registration in secondary process 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: Mon, 15 Jan 2018 15:32:24 -0000 Hi Xueming, On Mon, Jan 15, 2018 at 02:54:18PM +0800, Xueming Li wrote: > Secondary process are not alloed to access verbs resources, add check to > prevent MR registration in data path. > > Signed-off-by: Xueming Li > --- > doc/guides/nics/mlx5.rst | 1 + > drivers/net/mlx5/mlx5_mr.c | 3 +++ > drivers/net/mlx5/mlx5_rxtx.h | 3 --- > 3 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst > index bdc2216c0..4373c7990 100644 > --- a/doc/guides/nics/mlx5.rst > +++ b/doc/guides/nics/mlx5.rst > @@ -107,6 +107,7 @@ Limitations > - Inner RSS for VXLAN frames is not supported yet. > - Hardware checksum RX offloads for VXLAN inner header are not supported yet. > - Forked secondary process not supported. > +- Mempools used in secondary process TX have to be initialized in primary process before rte_eth_dev_start(). > - Flow pattern without any specific vlan will match for vlan packets as well: > > When VLAN spec is not specified in the pattern, the matching rule will be created with VLAN as a wild card. > diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c > index 6b29eed55..3c80fbb89 100644 > --- a/drivers/net/mlx5/mlx5_mr.c > +++ b/drivers/net/mlx5/mlx5_mr.c > @@ -278,6 +278,9 @@ priv_mr_new(struct priv *priv, struct rte_mempool *mp) > unsigned int i; > struct mlx5_mr *mr; > > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) > + rte_panic("Please init mempool before rte_eth_dev_start() in primary process: %s", > + mp->name); Panic should be avoided unless the situation becomes totally un-predectible. Here you can return NULL and stop the Tx burst increasing at the same time the error statistics. The panic message can remain as a warning. This don't deserve a panic. > mr = rte_zmalloc_socket(__func__, sizeof(*mr), 0, mp->socket_id); > if (!mr) { > DEBUG("unable to configure MR, ibv_reg_mr() failed."); > diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h > index 2eb2f0506..18e1d26f3 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.h > +++ b/drivers/net/mlx5/mlx5_rxtx.h > @@ -561,9 +561,6 @@ mlx5_tx_mb2mr(struct mlx5_txq_data *txq, struct rte_mbuf *mb) > } > if (txq->mp2mr[i]->start <= addr && > txq->mp2mr[i]->end >= addr) { > - assert(txq->mp2mr[i]->lkey != (uint32_t)-1); > - assert(rte_cpu_to_be_32(txq->mp2mr[i]->mr->lkey) == > - txq->mp2mr[i]->lkey); > txq->mr_cache_idx = i; > return txq->mp2mr[i]->lkey; > } > -- > 2.13.3 > Thanks, -- Nélio Laranjeiro 6WIND