From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0080.outbound.protection.outlook.com [104.47.42.80]) by dpdk.org (Postfix) with ESMTP id C2F4E1AEF3 for ; Thu, 30 Nov 2017 14:12:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=cAs/ZFEogiPM0pXWNmDVQERlT5+8oc9F+rlWhcaiBMw=; b=T4hbgoQpOCIL90yT9yYD5drBNQdlYzX5ZNUF1KhTTaBL28qEwZEX+OnYNsB2nuU5ztnHQpHtJpCv9xKFzOLST3zRnstKS2EOiQcF3pw3Fpm1fPA6GUM4lLr1vxw3dn+ENAkbrglGZSH2FUl1wzrkNmtmmELWR8jQ7nVMMUPUPm0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by DM5PR12MB1514.namprd12.prod.outlook.com (10.172.39.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Thu, 30 Nov 2017 13:12:01 +0000 From: Ravi Kumar To: dev@dpdk.org Date: Thu, 30 Nov 2017 08:11:12 -0500 Message-Id: <1512047472-118050-16-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> References: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR01CA0077.INDPRD01.PROD.OUTLOOK.COM (10.174.56.17) To DM5PR12MB1514.namprd12.prod.outlook.com (10.172.39.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: baf3552f-569b-4943-d773-08d537f3f205 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603286); SRVR:DM5PR12MB1514; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1514; 3:zlfZhhD84y2acIcBlKLDn9Rc4gPV7K2Bp1pFGtL7JLw+kg440LR/ysRhYuSFbjo2ma2jsWEViS32cJsqKFOlalNPuhcvR+RHVdalcTU4XG2VQfONkiZ69f0bhZYsY+FPvbRSICk9H7VLVoF4g4cutR5zktwHPGpkKqsKakZMD8YXw+KJ+9kgXFmfPx83h39PceY3GS1z5m36ScPV25+uPp530HpiLSIMzlo/Ks34CIRR6D2J+rhS/ANICTWt02gi; 25:1Lg5SEUaoZKecT/ZopRDTjYWvThY+uHSv4MQ/H53zBh+OBBMDHYA6LCHyzMS7wwXu6KB/hWQdHMpkLnC+n7tfsx6gHcoua+XFIXhpIfbYLQ6xYKEObtBBHVp1HNEd+EWnSToP9uNgiW4dyj0OU01ORuwx6bg20QCZ+ARCrUiiwlJqiQOKLCQew4QVP4XvRYQtlxNmvIPxSvQu2D9G1/1ZFzvLDsrU7BTjmqY1gche7dGF4TjCgSJYLi2IHqtj7WGC/yrwA5d0Uw3XwNT1t67nAB++FhRIIIwAh4tOg/Cdi/57G38EsZZG74o9trvTD4csavY0I5h9C5fuUbD2ggINQ==; 31:t3YFmRCzFHlZVPprRq7NsenHu5AS+TVVPzzVXDXBHE8ibViAERNU8qGLaDm0jR5wRa08gZUwHI7V816NCR9Goe3nu8tq+roOPBaDfCvoAFzSM57Sd7RDDwyer9WDVn+XwORIiYWPZwSOshZRJOXta5pgqUlXCtAtT8uLysoTp/et7x7SiUe+ouoPY2CZ3T2alXR2KyRHJwBXFUsS0tWYE1JwT1uJTMmEjAsxlLGmVOw= X-MS-TrafficTypeDiagnostic: DM5PR12MB1514: X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1514; 20:AbBIjVtAadXa0tHtJHXnBlpx0Jp/VI5ZKuFq03QAqsRHjZjOeX6nckUzvxJt6l29Q7WSDPuHoYEPfjr9ds57yd7ZytNIl8zGOQcS7aQLqNEp0++SF50bLHfsDKdvPzDn0x8IKK2UpFo9gZJu7dsydlEEajXKjj7DJpf3g8WF1QkMsA6yge32ImBinFD4e2NyLFIGrP0QviZNqVP6oUBqEvjbGGjuQrUu9uGoqXF/7H85YmLz7YCnfrvz+NDW7VnpiuqGmbcu3GJmH2+00rBbDa4uNNJb/FMw1LMON1wA+RdHv2xlLNpo+1WzGO4C4Evpyua+ZsfLrpBGnRAWP1HkI4jyOYQ/gcMcj9yv/+YeyrlgGTYtVFeOSjpyvpz29eE4eczQxWK0uCHjT5YDzHNgwFaCJDo2sVgGyUh7dqrodzxPTealgTGVppBgq3mNeB5d6wfZRd6943GUtAsrNLYCiD2CMI+ybK287HL8VatHRd1F/aliY7G04KGplvf7tTMl; 4:ZqhDZrQnAR7Ozk310n90v6TVVo2QipJQSJ5vJDDwrhtRtefHbiPgmJeTfZBvTe28wu/BQWfcjNMDyJwhTEH2dQ11svqOpn+I7JfLS0G+HM97+eWATl1n7FdFVW6Rl7HLxw2CV1VvM05eG3Fyk41N+N2ZFDlpwhH6RmkPGMI+hMEbhz9pByenIvRpGwwz+nbf6Q6w3JG24PRCt+MMtOEscHPbzPTNo0OWgPjZwgsX9YJfAmUk001XMKoozImkOJYeKPReA/W+ntv0a5G0+NJWW9on7OvWlK3TmUuWeFpGRIPWVYyJXEehZa3IG2TQO4PRphz2unSKn2TZh3RDCq11renUmHYDyPYpp/0cMlhVVgriA949wG+eeG7jywMsDmS7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030)(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231022)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:DM5PR12MB1514; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR12MB1514; X-Forefront-PRVS: 05079D8470 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(366004)(346002)(39860400002)(376002)(199003)(189002)(48376002)(16586007)(6666003)(68736007)(86362001)(316002)(101416001)(2906002)(50466002)(8676002)(51416003)(6486002)(72206003)(50226002)(16526018)(50986010)(76176010)(53416004)(189998001)(7696005)(52116002)(97736004)(53936002)(6916009)(2351001)(2950100002)(105586002)(66066001)(106356001)(3846002)(25786009)(2361001)(81156014)(5660300001)(36756003)(6116002)(47776003)(305945005)(478600001)(8936002)(7736002)(6306002)(81166006)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1514; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB1514; 23:Y9gAx/tM8Vx7mtyURt1SevAA1NzXKYJ4LyeJAAhpW?= =?us-ascii?Q?K8uiEcADtuuEeZH6E/cRuwQp46s+Sh4OCt6eRXXimYsncAqFK1oRhBNog1W9?= =?us-ascii?Q?TJqSjzboFsq62sM8Pz2PCQBhHCwWjsbyiHcRMkfW1CmXQjEA+79ZQeYCehKA?= =?us-ascii?Q?YDkFvKw+dUDWsl5nbCjsvaOM3sXXFvn/yafdHGWfLvwp4IyKSwKqOfBZckXc?= =?us-ascii?Q?vPxeG9k5C7X8GvKMs99pceElTKtguvxytKaNy15ZjgNTrX5jjeLPus0Ter07?= =?us-ascii?Q?l/8HzkUEKwZDeJJ1HIHr0BfxLPbcv6XCIPmXfNSiiHkbXMDD1FE3jLX00Mqi?= =?us-ascii?Q?V/Trb+FTLEj00OP0OUYy8WI2ioY5kn8f3/WiuBswm0heMULZnF4RiJU/bfwS?= =?us-ascii?Q?ftSgftu62HnMinSlCT76CflOIvQdoi+Hhh0XYUw+RLs9nZfSy4vWdSUGf6oL?= =?us-ascii?Q?I8MyCxv5+Pb3MY4UIDVLuAJrVzMpXLAb8TQxzxi5WfgxVHqi+Suof0+zBYvs?= =?us-ascii?Q?ylvHmi6cn8oRbtXKmIEG5bIJPQ/QwlohQMgJK0SOw3MNDub0UTx/bMJEUQ+J?= =?us-ascii?Q?FTq0jxpD2Yr4xUmvupi8oEiiKhPHP+5Q6Etp4tPsvoTW8mfy6HujplSTmyJ7?= =?us-ascii?Q?03pvpcolqapMHIfaeHyTUjdS3TAHF4GwYFTvrESDz41+6KCw4Aq/bvr95Qic?= =?us-ascii?Q?dU+Dr/22YZRkxZbISkEVVQYi4gMNP3ObL2jBfIuXMk44H5Cx2Jx0Y6UtkwS2?= =?us-ascii?Q?7QR/ZKucI84LEY0EF1VEskpqpxX6wUtVqm4nxQGXEOa69suZ9phogCmCI1iE?= =?us-ascii?Q?L7e5juj69DMwBulZ2DnwsAPL3ZBkxcEPb/P2tiiajAScGCJE5aTc0AR/RLhK?= =?us-ascii?Q?GPjd8iKlWi4KwJp8RYD1QKluvytD5Gb2WA6zXSOsBY2pqyFXS5mSuS+mymgE?= =?us-ascii?Q?qlN5oh33xZdPwjrtNfgcfJhpPQMTfgZH3fXOVTqFpsPAoOKYQxdpmlzW9WuI?= =?us-ascii?Q?glnqznEdGpvArELZANk3iAx2RFLOzX4vUow9j0dNz2et4NcgHj3bzH79Ludr?= =?us-ascii?Q?C6RKxuwAmIf4djQXygP4+kpWv0tG5qCqt/StecGBzA2gRqYtbIcmmTG+L63z?= =?us-ascii?Q?mLIfdtw1cQD5Qq1RNBMjv88vTaciZk8y+vKZQZBGWSuK7MPwG9LhPzU0M3MK?= =?us-ascii?Q?KcbL8Z0a8lkQ+4=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1514; 6:Z9hKWNVp1sOERvs3uJWAdV97MqXi9vBUReORocI/yPg7XTtQmOGeG2dxH7gg95v3OLKN4WGtbiDn0yE6xdz79gGARsutpsL2OyutVIs+CwIClmK3J0Dmt0wrzhDDpkmPf+/Q6ZtNT1dIXt0zdZt2d+E4y0Yde4NhITHaypaRwevdD3od/9BqIzvN3orm96vAkBVerTJTTKsPI2ng1qiOYxSUotSL3/iCY+LyzfdNCxIHNfAexG/cFg0GniCup/h1cQmBI6lquVj+e8bH2dusZsUV3fShHgJ7uznAyDUlXEnku3+mw3BBZAMEWQ0t7udHEKmyiaGeNYSh8ovQY8kuEVvw9/3FAszVS7QkYzAyphE=; 5:olMFQ56STSh9Uory55Id7umDYWN1s9umaxs3OYKAG+Edm4K4xDRos17yLIeg9zPY8qiPzxsYrw5QpXsq0jCqYAQAo9yJVh91bfdqb2jKpa2BJa941xRhtVheGCGcIghphYBCzymd7k6cmYPybDRYjoJLSzMlr/M6G/tJQ7aw3ME=; 24:L16otJP7ENGI15+Nbu0X853mJAXHlGKWx4Q6a7PIrUd8KaAeirqoLDVBG5tUq6J7pRPdyz0OjALelBMHOprI76Gcj65KGDt5Ifz/TmaaPiI=; 7:/UpiksC982FzFU+pqEGtP1BDO3wfw8KVuVKROWU6DJXoDQeBu8Cb9H7YyKUXZfA3M2onvJprAN/Q5aSwuL4t7O7sjz5ThdYhRmBX/QLGQ29gg+l8rHlfysEvSO6wQgCpSjcJc5SGH3/38kCshAqo1FZgUYxTRW0V8y6eYn+eLZ+e/6lIckux2zebwY88xKZTMH+k3SyWpk4jG2RJfshtJDsU+/V78OqzJn3xmVnES3xSD5svzkMgM/pY5vEfI10Y SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1514; 20:ZrVuEPImBl64+NvbFTmyB0riVw8OTWiA5FTL/JlKQjk51mHzd5FcSPBLAGWavo5a1WZjwOVvQbRsR4BLRVPlbfEVIzM2Vmz8X8jslJU/1uRwZlMVzOGY7Ua0UiAn/eaYk0XZ8SxQNNNpGCRszm5VbhttlR4ybVq3XM5LE6w7mTXX1kWSNviWZ01GLYCa5DxbwpC/s6wOGX+WL2Zw/g1+P1ImKODN2vHb3P81LCy2METtnepHBWENRj742vyZjyRH X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2017 13:12:01.1874 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: baf3552f-569b-4943-d773-08d537f3f205 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1514 Subject: [dpdk-dev] [PATCH 16/16] net/axgbe: add support for build 32-bit 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: Thu, 30 Nov 2017 13:12:04 -0000 Signed-off-by: Ravi Kumar --- drivers/net/axgbe/axgbe_common.h | 49 +++--- drivers/net/axgbe/axgbe_ethdev.c | 10 +- drivers/net/axgbe/axgbe_ethdev.h | 8 +- drivers/net/axgbe/axgbe_rxtx.c | 12 +- drivers/net/axgbe/axgbe_rxtx.h | 4 +- drivers/net/axgbe/axgbe_rxtx.h.orig | 307 ++++++++++++++++++++++++++++++++++++ 6 files changed, 354 insertions(+), 36 deletions(-) create mode 100644 drivers/net/axgbe/axgbe_rxtx.h.orig diff --git a/drivers/net/axgbe/axgbe_common.h b/drivers/net/axgbe/axgbe_common.h index 9a5808d..0ceeefa 100644 --- a/drivers/net/axgbe/axgbe_common.h +++ b/drivers/net/axgbe/axgbe_common.h @@ -1506,7 +1506,7 @@ do { \ * register definitions formed using the input names */ #define AXGMAC_IOREAD(_pdata, _reg) \ - rte_read32((void *)((_pdata)->xgmac_regs + (_reg))) + rte_read32((void *)((uint8_t *)((_pdata)->xgmac_regs) + (_reg))) #define AXGMAC_IOREAD_BITS(_pdata, _reg, _field) \ GET_BITS(AXGMAC_IOREAD((_pdata), _reg), \ @@ -1514,7 +1514,8 @@ do { \ _reg##_##_field##_WIDTH) #define AXGMAC_IOWRITE(_pdata, _reg, _val) \ - rte_write32((_val), (void *)((_pdata)->xgmac_regs + (_reg))) + rte_write32((_val), \ + (void *)((uint8_t *)((_pdata)->xgmac_regs) + (_reg))) #define AXGMAC_IOWRITE_BITS(_pdata, _reg, _field, _val) \ do { \ @@ -1530,7 +1531,7 @@ do { \ * base register value is calculated by the queue or traffic class number */ #define AXGMAC_MTL_IOREAD(_pdata, _n, _reg) \ - rte_read32((void *)((_pdata)->xgmac_regs + \ + rte_read32((void *)((uint8_t *)((_pdata)->xgmac_regs) + \ MTL_Q_BASE + ((_n) * MTL_Q_INC) + (_reg))) #define AXGMAC_MTL_IOREAD_BITS(_pdata, _n, _reg, _field) \ @@ -1539,7 +1540,7 @@ do { \ _reg##_##_field##_WIDTH) #define AXGMAC_MTL_IOWRITE(_pdata, _n, _reg, _val) \ - rte_write32((_val), (void *)((_pdata)->xgmac_regs + \ + rte_write32((_val), (void *)((uint8_t *)((_pdata)->xgmac_regs) +\ MTL_Q_BASE + ((_n) * MTL_Q_INC) + (_reg))) #define AXGMAC_MTL_IOWRITE_BITS(_pdata, _n, _reg, _field, _val) \ @@ -1556,7 +1557,7 @@ do { \ * base register value is obtained from the ring */ #define AXGMAC_DMA_IOREAD(_channel, _reg) \ - rte_read32((void *)((_channel)->dma_regs + (_reg))) + rte_read32((void *)((uint8_t *)((_channel)->dma_regs) + (_reg))) #define AXGMAC_DMA_IOREAD_BITS(_channel, _reg, _field) \ GET_BITS(AXGMAC_DMA_IOREAD((_channel), _reg), \ @@ -1564,7 +1565,8 @@ do { \ _reg##_##_field##_WIDTH) #define AXGMAC_DMA_IOWRITE(_channel, _reg, _val) \ - rte_write32((_val), (void *)((_channel)->dma_regs + (_reg))) + rte_write32((_val), \ + (void *)((uint8_t *)((_channel)->dma_regs) + (_reg))) #define AXGMAC_DMA_IOWRITE_BITS(_channel, _reg, _field, _val) \ do { \ @@ -1589,16 +1591,18 @@ do { \ _prefix##_##_field##_WIDTH, (_val)) #define XPCS32_IOWRITE(_pdata, _off, _val) \ - rte_write32(_val, (void *)((_pdata)->xpcs_regs + (_off))) + rte_write32(_val, \ + (void *)((uint8_t *)((_pdata)->xpcs_regs) + (_off))) #define XPCS32_IOREAD(_pdata, _off) \ - rte_read32((void *)((_pdata)->xpcs_regs + (_off))) + rte_read32((void *)((uint8_t *)((_pdata)->xpcs_regs) + (_off))) #define XPCS16_IOWRITE(_pdata, _off, _val) \ - rte_write16(_val, (void *)((_pdata)->xpcs_regs + (_off))) + rte_write16(_val, \ + (void *)((uint8_t *)((_pdata)->xpcs_regs) + (_off))) #define XPCS16_IOREAD(_pdata, _off) \ - rte_read16((void *)((_pdata)->xpcs_regs + (_off))) + rte_read16((void *)((uint8_t *)((_pdata)->xpcs_regs) + (_off))) /* Macros for building, reading or writing register values or bits * within the register values of SerDes integration registers. @@ -1614,7 +1618,7 @@ do { \ _prefix##_##_field##_WIDTH, (_val)) #define XSIR0_IOREAD(_pdata, _reg) \ - rte_read16((void *)((_pdata)->sir0_regs + (_reg))) + rte_read16((void *)((uint8_t *)((_pdata)->sir0_regs) + (_reg))) #define XSIR0_IOREAD_BITS(_pdata, _reg, _field) \ GET_BITS(XSIR0_IOREAD((_pdata), _reg), \ @@ -1622,7 +1626,8 @@ do { \ _reg##_##_field##_WIDTH) #define XSIR0_IOWRITE(_pdata, _reg, _val) \ - rte_read16((_val), (void *)((_pdata)->sir0_regs + (_reg))) + rte_read16((_val), \ + (void *)((uint8_t *)((_pdata)->sir0_regs) + (_reg))) #define XSIR0_IOWRITE_BITS(_pdata, _reg, _field, _val) \ do { \ @@ -1634,7 +1639,7 @@ do { \ } while (0) #define XSIR1_IOREAD(_pdata, _reg) \ - rte_read16((void *)((_pdata)->sir1_regs + _reg)) + rte_read16((void *)((uint8_t *)((_pdata)->sir1_regs) + _reg)) #define XSIR1_IOREAD_BITS(_pdata, _reg, _field) \ GET_BITS(XSIR1_IOREAD((_pdata), _reg), \ @@ -1642,7 +1647,8 @@ do { \ _reg##_##_field##_WIDTH) #define XSIR1_IOWRITE(_pdata, _reg, _val) \ - rte_read16((_val), (void *)((_pdata)->sir1_regs + (_reg))) + rte_read16((_val), \ + (void *)((uint8_t *)((_pdata)->sir1_regs) + (_reg))) #define XSIR1_IOWRITE_BITS(_pdata, _reg, _field, _val) \ do { \ @@ -1657,7 +1663,7 @@ do { \ * within the register values of SerDes RxTx registers. */ #define XRXTX_IOREAD(_pdata, _reg) \ - rte_read16((void *)((_pdata)->rxtx_regs + (_reg))) + rte_read16((void *)((uint8_t *)((_pdata)->rxtx_regs) + (_reg))) #define XRXTX_IOREAD_BITS(_pdata, _reg, _field) \ GET_BITS(XRXTX_IOREAD((_pdata), _reg), \ @@ -1665,7 +1671,8 @@ do { \ _reg##_##_field##_WIDTH) #define XRXTX_IOWRITE(_pdata, _reg, _val) \ - rte_write16((_val), (void *)((_pdata)->rxtx_regs + (_reg))) + rte_write16((_val), \ + (void *)((uint8_t *)((_pdata)->rxtx_regs) + (_reg))) #define XRXTX_IOWRITE_BITS(_pdata, _reg, _field, _val) \ do { \ @@ -1690,7 +1697,7 @@ do { \ _prefix##_##_field##_WIDTH, (_val)) #define XP_IOREAD(_pdata, _reg) \ - rte_read32((void *)((_pdata)->xprop_regs + (_reg))) + rte_read32((void *)((uint8_t *)((_pdata)->xprop_regs) + (_reg))) #define XP_IOREAD_BITS(_pdata, _reg, _field) \ GET_BITS(XP_IOREAD((_pdata), (_reg)), \ @@ -1698,7 +1705,8 @@ do { \ _reg##_##_field##_WIDTH) #define XP_IOWRITE(_pdata, _reg, _val) \ - rte_write32((_val), (void *)((_pdata)->xprop_regs + (_reg))) + rte_write32((_val), \ + (void *)((uint8_t *)((_pdata)->xprop_regs) + (_reg))) #define XP_IOWRITE_BITS(_pdata, _reg, _field, _val) \ do { \ @@ -1723,7 +1731,7 @@ do { \ _prefix##_##_field##_WIDTH, (_val)) #define XI2C_IOREAD(_pdata, _reg) \ - rte_read32((void *)((_pdata)->xi2c_regs + (_reg))) + rte_read32((void *)((uint8_t *)((_pdata)->xi2c_regs) + (_reg))) #define XI2C_IOREAD_BITS(_pdata, _reg, _field) \ GET_BITS(XI2C_IOREAD((_pdata), (_reg)), \ @@ -1731,7 +1739,8 @@ do { \ _reg##_##_field##_WIDTH) #define XI2C_IOWRITE(_pdata, _reg, _val) \ - rte_write32((_val), (void *)((_pdata)->xi2c_regs + (_reg))) + rte_write32((_val), \ + (void *)((uint8_t *)((_pdata)->xi2c_regs) + (_reg))) #define XI2C_IOWRITE_BITS(_pdata, _reg, _field, _val) \ do { \ diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index 84adf96..fca5a2a 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -710,10 +710,12 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) rte_eth_copy_pci_info(eth_dev, pci_dev); pdata->xgmac_regs = - (uint64_t)pci_dev->mem_resource[AXGBE_AXGMAC_BAR].addr; - pdata->xprop_regs = pdata->xgmac_regs + AXGBE_MAC_PROP_OFFSET; - pdata->xi2c_regs = pdata->xgmac_regs + AXGBE_I2C_CTRL_OFFSET; - pdata->xpcs_regs = (uint64_t)pci_dev->mem_resource[AXGBE_XPCS_BAR].addr; + (void *)pci_dev->mem_resource[AXGBE_AXGMAC_BAR].addr; + pdata->xprop_regs = (void *)((uint8_t *)pdata->xgmac_regs + + AXGBE_MAC_PROP_OFFSET); + pdata->xi2c_regs = (void *)((uint8_t *)pdata->xgmac_regs + + AXGBE_I2C_CTRL_OFFSET); + pdata->xpcs_regs = (void *)pci_dev->mem_resource[AXGBE_XPCS_BAR].addr; /* version specific driver data*/ if (pci_dev->id.device_id == 0x1458) diff --git a/drivers/net/axgbe/axgbe_ethdev.h b/drivers/net/axgbe/axgbe_ethdev.h index a36a341..a4fa94f 100644 --- a/drivers/net/axgbe/axgbe_ethdev.h +++ b/drivers/net/axgbe/axgbe_ethdev.h @@ -567,10 +567,10 @@ struct axgbe_port { struct axgbe_version_data *vdata; /* AXGMAC/XPCS related mmio registers */ - uint64_t xgmac_regs; /* AXGMAC CSRs */ - uint64_t xpcs_regs; /* XPCS MMD registers */ - uint64_t xprop_regs; /* AXGBE property registers */ - uint64_t xi2c_regs; /* AXGBE I2C CSRs */ + void *xgmac_regs; /* AXGMAC CSRs */ + void *xpcs_regs; /* XPCS MMD registers */ + void *xprop_regs; /* AXGBE property registers */ + void *xi2c_regs; /* AXGBE I2C CSRs */ /* XPCS indirect addressing lock */ unsigned int xpcs_window_def_reg; diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index 3e92f84..7981cdd 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -192,9 +192,9 @@ int axgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, rxq->queue_id = queue_idx; rxq->port_id = dev->data->port_id; rxq->nb_desc = rx_desc; - rxq->dma_regs = pdata->xgmac_regs + DMA_CH_BASE + - (DMA_CH_INC * rxq->queue_id); - rxq->dma_tail_reg = (volatile uint32_t *)(rxq->dma_regs + + rxq->dma_regs = (void *)((uint8_t *)pdata->xgmac_regs + DMA_CH_BASE + + (DMA_CH_INC * rxq->queue_id)); + rxq->dma_tail_reg = (volatile uint32_t *)((uint8_t *)rxq->dma_regs + DMA_CH_RDTR_LO); rxq->crc_len = (uint8_t)((dev->data->dev_conf.rxmode.hw_strip_crc) ? 0 : @@ -509,9 +509,9 @@ int axgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, txq->desc = tz->addr; txq->queue_id = queue_idx; txq->port_id = dev->data->port_id; - txq->dma_regs = pdata->xgmac_regs + DMA_CH_BASE + - (DMA_CH_INC * txq->queue_id); - txq->dma_tail_reg = (volatile uint32_t *)(txq->dma_regs + + txq->dma_regs = (void *)((uint8_t *)pdata->xgmac_regs + DMA_CH_BASE + + (DMA_CH_INC * txq->queue_id)); + txq->dma_tail_reg = (volatile uint32_t *)((uint8_t *)txq->dma_regs + DMA_CH_TDTR_LO); txq->cur = 0; txq->dirty = 0; diff --git a/drivers/net/axgbe/axgbe_rxtx.h b/drivers/net/axgbe/axgbe_rxtx.h index 6cac673..8bf774c 100644 --- a/drivers/net/axgbe/axgbe_rxtx.h +++ b/drivers/net/axgbe/axgbe_rxtx.h @@ -201,7 +201,7 @@ struct axgbe_rx_queue { /* Ring physical address */ uint64_t ring_phys_addr; /* Dma Channel register address */ - uint64_t dma_regs; + void *dma_regs; /* Dma channel tail register address*/ volatile uint32_t *dma_tail_reg; /* DPDK queue index */ @@ -248,7 +248,7 @@ struct axgbe_tx_queue { /* Physical address of ring */ uint64_t ring_phys_addr; /* Dma channel register space */ - uint64_t dma_regs; + void *dma_regs; /* Dma tail register address of ring*/ volatile uint32_t *dma_tail_reg; /* Tx queue index/id*/ diff --git a/drivers/net/axgbe/axgbe_rxtx.h.orig b/drivers/net/axgbe/axgbe_rxtx.h.orig new file mode 100644 index 0000000..6cac673 --- /dev/null +++ b/drivers/net/axgbe/axgbe_rxtx.h.orig @@ -0,0 +1,307 @@ +/*- + * Copyright(c) 2017 Advanced Micro Devices, Inc. + * All rights reserved. + * + * AMD 10Gb Ethernet driver + * + * This file is available to you under your choice of the following two + * licenses: + * + * License 1: GPLv2 + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * + * This file is free software; you may copy, redistribute and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2013 Synopsys, Inc. + * + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + * + * License 2: Modified BSD + * + * Copyright (c) 2017 Advanced Micro Devices, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of Advanced Micro Devices, Inc. nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * This file incorporates work covered by the following copyright and + * permission notice: + * + * Copyright (c) 2013 Synopsys, Inc. + * + * The Synopsys DWC ETHER XGMAC Software Driver and documentation + * (hereinafter "Software") is an unsupported proprietary work of Synopsys, + * Inc. unless otherwise expressly agreed to in writing between Synopsys + * and you. + * + * The Software IS NOT an item of Licensed Software or Licensed Product + * under any End User Software License Agreement or Agreement for Licensed + * Product with Synopsys or any supplement thereto. Permission is hereby + * granted, free of charge, to any person obtaining a copy of this software + * annotated with this license and the Software, to deal in the Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished + * to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" + * BASIS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _AXGBE_RXTX_H_ +#define _AXGBE_RXTX_H_ + +/* to suppress gcc warnings related to descriptor casting */ +#ifdef RTE_TOOLCHAIN_GCC +#pragma GCC diagnostic ignored "-Wcast-qual" +#endif +#ifdef RTE_TOOLCHAIN_CLANG +#pragma GCC diagnostic ignored "-Wcast-qual" +#endif + +/* Descriptor related defines */ +#define AXGBE_MAX_RING_DESC 4096 /*should be power of 2*/ +#define AXGBE_TX_DESC_MIN_FREE (AXGBE_MAX_RING_DESC >> 3) +#define AXGBE_TX_DESC_MAX_PROC (AXGBE_MAX_RING_DESC >> 1) +#define AXGBE_MIN_RING_DESC 32 +#define RTE_AXGBE_DESCS_PER_LOOP 4 +#define RTE_AXGBE_MAX_RX_BURST 32 + +#define AXGBE_RX_FREE_THRESH 32 +#define AXGBE_TX_FREE_THRESH 32 + +#define AXGBE_DESC_ALIGN 128 +#define AXGBE_DESC_OWN 0x80000000 +#define AXGBE_ERR_STATUS 0x000f0000 +#define AXGBE_L3_CSUM_ERR 0x00050000 +#define AXGBE_L4_CSUM_ERR 0x00060000 + +#include "axgbe_common.h" + +#define AXGBE_GET_DESC_PT(_queue, _idx) \ + (((_queue)->desc) + \ + ((_idx) & ((_queue)->nb_desc - 1))) + +#define AXGBE_GET_DESC_IDX(_queue, _idx) \ + ((_idx) & ((_queue)->nb_desc - 1)) \ + +/* Rx desc format */ +union axgbe_rx_desc { + struct { + uint64_t baddr; + uint32_t desc2; + uint32_t desc3; + } read; + struct { + uint32_t desc0; + uint32_t desc1; + uint32_t desc2; + uint32_t desc3; + } write; +}; + +struct axgbe_rx_queue { + /* membuf pool for rx buffers */ + struct rte_mempool *mb_pool; + /* H/w Rx buffer size configured in DMA */ + unsigned int buf_size; + /* CRC h/w offload */ + uint16_t crc_len; + /* address of s/w rx buffers */ + struct rte_mbuf **sw_ring; + /* Port private data */ + struct axgbe_port *pdata; + /* Number of Rx descriptors in queue */ + uint16_t nb_desc; + /* max free RX desc to hold */ + uint16_t free_thresh; + /* Index of descriptor to check for packet availability */ + uint64_t cur; + /* Index of descriptor to check for buffer reallocation */ + uint64_t dirty; + /* Software Rx descriptor ring*/ + volatile union axgbe_rx_desc *desc; + /* Ring physical address */ + uint64_t ring_phys_addr; + /* Dma Channel register address */ + uint64_t dma_regs; + /* Dma channel tail register address*/ + volatile uint32_t *dma_tail_reg; + /* DPDK queue index */ + uint16_t queue_id; + /* dpdk port id*/ + uint16_t port_id; + /* queue stats */ + uint64_t pkts; + uint64_t bytes; + uint64_t errors; + /* Number of mbufs allocated from pool*/ + uint64_t mbuf_alloc; + +} ____cacheline_aligned; + +/*Tx descriptor format */ +struct axgbe_tx_desc { + phys_addr_t baddr; + uint32_t desc2; + uint32_t desc3; +}; + +struct axgbe_tx_queue { + /* Port private data reference */ + struct axgbe_port *pdata; + /* Number of Tx descriptors in queue*/ + uint16_t nb_desc; + /* Start freeing TX buffers if there are less free descriptors than + * this value + */ + uint16_t free_thresh; + /* Available descriptors for Tx processing*/ + uint16_t nb_desc_free; + /* Batch of mbufs/descs to release */ + uint16_t free_batch_cnt; + /* Flag for vector support */ + uint16_t vector_disable; + /* Index of descriptor to be used for current transfer */ + uint64_t cur; + /* Index of descriptor to check for transfer complete */ + uint64_t dirty; + /* Virtual address of ring */ + volatile struct axgbe_tx_desc *desc; + /* Physical address of ring */ + uint64_t ring_phys_addr; + /* Dma channel register space */ + uint64_t dma_regs; + /* Dma tail register address of ring*/ + volatile uint32_t *dma_tail_reg; + /* Tx queue index/id*/ + uint16_t queue_id; + /* Reference to hold Tx mbufs mapped to Tx descriptors freed + * after transmission confirmation + */ + struct rte_mbuf **sw_ring; + /* dpdk port id*/ + uint16_t port_id; + /* queue stats */ + uint64_t pkts; + uint64_t bytes; + uint64_t errors; + +} __rte_cache_aligned; + +/*Queue related APIs */ + +/* + * RX/TX function prototypes + */ + + +void axgbe_dev_tx_queue_release(void *txq); +int axgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, + uint16_t nb_tx_desc, unsigned int socket_id, + const struct rte_eth_txconf *tx_conf); +void axgbe_dev_enable_tx(struct rte_eth_dev *dev); +void axgbe_dev_disable_tx(struct rte_eth_dev *dev); +int axgbe_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id); +int axgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id); + +uint16_t axgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts); +uint16_t axgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts); + + +void axgbe_dev_rx_queue_release(void *rxq); +int axgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, + uint16_t nb_rx_desc, unsigned int socket_id, + const struct rte_eth_rxconf *rx_conf, + struct rte_mempool *mb_pool); +void axgbe_dev_enable_rx(struct rte_eth_dev *dev); +void axgbe_dev_disable_rx(struct rte_eth_dev *dev); +int axgbe_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id); +int axgbe_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id); +uint16_t axgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts); +uint16_t axgbe_recv_pkts_threshold_refresh(void *rx_queue, + struct rte_mbuf **rx_pkts, + uint16_t nb_pkts); +void axgbe_dev_clear_queues(struct rte_eth_dev *dev); + +#endif /* _AXGBE_RXTX_H_ */ -- 2.7.4