From patchwork Fri Jul 30 16:10:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harman Kalra X-Patchwork-Id: 96473 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3C7E3A0C40; Fri, 30 Jul 2021 18:10:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2943A40042; Fri, 30 Jul 2021 18:10:18 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 685D240040 for ; Fri, 30 Jul 2021 18:10:16 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16UGAFkW008879 for ; Fri, 30 Jul 2021 09:10:15 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0220; bh=eUjcYyc8kdXee84XnhhtoUYmBvUp6WkKfKZsCed7epY=; b=V8uDKlpJN9NXV2P+CKjaX/jKmk4T52IBhZ9MnVvfK6MXGZHWPsZC0dzKiHdlurYuqv55 ZcFXdCzHhJfFTqVtZgVhTL03KVwpBt5+qDf8X64R9tb6cIZKh+jlL/xpnfYd3rf6sZYy DOlWY4Eo0STm8c+uq9pjVwoPHqC8jb/vOFZwnBeHeaMoPK6F4KT8Gm5IFtfDzgVa/4r6 yfoU/14ETBJ2RgcTbkrykV2JTe3vpmRTTS8yzHkTEiEhZh/6hfIvRzkBUm4sp2M/F3Uf i2CdLdcjrCbtRWsIMZdE9SE71x/WnEIRY3EPS3WiLZQcBqseA4BAFli8HDcD/h+1Gie3 Yw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3a4866ts40-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 30 Jul 2021 09:10:15 -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.18; Fri, 30 Jul 2021 09:10:14 -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.18 via Frontend Transport; Fri, 30 Jul 2021 09:10:14 -0700 Received: from localhost.localdomain (unknown [10.29.52.211]) by maili.marvell.com (Postfix) with ESMTP id C6B233F7092; Fri, 30 Jul 2021 09:10:11 -0700 (PDT) From: Harman Kalra To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Harman Kalra Date: Fri, 30 Jul 2021 21:40:07 +0530 Message-ID: <20210730161009.14383-1-hkalra@marvell.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Proofpoint-GUID: gWdokGk3A9qpvYFY3jgfhNljXw5BBEbk X-Proofpoint-ORIG-GUID: gWdokGk3A9qpvYFY3jgfhNljXw5BBEbk X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-30_11:2021-07-30, 2021-07-30 signatures=0 Subject: [dpdk-dev] [PATCH 1/2] common/cnxk: setup nix and lbk in loop mode in 98xx X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In case of 98xx, 2 NIX blocks and 4 LBK blocks are present. Moreover AF VFs are alternatively attached to NIX0 and NIX1 to ensure load balancing. To support loopback functionality between pairs NIX0/NIX1 are attached to LBK1/LBK2 for transmission/reception respectively. But in this default configuration NIX blocks cannot receive the packets they sent from the same LBK, which is an important requirement as some ODP applications only uses one AF VF for loopback functionality. To support this scenario, NIX0 can use LBK0 (NIX1 - LBK3) by setting a loop flag while making LF alloc mailbox request. Signed-off-by: Harman Kalra --- drivers/common/cnxk/roc_mbox.h | 1 + drivers/common/cnxk/roc_nix.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/common/cnxk/roc_mbox.h b/drivers/common/cnxk/roc_mbox.h index b5da931b81..75d1ff1ef3 100644 --- a/drivers/common/cnxk/roc_mbox.h +++ b/drivers/common/cnxk/roc_mbox.h @@ -723,6 +723,7 @@ struct nix_lf_alloc_req { uint64_t __io rx_cfg; /* See NIX_AF_LF(0..127)_RX_CFG */ uint64_t __io way_mask; #define NIX_LF_RSS_TAG_LSB_AS_ADDER BIT_ULL(0) +#define NIX_LF_LBK_BLK_SEL BIT_ULL(1) uint64_t flags; }; diff --git a/drivers/common/cnxk/roc_nix.c b/drivers/common/cnxk/roc_nix.c index 23d508b941..1621f77fb0 100644 --- a/drivers/common/cnxk/roc_nix.c +++ b/drivers/common/cnxk/roc_nix.c @@ -145,9 +145,12 @@ roc_nix_lf_alloc(struct roc_nix *roc_nix, uint32_t nb_rxq, uint32_t nb_txq, req->npa_func = idev_npa_pffunc_get(); req->sso_func = idev_sso_pffunc_get(); req->rx_cfg = rx_cfg; + if (roc_nix_is_lbk(roc_nix) && roc_nix->enable_loop && + roc_model_is_cn98xx()) + req->flags = NIX_LF_LBK_BLK_SEL; if (!roc_nix->rss_tag_as_xor) - req->flags = NIX_LF_RSS_TAG_LSB_AS_ADDER; + req->flags |= NIX_LF_RSS_TAG_LSB_AS_ADDER; rc = mbox_process_msg(mbox, (void *)&rsp); if (rc)