From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 003654C76 for ; Tue, 24 Apr 2018 20:46:14 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id w195so3008281wmw.2 for ; Tue, 24 Apr 2018 11:46:14 -0700 (PDT) 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:in-reply-to; bh=YTTZoW+rlewQ4SQfsWEzwjBZV2VUIcp5wO5qJ+j/M9s=; b=UsYFM4VwpRkeNlwpxxf6i2xpR6Poxpn795fof/YsZV9NX10HbhTgC9pjLKOOf0ge0a fkD8iRD4WKVNn/wEyJmQt7E4tVwYQHObt/+kWSkBeJX9Ym9Nl/t+EwkymTGO9mipXQkC yWtqp5FC2KLPpAzWsWqNWs5zqoLHO98OCk+oFYZ1AYZ1SgPQWyxngf3D+1sFR2TZa3Py 4V3NYHwGdwRQ75UTacuCS8LSN3tHtlywhai9e2Nv3vuPNT39hDRigw6cF3J8L3JsPTPD PqebZ1/u/+86A1tMywdstn8LmlJCSV/9pgFK0MK4StjfAfrMKB0v+ITTe0iRIGwLuvwo MIFw== 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:in-reply-to; bh=YTTZoW+rlewQ4SQfsWEzwjBZV2VUIcp5wO5qJ+j/M9s=; b=noSuyyjw1tpIS9iIq5kkzoMN/p6c1o4Tj0v2vpN37ullW3WITfzzZU8j+Bq5tyCXka Iz2eY780ZVOUueHWZesp+hCQF7yoC0DCTkDPYxdQ7IoHGovDro9qr9TLQAkG1TZAJMQA ftudnHVPZ6l9gpNEh0tLfo9GCBnC9opuG5Pm4e98MTr1L9qohcvSR6C9TkmGh3XLar0z sJL9KFN2TAdMCkcVoX55EIMRUtagf05h0QmqU6i8Y6vO3K8GAj7bvcAdmRdX8ZavETla HoHu+ZZmNxCyS2vxd01QjCYJbnv0XvwWuEJZPsNDbX5nm5SfU3yi2OInmLBPRKmMErf1 bM5A== X-Gm-Message-State: ALQs6tDLJxGJf6EWjgRQW4Rh2pm8o5t9hPqAA1j9bPXcuBXaa0Vfo4s+ uhNTO5P/Y9lfEuT0AUNSLblMUg== X-Google-Smtp-Source: AB8JxZqBA1IxuyF28sccqeNwNRlm3N4Y6HnPoVQlPkNtFrepLs+Gwh3T4KUhsPeSwotJJunrRma7Kg== X-Received: by 10.28.109.80 with SMTP id i77mr12414340wmc.46.1524595574695; Tue, 24 Apr 2018 11:46:14 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id l2sm15234122wmi.16.2018.04.24.11.46.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 11:46:13 -0700 (PDT) Date: Tue, 24 Apr 2018 20:45:59 +0200 From: Adrien Mazarguil To: Ferruh Yigit Cc: Qi Zhang , thomas@monjalon.net, Xueming Li , dev@dpdk.org Message-ID: <20180424184559.GQ4957@6wind.com> References: <20180424141806.47123-1-qi.z.zhang@intel.com> <21872768-08ca-852d-7c13-0f596d92dc5e@intel.com> <7a30060c-ff3a-da0e-bbc2-11819dddec0a@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7a30060c-ff3a-da0e-bbc2-11819dddec0a@intel.com> Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix testpmd failure due to RSS offload check 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, 24 Apr 2018 18:46:15 -0000 On Tue, Apr 24, 2018 at 05:13:46PM +0100, Ferruh Yigit wrote: > On 4/24/2018 3:39 PM, Ferruh Yigit wrote: > > On 4/24/2018 3:18 PM, Qi Zhang wrote: > >> After add RSS hash offload check, default rss_hf will fail on > >> devices that not support all bits, the patch take rss_hf as > >> a suggest value and only set bits that device supported base on > >> rte_eth_dev_get_info. > >> > >> Fixes: 527624c663f8 ("ethdev: add supported hash function check") > >> Signed-off-by: Qi Zhang > >> --- > >> app/test-pmd/testpmd.c | 5 ++++- > >> 1 file changed, 4 insertions(+), 1 deletion(-) > >> > >> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > >> index d6da41927..af3fc5388 100644 > >> --- a/app/test-pmd/testpmd.c > >> +++ b/app/test-pmd/testpmd.c > >> @@ -2265,13 +2265,16 @@ init_port_config(void) > >> { > >> portid_t pid; > >> struct rte_port *port; > >> + struct rte_eth_dev_info dev_info; > >> > >> RTE_ETH_FOREACH_DEV(pid) { > >> port = &ports[pid]; > >> port->dev_conf.fdir_conf = fdir_conf; > >> if (nb_rxq > 1) { > >> + rte_eth_dev_info_get(pid, &dev_info); > >> port->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL; > >> - port->dev_conf.rx_adv_conf.rss_conf.rss_hf = rss_hf; > >> + port->dev_conf.rx_adv_conf.rss_conf.rss_hf = > >> + rss_hf & dev_info.flow_type_rss_offloads; > > > > "rss_hf" is a global variable, not per port. Adrien's patch [1] made that it has > > been updated by "port config all rss ..." command, so that value can change. > > > > Also Xueming's patch did it will set "0" if "default" parameter used [2], like > > "port config all rss default" > > > > So not sure if rss_hf is reliable at this point. > > > > What do you think using dev_info.flow_type_rss_offloads directly? > > Prevent updating rss_hf in "port config all rss default" and this patch together > lgtm. I have to take back my previous reply [3] regarding the original series. After testing it I confirm mlx4 is broken with testpmd as well. The fact mlx4 doesn't implement the legacy RSS API means it won't ever satisfy the global rss_hf settings and rte_eth_dev_configure() will always fail. As an immediate fix, Qi's patch above should deal with this problem. Now what's needed in testpmd is the ability to distinguish a *configured* rss_hf value (--rss-ip, --rss-udp command-line parameters or interactively through "port config all rss $anything_other_than_default") from a default one (no command-line parameters or "port config all rss default"). I think a second global is needed: int rss_hf_enable = 0; /* Take rss_hf into account. */ If unset, rss_hf is never taken into account and PMDs are fed their default settings (whatever they report as supported), otherwise rss_hf is enforced as requested by user configuration. > > [1] 75d5493eb302 ("app/testpmd: fix RSS flow action configuration") > > > > [2] 8c1f4aff92a6 ("app/testpmd: new parameter for port config all RSS command") > > > >> } else { > >> port->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL; > >> port->dev_conf.rx_adv_conf.rss_conf.rss_hf = 0; > >> > > > [3] http://dpdk.org/ml/archives/dev/2018-April/097904.html -- Adrien Mazarguil 6WIND