From patchwork Fri Dec 8 06:56:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hariprasad Kelam X-Patchwork-Id: 175613 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5283707vqy; Thu, 7 Dec 2023 22:57:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUxnh8xNqkI9HGG/jfCysQHgKI1yiqx52f2/zBaFfVs6jS7SRhGJ4ifv0IS3PsmL8JgV9F X-Received: by 2002:a17:902:e5cc:b0:1d0:cae6:eea1 with SMTP id u12-20020a170902e5cc00b001d0cae6eea1mr3991441plf.83.1702018631178; Thu, 07 Dec 2023 22:57:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702018631; cv=none; d=google.com; s=arc-20160816; b=UlCK4bC0tjlstCiG8e6iWOZgw6fkjRneME+0bSvnS057V58zVNAoWxlfF/ezOONxCX fECFQlcYr9NyzwjQJbB5o+ls67jOP4GJ5NX50xkruC+5RbQ8snpmR3PvbZ16gknPEIh8 4oPBqKjY4CFMlbf4D+p4JjagrTlVNxfHL8alRPW1NdiWYdGax12HMiJ9kPuYA7nvvV4e gDghKBQbsD5wS0G1X9CARaVZEYcf3My8VmATMvryt95dL6l7L16Pq09c5K02YmQnE996 +BgetHGyEOVsd2pjS/nYXwiFR7bAwuCwvEKal+P3HFKnIdMkCtbr7ZyHUV7M9A5zSmHf rgAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=0ZbZa1UixBoOl2+uBtZ0D+1n/eyzGSd63YT0lH0OjD8=; fh=+k3MSxe8bGu7+vpCqCHH3WWBYVLMuN2nEavX9/ZyOOI=; b=akf41falufVG0CXaWkqm9lfPcqgneObj1rod+MM1WQUxEZA+J9dDgh+kDkDJyy+OmK CfSwat8RbxzfpCOCgrWAEOSeWfofUdec/Od1W9cXA8R/DHCkhlokRif/x0SlvECUow6+ M1iVrO/vaQgiUdYUGgPCBIy+M6R5ytxhllwgMiMYrRfHKoJAF2xA6bWGj8888rqSbWie NeQbv8LXkaCxf0zinMsYJuAhOUKON7gg87Fqg70IWnoE2ZYMzV8SZxYpylR/DxRZ+C00 msWNrMSXMa3D0C4+H4x47horBIwWbY6R7sZQRO6+FjgB2Bys0UquPaEdxeAM17QIRNfk gSQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=ecu7JAtz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id y6-20020a17090322c600b001d1db5e39b0si1110965plg.222.2023.12.07.22.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 22:57:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=ecu7JAtz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B27BC808720A; Thu, 7 Dec 2023 22:56:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233024AbjLHG42 (ORCPT + 99 others); Fri, 8 Dec 2023 01:56:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjLHG4X (ORCPT ); Fri, 8 Dec 2023 01:56:23 -0500 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C6B11722; Thu, 7 Dec 2023 22:56:29 -0800 (PST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B83H1wh017036; Thu, 7 Dec 2023 22:56:22 -0800 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-type; s=pfpt0220; bh=0ZbZa1UixBoOl2+uBtZ0D+1n/eyzGSd63YT0lH0OjD8=; b=ecu7JAtz6x9AvyNKFti63a8pzCWpIrZYzKUX/tvz1iHV2slyd6dlfaDolhPuSX70sOFa 8AMqmQqpM8osUrAi6yQKM67pMh3Js7OKPbYL9RmAjsosF4uObhNTeXbIS7wxkJos5UPL deTUnFl/+XGmHxqtzuhkBxev08416HivJEJD+ZQcEilXQDBTgoLGeNCYCjgcOJzVFny+ pY+z80rW7Fa6HKnGdfxEG5M/Q/Zwt6Gl1eLhShyCCIOukoJ/lKMCiMl1QCnaHxNI3dRy rDwaRuMGv5pQ6lff5VOEJ1xzfjBIfdoIRuO6TK/XqFDbo1Kiyit41xHeh5pioy59MGbi kA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3uu8qecncr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 07 Dec 2023 22:56:21 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 7 Dec 2023 22:56:20 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Thu, 7 Dec 2023 22:56:20 -0800 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id 83DBB3F70C3; Thu, 7 Dec 2023 22:56:16 -0800 (PST) From: Hariprasad Kelam To: , CC: , , , , , , , , , , Subject: [net 1/2] octeontx2-pf: Fix promisc mcam entry action Date: Fri, 8 Dec 2023 12:26:09 +0530 Message-ID: <20231208065610.16086-2-hkelam@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231208065610.16086-1-hkelam@marvell.com> References: <20231208065610.16086-1-hkelam@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: Y_tdXlCFjVK0tYOPt1IswN0uPVqUO8BS X-Proofpoint-ORIG-GUID: Y_tdXlCFjVK0tYOPt1IswN0uPVqUO8BS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-08_02,2023-12-07_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 07 Dec 2023 22:56:40 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784695888092102262 X-GMAIL-MSGID: 1784695888092102262 Current implementation is such that, promisc mcam entry action is set as multicast even when there are no trusted VFs. multicast action causes the hardware to copy packet data, which reduces the performance. This patch fixes this issue by setting the promisc mcam entry action to unicast instead of multicast when there are no trusted VFs. The same change is made for the 'allmulti' mcam entry action. Fixes: ffd2f89ad05c ("octeontx2-pf: Enable promisc/allmulti match MCAM entries.") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham --- .../ethernet/marvell/octeontx2/nic/otx2_pf.c | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c index 0c17ebdda148..a57455aebff6 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -1650,6 +1650,21 @@ static void otx2_free_hw_resources(struct otx2_nic *pf) mutex_unlock(&mbox->lock); } +static bool otx2_promisc_use_mce_list(struct otx2_nic *pfvf) +{ + int vf; + + /* The AF driver will determine whether to allow the VF netdev or not */ + if (is_otx2_vf(pfvf->pcifunc)) + return true; + + /* check if there are any trusted VFs associated with the PF netdev */ + for (vf = 0; vf < pci_num_vf(pfvf->pdev); vf++) + if (pfvf->vf_configs[vf].trusted) + return true; + return false; +} + static void otx2_do_set_rx_mode(struct otx2_nic *pf) { struct net_device *netdev = pf->netdev; @@ -1682,7 +1697,8 @@ static void otx2_do_set_rx_mode(struct otx2_nic *pf) if (netdev->flags & (IFF_ALLMULTI | IFF_MULTICAST)) req->mode |= NIX_RX_MODE_ALLMULTI; - req->mode |= NIX_RX_MODE_USE_MCE; + if (otx2_promisc_use_mce_list(pf)) + req->mode |= NIX_RX_MODE_USE_MCE; otx2_sync_mbox_msg(&pf->mbox); mutex_unlock(&pf->mbox.lock); @@ -2691,11 +2707,14 @@ static int otx2_ndo_set_vf_trust(struct net_device *netdev, int vf, pf->vf_configs[vf].trusted = enable; rc = otx2_set_vf_permissions(pf, vf, OTX2_TRUSTED_VF); - if (rc) + if (rc) { pf->vf_configs[vf].trusted = !enable; - else + } else { netdev_info(pf->netdev, "VF %d is %strusted\n", vf, enable ? "" : "not "); + otx2_set_rx_mode(netdev); + } + return rc; } From patchwork Fri Dec 8 06:56:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hariprasad Kelam X-Patchwork-Id: 175612 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5283609vqy; Thu, 7 Dec 2023 22:56:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPCCU+hSmTeXJHK7O6Pdoibf1X3adf5mLJ/r4Bw1WKHnSxWco+LCFd2GzLT6twxhc5uCis X-Received: by 2002:a05:6830:4d1:b0:6d9:e907:ae3a with SMTP id s17-20020a05683004d100b006d9e907ae3amr655026otd.9.1702018616023; Thu, 07 Dec 2023 22:56:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702018615; cv=none; d=google.com; s=arc-20160816; b=I8ziSPOXZUpVAGzntQH5p4butcAq+pPBd1pfLhTt5mIfsISQ6XLoy88NZNyG0HLDHh U6Nl/Su4UUK5cbXbGLLN/oGjlxlTrxYNtb0mTF4zNQXuyClfyzpS3htfEISHdPfqSHNg Wy5DQX66FhmuAsB+AuSDItJamkq4jXvu5S8bHejHRQoLGESwt/TLJIdKW6qG4go09t2I aAdZhOICnuau1C+3RtAToKQg1hraTw0n+sm8eD/nBwXFCsPyXhuLPCrYRR/lQkSwEvwv bvSXYTC6MV+eKvbZeHFeO4/u1mwkl+9A5mmZuje6mx/QDMS8U51XWHmDLGy/I+bMo2EB Xs5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=j40vAbxbC9C9HLlER4a3cYonqK/INrKGkTJhBdoOE+Q=; fh=+k3MSxe8bGu7+vpCqCHH3WWBYVLMuN2nEavX9/ZyOOI=; b=dXrszn8s2/ONMyiaMuFtVSFVyR/O+XdEiWNEkG+gphBl9fD90I9/a7CdR+wDulnMeF GaTkLq4O6iVMn8QBGLBv9Yl2gjvSYn5XNSYy4DxvI2QVvI1aumoKko/hPEHd7VFxZxZE PHkzpa408pHuGedSN/YAHeqbnOfE10w8Fq4uJr3aGqVn9YLwBeyAJZPPluBoT+WhuDvG QuuqENJ4CehM8QXjrHDHL8s46oysfFSdQ1SI3RQcCd8b+fv5A9Yv5uUCB3OIKwSQy4Qb sdxq/T33iGwlRM7fFpxik8OFgRp4oNOkfKvztb9v619Fa/jFEtK3CGipZc4fE+ohTJyX hUyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="B/ZkAX6N"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id b13-20020a630c0d000000b005c65eb2bc62si1004489pgl.237.2023.12.07.22.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 22:56:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="B/ZkAX6N"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7996B817C8B0; Thu, 7 Dec 2023 22:56:53 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232974AbjLHG4c (ORCPT + 99 others); Fri, 8 Dec 2023 01:56:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233179AbjLHG41 (ORCPT ); Fri, 8 Dec 2023 01:56:27 -0500 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF07172C; Thu, 7 Dec 2023 22:56:32 -0800 (PST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B84BRcg017039; Thu, 7 Dec 2023 22:56:26 -0800 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-type; s=pfpt0220; bh=j40vAbxbC9C9HLlER4a3cYonqK/INrKGkTJhBdoOE+Q=; b=B/ZkAX6NaT1FBRq2iSRiSFR+6/nvq0UJ3NJ3kr3JQbPUTfqQ4OCEsHsb1hCjnTPEZlyO JT9U8RU8MgHuUsEOLTK7rA1fngHrf8BCIB0u4NZbXzM0bzHn49KWFaVMmLSQ089ZDyHC cumJs5wqP8fZV4PDp5ang1/8aqApzMMpkpFlwh6Ll6hPsXTYSSvLRbkDSXaO6kW5Mac3 qT3DgVU8x08/jqSi/Y1TGzV2m0lf/cRp57tjGidBVIG/Zafi1PPHvrElT/ncLX2tMdN/ fZfN5BJyssWDx7cXve8yz3E4B9WMOA3fcZeOK6Jx9dPAPDP7HqJMkcuMzee18lXWb9ns FA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3uu8qecnd6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 07 Dec 2023 22:56:26 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 7 Dec 2023 22:56:25 -0800 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.48 via Frontend Transport; Thu, 7 Dec 2023 22:56:24 -0800 Received: from hyd1soter3.marvell.com (unknown [10.29.37.12]) by maili.marvell.com (Postfix) with ESMTP id EA0CE3F70AA; Thu, 7 Dec 2023 22:56:20 -0800 (PST) From: Hariprasad Kelam To: , CC: , , , , , , , , , , Subject: [net 2/2] octeontx2-af: Update RSS algorithm index Date: Fri, 8 Dec 2023 12:26:10 +0530 Message-ID: <20231208065610.16086-3-hkelam@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231208065610.16086-1-hkelam@marvell.com> References: <20231208065610.16086-1-hkelam@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: vA2OjqBjrypEWDePL_qGrGcxm1Nu1hHX X-Proofpoint-ORIG-GUID: vA2OjqBjrypEWDePL_qGrGcxm1Nu1hHX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-08_02,2023-12-07_01,2023-05-22_02 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 07 Dec 2023 22:56:53 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784695872174934083 X-GMAIL-MSGID: 1784695872174934083 The RSS flow algorithm is not set up correctly for promiscuous or all multi MCAM entries. This has an impact on flow distribution. This patch fixes the issue by updating flow algorithm index in above mentioned MCAM entries. Fixes: 967db3529eca ("octeontx2-af: add support for multicast/promisc packet replication feature") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham --- .../ethernet/marvell/octeontx2/af/rvu_npc.c | 55 +++++++++++++++---- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index f65805860c8d..0bcf3e559280 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c @@ -671,6 +671,7 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc, int blkaddr, ucast_idx, index; struct nix_rx_action action = { 0 }; u64 relaxed_mask; + u8 flow_key_alg; if (!hw->cap.nix_rx_multicast && is_cgx_vf(rvu, pcifunc)) return; @@ -701,6 +702,8 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc, action.op = NIX_RX_ACTIONOP_UCAST; } + flow_key_alg = action.flow_key_alg; + /* RX_ACTION set to MCAST for CGX PF's */ if (hw->cap.nix_rx_multicast && pfvf->use_mce_list && is_pf_cgxmapped(rvu, rvu_get_pf(pcifunc))) { @@ -740,7 +743,7 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc, req.vf = pcifunc; req.index = action.index; req.match_id = action.match_id; - req.flow_key_alg = action.flow_key_alg; + req.flow_key_alg = flow_key_alg; rvu_mbox_handler_npc_install_flow(rvu, &req, &rsp); } @@ -854,6 +857,7 @@ void rvu_npc_install_allmulti_entry(struct rvu *rvu, u16 pcifunc, int nixlf, u8 mac_addr[ETH_ALEN] = { 0 }; struct nix_rx_action action = { 0 }; struct rvu_pfvf *pfvf; + u8 flow_key_alg; u16 vf_func; /* Only CGX PF/VF can add allmulticast entry */ @@ -888,6 +892,7 @@ void rvu_npc_install_allmulti_entry(struct rvu *rvu, u16 pcifunc, int nixlf, *(u64 *)&action = npc_get_mcam_action(rvu, mcam, blkaddr, ucast_idx); + flow_key_alg = action.flow_key_alg; if (action.op != NIX_RX_ACTIONOP_RSS) { *(u64 *)&action = 0; action.op = NIX_RX_ACTIONOP_UCAST; @@ -924,7 +929,7 @@ void rvu_npc_install_allmulti_entry(struct rvu *rvu, u16 pcifunc, int nixlf, req.vf = pcifunc | vf_func; req.index = action.index; req.match_id = action.match_id; - req.flow_key_alg = action.flow_key_alg; + req.flow_key_alg = flow_key_alg; rvu_mbox_handler_npc_install_flow(rvu, &req, &rsp); } @@ -990,11 +995,38 @@ static void npc_update_vf_flow_entry(struct rvu *rvu, struct npc_mcam *mcam, mutex_unlock(&mcam->lock); } +static void npc_update_rx_action_with_alg_idx(struct rvu *rvu, struct nix_rx_action action, + struct rvu_pfvf *pfvf, int mcam_index, int blkaddr, + int alg_idx) + +{ + struct npc_mcam *mcam = &rvu->hw->mcam; + struct rvu_hwinfo *hw = rvu->hw; + int bank, op_rss; + + if (!is_mcam_entry_enabled(rvu, mcam, blkaddr, mcam_index)) + return; + + op_rss = (!hw->cap.nix_rx_multicast || !pfvf->use_mce_list); + + bank = npc_get_bank(mcam, mcam_index); + mcam_index &= (mcam->banksize - 1); + + /* If Rx action is MCAST update only RSS algorithm index */ + if (!op_rss) { + *(u64 *)&action = rvu_read64(rvu, blkaddr, + NPC_AF_MCAMEX_BANKX_ACTION(mcam_index, bank)); + + action.flow_key_alg = alg_idx; + } + rvu_write64(rvu, blkaddr, + NPC_AF_MCAMEX_BANKX_ACTION(mcam_index, bank), *(u64 *)&action); +} + void rvu_npc_update_flowkey_alg_idx(struct rvu *rvu, u16 pcifunc, int nixlf, int group, int alg_idx, int mcam_index) { struct npc_mcam *mcam = &rvu->hw->mcam; - struct rvu_hwinfo *hw = rvu->hw; struct nix_rx_action action; int blkaddr, index, bank; struct rvu_pfvf *pfvf; @@ -1050,15 +1082,16 @@ void rvu_npc_update_flowkey_alg_idx(struct rvu *rvu, u16 pcifunc, int nixlf, /* If PF's promiscuous entry is enabled, * Set RSS action for that entry as well */ - if ((!hw->cap.nix_rx_multicast || !pfvf->use_mce_list) && - is_mcam_entry_enabled(rvu, mcam, blkaddr, index)) { - bank = npc_get_bank(mcam, index); - index &= (mcam->banksize - 1); + npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index, blkaddr, + alg_idx); - rvu_write64(rvu, blkaddr, - NPC_AF_MCAMEX_BANKX_ACTION(index, bank), - *(u64 *)&action); - } + index = npc_get_nixlf_mcam_index(mcam, pcifunc, + nixlf, NIXLF_ALLMULTI_ENTRY); + /* If PF's allmulti entry is enabled, + * Set RSS action for that entry as well + */ + npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index, blkaddr, + alg_idx); } void npc_enadis_default_mce_entry(struct rvu *rvu, u16 pcifunc,