From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30041.outbound.protection.outlook.com [40.107.3.41]) by dpdk.org (Postfix) with ESMTP id B9CB11B53 for ; Wed, 19 Sep 2018 14:16:03 +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=WMKNVeaZwN2/CtveRg0mAvPFMl4KjM2QEuH5mYNKABg=; b=NppAFTudxsqkuwN22bsUIoGAx6E/zieOeWtGXh2FmsqNuwdQUrcTST1SOaxWE3o4ropSKDUCsJXt55ZJURrAHZ+cd41Rogo92esOXfnHFhG0b8+e7QjfbkdJmUqOBpExBcZXC08tg2P7snBdpaUo1SQ0NXtwvYzsT5yS7RnvNfQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from [10.232.14.39] (14.142.187.166) by AM0PR04MB4674.eurprd04.prod.outlook.com (2603:10a6:208:75::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Wed, 19 Sep 2018 12:16:00 +0000 To: Gagandeep Singh Cc: dev@dpdk.org, ferruh.yigit@intel.com, pankaj.chauhan@nxp.com References: <20180906055449.21731-1-g.singh@nxp.com> <20180906055449.21731-3-g.singh@nxp.com> From: Shreyansh Jain Message-ID: Date: Wed, 19 Sep 2018 17:45:41 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180906055449.21731-3-g.singh@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0041.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::27) To AM0PR04MB4674.eurprd04.prod.outlook.com (2603:10a6:208:75::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1cfb6b79-54b8-42f5-05af-08d61e29aa11 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4674; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4674; 3:ex98R85nlraAyKTJooc7WHXfq+/sdFsRh1dkFNK+2PbjLdsrIKK3okYwlq/zzK1h5oRAMlMs+JsQ/x35vUJiGxCfjOxWyyM0LIiyKzx+539I2x/IfPRU0Dtau49lc2eIWKzF5udmsF/uFaQv8b8ZOjvOJ3UYa8f8yreq8G9xwfIfvbn9zmtPa/IRYRkK+iq/fovgLud9ZVRmRoyxMru9aIo87FefneppfVX3qMDm+HlmCxqmpaqXWAylE9api5R/; 25:iaqgs1Z/x/QrmZybp5yX2O9MNvw9f9q0rKig4rUuz0MX8fbjmPZOdEa9RP+VsjNvrIfITVe+KT8GM54DY3XTBPmlJFDAxilegFi1OJywlXhvVLMxhWLiEURap7UuXcaXzWUqUumPhFG8ODDl+UWQuVQoE8lVRxSrrL3Ibhguh2F/JW0Anlk92/Y/g72dA+s1r/iEeg33cgj9XXjKsgWVG25Gp/8DRqz233BhD6b/mbWQfgeoHw84t+pjdURqLkBj2XR5J13AIzkzorDHpi0rGgKXEfbTswM08FAqRDl42BAW1I4HXNHrij6rS+sN4cEkkUauQvD09u06fbO/94EawA==; 31:jyy48Fl+5gdgQisZy3nm0APYLPZfilJusEOjdPmOfVH63MjcBKSUGJb9yndP7JtZVFPbyDY0KKUp93+HPJURwFx5fuhEMgo2gIMNQ1nAspGPj8ZmBm7xuWSq7PXcGo817xtMsZZu1W7N2B4HWygdtJrTmDZsTy/mcCWmqZU7AH7C0CDYrodm4ku2lKMigL/tsL3gSg1GW8LGM4XTQW22J29STUiDKUumC+JNyLjNJJM= X-MS-TrafficTypeDiagnostic: AM0PR04MB4674: X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4674; 20:48VtYnuk4rifDMYN9DYjEwD1fsTJfzMFOduFac+JWPk7BUDjuNiu5SEZnvbApVC9SJs+y6WLFaEYTXjDrJ68S9b4lSkFMhfodWotiN8rqXrlgfyTcsm0ykbgSdgPtCPsLfgKaZCcJ/g43yVRkHijUnYdfK3BPWm9o80AwGrmoqqEo6fx0/8wwN9z10rud47Y7QIhwj2gRkPRlVqQ/5/SqvzGgI53T1ukFNbxfw1lVQKvMEuushmp3LGCJ2xmKL5lDa36CHUZgluDuuC3GY6u9PcZ9SxEJCfjWJ4J18RNxpfmPoHwRM/iBR/kDfuz0kC25awJdt2xH+NBuY5q83TphcNtumiysAAoq0mOqyLjSEJg5E24uFZq3g7vq0ukIQv4QXb+Uy2GrBTzuV8VCGneY44deLcz4wa7o2nsl4J1h5bqkW5zPct1UdwCaFFVAiKMc+1xMnNdM6c702XMOYf4PwfnafZKDxUFBo+Z9Sy3y+yV4iC97Co2uDsCWg2Vp01a; 4:haBYoUJfKY4kSGT9qeqzYAfGPdDOMizGj2i1Q/9n+19cvm63emq+BLE+sgJDVaCQYyMlESiaJeS2T/fzP1r8rLDR+PQAV+j2EbvOOgeHTUpr4AY7xa8oqqcRpl8blkd+ShLv67nqzVuyaqUusBHHCfCN8KZpQatqtnHhP+ZSi8t7Orp8Me67YirSKN71QP8I++2SzWX/tPXY+92SenDd0BW21AzY5Y8KXU8zWzQzbK/nEN2jCCHrl9Ojf10Ih5MGKl6MaGZ5Ihfu28JMa3kc3qd97dWy5Awca5XwHmeapdTHShVW6BFwh9BJS6IncJEdFgdYXtx5pNw9adkGimrn3WQydv5NBBSceouY1Cah9hU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(190756311086443)(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231355)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:AM0PR04MB4674; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4674; X-Forefront-PRVS: 0800C0C167 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(136003)(366004)(346002)(39860400002)(396003)(376002)(189003)(199004)(6246003)(14444005)(77096007)(37006003)(52116002)(58126008)(6486002)(16576012)(316002)(26005)(229853002)(5009440100003)(956004)(52146003)(2616005)(2486003)(97736004)(31686004)(486006)(106356001)(23676004)(105586002)(217873002)(6862004)(476003)(53936002)(4326008)(16526019)(11346002)(8676002)(67846002)(446003)(44832011)(25786009)(81166006)(478600001)(81156014)(86362001)(36756003)(76176011)(31696002)(2870700001)(305945005)(8936002)(7736002)(6666003)(64126003)(47776003)(2906002)(6116002)(65806001)(68736007)(3846002)(5660300001)(386003)(50466002)(6636002)(66066001)(65826007)(65956001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4674; H:[10.232.14.39]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:3; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTBQUjA0TUI0Njc0OzIzOjZTd1dGTGFlSGpHMU1SRi8yVEZFZWxSVHJZ?= =?utf-8?B?S1lINTZINVJvZzA2b09xZDZMb2YzYkJNbTN6Tk02bVdnTlYyTGNiWjJUMkI3?= =?utf-8?B?U1Y3cGVjMUl0bFBYOW1XNUJxNUZyMUhTMlR4UEU1QVZ5bVE4SDJkTXVVV2Uv?= =?utf-8?B?dFUzL0JHOVRBanM1azR0eU11V1dSRnhTUzB4ajl2Z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/nBJdrAGpNCMKeIm3lkHGc0jv4t/VxNkUkq2J/uWZqjZAlfF3E6YSKCt1DyrYiGj7RYhJwp566KHtBI14XmUhc6/sK/r2JxoKLi+Qnpb4LoBtuZ51aqh0Rs=; 7:y2WRVOkE/OFoVvkCkxxRkS21QANaJRaHUVnfOiy3xPm2YQlQeBmB6YGADA6s3scr6nN8gMEXNbfI6KgKY7YSG9akaEFtS1VbkOdyg2gPvmLKYyYRKDxtYhHX1uJFDjiKL1o0Xjglic/1Ty/ckkZQxmz028q8QsQZPxXkZhiz2yZJ4VSEjXgOdNns4DVMxYH6VwO+VWioNfV/ZGm/6Mw+uvqYv/WrhzsjknYhDZrfbs48gm8sXNF3JDZE0W3Z5/5q SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2018 12:16:00.4230 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1cfb6b79-54b8-42f5-05af-08d61e29aa11 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4674 Subject: Re: [dpdk-dev] [PATCH 2/3] net/enetc: add ENETC PMD with basic operations 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: Wed, 19 Sep 2018 12:16:03 -0000 On Thursday 06 September 2018 11:24 AM, Gagandeep Singh wrote: > This patch introduces the enetc PMD with basic > initialisation functions includes probe, teardown, > hardware intialisation > > Signed-off-by: Gagandeep Singh > --- > MAINTAINERS | 1 + > config/common_base | 5 + > config/common_linuxapp | 5 + > doc/guides/nics/enetc.rst | 1 + > doc/guides/nics/features/enetc.ini | 2 + > drivers/net/Makefile | 1 + > drivers/net/enetc/Makefile | 24 ++ > drivers/net/enetc/base/enetc_hw.h | 220 ++++++++++++++++ > drivers/net/enetc/enetc.h | 111 ++++++++ > drivers/net/enetc/enetc_ethdev.c | 269 ++++++++++++++++++++ > drivers/net/enetc/enetc_logs.h | 40 +++ > drivers/net/enetc/meson.build | 10 + > drivers/net/enetc/rte_pmd_enetc_version.map | 4 + > drivers/net/meson.build | 1 + > mk/rte.app.mk | 1 + > 15 files changed, 695 insertions(+) > create mode 100644 drivers/net/enetc/Makefile > create mode 100644 drivers/net/enetc/base/enetc_hw.h > create mode 100644 drivers/net/enetc/enetc.h > create mode 100644 drivers/net/enetc/enetc_ethdev.c > create mode 100644 drivers/net/enetc/enetc_logs.h > create mode 100644 drivers/net/enetc/meson.build > create mode 100644 drivers/net/enetc/rte_pmd_enetc_version.map > [...] > diff --git a/drivers/net/enetc/base/enetc_hw.h b/drivers/net/enetc/base/enetc_hw.h > new file mode 100644 > index 000000000..806b26a2c > --- /dev/null > +++ b/drivers/net/enetc/base/enetc_hw.h > @@ -0,0 +1,220 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright 2018 NXP > + */ > + [...] > + > +/* PCI device info */ > +struct enetc_hw { > + /* SI registers, used by all PCI functions */ > + void *reg; > + /* Port registers, PF only */ > + void *port; > + /* IP global registers, PF only */ > + void *global; > +}; A trivial one: Some structures have comments, but some don't. Even the one above has comments *before* the variable. There is a no fixed standard, but it is expected that comments would be uniform across the file. If you see in file enetc/enetc.h, you would observe some comments *after* the variable. Can you make them uniform? > + > +struct enetc_eth_mac_info { > + uint8_t addr[ETH_ADDR_LEN]; > + uint8_t perm_addr[ETH_ADDR_LEN]; > + bool get_link_status; > +}; > + > +struct enetc_eth_hw { > + struct net_device *ndev; > + struct enetc_hw hw; > + uint16_t device_id; > + uint16_t vendor_id; > + uint8_t revision_id; > + struct enetc_eth_mac_info mac; > +}; > + > +/* Transmit Descriptor */ > +struct enetc_tx_desc { > + uint64_t addr; > + uint16_t frm_len; > + uint16_t buf_len; > + uint32_t flags_errors; > +}; > + > +/* TX Buffer Descriptors (BD) */ > +struct enetc_tx_bd { > + uint64_t addr; > + uint16_t buf_len; > + uint16_t frm_len; > + uint16_t err_csum; > + uint16_t flags; > +}; > + > +/* RX buffer descriptor */ > +union enetc_rx_bd { > + struct { > + uint64_t addr; > + uint8_t reserved[8]; > + } w; > + struct { > + uint16_t inet_csum; > + uint16_t parse_summary; > + uint32_t rss_hash; > + uint16_t buf_len; > + uint16_t vlan_opt; > + union { > + struct { > + uint16_t flags; > + uint16_t error; > + }; > + uint32_t lstatus; > + }; > + } r; > +}; [...] > +#endif /* _ENETC_H_ */ > diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c > new file mode 100644 > index 000000000..06438835d > --- /dev/null > +++ b/drivers/net/enetc/enetc_ethdev.c > @@ -0,0 +1,269 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright 2018 NXP > + */ > + > +#include > +#include > + > +#include "enetc_logs.h" > +#include "enetc.h" > + > +int enetc_logtype_pmd; > + > +/* Functions Prototypes */ > +static int enetc_dev_configure(struct rte_eth_dev *dev); > +static int enetc_dev_start(struct rte_eth_dev *dev); > +static void enetc_dev_stop(struct rte_eth_dev *dev); > +static void enetc_dev_close(struct rte_eth_dev *dev); > +static void enetc_dev_infos_get(struct rte_eth_dev *dev, > + struct rte_eth_dev_info *dev_info); > +static int enetc_link_update(struct rte_eth_dev *dev, int wait_to_complete); > +static int enetc_hardware_init(struct enetc_eth_hw *hw); > + > +/* > + * The set of PCI devices this driver supports > + */ > +static const struct rte_pci_id pci_id_enetc_map[] = { > + { RTE_PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, ENETC_DEV_ID) }, > + { RTE_PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, ENETC_DEV_ID_VF) }, > + { .vendor_id = 0, /* sentinel */ }, > +}; > + > +/* Features supported by this driver */ > +static const struct eth_dev_ops enetc_ops = { > + .dev_configure = enetc_dev_configure, > + .dev_start = enetc_dev_start, > + .dev_stop = enetc_dev_stop, > + .dev_close = enetc_dev_close, > + .link_update = enetc_link_update, > + .dev_infos_get = enetc_dev_infos_get, > +}; > + > +/** > + * Initialisation of the enetc device > + * > + * @param eth_dev > + * - Pointer to the structure rte_eth_dev > + * > + * @return > + * - On success, zero. > + * - On failure, negative value. > + */ > +static int > +enetc_dev_init(struct rte_eth_dev *eth_dev) > +{ > + int error = 0, i; > + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); > + struct enetc_eth_hw *hw = > + ENETC_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); > + struct enetc_eth_adapter *adapter = > + ENETC_DEV_PRIVATE(eth_dev->data->dev_private); > + > + PMD_INIT_FUNC_TRACE(); > + eth_dev->dev_ops = &enetc_ops; > + eth_dev->rx_pkt_burst = NULL; > + eth_dev->tx_pkt_burst = NULL; > + > + rte_eth_copy_pci_info(eth_dev, pci_dev); > + > + /* Retrieving and storing the HW base address of device */ > + hw->hw.reg = (void *)pci_dev->mem_resource[0].addr; > + > + adapter->tx_bd_count = MAX_BD_COUNT; > + adapter->rx_bd_count = MAX_BD_COUNT; > + > + adapter->num_rx_rings = MAX_RX_RINGS; > + adapter->num_tx_rings = MAX_TX_RINGS; > + > + for (i = 0; i < adapter->num_rx_rings; i++) { > + adapter->rx_ring[i] = rte_zmalloc(NULL, > + sizeof(struct enetc_bdr), 0); > + if (!adapter->rx_ring[i]) { > + ENETC_PMD_ERR("Failed to allocate RX ring memory"); > + while (--i >= 0) > + rte_free(adapter->rx_ring[i]); > + error = -ENOMEM; > + goto err_late; > + } > + adapter->rx_ring[i]->bd_count = adapter->rx_bd_count; > + } > + > + for (i = 0; i < adapter->num_tx_rings; i++) { > + adapter->tx_ring[i] = rte_zmalloc(NULL, > + sizeof(struct enetc_bdr), 0); > + if (!adapter->tx_ring[i]) { > + ENETC_PMD_ERR("Failed to allocate TX ring memory"); > + while (--i >= 0) > + rte_free(adapter->tx_ring[i]); > + error = -ENOMEM; > + goto err_second; > + } > + adapter->tx_ring[i]->bd_count = adapter->tx_bd_count; > + } > + > + error = enetc_hardware_init(hw); > + if (error != 0) { > + ENETC_PMD_ERR("Hardware initialization failed"); > + goto err_first; > + } > + > + /* Allocate memory for storing MAC addresses */ > + eth_dev->data->mac_addrs = rte_zmalloc("enetc_eth", > + ETHER_ADDR_LEN, 0); > + if (!eth_dev->data->mac_addrs) { > + ENETC_PMD_ERR("Failed to allocate %d bytes needed to " > + "store MAC addresses", > + ETHER_ADDR_LEN * 1); Formatting of the above log is not correct. It should be in format: FUNCTION_NAME(Some argument, argument on new line after just below the first, ...); > + error = -ENOMEM; > + goto err_first; > + } > + > + /* Copy the permanent MAC address */ > + ether_addr_copy((struct ether_addr *)hw->mac.addr, > + ð_dev->data->mac_addrs[0]); Alignment of the second argument should be below the first one. > + > + ENETC_PMD_DEBUG("port_id %d vendorID=0x%x deviceID=0x%x", > + eth_dev->data->port_id, pci_dev->id.vendor_id, > + pci_dev->id.device_id); > + return 0; > + > +err_first: > + for (i = 0; i < adapter->num_tx_rings; i++) > + rte_free(adapter->tx_ring[i]); > +err_second: > + for (i = 0; i < adapter->num_rx_rings; i++) > + rte_free(adapter->rx_ring[i]); > +err_late: > + return error; > +} > + > +static int > +enetc_dev_uninit(struct rte_eth_dev *eth_dev) > +{ Some functions have FUNC_TRACE, some don't. Maybe you should make it uniform. > + return 0; > +} > + > +static int > +enetc_dev_configure(struct rte_eth_dev *dev) > +{ > + PMD_INIT_FUNC_TRACE(); > + return 0; > +} > + > +static int > +enetc_dev_start(struct rte_eth_dev *dev) > +{ > + PMD_INIT_FUNC_TRACE(); > + return 0; > +} > + > +static void > +enetc_dev_stop(struct rte_eth_dev *dev) > +{ > +} > + > +static void > +enetc_dev_close(struct rte_eth_dev *dev) > +{ > +} > + > +/* return 0 means link status changed, -1 means not changed */ > +static int > +enetc_link_update(struct rte_eth_dev *dev, int wait_to_complete) > +{ > + struct enetc_eth_hw *hw = > + ENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + struct rte_eth_link link; > + > + hw->mac.get_link_status = 1; > + > + memset(&link, 0, sizeof(link)); > + rte_eth_linkstatus_get(dev, &link); > + > + link.link_duplex = ETH_LINK_FULL_DUPLEX; > + link.link_status = ETH_LINK_UP; > + rte_eth_linkstatus_set(dev, &link); > + > + return 0; > +} > + > +static int > +enetc_hardware_init(struct enetc_eth_hw *hw) > +{ > + uint32_t psipmr = 0; > + > + /* Calculating and storing the base HW addresses */ > + hw->hw.port = hw->hw.reg + ENETC_PORT_BASE; > + hw->hw.global = hw->hw.reg + ENETC_GLOBAL_BASE; > + > + /* Enabling Station Interface */ > + ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.reg, ENETC_SIMR), > + ENETC_SIMR_EN); Second argument on new line should start below first. > + > + /* Setting to accept broadcast packets for each inetrface */ > + psipmr |= ENETC_PSIPMR_SET_UP(0) | ENETC_PSIPMR_SET_MP(0) | > + ENETC_PSIPMR_SET_VLAN_MP(0); > + psipmr |= ENETC_PSIPMR_SET_UP(1) | ENETC_PSIPMR_SET_MP(1) | > + ENETC_PSIPMR_SET_VLAN_MP(1); > + psipmr |= ENETC_PSIPMR_SET_UP(2) | ENETC_PSIPMR_SET_MP(2) | > + ENETC_PSIPMR_SET_VLAN_MP(2); > + > + ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PSIPMR), > + psipmr); > + > + ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PM0_CMD_CFG), > + ENETC_PM0_TX_EN | ENETC_PM0_RX_EN); > + > + /* Enable port */ > + ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PMR), > + ENETC_PMR_EN); > + > + /* Enabling broadcast address */ > + ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PSIPMAR0(0)), > + 0xFFFFFFFF); > + ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PSIPMAR1(0)), > + 0xFFFF << 16); > + > + return 0; > +} [...] > diff --git a/mk/rte.app.mk b/mk/rte.app.mk > index de33883be..154ae3b2c 100644 > --- a/mk/rte.app.mk > +++ b/mk/rte.app.mk > @@ -135,6 +135,7 @@ endif > _LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 > _LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena > _LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic > +_LDLIBS-$(CONFIG_RTE_LIBRTE_ENETC_PMD) += -lrte_pmd_enetc > _LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k > _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_FAILSAFE) += -lrte_pmd_failsafe > _LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e > 32 bit compilation for this is failing with errors like this: /home/shreyansh/build/DPDK/05_dpdk/drivers/net/enetc/enetc_rxtx.c: In function ‘enetc_xmit_pkts’: /home/shreyansh/build/DPDK/05_dpdk/drivers/net/enetc/enetc_rxtx.c:73:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] (uint64_t)rte_cpu_to_le_64(tx_swbd->buffer_addr->buf_addr + ^ /home/shreyansh/build/DPDK/05_dpdk/drivers/net/enetc/enetc_rxtx.c: In function ‘enetc_refill_rx_ring’: /home/shreyansh/build/DPDK/05_dpdk/drivers/net/enetc/enetc_rxtx.c:98:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] rxbd->w.addr = (uint64_t)rx_swbd->buffer_addr->buf_addr + ^ In file included from /home/shreyansh/build/DPDK/05_dpdk/drivers/net/enetc/enetc_rxtx.c:13:0: /home/shreyansh/build/DPDK/05_dpdk/drivers/net/enetc/enetc_rxtx.c: In function ‘enetc_setup_txbdr’: /home/shreyansh/build/DPDK/05_dpdk/drivers/net/enetc/enetc_rxtx.c:293:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] lower_32_bits((uint64_t)tx_ring->bd_base)); ^ /home/shreyansh/build/DPDK/05_dpdk/drivers/net/enetc/base/enetc_hw.h:108:45: note: in definition of macro ‘enetc_wr_reg’ #define enetc_wr_reg(reg, val) rte_write32((val), (reg)) ^~~ /home/shreyansh/build/DPDK/05_dpdk/drivers/net/enetc/base/enetc_hw.h:121:5: note: in expansion of macro ‘enetc_wr’ enetc_wr(hw, ENETC_BDR(t, n, off), val) ^~~~~~~~ /home/shreyansh/build/DPDK/05_dpdk/drivers/net/enetc/base/enetc_hw.h:126:5: note: in expansion of macro ‘enetc_bdr_wr’ enetc_bdr_wr(hw, TX, n, off, val) ^~~~~~~~~~~~ /home/shreyansh/build/DPDK/05_dpdk/drivers/net/enetc/enetc_rxtx.c:292:2: note: in expansion of macro ‘enetc_txbdr_wr’