Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4220316pxu; Wed, 9 Dec 2020 11:14:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxgj6FkTMHD1zcVWWfJng2lPJMNmks24RPst89Y55P0uWXq+XivqElB1cVOzK5QHMpL1ShX X-Received: by 2002:aa7:c4c2:: with SMTP id p2mr3441324edr.63.1607541292434; Wed, 09 Dec 2020 11:14:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607541292; cv=none; d=google.com; s=arc-20160816; b=yrLKBPYL1kqCzPJxCuZ15G7+Rl/9Z0Q/TwLcEF1VhAF7TOfSBzMXN41EQRqkO7g5pT hrhlnhNf+1+2wRB5gur3M9OSgjDBQ6z2MfrHqhGibgvxwTWknmfU9Ey9uGtOBscJXoqo DzUP9/KtmdxaipSe+sPCZLK4yl8Jx74UMzuKvzxUBmNVvb/sspy5YUaq9g/CKuWDpQpS Z+fNg1/eV2klvCu2fgnvwBrWOAkmO7E8Y2iEFXJwRW4Jmvk/TEObUCcjLJifE7Bcgzjo kRI9HW0jLdaN7NuuJX+5dc1GZChMtecVo6llMGp4OFedozaG7fg+ZsvRQhxeVkmX/UgC ddxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :dkim-signature:message-id; bh=sGnMroXGKqTN4qldUBx6rUWX/N66H5MFdkRsEFawUGU=; b=lVEv6LhuNsA7NzgMPuIgPSGBVmZ1QZdtH3RJJj5vOmwFzYCnvNcE9VwOnE6biZ2p0k yuINB5JEqhtLEckQPxRE+yI9SNQ14oW4STS7sBXP9+UmUFj1XtkAsZPbrvjaMilshEMR WjKgSOC6hPoTetwuQaRjgqg7HRh0h0jW/b3rVbF8fx0VjFOcUCch0K4O2lgtJdYQLu6M jnugo7Fj5w/q/Oqx3AtaK55NApYV9glGx5mXOx5G7VnDBATNXcTvRugJvJN91KxwGYCG zVptbXCjao5hgYMZVJdDb1r8zAfN0I/ludmVRLi20WcykXabFvN9VDotTLIC5yWOdJgq avKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vPVoR+yr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t20si1257509ejd.719.2020.12.09.11.14.25; Wed, 09 Dec 2020 11:14:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vPVoR+yr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387593AbgLITJI (ORCPT + 99 others); Wed, 9 Dec 2020 14:09:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:54774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733001AbgLITJH (ORCPT ); Wed, 9 Dec 2020 14:09:07 -0500 Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607540907; bh=MZoHqy8IDSGzdgkpc0oauuGyvv+fzNC267tZh0farKc=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=vPVoR+yr9Irrh4vZvZhRF7yzxMdjKL8IJL6xAJj+2hpkMQuUvOlNGsB/zdXAdJrnf G1d95aKPLd8DjKSMXVM7U4aIqTPmYZUhKrBM4BX5IQhzUPYoy68UPSZyPhqmBsYD9I LwQ+Ir0SNSfYN8cNw0u9nPfel734j7BdCWjz2BwVV/UQifaiRbHbVWFhGcmXYINhJ4 Jr+sMzueG7eNx7LH/i8qtt0HmzFFRK80XB+KToWv+1eJf4U9m2XbgNW0NhM9ex6Pgs NmQirD8+GSWg+ugJkqDQlTUIcyV79SOZqt5j583avk5K98QabQLRpNwsE5zSjmMEX/ IH3WjRqTnPvfg== Subject: Re: [PATCHv3 net-next] octeontx2-pf: Add RSS multi group support From: Saeed Mahameed To: Geetha sowjanya , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: sgoutham@marvell.com, davem@davemloft.net, kuba@kernel.org, sbhatta@marvell.com Date: Wed, 09 Dec 2020 11:08:24 -0800 In-Reply-To: <20201209170937.19548-1-gakula@marvell.com> References: <20201209170937.19548-1-gakula@marvell.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-12-09 at 22:39 +0530, Geetha sowjanya wrote: > Hardware supports 8 RSS groups per interface. Currently we are using > only group '0'. This patch allows user to create new RSS > groups/contexts > and use the same as destination for flow steering rules. > > usage: > To steer the traffic to RQ 2,3 > > ethtool -X eth0 weight 0 0 1 1 context new > (It will print the allocated context id number) > New RSS context is 1 > > ethtool -N eth0 flow-type tcp4 dst-port 80 context 1 loc 1 > > To delete the context > ethtool -X eth0 context 1 delete > > When an RSS context is removed, the active classification > rules using this context are also removed. > > Change-log: > v2 > - Removed unrelated whitespace > - Coverted otx2_get_rxfh() to use new function. > > v3 > - Coverted otx2_set_rxfh() to use new function. > > Signed-off-by: Sunil Kovvuri Goutham > Signed-off-by: Geetha sowjanya > --- ... > -/* Configure RSS table and hash key */ > -static int otx2_set_rxfh(struct net_device *dev, const u32 *indir, > - const u8 *hkey, const u8 hfunc) > +static int otx2_get_rxfh_context(struct net_device *dev, u32 *indir, > + u8 *hkey, u8 *hfunc, u32 rss_context) > { > struct otx2_nic *pfvf = netdev_priv(dev); > + struct otx2_rss_ctx *rss_ctx; > struct otx2_rss_info *rss; > int idx; > > - if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != > ETH_RSS_HASH_TOP) > - return -EOPNOTSUPP; > - > rss = &pfvf->hw.rss_info; > > if (!rss->enable) { > - netdev_err(dev, "RSS is disabled, cannot change > settings\n"); > + netdev_err(dev, "RSS is disabled\n"); > return -EIO; > } I see that you init/enable rss on open, is this is your way to block getting rss info if device is not open ? why do you need to report an error anyway, why not just report whatever default config you will be setting up on next open ? to me reporting errors to ethtool queries when device is down is a bad user experience. > + if (rss_context >= MAX_RSS_GROUPS) > + return -EINVAL; > + -ENOENT > + rss_ctx = rss->rss_ctx[rss_context]; > + if (!rss_ctx) > + return -EINVAL; > -ENOENT