From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30048.outbound.protection.outlook.com [40.107.3.48]) by dpdk.org (Postfix) with ESMTP id 8D0E22C24 for ; Mon, 8 Apr 2019 13:22:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ybZ61S27Q6kkgR0IkUGCVyPKuPN/TOiO6hj66IWrWPQ=; b=INj/H+GNqpzYgUDBidEkXHWyqh4G1UmdR9xSJS8pkRqbOzo98BpGxS/SuKGfQcWjBO5uDphpUkGzbTrT9cRhqgAX1yUjQXUINi9sM2LzMV2TqdP2cGeZpSMjQqxRvWtWOs3GcNHLqlaU85UDAjCcFho82XK8KVA6Al9feiFBy6k= Received: from VE1PR04MB6365.eurprd04.prod.outlook.com (10.255.118.78) by VE1PR04MB6606.eurprd04.prod.outlook.com (20.179.235.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.13; Mon, 8 Apr 2019 11:22:30 +0000 Received: from VE1PR04MB6365.eurprd04.prod.outlook.com ([fe80::f5ad:f178:4c55:13e0]) by VE1PR04MB6365.eurprd04.prod.outlook.com ([fe80::f5ad:f178:4c55:13e0%3]) with mapi id 15.20.1771.016; Mon, 8 Apr 2019 11:22:30 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , "ferruh.yigit@intel.com" CC: Gagandeep Singh Thread-Topic: [PATCH 01/13] net/enetc: support physical addressing mode Thread-Index: AQHU7f1akMNK1l7MG0KptGTjV/DZiQ== Date: Mon, 8 Apr 2019 11:22:30 +0000 Message-ID: <1554745507-15089-2-git-send-email-g.singh@nxp.com> References: <1554745507-15089-1-git-send-email-g.singh@nxp.com> In-Reply-To: <1554745507-15089-1-git-send-email-g.singh@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0003.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::13) To VE1PR04MB6365.eurprd04.prod.outlook.com (2603:10a6:803:12a::14) x-mailer: git-send-email 1.9.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.120.1.67] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3ddbb8b2-6af6-4fc5-b7b4-08d6bc147cd0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:VE1PR04MB6606; x-ms-traffictypediagnostic: VE1PR04MB6606: x-microsoft-antispam-prvs: x-forefront-prvs: 0001227049 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(39860400002)(396003)(136003)(199004)(189003)(76176011)(97736004)(81156014)(71200400001)(71190400001)(72206003)(3846002)(25786009)(81166006)(53936002)(2616005)(5660300002)(6116002)(8676002)(7736002)(446003)(478600001)(8936002)(11346002)(305945005)(2906002)(256004)(66066001)(6512007)(476003)(6436002)(486006)(50226002)(2501003)(99286004)(106356001)(86362001)(110136005)(4326008)(6486002)(68736007)(105586002)(6506007)(52116002)(316002)(26005)(386003)(14454004)(186003)(36756003)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6606; H:VE1PR04MB6365.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: BukpIo3IrzvhXlSbOr55FSEjzYBN+zZUsuRUX2M8eaegxDilmtawS3HgC6sLOS1ZPlaPVL3yCNxJ+Cc+AisshHhHXaeV4gGey4yki/AuQUKRhJ8ykVlGZINRs+Ln05ga2l+I+Jck4C7BX/1m1YB3N0YA7AE0jASjXgCFEY5nZWRmMwNyVi4GSGbf0PrWk1789GfjvYX3+o+fosyupfW3DyKhmeGSJzBbQjGD3cp0sc0n5lAZN4myNfYWs+PqAUsN4vDpWpG93FlfIm03/MMJdGKSeHhMBbarsLKt8NODpkl7S+RQMeO+NHlthw6RJtrTEFep9J7dLBAAE0Fs0Zzm25mf70HejAIUQ2+ibfUOIBQNx6TJYuEE2xSa9bFxPl5iHgsU6ORaTW2h87Gvpq2kwn8v0MlTZ/Ti9EQuDWfAfsc= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ddbb8b2-6af6-4fc5-b7b4-08d6bc147cd0 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Apr 2019 11:22:30.4518 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6606 Subject: [dpdk-dev] [PATCH 01/13] net/enetc: support physical addressing mode 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: , X-List-Received-Date: Mon, 08 Apr 2019 11:22:31 -0000 Support added for physical addressing mode and change driver flags to don't care. Signed-off-by: Gagandeep Singh --- drivers/net/enetc/enetc_ethdev.c | 22 ++++++++++++---------- drivers/net/enetc/enetc_rxtx.c | 6 +++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_eth= dev.c index 023fe75..7a9a97d 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ =20 #include @@ -334,14 +334,15 @@ static int enetc_tx_queue_setup(struct rte_eth_dev *d= ev, uint16_t tx_queue_id, enetc_setup_txbdr(struct enetc_hw *hw, struct enetc_bdr *tx_ring) { int idx =3D tx_ring->index; - uintptr_t base_addr; uint32_t tbmr; + phys_addr_t bd_address; =20 - base_addr =3D (uintptr_t)tx_ring->bd_base; + bd_address =3D (phys_addr_t) + rte_mem_virt2iova((const void *)tx_ring->bd_base); enetc_txbdr_wr(hw, idx, ENETC_TBBAR0, - lower_32_bits((uint64_t)base_addr)); + lower_32_bits((uint64_t)bd_address)); enetc_txbdr_wr(hw, idx, ENETC_TBBAR1, - upper_32_bits((uint64_t)base_addr)); + upper_32_bits((uint64_t)bd_address)); enetc_txbdr_wr(hw, idx, ENETC_TBLENR, ENETC_RTBLENR_LEN(tx_ring->bd_count)); =20 @@ -478,14 +479,15 @@ static int enetc_tx_queue_setup(struct rte_eth_dev *d= ev, uint16_t tx_queue_id, struct rte_mempool *mb_pool) { int idx =3D rx_ring->index; - uintptr_t base_addr; uint16_t buf_size; + phys_addr_t bd_address; =20 - base_addr =3D (uintptr_t)rx_ring->bd_base; + bd_address =3D (phys_addr_t) + rte_mem_virt2iova((const void *)rx_ring->bd_base); enetc_rxbdr_wr(hw, idx, ENETC_RBBAR0, - lower_32_bits((uint64_t)base_addr)); + lower_32_bits((uint64_t)bd_address)); enetc_rxbdr_wr(hw, idx, ENETC_RBBAR1, - upper_32_bits((uint64_t)base_addr)); + upper_32_bits((uint64_t)bd_address)); enetc_rxbdr_wr(hw, idx, ENETC_RBLENR, ENETC_RTBLENR_LEN(rx_ring->bd_count)); =20 @@ -612,7 +614,7 @@ static int enetc_tx_queue_setup(struct rte_eth_dev *dev= , uint16_t tx_queue_id, =20 static struct rte_pci_driver rte_enetc_pmd =3D { .id_table =3D pci_id_enetc_map, - .drv_flags =3D RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_IOVA_AS_VA, + .drv_flags =3D RTE_PCI_DRV_NEED_MAPPING, .probe =3D enetc_pci_probe, .remove =3D enetc_pci_remove, }; diff --git a/drivers/net/enetc/enetc_rxtx.c b/drivers/net/enetc/enetc_rxtx.= c index 631e243..a31a387 100644 --- a/drivers/net/enetc/enetc_rxtx.c +++ b/drivers/net/enetc/enetc_rxtx.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ =20 #include @@ -64,7 +64,7 @@ txbd->buf_len =3D txbd->frm_len; txbd->flags =3D rte_cpu_to_le_16(ENETC_TXBD_FLAGS_F); txbd->addr =3D (uint64_t)(uintptr_t) - rte_cpu_to_le_64((size_t)tx_swbd->buffer_addr->buf_addr + + rte_cpu_to_le_64((size_t)tx_swbd->buffer_addr->buf_iova + tx_swbd->buffer_addr->data_off); i++; start++; @@ -91,7 +91,7 @@ rx_swbd->buffer_addr =3D rte_cpu_to_le_64(rte_mbuf_raw_alloc(rx_ring->mb_pool)); rxbd->w.addr =3D (uint64_t)(uintptr_t) - rx_swbd->buffer_addr->buf_addr + + rx_swbd->buffer_addr->buf_iova + rx_swbd->buffer_addr->data_off; /* clear 'R" as well */ rxbd->r.lstatus =3D 0; --=20 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 0BABAA0096 for ; Mon, 8 Apr 2019 13:22:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9212A4CA6; Mon, 8 Apr 2019 13:22:36 +0200 (CEST) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30048.outbound.protection.outlook.com [40.107.3.48]) by dpdk.org (Postfix) with ESMTP id 8D0E22C24 for ; Mon, 8 Apr 2019 13:22:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ybZ61S27Q6kkgR0IkUGCVyPKuPN/TOiO6hj66IWrWPQ=; b=INj/H+GNqpzYgUDBidEkXHWyqh4G1UmdR9xSJS8pkRqbOzo98BpGxS/SuKGfQcWjBO5uDphpUkGzbTrT9cRhqgAX1yUjQXUINi9sM2LzMV2TqdP2cGeZpSMjQqxRvWtWOs3GcNHLqlaU85UDAjCcFho82XK8KVA6Al9feiFBy6k= Received: from VE1PR04MB6365.eurprd04.prod.outlook.com (10.255.118.78) by VE1PR04MB6606.eurprd04.prod.outlook.com (20.179.235.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.13; Mon, 8 Apr 2019 11:22:30 +0000 Received: from VE1PR04MB6365.eurprd04.prod.outlook.com ([fe80::f5ad:f178:4c55:13e0]) by VE1PR04MB6365.eurprd04.prod.outlook.com ([fe80::f5ad:f178:4c55:13e0%3]) with mapi id 15.20.1771.016; Mon, 8 Apr 2019 11:22:30 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , "ferruh.yigit@intel.com" CC: Gagandeep Singh Thread-Topic: [PATCH 01/13] net/enetc: support physical addressing mode Thread-Index: AQHU7f1akMNK1l7MG0KptGTjV/DZiQ== Date: Mon, 8 Apr 2019 11:22:30 +0000 Message-ID: <1554745507-15089-2-git-send-email-g.singh@nxp.com> References: <1554745507-15089-1-git-send-email-g.singh@nxp.com> In-Reply-To: <1554745507-15089-1-git-send-email-g.singh@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0003.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::13) To VE1PR04MB6365.eurprd04.prod.outlook.com (2603:10a6:803:12a::14) x-mailer: git-send-email 1.9.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.120.1.67] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3ddbb8b2-6af6-4fc5-b7b4-08d6bc147cd0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:VE1PR04MB6606; x-ms-traffictypediagnostic: VE1PR04MB6606: x-microsoft-antispam-prvs: x-forefront-prvs: 0001227049 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(39860400002)(396003)(136003)(199004)(189003)(76176011)(97736004)(81156014)(71200400001)(71190400001)(72206003)(3846002)(25786009)(81166006)(53936002)(2616005)(5660300002)(6116002)(8676002)(7736002)(446003)(478600001)(8936002)(11346002)(305945005)(2906002)(256004)(66066001)(6512007)(476003)(6436002)(486006)(50226002)(2501003)(99286004)(106356001)(86362001)(110136005)(4326008)(6486002)(68736007)(105586002)(6506007)(52116002)(316002)(26005)(386003)(14454004)(186003)(36756003)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6606; H:VE1PR04MB6365.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: BukpIo3IrzvhXlSbOr55FSEjzYBN+zZUsuRUX2M8eaegxDilmtawS3HgC6sLOS1ZPlaPVL3yCNxJ+Cc+AisshHhHXaeV4gGey4yki/AuQUKRhJ8ykVlGZINRs+Ln05ga2l+I+Jck4C7BX/1m1YB3N0YA7AE0jASjXgCFEY5nZWRmMwNyVi4GSGbf0PrWk1789GfjvYX3+o+fosyupfW3DyKhmeGSJzBbQjGD3cp0sc0n5lAZN4myNfYWs+PqAUsN4vDpWpG93FlfIm03/MMJdGKSeHhMBbarsLKt8NODpkl7S+RQMeO+NHlthw6RJtrTEFep9J7dLBAAE0Fs0Zzm25mf70HejAIUQ2+ibfUOIBQNx6TJYuEE2xSa9bFxPl5iHgsU6ORaTW2h87Gvpq2kwn8v0MlTZ/Ti9EQuDWfAfsc= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ddbb8b2-6af6-4fc5-b7b4-08d6bc147cd0 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Apr 2019 11:22:30.4518 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6606 Subject: [dpdk-dev] [PATCH 01/13] net/enetc: support physical addressing mode 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" Message-ID: <20190408112230.nJ4S1FwelyLotTB-JZlGRtXw25hvMyYk6e6f9tBGG7s@z> Support added for physical addressing mode and change driver flags to don't care. Signed-off-by: Gagandeep Singh --- drivers/net/enetc/enetc_ethdev.c | 22 ++++++++++++---------- drivers/net/enetc/enetc_rxtx.c | 6 +++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_eth= dev.c index 023fe75..7a9a97d 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ =20 #include @@ -334,14 +334,15 @@ static int enetc_tx_queue_setup(struct rte_eth_dev *d= ev, uint16_t tx_queue_id, enetc_setup_txbdr(struct enetc_hw *hw, struct enetc_bdr *tx_ring) { int idx =3D tx_ring->index; - uintptr_t base_addr; uint32_t tbmr; + phys_addr_t bd_address; =20 - base_addr =3D (uintptr_t)tx_ring->bd_base; + bd_address =3D (phys_addr_t) + rte_mem_virt2iova((const void *)tx_ring->bd_base); enetc_txbdr_wr(hw, idx, ENETC_TBBAR0, - lower_32_bits((uint64_t)base_addr)); + lower_32_bits((uint64_t)bd_address)); enetc_txbdr_wr(hw, idx, ENETC_TBBAR1, - upper_32_bits((uint64_t)base_addr)); + upper_32_bits((uint64_t)bd_address)); enetc_txbdr_wr(hw, idx, ENETC_TBLENR, ENETC_RTBLENR_LEN(tx_ring->bd_count)); =20 @@ -478,14 +479,15 @@ static int enetc_tx_queue_setup(struct rte_eth_dev *d= ev, uint16_t tx_queue_id, struct rte_mempool *mb_pool) { int idx =3D rx_ring->index; - uintptr_t base_addr; uint16_t buf_size; + phys_addr_t bd_address; =20 - base_addr =3D (uintptr_t)rx_ring->bd_base; + bd_address =3D (phys_addr_t) + rte_mem_virt2iova((const void *)rx_ring->bd_base); enetc_rxbdr_wr(hw, idx, ENETC_RBBAR0, - lower_32_bits((uint64_t)base_addr)); + lower_32_bits((uint64_t)bd_address)); enetc_rxbdr_wr(hw, idx, ENETC_RBBAR1, - upper_32_bits((uint64_t)base_addr)); + upper_32_bits((uint64_t)bd_address)); enetc_rxbdr_wr(hw, idx, ENETC_RBLENR, ENETC_RTBLENR_LEN(rx_ring->bd_count)); =20 @@ -612,7 +614,7 @@ static int enetc_tx_queue_setup(struct rte_eth_dev *dev= , uint16_t tx_queue_id, =20 static struct rte_pci_driver rte_enetc_pmd =3D { .id_table =3D pci_id_enetc_map, - .drv_flags =3D RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_IOVA_AS_VA, + .drv_flags =3D RTE_PCI_DRV_NEED_MAPPING, .probe =3D enetc_pci_probe, .remove =3D enetc_pci_remove, }; diff --git a/drivers/net/enetc/enetc_rxtx.c b/drivers/net/enetc/enetc_rxtx.= c index 631e243..a31a387 100644 --- a/drivers/net/enetc/enetc_rxtx.c +++ b/drivers/net/enetc/enetc_rxtx.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ =20 #include @@ -64,7 +64,7 @@ txbd->buf_len =3D txbd->frm_len; txbd->flags =3D rte_cpu_to_le_16(ENETC_TXBD_FLAGS_F); txbd->addr =3D (uint64_t)(uintptr_t) - rte_cpu_to_le_64((size_t)tx_swbd->buffer_addr->buf_addr + + rte_cpu_to_le_64((size_t)tx_swbd->buffer_addr->buf_iova + tx_swbd->buffer_addr->data_off); i++; start++; @@ -91,7 +91,7 @@ rx_swbd->buffer_addr =3D rte_cpu_to_le_64(rte_mbuf_raw_alloc(rx_ring->mb_pool)); rxbd->w.addr =3D (uint64_t)(uintptr_t) - rx_swbd->buffer_addr->buf_addr + + rx_swbd->buffer_addr->buf_iova + rx_swbd->buffer_addr->data_off; /* clear 'R" as well */ rxbd->r.lstatus =3D 0; --=20 1.9.1