From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 6562A5B32 for ; Sat, 10 Mar 2018 06:22:17 +0100 (CET) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id w2A5MC53011381; Fri, 9 Mar 2018 21:22:13 -0800 Date: Sat, 10 Mar 2018 10:51:45 +0530 From: Rahul Lakkireddy To: Ferruh Yigit Cc: "dev@dpdk.org" , Kumar A S , Surendra Mobiya , Nirranjan Kirubaharan , Indranil Choudhury Message-ID: <20180310052144.GA31923@chelsio.com> References: <53646d44-eed1-e3f5-648a-cdd4fd48412b@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53646d44-eed1-e3f5-648a-cdd4fd48412b@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] [PATCH v2 3/7] cxgbe: add support to update RSS hash configuration and key 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: Sat, 10 Mar 2018 05:22:17 -0000 On Thursday, March 03/08/18, 2018 at 19:04:31 +0530, Ferruh Yigit wrote: > On 2/28/2018 6:04 PM, Rahul Lakkireddy wrote: > > From: Kumar Sanghvi > > > > Add firmware API for updating RSS hash configuration and key. Move > > RSS hash configuration from cxgb4_write_rss() to a separate function > > cxgbe_write_rss_conf(). > > > > Also, rename cxgb4_write_rss() to cxgbe_write_rss() for consistency. > > > > Original work by Surendra Mobiya > > > > Signed-off-by: Kumar Sanghvi > > Signed-off-by: Rahul Lakkireddy > > <...> > > > @@ -985,6 +1016,7 @@ static const struct eth_dev_ops cxgbe_eth_dev_ops = { > > .get_eeprom = cxgbe_get_eeprom, > > .set_eeprom = cxgbe_set_eeprom, > > .get_reg = cxgbe_get_regs, > > + .rss_hash_update = cxgbe_dev_rss_hash_update, > > Also in cxgbe_dev_info_get(), rte_eth_dev_info->flow_type_rss_offloads should be > updated with supported RSS hash functions. > > I don't see any usage of "flow_type_rss_offloads" in sample apps except testpmd > is using it to print the log, but that is the way to notify applications about > support. > > You don't need to send a new version of patchset for this, please send an > incremental patch and I can squash it into this set. > > <...> > Ok, will update supported RSS hash functions in flow_type_rss_offloads. Will send a fix. > > +int cxgbe_write_rss_conf(const struct port_info *pi, uint64_t rss_hf) > > +{ > > + struct adapter *adapter = pi->adapter; > > + const struct sge_eth_rxq *rxq; > > + u64 flags = 0; > > + u16 rss; > > + int err; > > + > > + /* Should never be called before setting up sge eth rx queues */ > > + if (!(adapter->flags & FULL_INIT_DONE)) { > > + dev_err(adap, "%s No RXQs available on port %d\n", > > + __func__, pi->port_id); > > + return -EINVAL; > > + } > > + > > + if (rss_hf & ETH_RSS_IPV4) > > + flags |= F_FW_RSS_VI_CONFIG_CMD_IP4TWOTUPEN; > > + > > + if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) > > + flags |= F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN; > > + > > + if (rss_hf & ETH_RSS_NONFRAG_IPV4_UDP) > > + flags |= F_FW_RSS_VI_CONFIG_CMD_IP4FOURTUPEN | > > + F_FW_RSS_VI_CONFIG_CMD_UDPEN; > > + > > + if (rss_hf & ETH_RSS_IPV6) > > + flags |= F_FW_RSS_VI_CONFIG_CMD_IP6TWOTUPEN; > > + > > + if (rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) > > + flags |= F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN; > > + > > + if (rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) > > + flags |= F_FW_RSS_VI_CONFIG_CMD_IP6FOURTUPEN | > > + F_FW_RSS_VI_CONFIG_CMD_UDPEN; > > + > > + rxq = &adapter->sge.ethrxq[pi->first_qset]; > > + rss = rxq[0].rspq.abs_id; > > What if driver gets a rss_hf that is not supported, will the API report back an > error to the application? > Good catch! Will send a fix. Thanks, Rahul