From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f169.google.com (mail-wr0-f169.google.com [209.85.128.169]) by dpdk.org (Postfix) with ESMTP id 37D11A496 for ; Mon, 15 Jan 2018 17:03:06 +0100 (CET) Received: by mail-wr0-f169.google.com with SMTP id g38so9023918wrd.2 for ; Mon, 15 Jan 2018 08:03:06 -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=+0WXOWoxc8Cdy73eoPZT0RbfXC4iNlTrPCp6LkVCT2U=; b=irm3aH4kaU/3DwMYiXQ0MrSwngH47qxseZHo3xrKNHf4Jj69yPfJtIzpbYtyl6YFJn GeSHL86A/eK765bejfGoj2PZRtnOWVr1YKoK3etWsGwtmVs9vQQ++pduIJIUDpDefB1o NSGiqSZQJ02Uhp7pO42OFrHjNsH5VNivIUGK7/bAWHuus+KcW/HzS1LeyURVbrVFlCWP hsMZXfvrzoS3XI6O1t1/Nr9lwKJKyjlq90xEYO3mR2LFebxSUHsrCdy9sOTzxDcpXGRf 37dsM9EGtWCME2oIf5jkSIYrVha89Edg0b/WkelO1ZRmtBPX8+1QnhrJuHBCVP5TPzu3 dLvA== 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=+0WXOWoxc8Cdy73eoPZT0RbfXC4iNlTrPCp6LkVCT2U=; b=O4QAvgR+XYpC/ohgV/QBAQLOhEJvLgW0bjbADF00qgPf3MHN5YT2m/oGgbSH3Togbw Q4tfjwfGVKyiXJclc27hCW5046xNDXFBUFeKjyX3B38luBYqFOPMIzaS8hsGqa5Xy9gP 6LIyAYXWxNyahD5Bl2HpR/hg5IxkR1LbjC97G/nBjf30RiVHbFEVJmEDwAvnnugmMZ/K 292DP59xRJW0mCboLePBbpzQ9O8uhkpzYtFRHg/wm9GuXiSTpJwpPzE0DNU+1af6wmE5 7T1Gc7i3rPPADrPX42hMExSvWEd9M0ZS8PuA/cCftuf0SDdgajn6/43/6DBNaqLmOOGi XKKQ== X-Gm-Message-State: AKGB3mKMCjVLgN6L2MLt1vaDA+/L0Arv+AVaMFltoiTcXGut8rVB4mtb tgWbtF/5WaZOi+V3wPWWl7k6v2xg X-Google-Smtp-Source: ACJfBoumhbH93HMWr751Ow8KjZxqGHirxV8Tk1bzeObCmdnowhk74fYiRfCep6LGWDlY3iOIx01Q8Q== X-Received: by 10.223.137.1 with SMTP id s1mr28587520wrs.53.1516032185738; Mon, 15 Jan 2018 08:03:05 -0800 (PST) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 70sm335815wmf.43.2018.01.15.08.03.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Jan 2018 08:03:04 -0800 (PST) Date: Mon, 15 Jan 2018 17:02:52 +0100 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Moti Haimovsky Cc: ferruh.yigit@intel.com, stephen@networkplumber.org, dev@dpdk.org Message-ID: <20180115160252.734ts4actt6wqrav@bidouze.vm.6wind.com> References: <1515095458-186363-2-git-send-email-motih@mellanox.com> <1515595223-36144-1-git-send-email-motih@mellanox.com> <1515595223-36144-2-git-send-email-motih@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1515595223-36144-2-git-send-email-motih@mellanox.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH V3 2/2] net/failsafe: convert to new Rx offloads API 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 16:03:06 -0000 My remarks for this one are mostly the same, I will try to repeat them faithfully... "convert to" -> "use" On Wed, Jan 10, 2018 at 04:40:23PM +0200, Moti Haimovsky wrote: ... > +static bool > +fs_rxq_are_offloads_valid(struct rte_eth_dev *dev, uint64_t offloads) function name can be shortened (s/_are//). > +{ > + uint64_t port_offloads = dev->data->dev_conf.rxmode.offloads; > + uint64_t queue_supp_offloads = PRIV(dev)->infos.rx_queue_offload_capa; > + uint64_t port_supp_offloads = PRIV(dev)->infos.rx_offload_capa; > + Please separate variable definition and initialization. > + if ((offloads & (queue_supp_offloads | port_supp_offloads)) != > + offloads) > + return false; > + /* Verify we have no conflict with port offloads */ > + if ((port_offloads ^ offloads) & port_supp_offloads) > + return false; > + return true; > +} > + > static void > fs_rx_queue_release(void *queue) > { > @@ -290,6 +313,17 @@ > fs_rx_queue_release(rxq); > dev->data->rx_queues[rx_queue_id] = NULL; > } > + /* Verify application offloads are valid for our port and queue. */ > + if (!fs_rxq_are_offloads_valid(dev, rx_conf->offloads)) { > + rte_errno = ENOTSUP; > + ERROR("%p: Rx queue offloads 0x%lx don't match port " Here, the device pointer should not be displayed. It may be a larger issue with the fail-safe, that should be fixed (when using multiple fail-safe instances), but for now, all outputs should follow the same format. Otherwise, use PRIx64 for displaying uint64_t. > + "offloads 0x%lx or supported offloads 0x%lx", > + (void *)dev, rx_conf->offloads, > + dev->data->dev_conf.rxmode.offloads, > + PRIV(dev)->infos.rx_offload_capa | > + PRIV(dev)->infos.rx_queue_offload_capa); > + return -rte_errno; > + } > rxq = rte_zmalloc(NULL, > sizeof(*rxq) + > sizeof(rte_atomic64_t) * PRIV(dev)->subs_tail, > @@ -589,12 +623,16 @@ > sizeof(default_infos)); > } else { > uint32_t rx_offload_capa; > + uint32_t rxq_offload_capa; > > rx_offload_capa = default_infos.rx_offload_capa; > + rxq_offload_capa = default_infos.rx_queue_offload_capa; > FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) { > rte_eth_dev_info_get(PORT_ID(sdev), > &PRIV(dev)->infos); > rx_offload_capa &= PRIV(dev)->infos.rx_offload_capa; > + rxq_offload_capa &= > + PRIV(dev)->infos.rx_queue_offload_capa; > } > sdev = TX_SUBDEV(dev); > rte_eth_dev_info_get(PORT_ID(sdev), &PRIV(dev)->infos); > -- > 1.8.3.1 > Regards, -- Gaëtan Rivet 6WIND