Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3917391pxk; Tue, 22 Sep 2020 06:10:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVfEl0cTFW2dEGInMzd9TlCWcmyYB5zAxi5QuZ5ZId7VcPLCtsfP4VHfNLrMq26DMSeJgb X-Received: by 2002:a17:906:3e0c:: with SMTP id k12mr4763212eji.189.1600780232023; Tue, 22 Sep 2020 06:10:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600780232; cv=none; d=google.com; s=arc-20160816; b=NufIRPeEVmHRKx0lyxqgGLywfWfahBDo7GWbHi799SC+/LLikruamYl9BeyAK0Bh/G N07ZAelODi+b2Sx71UTolTZ6ojNV4D95fMk3sz2aj0/3WNbx6SHh874638ppsqHBdBn4 VuHywXBbPFqvfRc8bUa1RbjJVhZXUa1UImjx+uxF3c7qYlEM4vmo2D9i3wvEwV6TdKP9 RkabzXMvdzOUvJyftQEj94mbQ9YjnZBGixpEqZNRY7Pqlkpwo7oYRxrgciZNYaxEv9QL hWWbfMr8ftAJd3tKjL6MM+VyroiJWro5ELcyrXGfXb0xprgCw3ADe2jRmq4bxWdrpZkN szJQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6wa6TQnds4To/blqpDE4MQd5qZXhirQSwikJ/CZLN/I=; b=jeCWZVMlRsdkz+3O8bR21v1cMLK7kBanJ6rzjm7J1jhv7leKTPUUdgKnM1PmmZO0hL WT7mydwTesezwlyL/zOo2B8C8Gpm+EnkANMdYvxiChobrb6CRHJyvgN1Dg7tnFEChrS+ auVF29WZreRWy1TYp0MY7Y6SPBM7fo7sQG8l0vJ4hKLdnO6QlhAXzLJn3Cjj8fNhoYgr W12IgSnic1gPYsddCqa0X5t0raB94K2ZjQ7igjs/6BP/SnV/mf1XNDN8zHTsmjmkEZJQ 5acUsY1SnDbjopNrPZVJEk4ENf+5PhU1iCZVSl0hLU8iDwhem0FyS3nuuUh/qNUX4Fw3 gVIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=YTOGnmoD; 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=marvell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh17si10514742ejb.128.2020.09.22.06.10.08; Tue, 22 Sep 2020 06:10:32 -0700 (PDT) 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=@marvell.com header.s=pfpt0220 header.b=YTOGnmoD; 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=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbgIVNIK (ORCPT + 99 others); Tue, 22 Sep 2020 09:08:10 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:14032 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726573AbgIVNIK (ORCPT ); Tue, 22 Sep 2020 09:08:10 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08MD6TQB021917; Tue, 22 Sep 2020 06:08:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=6wa6TQnds4To/blqpDE4MQd5qZXhirQSwikJ/CZLN/I=; b=YTOGnmoDrOi+D1K/jlBxpIJYvGdZLER6jJsqZWYkoAlfc8xQiPEffwDrZl1wjvBiH+1G u6RnM/FTht/ttgaSDDqp+rKOVd7XkhajXqEDh8ltntQBvx5uLLDKLJOytWXRlfqBGMy6 iBcTxmfeNWqbOODTx7ES1AfdfGBayWpIE8utHjunftu0kvOT0uxz8JM83uJJA9CwWvVh 1Iwp61qg5wWty8DFn0Oi5UYN2Gv3oeing4QifsieFmENs+Fz2Q7aY8gea8omJ6ufuMwo HcajW/qxsRwfY9fcMCweWSxX8hKMQkSQWW/WUS9Yo5fjNxachf61pzO/XvzlskCWCVoP iA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 33nhgna5es-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 22 Sep 2020 06:08:06 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 06:08:05 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 06:08:04 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 22 Sep 2020 06:08:04 -0700 Received: from hyd1584.caveonetworks.com (unknown [10.29.37.82]) by maili.marvell.com (Postfix) with ESMTP id 0E1EB3F703F; Tue, 22 Sep 2020 06:07:59 -0700 (PDT) From: George Cherian To: , CC: George Cherian , Sunil Goutham , "David S. Miller" , "Sunil Kovvuri Goutham" , Geetha sowjanya , Subbaraya Sundeep , "Tomasz Duszynski" , Aleksey Makarov , Christina Jacob , Hariprasad Kelam , Felix Manlunas , hariprasad Subject: [net-next PATCH 2/2] octeontx2-pf: Support to change VLAN based RSS hash options via ethtool Date: Tue, 22 Sep 2020 18:37:27 +0530 Message-ID: <20200922130727.2350661-3-george.cherian@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200922130727.2350661-1-george.cherian@marvell.com> References: <20200922130727.2350661-1-george.cherian@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-22_12:2020-09-21,2020-09-22 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to control rx-flow-hash based on VLAN. By default VLAN plus 4-tuple based hashing is enabled. Changes can be done runtime using ethtool To enable 2-tuple plus VLAN based flow distribution # ethtool -N rx-flow-hash sdv To enable 4-tuple plus VLAN based flow distribution # ethtool -N rx-flow-hash sdfnv Signed-off-by: George Cherian Signed-off-by: Sunil Goutham --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 2 +- drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c index 820fc660de66..d2581090f9a4 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c @@ -355,7 +355,7 @@ int otx2_rss_init(struct otx2_nic *pfvf) rss->flowkey_cfg = rss->enable ? rss->flowkey_cfg : NIX_FLOW_KEY_TYPE_IPV4 | NIX_FLOW_KEY_TYPE_IPV6 | NIX_FLOW_KEY_TYPE_TCP | NIX_FLOW_KEY_TYPE_UDP | - NIX_FLOW_KEY_TYPE_SCTP; + NIX_FLOW_KEY_TYPE_SCTP | NIX_FLOW_KEY_TYPE_VLAN; ret = otx2_set_flowkey_cfg(pfvf); if (ret) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c index 0341d9694e8b..662fb80dbb9d 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c @@ -428,6 +428,8 @@ static int otx2_get_rss_hash_opts(struct otx2_nic *pfvf, /* Mimimum is IPv4 and IPv6, SIP/DIP */ nfc->data = RXH_IP_SRC | RXH_IP_DST; + if (rss->flowkey_cfg & NIX_FLOW_KEY_TYPE_VLAN) + nfc->data |= RXH_VLAN; switch (nfc->flow_type) { case TCP_V4_FLOW: @@ -477,6 +479,11 @@ static int otx2_set_rss_hash_opts(struct otx2_nic *pfvf, if (!(nfc->data & RXH_IP_SRC) || !(nfc->data & RXH_IP_DST)) return -EINVAL; + if (nfc->data & RXH_VLAN) + rss_cfg |= NIX_FLOW_KEY_TYPE_VLAN; + else + rss_cfg &= ~NIX_FLOW_KEY_TYPE_VLAN; + switch (nfc->flow_type) { case TCP_V4_FLOW: case TCP_V6_FLOW: -- 2.25.1