From patchwork Tue Aug 17 04:44:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Subbaraya Sundeep X-Patchwork-Id: 12440491 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2D2EC4338F for ; Tue, 17 Aug 2021 04:45:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ABD4660F5C for ; Tue, 17 Aug 2021 04:45:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238089AbhHQEqU (ORCPT ); Tue, 17 Aug 2021 00:46:20 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:50502 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237753AbhHQEqE (ORCPT ); Tue, 17 Aug 2021 00:46:04 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 17H2lpri006897; Mon, 16 Aug 2021 21:45:31 -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-type; s=pfpt0220; bh=8OqO2N5MJl3DjxRITkvRf5Rlh6jbiNg9ftdV8SCEeDA=; b=Eu7jHHUCZoHQdIe4QnwWleU6v7t4NwMNlGdraRyAveOqkb+vHaigss36UqYrQTdDIuaH 0/VzZIFnaS7oCtzre6F8wda+sk0gZhDyur+yxlIzfc7AG3Q8m1nClMnKzqm+4LhM+mcD G5eprc+wd4a9u7uwnroXpDBIQOg0ALyNyLAb4U/5IufVmF47AW5J7mqlxBQl+6LXaffW J9QqTbnRa/nTXPlv3eYuIDzcZAm0tlJlJTd52dkN1yl9P35w5LkAJ34i7kpOUL9IecTz lh2QxXng4kfLPwLS10n0oi1Dsz51sTTviK+QpX8FD9brvZVb3+xOu+Gs6pJSqyr9Qf6l 6Q== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3ag4n0ra5p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 16 Aug 2021 21:45:30 -0700 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.18; Mon, 16 Aug 2021 21:45:29 -0700 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.18 via Frontend Transport; Mon, 16 Aug 2021 21:45:29 -0700 Received: from hyd1358.marvell.com (unknown [10.29.37.11]) by maili.marvell.com (Postfix) with ESMTP id 36E613F70AD; Mon, 16 Aug 2021 21:45:26 -0700 (PDT) From: Subbaraya Sundeep To: , , CC: , , , Vidya , Subbaraya Sundeep Subject: [net-next PATCH 11/11] octeontx2-af: configure npc for cn10k to allow packets from cpt Date: Tue, 17 Aug 2021 10:14:53 +0530 Message-ID: <1629175493-4895-12-git-send-email-sbhatta@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1629175493-4895-1-git-send-email-sbhatta@marvell.com> References: <1629175493-4895-1-git-send-email-sbhatta@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: 8cAM3xHwSLQK8PzxXd2R7BHDj_eRiIMO X-Proofpoint-ORIG-GUID: 8cAM3xHwSLQK8PzxXd2R7BHDj_eRiIMO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-08-17_01,2021-08-16_02,2020-04-07_01 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vidya On CN10K, the higher bits in the channel number represents the CPT channel number. Mask out these higher bits in the npc configuration to allow packets from cpt for parsing. Signed-off-by: Vidya Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep --- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index 504dfa5..6f23100 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c @@ -724,7 +724,17 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc, action.index = pfvf->promisc_mce_idx; } - req.chan_mask = 0xFFFU; + /* For cn10k the upper two bits of the channel number are + * cpt channel number. with masking out these bits in the + * mcam entry, same entry used for NIX will allow packets + * received from cpt for parsing. + */ + if (!is_rvu_otx2(rvu)) { + req.chan_mask = NIX_CHAN_CPT_X2P_MASK; + } else { + req.chan_mask = 0xFFFU; + } + if (chan_cnt > 1) { if (!is_power_of_2(chan_cnt)) { dev_err(rvu->dev,