From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3CBD0A04BA; Wed, 7 Oct 2020 19:34:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 23E6E1B96B; Wed, 7 Oct 2020 19:34:15 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 6FFAC1B6F6 for ; Wed, 7 Oct 2020 18:43:55 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 097GfFfX027729 for ; Wed, 7 Oct 2020 09:43:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0220; bh=CHTCq/p9xF4ec70IYLkBXhqZfDqZsYQjcIOFfFRobo0=; b=bvqbF7RewrpG+5zko2eVfmSLRQcz8sC43Q2dTfaL7EgjqjVIgnm0IVW+DPNGRk5KpkXN n5+6gaHu+w5L9rrCsQxgaQ1HBUbdLqaKPtMOfzy/AgbrbNGCqs93t6Cujzz2Bu0ssOzs Esfml6zBkdgyE6Fv0OptzN7SbuZfPySXDo96zf6gzkxHVii4zCdyftb87qW4e/kJBTBp I5CHvhObP0JzqZsctP8qlIqFB1QCFDqAW/QxMXtPR9t7Rubf391CIwzNfANqTsQDTeu+ ES/brhAgFQwp4BgMvQuAtytBqNuq6o4OlWedgOSKnaeEHm1uFx8puzg3uWVAk3uqEUjx vg== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 33xpnpwm8p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 07 Oct 2020 09:43:53 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 7 Oct 2020 09:43:52 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 7 Oct 2020 09:43:52 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.172) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 7 Oct 2020 09:43:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ESklSPhUkrK9bodFVF0SF/OU9KnxcXE8s68j7BWePPrIX6RJN/93D5tSs7NtFnuhShnhGnG4OkZp/alsQTzqMevmad3V4M6EsT8g38CfrtkXLwuuyUsiqnU7OHcNco1lbz5mEB9RB9EVNkm/V5sedSdq6rq2y+9FcFvYaZRFEQPMpZ3uIRyllL/egdprzoNTUtteiqN8aLJ9WLRrabQ6eo/vgA6ugNOe8B3Z9pmJ1pT7T6oESMsMCqKsfbEU9nLc6csMK8Ac0l4F3l6CREtwCkBFJx7J24hEViqpvL6vMbnpggAF33om1Q4JbeLqU0hiwPm3YAi2wk26D2A0FTt1Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CHTCq/p9xF4ec70IYLkBXhqZfDqZsYQjcIOFfFRobo0=; b=gGZ2U6qRSfgPMTKDWntWISMvL8vFj8EncZYbu0GBabeQ6LcBaoCMWf3bE2SkbznrxmlK6/cjH7yyid98w48sroy3/DuRplt+D5+48Hk6ZEMTQg+9dqAgFpA8WwxYMW5coycYyROBDTEwLnhLUyaC+kk5HLQWxefMP9tkvktOSpLNwlHgFgQRzrMDWNwpjgQngmaGA4A5exEJeVO801v+7rasVtAzVVnCdpfp3jo40CIl8hfH/gTFAmfu42vLcgFkFuSKt1kRHjh5KOz4u34CR7MxlrzyQWZa7ZJ5la9X7LImxqMntJQBVSOwEsGtPNJS5wkmvOt/yzrZ9EpuWMKY1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CHTCq/p9xF4ec70IYLkBXhqZfDqZsYQjcIOFfFRobo0=; b=ugR3yrUXSaa1tjDfQzrZqQklwPD2D/wo7WqkgPfqYGtklT4NKv1RdB/nzaUthjYRv9KPujzPHMypR2ssYP7IIBQUNkZlC8kulUB17WgNGlgpQ41NiI8eixJG2nNfm4w+eXHOeKLnT31chCmAKT0hPo7xE5inyL6DysXx8pv7DxQ= Received: from BYAPR18MB2918.namprd18.prod.outlook.com (2603:10b6:a03:109::32) by BY5PR18MB3156.namprd18.prod.outlook.com (2603:10b6:a03:1ae::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.23; Wed, 7 Oct 2020 16:43:50 +0000 Received: from BYAPR18MB2918.namprd18.prod.outlook.com ([fe80::4407:9a77:794d:32b3]) by BYAPR18MB2918.namprd18.prod.outlook.com ([fe80::4407:9a77:794d:32b3%7]) with mapi id 15.20.3433.045; Wed, 7 Oct 2020 16:43:50 +0000 From: Satha Koteswara Rao Kottidi To: Radha Chintakuntla , "dev@dpdk.org" CC: Jerin Jacob Kollanukkaran , Radha Chintakuntla , Satananda Burla Thread-Topic: [PATCH RESEND 2/2] raw/octeontx2_dma: Add support in case of multiple DPI blocks Thread-Index: AQHWm6HMaXaVDMCD10md4lUqspDZiamMWrCw Date: Wed, 7 Oct 2020 16:43:50 +0000 Message-ID: References: <20201006053021.134706-1-radhac@marvell.com> <20201006053021.134706-2-radhac@marvell.com> In-Reply-To: <20201006053021.134706-2-radhac@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [103.252.27.5] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b0f61ac1-dbb6-4fff-955e-08d86ae02b77 x-ms-traffictypediagnostic: BY5PR18MB3156: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:170; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qI1u3zUan+G/IMJnOOslpE8UTYw0fbyf1+7zM8LyYnRrDF/W80McrYd5SxAwwzseEduyb7Qm6HXQfKKoQdE2jNzxklMAXIDdOxmDgy2wqejP8LT0iuqokGCn/FxtFR3FhQ4K80b6/XgloZ0SV93LTQ7AkOftVrQQNJ+OpMHob6ijSfweXjOet6GaGd6SrjLBgQNMn7IJYtDkrJ4eWqoqcSUNYqnbf/vyJlb/BQXPyrH06ax6tua8d1uOQJHm1dZ2v5cUimFJOIGZXkj+ygzXbLRZhP2mYTZ/pFQF3rKSA59k723taY3oMUl/Lcr3/QsQ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR18MB2918.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(376002)(366004)(396003)(136003)(39850400004)(9686003)(52536014)(54906003)(8676002)(5660300002)(8936002)(316002)(110136005)(107886003)(66556008)(64756008)(66476007)(76116006)(66446008)(66946007)(71200400001)(26005)(86362001)(55016002)(478600001)(33656002)(83380400001)(7696005)(6506007)(53546011)(4326008)(186003)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: h8DKWDZKnjt4Hlm9JwZp4o4ZRs5FbWRRSwkVwLgpd+jCveyPbw5d+UTRwbVlm1WPFclO7G8bk0r1VTUz/0y+oUtrR9VkJbrEafYNEZxSJL8JxuH0Y+ctIaNiqgAo7Twoi6vJpSpGQq4ej1q7nTcwky68UxXy1n7RReh8TkVUmWIQxuBVrk/06UWTOodivbTa0uXU6p8ReaCF7ycKCoeNI6BPtcTChXoEK96d+x3UBMQ9fRPhryvYhwMS7GVqvOiY53rhnI0p43gcj9L6qBOLuIBHC+ijI3VA1ddKgQR+t9DpifVQfKpK4qRcl2qwgPJ1pxA84j8gCeeYJ2va188kz3O0RinkDXRsRp/mAQZ3Bx9M00n1EF1K2CE8YNp9Qit8a397FTqgksV8clKL0h5PoQ/dLZ4TNXmOAAJeZLrcySTROcBCAv3b0xm/D2wFBQfMIQPHRPwyEJuit+SlUDLLT4dq92NlNhKigeTFxINIw3kk6i6AKY7wXOUGm+6OWtiw6T4DIhFi8URoD49KIc+UMZyEtxzcREmN7e3riSz0AxvIGdxmvzCUz15L787TqoJirJDQlF1deY2tXTnegdxxdtMt9UGzTiRN97ow2wPUrxo/zm/MwITF1d2NlOryeOPtTj0CwgBY9UGqQQflOckxtg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR18MB2918.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0f61ac1-dbb6-4fff-955e-08d86ae02b77 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2020 16:43:50.4862 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eS87NqOuraybtZlBpaFDpVO/ZLFfLEFyEvE1nnGaFNiH+ODgW3HNRmXJ//D+e/tdcdPCYB9zB/B+3B4d22AU/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR18MB3156 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-07_10:2020-10-07, 2020-10-07 signatures=0 X-Mailman-Approved-At: Wed, 07 Oct 2020 19:34:14 +0200 Subject: Re: [dpdk-dev] [PATCH RESEND 2/2] raw/octeontx2_dma: Add support in case of multiple DPI blocks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" -----Original Message----- From: Radha Mohan Chintakuntla =20 Sent: Tuesday, October 6, 2020 11:00 AM To: dev@dpdk.org; Satha Koteswara Rao Kottidi Cc: Jerin Jacob Kollanukkaran ; Radha Chintakuntla ; Satananda Burla Subject: [PATCH RESEND 2/2] raw/octeontx2_dma: Add support in case of multi= ple DPI blocks This patch adds support for multiple DPI blocks by removing the fixed macro= that was writing to same sysfs entry for different DPI blocks. Signed-off-by: Radha Mohan Chintakuntla Reviewed-by: Satananda Burla --- drivers/raw/octeontx2_dma/otx2_dpi_msg.c | 18 +++++++++--------- drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c | 4 ++-- drivers/raw/octeont= x2_dma/otx2_dpi_rawdev.h | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/raw/octeontx2_dma/otx2_dpi_msg.c b/drivers/raw/octeont= x2_dma/otx2_dpi_msg.c index aa361cb8a..655de216a 100644 --- a/drivers/raw/octeontx2_dma/otx2_dpi_msg.c +++ b/drivers/raw/octeontx2_dma/otx2_dpi_msg.c @@ -39,14 +39,14 @@ union dpi_mbox_message_u { }; =20 static inline int -send_msg_to_pf(const char *value, int size) +send_msg_to_pf(struct rte_pci_addr *pci, const char *value, int size) { char buff[255] =3D { 0 }; int res, fd; =20 res =3D snprintf(buff, sizeof(buff), "%s/" PCI_PRI_FMT "/%s", - rte_pci_get_sysfs_path(), DPI_PF_DBDF_DOMAIN, - DPI_PF_DBDF_BUS, DPI_PF_DBDF_DEVICE & 0x7, + rte_pci_get_sysfs_path(), pci->domain, + pci->bus, DPI_PF_DBDF_DEVICE & 0x7, DPI_PF_DBDF_FUNCTION & 0x7, DPI_PF_MBOX_SYSFS_ENTRY); if ((res < 0) || ((size_t)res > sizeof(buff))) return -ERANGE; @@ -63,20 +63,20 @@ send_msg_to_pf(const char *value, int size) } =20 int -otx2_dpi_queue_open(uint16_t vf_id, uint32_t size, uint32_t gaura) +otx2_dpi_queue_open(struct dpi_vf_s *dpivf, uint32_t size, uint32_t=20 +gaura) { union dpi_mbox_message_u mbox_msg; int ret =3D 0; =20 /* DPI PF driver expects vfid starts from index 0 */ - mbox_msg.s.vfid =3D vf_id; + mbox_msg.s.vfid =3D dpivf->vf_id; mbox_msg.s.cmd =3D DPI_QUEUE_OPEN; mbox_msg.s.csize =3D size; mbox_msg.s.aura =3D gaura; mbox_msg.s.sso_pf_func =3D otx2_sso_pf_func_get(); mbox_msg.s.npa_pf_func =3D otx2_npa_pf_func_get(); =20 - ret =3D send_msg_to_pf((const char *)&mbox_msg, + ret =3D send_msg_to_pf(&dpivf->dev->addr, (const char *)&mbox_msg, sizeof(mbox_msg)); if (ret < 0) otx2_dpi_dbg("Failed to send mbox message to dpi pf"); @@ -85,16 +85,16 = @@ otx2_dpi_queue_open(uint16_t vf_id, uint32_t size, uint32_t gaura) } =20 int -otx2_dpi_queue_close(uint16_t vf_id) +otx2_dpi_queue_close(struct dpi_vf_s *dpivf) { union dpi_mbox_message_u mbox_msg; int ret =3D 0; =20 /* DPI PF driver expects vfid starts from index 0 */ - mbox_msg.s.vfid =3D vf_id; + mbox_msg.s.vfid =3D dpivf->vf_id; mbox_msg.s.cmd =3D DPI_QUEUE_CLOSE; =20 - ret =3D send_msg_to_pf((const char *)&mbox_msg, + ret =3D send_msg_to_pf(&dpivf->dev->addr, (const char *)&mbox_msg, sizeof(mbox_msg)); if (ret < 0) otx2_dpi_dbg("Failed to send mbox message to dpi pf"); diff --git a/driv= ers/raw/octeontx2_dma/otx2_dpi_rawdev.c b/drivers/raw/octeontx2_dma/otx2_dp= i_rawdev.c index a1b94ce1d..efdba2779 100644 --- a/drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c +++ b/drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c @@ -60,7 +60,7 @@ dma_queue_finish(struct dpi_vf_s *dpivf) reg =3D otx2_read64(dpivf->vf_bar0 + DPI_VDMA_SADDR); } =20 - if (otx2_dpi_queue_close(dpivf->vf_id) < 0) + if (otx2_dpi_queue_close(dpivf) < 0) return -EACCES; =20 rte_mempool_put(dpivf->chunk_pool, dpivf->base_ptr); @@ -323,7 +323,7 @@ = otx2_dpi_rawdev_configure(const struct rte_rawdev *dev, rte_rawdev_obj_t co= nfig, otx2_write64(0, dpivf->vf_bar0 + DPI_VDMA_REQQ_CTL); otx2_write64(((uint64_t)buf >> 7) << 7, dpivf->vf_bar0 + DPI_VDMA_SADDR); - if (otx2_dpi_queue_open(dpivf->vf_id, DPI_CHUNK_SIZE, gaura) < 0) { + if (otx2_dpi_queue_open(dpivf, DPI_CHUNK_SIZE, gaura) < 0) { otx2_err("Unable to open DPI VF %d", dpivf->vf_id); rte_mempool_put(conf->chunk_pool, buf); return -EACCES; diff --git a/drivers/raw/octeontx2_dma/otx2_dpi_rawdev.h b/drivers/raw/octe= ontx2_dma/otx2_dpi_rawdev.h index 81740e84b..2bc9e3da3 100644 --- a/drivers/raw/octeontx2_dma/otx2_dpi_rawdev.h +++ b/drivers/raw/octeontx2_dma/otx2_dpi_rawdev.h @@ -190,8 +190,8 @@ union dpi_dma_instr_hdr_u { } s; }; =20 -int otx2_dpi_queue_open(uint16_t vf_id, uint32_t size, uint32_t gaura); -i= nt otx2_dpi_queue_close(uint16_t vf_id); +int otx2_dpi_queue_open(struct dpi_vf_s *dpivf, uint32_t size, uint32_t=20 +gaura); int otx2_dpi_queue_close(struct dpi_vf_s *dpivf); int test_otx2_dma_rawdev(uint16_t val); =20 #endif /* _DPI_RAWDEV_H_ */ -- 2.24.1 Acked-by: Satha Rao