From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0057.outbound.protection.outlook.com [104.47.36.57]) by dpdk.org (Postfix) with ESMTP id 342E8FAF3 for ; Mon, 19 Dec 2016 16:30:15 +0100 (CET) Received: from BN3PR03CA0108.namprd03.prod.outlook.com (10.174.66.26) by BY2PR0301MB0743.namprd03.prod.outlook.com (10.160.63.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Mon, 19 Dec 2016 15:30:13 +0000 Received: from BN1AFFO11FD042.protection.gbl (2a01:111:f400:7c10::173) by BN3PR03CA0108.outlook.office365.com (2603:10b6:400:4::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8 via Frontend Transport; Mon, 19 Dec 2016 15:30:12 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD042.mail.protection.outlook.com (10.58.52.253) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Mon, 19 Dec 2016 15:30:12 +0000 Received: from [127.0.0.1] ([10.232.133.65]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBJFU64H000627; Mon, 19 Dec 2016 08:30:09 -0700 To: Ferruh Yigit , References: <1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com> <1480875447-23680-21-git-send-email-hemant.agrawal@nxp.com> <4a688759-269f-3556-e32c-df14ccfa3b9a@intel.com> CC: , , From: Hemant Agrawal Message-ID: Date: Mon, 19 Dec 2016 21:00:05 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <4a688759-269f-3556-e32c-df14ccfa3b9a@intel.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131266350126159123; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(2980300002)(1109001)(1110001)(3190300001)(339900001)(24454002)(189002)(377454003)(199003)(65956001)(2906002)(47776003)(50466002)(65806001)(106466001)(83506001)(356003)(305945005)(85426001)(69596002)(8936002)(15395725005)(8676002)(104016004)(81156014)(230700001)(81166006)(68736007)(36756003)(626004)(2950100002)(50986999)(77096006)(189998001)(76176999)(5001770100001)(97736004)(6666003)(4326007)(38730400001)(92566002)(7246003)(7126002)(5660300001)(54356999)(86362001)(65826007)(229853002)(23746002)(31696002)(4001350100001)(33646002)(64126003)(31686004)(8666005)(120886001)(105606002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0743; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD042; 1:0wIosvslAmMlccdIBSvlhSfX1B4HjyrhYygHNEu1VTlUOUYUy59p9ANOu0j61MGs4MqyYo9sfbjE7rFtzxhBJJQ9lurLaZiGo2DqGOyI4d0W/+C6wxNcCSUixsAx7YV0kchwtUYyg5V0bNfqpcu0BLETM7i30wYiUnwFIUT+NkpKcviowKKVfCCshXSTJXZ/D+SMmxoJjcQ/TdQx39t2viaMLA+vv5FRAnb4lKy4sDpxx7RiXnvozoQuXDLDKFBurYznA+27c5Pfqr54fRZlm9jUfGbwyKwIGiD2d56yUkF0sbx3lcz5S4Rc4bipP+KVmbG+n+EGvsCW2SRQsU00tkNpjFfLQR4sNZi81Sj+Cyw0Xa4xsnpkYWMbeH6Ko/ZSIpXEzAcfw1OZy9s+7xWjt263hc0eNBNMpElsk+/Msbv258L+qRlzn7A84tBJZBswKIZkxxuZmzjkV7OqXpC01Z/HZ+BnAr4ZIUNV48ODe2Bdm5aod71BBh890NSHHdRviwTxNUESAS0T+1ewmSpBGB13TcxruTGjlLuMBZK+NxeF8BKd6GOhccQQ03GRXxYPoAofFyUm+mecJS80Pysw9N4Nnve9/9PpSqGWgLcVvr8obIhcpLLObF/1ZoYXnd1WeAUkkBCB3iXxon9CdzdpK107/xiuRxWuI7aDGHF5DA0= X-MS-Office365-Filtering-Correlation-Id: 67ee76ec-64d5-40d5-f3b2-08d42823ecaf X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY2PR0301MB0743; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0743; 3:Kejvbf2vvTmfFdqL1pgZSE1BqZ+pbjGEkOdbQnxuHuj9enz4l4Jc8UEIyw83MugI80E7+ABHGVNVIHLqQcG/OZCNMDI2AiF0Qzi0Xxp85DRBfcuTfDgZt9YLszI0u2YJkvDAOAucc9dSGtx6Gd8dGbiaMYJTvnCyo+nrH+Ax9WNQGrcpIFgKe3txAF90ehVdCex5IRfRv7wyzcQtyDLBof+t1Xp/UjaGyxqK5zuzC5JZVYVh1MRyvTBtRXorpg1NsTjoLLkNWI0V3Eq4CXCNzR6cXKrcZJTgNqC/AP8ikXDDku+P/hi2Nz7F+yu8H2X/CVqreY7FPAzpwE5MT01Bn29y5/qLZOnNOOzSAWUQky9pHIUxPlDVklBvt8UtMgSb; 25:yOsD2zy20j2yCj3moxAhs22jq2HSg189dPKyHd5vil0XqkruD0I6ZT1Tqwruy25oH5qWmaGqJ6PU9eEwm3xSa00XiCcP0hl6DHmRBQAOdX3X/RGeJ25v25efoViXhz+q+EAJ0IK7LQYBkbrLQcNh90SS9wfjoEJazqp4LDJlDu7pD3QRPdP8xoGTS1rNyspbi7d/YU44D6zVUcpuoXDDoy9m146bZDqeNVDwDa4294Evt3veQnK02g90gOxIgezIHLWh2RQxZlbQJw7gQoBv8ByoHjWux3SfaYlvBNyXOdO+wN92pG+1RR+OrxXuEK26k0oopsGYHkvdl4Y5AMHJYBPevMmh+f294u9hLFG2zYPhLyTWOqM4uxTVpcHZi0TKa6dK17gah2j1V2Z6W0kGQrhnwYQM6Snidrb10e5zLn8llLH8cu7lU33BeFDxPaPCGXxrUSQeS26nBk+ecrCnoQ== X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0743; 31:N1sfRdJ6QuZHnfg+eg8bd4LNOTMsrNK4d4qxfNn3+iguOeyy6EdpupwecFXZdIie9BZyaae90btwDjFJZ4jJ2w8Vj8lzmM5id6VS3E5vRwpu5V2uNxKITqDVJ2Iz+Ujkrv0hn0wiVewuiBh4pKsGE8AP/WcRBcYqYTOApYs77x8oVNcpS8LYDeLYZX6ktyrPRdRSXsKzPIZuYT8KiOb7z0gHnqbSdb0Fs96j63hVPMw34b6ttfI59W9Hp/j34QS3pMgBcy/miRW/+jyBAxPRV4i/pQk/HLkRxKJZfe00e/k= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(13017025)(13018025)(13015025)(13024025)(13023025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6096035)(20161123563025)(20161123565025)(20161123556025)(20161123559025)(20161123561025); SRVR:BY2PR0301MB0743; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0743; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0743; 4:TqgDUOmpKignPtVwShE60A1zOlvI9R42CAaHHmNXApflLuxsM9GlyeIP3puKROvSXl1Xdxte4SOa5EFMNs2javTxN6H4P0Np3X1vMjHgrI3+bhmUZWxO9cigfMxxBQA3Kx9Eod3zrZ24869GgJqPG7FHwy6frHsuKZr0pq8MQG9TP63gGEf14jAeeOcQOjd4k2Yn67I+rcoWZ0zS56HkrGwou/dl2Gdorqm6fbpzB6gurj2NpTllTfuzoXSZXn47tRV0WyGNJD7S1G6gtXXHH4AVa8pPe8PaE0zg4W4y8oqJdWhfgXVHZ7BEX+YVDdbmAzRJw6eH/DMwkIUyZnxcUWa2OPMK2g+8kiGgUUChc3An4BE/wPOY8Ab5+rtlgDF+iWbMhlwo0EbT4pOaNaCsQvUY4pNAcfxTfOvyk2E+xC9GX5XAsLrWMoX258pr8vQGPvNOjjbcBJPdtHmY5n4csT+2iyRDv87AdjMbPFd5WK2gd7Bc964gAHnFeLrCzSCoCj+yKfCjIDuRD1ycM04ix/wLrGUx7kgVkLUZhAjXDZESTiwqt3GmpvYy4WHbiX7OyusKlCDjYCCFYNNVtyKXVWs78WWad01Qd3/PPogrvw6jjHAvUzR1s4RBrmdqCVSVvAWlGOlM8IEYUhWADcrCDyCyLapOYhfbyvYbtp35G0R3N2h7K8UTD6QT10pAkIw5Kw7jM82BDu3+GbuPTCb4Kiz9KOLIeQO+c8hyE+tb+IJ+x3hJKymFeeAtH+pheoUS X-Forefront-PRVS: 01613DFDC8 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BY2PR0301MB0743; 23:ycOsdj12G0F3ODY77fs9d1lYwXQKgysyTCo?= =?Windows-1252?Q?QCcM3uiWFQETmzcSuTIj42pVlTuOkYKpAvfZhGnkzskYxiCwVf3AK+5r?= =?Windows-1252?Q?dr40+xFb2gbJuKabbPtH/K+MQAMMPqe1riKiDiA9MJy/3JV1typlGnit?= =?Windows-1252?Q?GXuHXlCAz/o2wAQXKfYtGqWk69D78PMJIpEt5Ga1xZrV7WxfB+OqxdAX?= =?Windows-1252?Q?aTWq5JPY5EGlsdfbA90g6B1xLyaWtiGga24YdqYv/GQqve2Ob03eyTT0?= =?Windows-1252?Q?oQSrlIQa+Lbs7z/UFUg6DXlxq3Qb2TdSPRFWHf1uZffJOSCBoxWbAO0S?= =?Windows-1252?Q?bGsvdZgKTCSeT/M9N34Rjgxlcaj2FOtWQggb0Fas3Bbzfj6q+q7+x04U?= =?Windows-1252?Q?oW7yIyoX5MQ5c1i3qJm2JKKZyHZ9klyF+Z8D3pkyczJHGe/qj67nTp8S?= =?Windows-1252?Q?YKW2fTf9Pt8dbL7cBxiljEh7XXKUVXb6cY/kFgJiP6glNPhOSEEQqx4p?= =?Windows-1252?Q?XayQ/RRqtbZOUpuM8HIk0Lqky2EEEwt1tM0mtbPiVlHb8F6yvvELIcu7?= =?Windows-1252?Q?WvlRwAynySnbq/k3AMlThoAocJXwJAj1KxYzv1oWNSSUQaO/i4nWBx1p?= =?Windows-1252?Q?t7alUfmqJpLMQc5jlggoRE4zCTeWpT8+1MCDjSMmnjOEZ2S7JkJptR6G?= =?Windows-1252?Q?675utiNkU/+ySxO2BAgF+d76svL9NDWHndhpTu5UZFiS9Pd1BQlSBk7l?= =?Windows-1252?Q?mdD9YFIpgvK7w5ImftaRZSH8It7346y3xWUnG19nfvbhGZOwU2fhVOVf?= =?Windows-1252?Q?s00tm/7mKirsm6/0qzsnoQDVn1uUukClS1ryUiZmRDG6VGw+kRAvPWQa?= =?Windows-1252?Q?95FpAAZCfJDk0wLI5naX6n6aDExlM8PupCP/O4ntMXdx6RUPhT2oa3XF?= =?Windows-1252?Q?h4vzCX4sE1rk+b9Z0A6kXzZGVnoIbtmz0QAony3TYrbUpQpki10/mMp0?= =?Windows-1252?Q?PktrT9Op040fnYv/4ctwEpluVIE++zM1NfV8agHHDZHzOL7tBKjotqtn?= =?Windows-1252?Q?TCI5ZxqOahvCoSW43SpkFXMa+g9F6H37glfvKuvdO76adhbBHt0EFRs+?= =?Windows-1252?Q?9sJmbebH+sXn3zlXyH7/LYEfiP+RNTGa0XzJmimEYjIxOqZT39K/SdAt?= =?Windows-1252?Q?wGtm1vmgKF9Ykhae27e7yyfAKetDtkQVa7bdZIZ0AnNG/c+Ljb3wGxW1?= =?Windows-1252?Q?t13v+FlKdF+rjxk2EDg1RVIClcmYi0CLIwfR2GvxtTCB92uTIJeSO0oM?= =?Windows-1252?Q?0uoKFGp6OmZBVKnan8bVQ1tdbELUbh6+eP6W6HqrCBsiHj/YqY9uftLh?= =?Windows-1252?Q?33j/bjUwZuRmC4t/2iPc+1ubraKcIrMOt2mURr6RzO1mKpuktQHiMhb+?= =?Windows-1252?Q?o+xfwXxxG6RGKgDNYMUG05ehiKSz1tudLi6thw7YSkQ7lFxxgWAjfbxL?= =?Windows-1252?Q?pSw4iVIJECNROC6c6zb7pJYi6k3xPuSE/nRyvRB/ys8DlqVqWhqnPnWA?= =?Windows-1252?Q?9NlVLkU/vXwo01xc=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0743; 6:MaVYppmqtGTStp8yRYe1V+NUrqqFJnZDI+F09zlY07M8PStY/hKGs6k5/1eS+I3edTz8GxKHYXCix7AbRoatAFx7Eud6HoUscZi28ny704LTh4k1J3c5nhZ7jgx2nA4jJwaeZt67aV45JKOhDULKIjlSEodN2UIXZ6iH/jvVKNHrgm06ksey25ll3vZlO4qIqVeUvkZzG4OOqGQw+1mZqKf7xWZvA2Rdx3aiHFBpzIhs8SUF2T/5MoOpgLL8yRiQxsoDZv5aAhPEenO1qOvO992G6F0MP8ZB4HfBNysYR1sLdEnIwNvN8RZctjE+o910qY301++hbFl9L9o//Wmduhyu57q4YOwKovMeE5cKchZCvqM3c9YPMyn+GEnk6ta9+Sg7WZ4FGl6xDUSvc6oHL2V3YtRJm/frOVSJLrcjpxnTKLBps3yQYEnWQZIwdohM; 5:6z9nwwXAV1qgLGfYlUVq1RiutlyVyeFk6c7PRb/sepjW1WJ8M11o6dv/rsE5aDjfVKMpb9hOpmp2ueNo68xUsjJdngBWYRKcuxbj6GPUA4RaM18UPRK+IhenjcYaqxNSrxPoOgU3AeCxAqRJgoOr6DhFZImwYEV2xcQsDtnjTZC2ZDPY4J3nAy+TnpEkS+AG; 24:44Z2Y0/mss62NBi+FbxC3hugVKFjzTYRLb0JVs7uezMpb81Embis3UpAtWjksTJXqL0cx9oN0wnizPcUnB/WS5nGHL9FlSPODFMRpDRAt7I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0743; 7:NKRC2jyV1uE41J1D7VDo71YmNl95fPw17Ljizy2j7GBSIc1hqXoz9fL8kkBAUXhQyqciCQ7TSMc9Ivpx4NOI38Llki8YXd9W8LkxVOfsEwnlU3pKpAfO2Ha3x5gV3UvMJ9lXEveoLhpr/JqKWOD3EfmFC1Gnv8fM9J+AhEar+ZsP3odZDAzAUIg3lTEldWQwiY+JZ1yxvoYjEp2apXcM4iuThQbNDFdcWdzXrHRx5QjyC9Y0kiGUMhDGVA05jBlqNcnQMS/G+TLuOZyWof8VIxWhkVsS79z5Z7yed5vzdEbcXoeQ7hfTJVQ/TyK29j2P5baAnDmVmHoe/Y4Rvq7mcxdHjAXlmU2midz2ZU0TCRysX2+rb0J1l83iMPuEFzizQ3y4K8FYt6yl2g7bFskz4RlcN7P2EF0YiHFx+qSJldKUfLAzTQLxf5vus7qN/q15BwQesqaCJ0C4FJ+RCTUEhw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2016 15:30:12.3663 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0743 Subject: Re: [dpdk-dev] [PATCH 20/32] net/dpaa2: add queue configuration support 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, 19 Dec 2016 15:30:15 -0000 On 12/7/2016 1:19 AM, Ferruh Yigit wrote: > On 12/4/2016 6:17 PM, Hemant Agrawal wrote: >> Signed-off-by: Hemant Agrawal >> --- >> doc/guides/nics/features/dpaa2.ini | 1 + >> drivers/net/dpaa2/base/dpaa2_hw_dpni.h | 14 +- >> drivers/net/dpaa2/base/dpaa2_hw_pvt.h | 21 +++ >> drivers/net/dpaa2/dpaa2_ethdev.c | 254 ++++++++++++++++++++++++++++++++- >> 4 files changed, 288 insertions(+), 2 deletions(-) >> >> diff --git a/doc/guides/nics/features/dpaa2.ini b/doc/guides/nics/features/dpaa2.ini >> index b176208..0b59725 100644 >> --- a/doc/guides/nics/features/dpaa2.ini >> +++ b/doc/guides/nics/features/dpaa2.ini >> @@ -4,6 +4,7 @@ >> ; Refer to default.ini for the full list of available PMD features. >> ; >> [Features] >> +Queue start/stop = Y >> Linux VFIO = Y >> ARMv8 = Y >> Usage doc = Y >> diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.h b/drivers/net/dpaa2/base/dpaa2_hw_dpni.h >> index 1b655e4..197fd28 100644 >> --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.h >> +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.h >> @@ -36,15 +36,27 @@ >> >> #include >> #include >> + >> +#define MAX_RX_QUEUES 16 >> +#define MAX_TX_QUEUES 16 >> + >> +/*default tc to be used for ,congestion, distribution etc configuration. */ >> +#define DPAA2_DEF_TC 0 >> + >> /*! Global MCP list */ >> extern void *(*mcp_ptr_list); >> >> - >> struct dpaa2_dev_priv { >> void *hw; >> int32_t hw_id; >> + int32_t qdid; >> uint16_t token; >> + uint8_t nb_tx_queues; >> + uint8_t nb_rx_queues; >> + void *rx_vq[MAX_RX_QUEUES]; >> + void *tx_vq[MAX_TX_QUEUES]; >> >> + uint8_t num_tc; >> uint8_t flags; /*dpaa2 config flags */ >> }; >> #endif /* _DPAA2_DPNI_H_ */ >> diff --git a/drivers/net/dpaa2/base/dpaa2_hw_pvt.h b/drivers/net/dpaa2/base/dpaa2_hw_pvt.h >> index 5038209..867611f 100644 >> --- a/drivers/net/dpaa2/base/dpaa2_hw_pvt.h >> +++ b/drivers/net/dpaa2/base/dpaa2_hw_pvt.h >> @@ -37,9 +37,12 @@ >> #include >> #include >> >> +#define DPAA2_DQRR_RING_SIZE 16 >> + /** > >> #define MC_PORTAL_INDEX 0 >> #define NUM_DPIO_REGIONS 2 >> +#define NUM_DQS_PER_QUEUE 2 >> >> #define MEMPOOL_F_HW_PKT_POOL 0x8000 /**< mpool flag to check offloaded pool */ >> >> @@ -70,6 +73,24 @@ struct dpaa2_dpio_dev { >> int32_t hw_id; /**< An unique ID of this DPIO device instance */ >> }; >> >> +struct queue_storage_info_t { >> + struct qbman_result *dq_storage[NUM_DQS_PER_QUEUE]; >> +}; >> + >> +struct dpaa2_queue { >> + struct rte_mempool *mb_pool; /**< mbuf pool to populate RX ring. */ >> + void *dev; >> + int32_t eventfd; /*!< Event Fd of this queue */ >> + uint32_t fqid; /*!< Unique ID of this queue */ >> + uint8_t tc_index; /*!< traffic class identifier */ >> + uint16_t flow_id; /*!< To be used by DPAA2 frmework */ >> + uint64_t rx_pkts; >> + uint64_t tx_pkts; >> + uint64_t err_pkts; >> + struct queue_storage_info_t *q_storage; >> +}; >> + >> /*! Global MCP list */ >> extern void *(*mcp_ptr_list); >> + >> #endif >> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c >> index daf59c1..45c3f8f 100644 >> --- a/drivers/net/dpaa2/dpaa2_ethdev.c >> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c >> @@ -46,10 +46,94 @@ >> #include >> >> #include >> +#include >> #include >> /* DPDK Interfaces */ >> #include >> >> +/* Name of the DPAA2 Net PMD */ >> +static const char *drivername = "DPNI PMD"; >> + >> +static void >> +dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) >> +{ >> + struct dpaa2_dev_priv *priv = dev->data->dev_private; >> + >> + PMD_INIT_FUNC_TRACE(); >> + >> + dev_info->driver_name = drivername; > > Please check patches > http://dpdk.org/dev/patchwork/patch/17170/ > http://dpdk.org/dev/patchwork/patch/17171/ > ok. I have taken care of it. >> + dev_info->if_index = priv->hw_id; >> + >> + dev_info->max_rx_queues = (uint16_t)priv->nb_rx_queues; >> + dev_info->max_tx_queues = (uint16_t)priv->nb_tx_queues; >> +} >> + >> +static int >> +dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) >> +{ >> + struct dpaa2_dev_priv *priv = dev->data->dev_private; >> + uint16_t dist_idx; >> + uint32_t vq_id; >> + struct dpaa2_queue *mc_q, *mcq; >> + uint32_t tot_queues; >> + int i; >> + struct dpaa2_queue *dpaa2_q; >> + >> + PMD_INIT_FUNC_TRACE(); >> + >> + tot_queues = priv->nb_rx_queues + priv->nb_tx_queues; >> + mc_q = rte_malloc(NULL, sizeof(struct dpaa2_queue) * tot_queues, >> + RTE_CACHE_LINE_SIZE); >> + if (!mc_q) { >> + PMD_INIT_LOG(ERR, "malloc failed for rx/tx queues\n"); >> + return -1; >> + } >> + >> + for (i = 0; i < priv->nb_rx_queues; i++) { >> + mc_q->dev = dev; >> + priv->rx_vq[i] = mc_q++; >> + dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[i]; >> + dpaa2_q->q_storage = rte_malloc("dq_storage", >> + sizeof(struct queue_storage_info_t), >> + RTE_CACHE_LINE_SIZE); >> + if (!dpaa2_q->q_storage) >> + goto fail; >> + >> + memset(dpaa2_q->q_storage, 0, >> + sizeof(struct queue_storage_info_t)); >> + dpaa2_q->q_storage->dq_storage[0] = rte_malloc(NULL, >> + DPAA2_DQRR_RING_SIZE * sizeof(struct qbman_result), >> + RTE_CACHE_LINE_SIZE); >> + } >> + >> + for (i = 0; i < priv->nb_tx_queues; i++) { >> + mc_q->dev = dev; >> + mc_q->flow_id = DPNI_NEW_FLOW_ID; >> + priv->tx_vq[i] = mc_q++; >> + } >> + >> + vq_id = 0; >> + for (dist_idx = 0; dist_idx < priv->nb_rx_queues; dist_idx++) { >> + mcq = (struct dpaa2_queue *)priv->rx_vq[vq_id]; >> + mcq->tc_index = DPAA2_DEF_TC; >> + mcq->flow_id = dist_idx; >> + vq_id++; >> + } >> + >> + return 0; >> +fail: >> + i -= 1; >> + mc_q = priv->rx_vq[0]; >> + while (i >= 0) { >> + dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[i]; >> + rte_free(dpaa2_q->q_storage->dq_storage[0]); >> + rte_free(dpaa2_q->q_storage); >> + priv->rx_vq[i--] = NULL; >> + } >> + rte_free(mc_q); >> + return -1; >> +} >> + >> static int >> dpaa2_eth_dev_configure(struct rte_eth_dev *dev) >> { >> @@ -69,15 +153,134 @@ >> return 0; >> } >> >> +/* Function to setup RX flow information. It contains traffic class ID, >> + * flow ID, destination configuration etc. >> + */ >> static int >> -dpaa2_dev_start(struct rte_eth_dev *dev) >> +dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, >> + uint16_t rx_queue_id, >> + uint16_t nb_rx_desc __rte_unused, >> + unsigned int socket_id __rte_unused, >> + const struct rte_eth_rxconf *rx_conf __rte_unused, >> + struct rte_mempool *mb_pool) >> { >> struct dpaa2_dev_priv *priv = dev->data->dev_private; >> struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; >> + struct dpaa2_queue *dpaa2_q; >> + struct dpni_queue cfg; >> + uint8_t options = 0; >> + uint8_t flow_id; >> + int ret; >> + >> + PMD_INIT_FUNC_TRACE(); >> + >> + PMD_INIT_LOG(DEBUG, "dev =%p, queue =%d, pool = %p, conf =%p", >> + dev, rx_queue_id, mb_pool, rx_conf); >> + >> + dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[rx_queue_id]; >> + dpaa2_q->mb_pool = mb_pool; /**< mbuf pool to populate RX ring. */ >> + >> + /*Get the tc id and flow id from given VQ id*/ >> + flow_id = rx_queue_id; >> + memset(&cfg, 0, sizeof(struct dpni_queue)); >> + >> + options = options | DPNI_QUEUE_OPT_USER_CTX; >> + cfg.user_context = (uint64_t)(dpaa2_q); >> + >> + ret = dpni_set_queue(dpni, CMD_PRI_LOW, priv->token, DPNI_QUEUE_RX, >> + dpaa2_q->tc_index, flow_id, options, &cfg); >> + if (ret) { >> + PMD_INIT_LOG(ERR, "Error in setting the rx flow: = %d\n", ret); >> + return -1; >> + } >> + >> + dev->data->rx_queues[rx_queue_id] = dpaa2_q; >> + return 0; >> +} >> + >> +static int >> +dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev, >> + uint16_t tx_queue_id, >> + uint16_t nb_tx_desc __rte_unused, >> + unsigned int socket_id __rte_unused, >> + const struct rte_eth_txconf *tx_conf __rte_unused) >> +{ >> + struct dpaa2_dev_priv *priv = dev->data->dev_private; >> + struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *) >> + priv->tx_vq[tx_queue_id]; >> + struct fsl_mc_io *dpni = priv->hw; >> + struct dpni_queue tx_conf_cfg; >> + struct dpni_queue tx_flow_cfg; >> + uint8_t options = 0, flow_id; >> + uint32_t tc_id; >> int ret; >> >> PMD_INIT_FUNC_TRACE(); >> >> + /* Return if queue already configured */ >> + if (dpaa2_q->flow_id != DPNI_NEW_FLOW_ID) >> + return 0; >> + >> + memset(&tx_conf_cfg, 0, sizeof(struct dpni_queue)); >> + memset(&tx_flow_cfg, 0, sizeof(struct dpni_queue)); >> + >> + tc_id = 0; >> + flow_id = tx_queue_id; >> + >> + ret = dpni_set_queue(dpni, CMD_PRI_LOW, priv->token, DPNI_QUEUE_TX, >> + tc_id, flow_id, options, &tx_flow_cfg); >> + if (ret) { >> + PMD_INIT_LOG(ERR, "Error in setting the tx flow: " >> + "tc_id=%d, flow =%d ErrorCode = %x\n", >> + tc_id, flow_id, -ret); >> + return -1; >> + } >> + >> + dpaa2_q->flow_id = flow_id; >> + >> + if (tx_queue_id == 0) { >> + /*Set tx-conf and error configuration*/ >> + ret = dpni_set_tx_confirmation_mode(dpni, CMD_PRI_LOW, >> + priv->token, >> + DPNI_CONF_DISABLE); >> + if (ret) { >> + PMD_INIT_LOG(ERR, "Error in set tx conf mode settings" >> + " ErrorCode = %x", ret); >> + return -1; >> + } >> + } >> + dpaa2_q->tc_index = tc_id; >> + >> + dev->data->tx_queues[tx_queue_id] = dpaa2_q; >> + return 0; >> +} >> + >> +static void >> +dpaa2_dev_rx_queue_release(void *q __rte_unused) >> +{ >> + PMD_INIT_FUNC_TRACE(); >> +} >> + >> +static void >> +dpaa2_dev_tx_queue_release(void *q __rte_unused) >> +{ >> + PMD_INIT_FUNC_TRACE(); >> +} >> + >> +static int >> +dpaa2_dev_start(struct rte_eth_dev *dev) >> +{ >> + struct rte_eth_dev_data *data = dev->data; >> + struct dpaa2_dev_priv *priv = data->dev_private; >> + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; >> + struct dpni_queue cfg; >> + uint16_t qdid; >> + struct dpni_queue_id qid; >> + struct dpaa2_queue *dpaa2_q; >> + int ret, i; >> + >> + PMD_INIT_FUNC_TRACE(); >> + >> ret = dpni_enable(dpni, CMD_PRI_LOW, priv->token); >> if (ret) { >> PMD_INIT_LOG(ERR, "Failure %d in enabling dpni %d device\n", >> @@ -85,6 +288,27 @@ >> return ret; >> } >> >> + ret = dpni_get_qdid(dpni, CMD_PRI_LOW, priv->token, >> + DPNI_QUEUE_TX, &qdid); >> + if (ret) { >> + PMD_INIT_LOG(ERR, "Error to get qdid:ErrorCode = %d\n", ret); >> + return ret; >> + } >> + priv->qdid = qdid; >> + >> + for (i = 0; i < data->nb_rx_queues; i++) { >> + dpaa2_q = (struct dpaa2_queue *)data->rx_queues[i]; >> + ret = dpni_get_queue(dpni, CMD_PRI_LOW, priv->token, >> + DPNI_QUEUE_RX, dpaa2_q->tc_index, >> + dpaa2_q->flow_id, &cfg, &qid); >> + if (ret) { >> + PMD_INIT_LOG(ERR, "Error to get flow " >> + "information Error code = %d\n", ret); >> + return ret; >> + } >> + dpaa2_q->fqid = qid.fqid; >> + } >> + >> return 0; >> } >> >> @@ -132,6 +356,11 @@ >> .dev_start = dpaa2_dev_start, >> .dev_stop = dpaa2_dev_stop, >> .dev_close = dpaa2_dev_close, >> + .dev_infos_get = dpaa2_dev_info_get, >> + .rx_queue_setup = dpaa2_dev_rx_queue_setup, >> + .rx_queue_release = dpaa2_dev_rx_queue_release, >> + .tx_queue_setup = dpaa2_dev_tx_queue_setup, >> + .tx_queue_release = dpaa2_dev_tx_queue_release, >> }; >> >> int >> @@ -140,6 +369,7 @@ >> struct rte_device *dev = eth_dev->device; >> struct rte_dpaa2_device *dpaa2_dev; >> struct fsl_mc_io *dpni_dev; >> + struct dpni_attr attr; >> struct dpaa2_dev_priv *priv = eth_dev->data->dev_private; >> int ret, hw_id; >> >> @@ -175,8 +405,30 @@ >> return -1; >> } >> >> + ret = dpni_get_attributes(dpni_dev, CMD_PRI_LOW, priv->token, &attr); >> + if (ret) { >> + PMD_INIT_LOG(ERR, "Failure in getting dpni@%d attribute, " >> + " error code %d\n", hw_id, ret); >> + return -1; >> + } >> + >> + priv->num_tc = attr.num_tcs; >> + priv->nb_rx_queues = attr.num_queues; >> + priv->nb_tx_queues = attr.num_queues; >> + >> + eth_dev->data->nb_rx_queues = priv->nb_rx_queues; >> + eth_dev->data->nb_tx_queues = priv->nb_tx_queues; >> + >> priv->hw = dpni_dev; >> priv->hw_id = hw_id; >> + priv->flags = 0; >> + >> + ret = dpaa2_alloc_rx_tx_queues(eth_dev); >> + if (ret) { >> + PMD_INIT_LOG(ERR, "dpaa2_alloc_rx_tx_queuesFailed\n"); >> + return -ret; >> + } >> + >> eth_dev->dev_ops = &dpaa2_ethdev_ops; >> return 0; >> } >> > >