From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2 3/7] cxgbe: add support to update RSS hash configuration and key Date: Thu, 8 Mar 2018 13:34:31 +0000 Message-ID: <53646d44-eed1-e3f5-648a-cdd4fd48412b@intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: kumaras@chelsio.com, surendra@chelsio.com, nirranjan@chelsio.com, indranil@chelsio.com To: Rahul Lakkireddy , dev@dpdk.org Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 39F115F28 for ; Thu, 8 Mar 2018 14:34:34 +0100 (CET) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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. <...> > +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?