get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/27965/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 27965,
    "url": "https://patches.dpdk.org/api/patches/27965/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1503658183-4078-11-git-send-email-hemant.agrawal@nxp.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1503658183-4078-11-git-send-email-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1503658183-4078-11-git-send-email-hemant.agrawal@nxp.com",
    "date": "2017-08-25T10:49:26",
    "name": "[dpdk-dev,10/27] net/dpaa2: update MC to 10.3.x",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "07c1c40510925ffe18ef7bd6b26ee217c5768a26",
    "submitter": {
        "id": 477,
        "url": "https://patches.dpdk.org/api/people/477/?format=api",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1503658183-4078-11-git-send-email-hemant.agrawal@nxp.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/27965/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/27965/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 28292917F;\n\tFri, 25 Aug 2017 12:50:27 +0200 (CEST)",
            "from NAM02-SN1-obe.outbound.protection.outlook.com\n\t(mail-sn1nam02on0055.outbound.protection.outlook.com [104.47.36.55])\n\tby dpdk.org (Postfix) with ESMTP id 268F1916B\n\tfor <dev@dpdk.org>; Fri, 25 Aug 2017 12:50:24 +0200 (CEST)",
            "from BN6PR03CA0054.namprd03.prod.outlook.com (10.173.137.16) by\n\tBN6PR03MB3316.namprd03.prod.outlook.com (10.174.233.145) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.1.1385.9; Fri, 25 Aug 2017 10:50:20 +0000",
            "from BY2FFO11FD021.protection.gbl (2a01:111:f400:7c0c::125) by\n\tBN6PR03CA0054.outlook.office365.com (2603:10b6:404:4c::16) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via\n\tFrontend Transport; Fri, 25 Aug 2017 10:50:20 +0000",
            "from tx30smr01.am.freescale.net (192.88.168.50) by\n\tBY2FFO11FD021.mail.protection.outlook.com (10.1.15.210) with\n\tMicrosoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15\n\tvia Frontend Transport; Fri, 25 Aug 2017 10:50:20 +0000",
            "from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net\n\t[10.232.134.28])\n\tby tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id\n\tv7PAnw6E032070; Fri, 25 Aug 2017 03:50:18 -0700"
        ],
        "Authentication-Results": "spf=fail (sender IP is 192.88.168.50)\n\tsmtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed)\n\theader.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;",
        "Received-SPF": "Fail (protection.outlook.com: domain of nxp.com does not\n\tdesignate 192.88.168.50 as permitted sender)\n\treceiver=protection.outlook.com; \n\tclient-ip=192.88.168.50; helo=tx30smr01.am.freescale.net;",
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <shreyansh.jain@nxp.com>",
        "Date": "Fri, 25 Aug 2017 16:19:26 +0530",
        "Message-ID": "<1503658183-4078-11-git-send-email-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com>",
        "References": "<1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com>",
        "X-EOPAttributedMessage": "0",
        "X-Matching-Connectors": "131481318205261591;\n\t(91ab9b29-cfa4-454e-5278-08d120cd25b8); ()",
        "X-Forefront-Antispam-Report": "CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI;\n\tSFV:NSPM;\n\tSFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(51234002)(189002)(199003)(48376002)(2351001)(5660300001)(50466002)(97736004)(47776003)(33646002)(68736007)(105606002)(77096006)(104016004)(305945005)(5003940100001)(189998001)(626005)(106466001)(50226002)(356003)(16200700003)(36756003)(5890100001)(8656003)(8676002)(85426001)(53946003)(54906002)(53936002)(86362001)(4326008)(8936002)(6666003)(2906002)(81166006)(498600001)(81156014)(2950100002)(6916009)(15650500001)(110136004)(50986999)(76176999)(2004002)(569006);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB3316;\n\tH:tx30smr01.am.freescale.net; \n\tFPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; BY2FFO11FD021;\n\t1:CDAKVMTAcErg5/Rty/DVy5k7vTkaFsvqqQq8Tc6OwJFtFaFRh0v6uUrb5OvKweh3xYF1dMHqLY8+zhrODgVNqRL9UjQn2+4YXivSAWR3ECfxEVs6mezrP27Bnk0gED3J",
            "1; BN6PR03MB3316;\n\t3:FA/KNpkd0Lm0uP2BZ8gAdwwWsiHWNmIX73nSL62/SqFUVWOBz6mKZDrHj3nPgBp0YKHzm8rm7Kwb3BPQjH5IMxtsV8zDyl9qQjgtDtazRM/kNGLu4ey/PusagT22HMJFlAG6NbedYREgHqd2TnXW9nOvJS9q4Uj7mw1KR67/OBS6stuxhfdbysTKamkvkvo0tclzRx25oY4Rf8PXqUfgZt+JWcWXWU3d68xWNg8irO7oZrpvwA9tES3fCnQr0GdhsgYfjkQ/7jzSklblQmaBR6veg0rJdkXSzigpyfzCVfoBXKTyi863Cb5F3sSjzsOtvOKHHtaUS2TRbaTGJtgCGkGKjUkpEPqUnXgmi948syo=;\n\t25:KI65Yozpl7ihxorCbzBrC+ruw+9cS4elaEZeyRknUot9qDvb5H++Dh5qmzBhN9QfbDiTJT02vrA9iwSTVU9M4W0AyEkXKm+YqLmAd/TMrjukPtD+K60AWXYM+9XWLbZFG0cYP8VK0lPO9KbWXOUg14l+a5R39KfGVCWUpogUtcLVP8q0KiDYbLK96zLWZ2DbAZfRPXyKiH+CDR9fnftoz3E11XzC9b/qqqDMYJg/yzEircCaPLsqJk/G/MImY/2XheAltOa6np7FF922hZh3SVBUe8wF+yuoeXcfWqJaj8zAWuZewsFTFRjDEX+V/2YMTrb5vXK4KzOe31K0tcFV5Q==",
            "1; BN6PR03MB3316;\n\t31:oIj0kAFBPjfxzV/DLC5MAS+vDkQlIV3eB6jV8/UioLqHpMIZ9DJsOEQDGuDIDuQsZ9iKTVEEE1W2gzbcWCZ9tSfkSPZzFmukLGUMaW2HaatZbtrhDBm1K5L2OT4FTmBC90F+PC0NtHjdVugPuiHsdsvpLJDCHFuhZAxV09+1nueFr3XxS02ZhiDw2pN1p+2lHFTRyGUuzz3SDJZ1bA+R7Uae1/cg8KI3BczFy67Y/K4=;\n\t4:qHcy/YWv6/OggTH+cRQPAQjRRHyGk2OV7jefz/x1vZDS51AnMK1sPwP5IbKDP6gtU7rimLhkHsUDaaWBkabKwG4oaMGHDa1+ER80CrSyx8mJ9HH6//qX64V+4EbuCrIbyTYxOHu1Asfy1yp+8twor4+np/j5FJgA2G95bXWUCCMapjiwETj5xryP9DVGDkPKm7UEonKZpMlV5zlYn26S2twEmT2jD06nlTfNCTt41hgGb5zJMxZ5EqK+WBdtLO585uZDNL/kt9RJANJa79LutUXbWf5nYpKvqDb9IABZzgXGlOQHDci3XqzXfja1V0t3i6DFR4rnZexp2ICoskHavSDhZs9xkNwG6eiq0YnwXTVAFnN/MwQTQdRtDxcKDQLl",
            "=?us-ascii?Q?1; BN6PR03MB3316;\n\t23:PuGxgU/8CU3ZUasMylOBVvNzFUs9lP38GoZOQMmV2?=\n\t8s/sCwxadIE7ij5oxoLIgDAYyrAcfAr6xxM70GetQ78w62d5UZSz7U9G4bmdPAYaA2lAwUs/J8SMOX/iYPuk32/vkmMaJAjjzuM9WP3oeByoGAW++567/2fZB9rbUhyi/PwKlXH8VYydadi1rXNYQTqpjkZ07jYXJXZ+e48w3fT/tpXSENozmtDrurVLIZooALCcSd+Crcl1v3Mv2wHiUS35/z1E6op/sTrLFqxjefDZYCz7EjCAzdqz5MHIK+4QV9VB4PqywZdhkH7uMkyA/BZ5up5F4BlPkliJfdb0v/gamHwdPBFO8SXmlhgdB6VJZkik1fbRtHSRtKEpEwpkvjLgo0V1l84Zrb6t2IUnKAubWPtkezEiye7ImNMjLuiEqb2wArbDcl1njhOuObGQnsrjWrbXmXLkdhadK9hckGMZuF/m59xhSF63obeF2BVcN3aB8avkylTnGHm6Dw11kyjuOtAJwmwNrcmiXJcwXdXVv0RhuPo/hpQFOKG2tpTm8KHqFJoHANUfFbKNCaAQywWSC+HX96J4nDZpfnfPu59tuagUsAmC0+m+Ff9GbVQHPgwPmucj40tR7If4bEgdBhFDqQ7VVsnLXOi0y104oJ+kjA1oiHbba+9mpG4sjCYKVfJJmhptm0Vk2PDM2GdBK2Qm34d0+XpPXUgW9rW/AKSo9va7p9UmtgAa9NUSSxRuWbktnL5g//R92+spsgJMBV7sffjoOTA4v6D9BcdU+zNNSnPC6PrbIcA6G2Au3aBlytR1Z/wvUJ78vk+KzdDzx8hJIWhDEDJfv6xPAv1ioqyBlDPVBQzTgWPii7Ug8awxM4asO+xHgjFaWhcHHLpI8Ms1czciyjCwhrFw2D7cUzZWV0YPRSAgkITKYhZJ8qa1RmFZs/VuGdvL5K5ixqk5t0h2Tn7u4fFMnLzYB1gahe0RMC/CMSOj6T3shcBtbno1pXft5/RQ7a+Fap8MYwJERBJXRUqqMSaKAoJ68HaXTj/qTT75Ok7kmVkgDVMTFdwEmzzAPyDwVqEVR3Sk5AIwdqRcl3BWq1qEYE7EMdt6rlVCmygbCuk2hxAvbucKMdzuz+VMn/qoRkZYHxkpumGEanq6712lo+ztalj3KIhQGd2fjHiINfN9+BrlxbX1WsQRkX7Ampz1k+e2ZqjbIUWSh9IMuHqYgWqQW8R5kGQgCNuy4fRjP9QuXeH4qY0bHC8oY+XZlj71RxwXeRT2EK50UDL0vDLq41JmjM6T/JQMYdleg==",
            "1; BN6PR03MB3316;\n\t6:MvgrxZUpjR3tin220snyUCPLKAqa5NNPvNgW+hbJUN56SrSJqhSeZG4egGtwvR6ubmsvHlwjNncl99NDrCYo05YLg4U1ZfYONPsgol0sQnW/6dfMtfcrr7vSCTdGnNitHqyok0DN3NOkOAmZM59W4c75BG4Fg4bWYq+r62lpJ1+LSYRxRlmSjZrz0NZN5Kl3ThycVbbm5Loun50IOOD+sSLLV4s4wMQD84Zv//ad0TvBnik9r78raS24tw8v+3NRGQniPokqwakAaavpkQhzkjxhIgX0LX5DrZhXf3lodaZnRIvbYz+nY1cSQmtelvA840tFNAMCUElAS3erTCrlpg==;\n\t5:Tt5QytXD2WU/rDoEz/gGQdNnzzVPT1C751N3RowW0g29QaH3Ug6HyhIpkvm9nb0iMVqsPlG9zFQh0CCA13KvIVI2S2CoPJh1iKASzMQLcmzLy9VRc2PtpQPoC5FQO6nvV8W8WogFyfVy1f07YipngA==;\n\t24:5MPCx/DCngHXhiXhwo5GY9d1D/ligdCpaT7Q76KxOVqvNEuYQgLL3npXg7nKSzIq7QdWYJFSrl5d+7zRyH6kKwXuSgewbHmjU4ox3ZLsj3s=;\n\t7:ENBxnp3L47fee3/PUKCGYUTxYWq0Z0OekZQmKqN4MIkQI9wLrAIrjAjKzJnzom+jipwpNyb4Gy0WyB1p1+T/DU5cM5arI8SuPhIRMIeIt+H7xihmkYDRZOO44+et1GdR11eydGy04pVtuZkVPvHH5nRRPv1ksEYhJ0sCG0AIKEaR6IL0dfXqKcUkDOMd/E7yTx4TLTAyvgrwFhsUFTmJd0pka6u2Hd2dUbpKAuB4uzE="
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "6ab8f952-f3f3-4656-1ab7-08d4eba7149b",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:BN6PR03MB3316; ",
        "X-MS-TrafficTypeDiagnostic": "BN6PR03MB3316:",
        "X-Exchange-Antispam-Report-Test": "UriScan:(278428928389397)(185117386973197)(275809806118684); ",
        "X-Microsoft-Antispam-PRVS": "<BN6PR03MB3316CAE0FB3DC902A47F3EE7899B0@BN6PR03MB3316.namprd03.prod.outlook.com>",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(13016025)(8121501046)(13018025)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123565025)(20161123561025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123556025)(20161123563025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:BN6PR03MB3316; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:BN6PR03MB3316; ",
        "X-Forefront-PRVS": "041032FF37",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "25 Aug 2017 10:50:20.1985\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-Id": "5afe0b00-7697-4969-b663-5eab37d5f47e",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;\n\tIp=[192.88.168.50]; \n\tHelo=[tx30smr01.am.freescale.net]",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BN6PR03MB3316",
        "Subject": "[dpdk-dev] [PATCH 10/27] net/dpaa2: update MC to 10.3.x",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Shreyansh Jain <shreyansh.jain@nxp.com>\n\nSigned-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>\nSigned-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n drivers/net/dpaa2/Makefile             |    1 +\n drivers/net/dpaa2/base/dpaa2_hw_dpni.c |   11 +-\n drivers/net/dpaa2/dpaa2_ethdev.c       |   21 +-\n drivers/net/dpaa2/dpaa2_ethdev.h       |    2 +-\n drivers/net/dpaa2/mc/dpkg.c            |  107 ++++\n drivers/net/dpaa2/mc/dpni.c            | 1093 ++++++++++++++++++++++++++------\n drivers/net/dpaa2/mc/fsl_dpkg.h        |   69 +-\n drivers/net/dpaa2/mc/fsl_dpni.h        | 1083 +++++++++----------------------\n drivers/net/dpaa2/mc/fsl_dpni_cmd.h    |  970 +++++++++++++++-------------\n drivers/net/dpaa2/mc/fsl_net.h         |    2 +-\n 10 files changed, 1939 insertions(+), 1420 deletions(-)\n create mode 100644 drivers/net/dpaa2/mc/dpkg.c",
    "diff": "diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile\nindex 32cd819..2f551d5 100644\n--- a/drivers/net/dpaa2/Makefile\n+++ b/drivers/net/dpaa2/Makefile\n@@ -63,6 +63,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += base/dpaa2_hw_dpni.c\n SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_rxtx.c\n SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2_ethdev.c\n SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpni.c\n+SRCS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += mc/dpkg.c\n \n LDLIBS += -lrte_bus_fslmc\n LDLIBS += -lrte_mempool_dpaa2\ndiff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c\nindex 4c82aa8..1269dd2 100644\n--- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c\n+++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c\n@@ -79,7 +79,7 @@ dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev,\n \ttc_cfg.dist_size = eth_dev->data->nb_rx_queues;\n \ttc_cfg.dist_mode = DPNI_DIST_MODE_HASH;\n \n-\tret = dpni_prepare_key_cfg(&kg_cfg, p_params);\n+\tret = dpkg_prepare_key_cfg(&kg_cfg, p_params);\n \tif (ret) {\n \t\tRTE_LOG(ERR, PMD, \"Unable to prepare extract parameters\\n\");\n \t\trte_free(p_params);\n@@ -118,12 +118,12 @@ int dpaa2_remove_flow_dist(\n \t}\n \tmemset(p_params, 0, DIST_PARAM_IOVA_SIZE);\n \tmemset(&tc_cfg, 0, sizeof(struct dpni_rx_tc_dist_cfg));\n-\n+\tkg_cfg.num_extracts = 0;\n \ttc_cfg.key_cfg_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(p_params));\n \ttc_cfg.dist_size = 0;\n \ttc_cfg.dist_mode = DPNI_DIST_MODE_NONE;\n \n-\tret = dpni_prepare_key_cfg(&kg_cfg, p_params);\n+\tret = dpkg_prepare_key_cfg(&kg_cfg, p_params);\n \tif (ret) {\n \t\tRTE_LOG(ERR, PMD, \"Unable to prepare extract parameters\\n\");\n \t\trte_free(p_params);\n@@ -133,12 +133,10 @@ int dpaa2_remove_flow_dist(\n \tret = dpni_set_rx_tc_dist(dpni, CMD_PRI_LOW, priv->token, tc_index,\n \t\t\t\t  &tc_cfg);\n \trte_free(p_params);\n-\tif (ret) {\n+\tif (ret)\n \t\tRTE_LOG(ERR, PMD,\n \t\t\t\"Setting distribution for Rx failed with err: %d\\n\",\n \t\t\tret);\n-\t\treturn ret;\n-\t}\n \treturn ret;\n }\n \n@@ -337,6 +335,7 @@ dpaa2_attach_bp_list(struct dpaa2_dev_priv *priv,\n \tbpool_cfg.pools[0].backup_pool = 0;\n \tbpool_cfg.pools[0].buffer_size = RTE_ALIGN_CEIL(bp_list->buf_pool.size,\n \t\t\t\t\t\tDPAA2_PACKET_LAYOUT_ALIGN);\n+\tbpool_cfg.pools[0].priority_mask = 0;\n \n \tretcode = dpni_set_pools(dpni, CMD_PRI_LOW, priv->token, &bpool_cfg);\n \tif (retcode != 0) {\ndiff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c\nindex 360109e..945dcc7 100644\n--- a/drivers/net/dpaa2/dpaa2_ethdev.c\n+++ b/drivers/net/dpaa2/dpaa2_ethdev.c\n@@ -941,7 +941,7 @@ void dpaa2_dev_stats_get(struct rte_eth_dev *dev,\n \n \t/*Get Counters from page_0*/\n \tretcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token,\n-\t\t\t\t      page0, &value);\n+\t\t\t\t      page0, 0, &value);\n \tif (retcode)\n \t\tgoto err;\n \n@@ -950,7 +950,7 @@ void dpaa2_dev_stats_get(struct rte_eth_dev *dev,\n \n \t/*Get Counters from page_1*/\n \tretcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token,\n-\t\t\t\t      page1, &value);\n+\t\t\t\t      page1, 0, &value);\n \tif (retcode)\n \t\tgoto err;\n \n@@ -959,7 +959,7 @@ void dpaa2_dev_stats_get(struct rte_eth_dev *dev,\n \n \t/*Get Counters from page_2*/\n \tretcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token,\n-\t\t\t\t      page2, &value);\n+\t\t\t\t      page2, 0, &value);\n \tif (retcode)\n \t\tgoto err;\n \n@@ -1384,22 +1384,19 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)\n \t\tgoto init_err;\n \t}\n \n-\tpriv->num_tc = attr.num_tcs;\n+\tpriv->num_rx_tc = attr.num_rx_tcs;\n \n-\t/* Resetting the \"num_rx_vqueues\" to equal number of queues in first TC\n+\t/* Resetting the \"num_rx_queues\" to equal number of queues in first TC\n \t * as only one TC is supported on Rx Side. Once Multiple TCs will be\n \t * in use for Rx processing then this will be changed or removed.\n \t */\n \tpriv->nb_rx_queues = attr.num_queues;\n \n-\t/* TODO:Using hard coded value for number of TX queues due to dependency\n-\t * in MC.\n-\t */\n-\tpriv->nb_tx_queues = 8;\n+\t/* Using number of TX queues as number of TX TCs */\n+\tpriv->nb_tx_queues = attr.num_tx_tcs;\n \n-\tPMD_INIT_LOG(DEBUG, \"num TC - RX %d\", priv->num_tc);\n-\tPMD_INIT_LOG(DEBUG, \"nb_tx_queues %d\", priv->nb_tx_queues);\n-\tPMD_INIT_LOG(DEBUG, \"nb_rx_queues %d\", priv->nb_rx_queues);\n+\tPMD_DRV_LOG(DEBUG, \"RX-TC= %d, nb_rx_queues= %d, nb_tx_queues=%d\",\n+\t\t    priv->num_tc, priv->nb_rx_queues, priv->nb_tx_queues);\n \n \tpriv->hw = dpni_dev;\n \tpriv->hw_id = hw_id;\ndiff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h\nindex a2902da..07e1da6 100644\n--- a/drivers/net/dpaa2/dpaa2_ethdev.h\n+++ b/drivers/net/dpaa2/dpaa2_ethdev.h\n@@ -87,7 +87,7 @@ struct dpaa2_dev_priv {\n \tuint32_t options;\n \tuint8_t max_mac_filters;\n \tuint8_t max_vlan_filters;\n-\tuint8_t num_tc;\n+\tuint8_t num_rx_tc;\n \tuint8_t flags; /*dpaa2 config flags */\n };\n \ndiff --git a/drivers/net/dpaa2/mc/dpkg.c b/drivers/net/dpaa2/mc/dpkg.c\nnew file mode 100644\nindex 0000000..3f98907\n--- /dev/null\n+++ b/drivers/net/dpaa2/mc/dpkg.c\n@@ -0,0 +1,107 @@\n+/*-\n+ * This file is provided under a dual BSD/GPLv2 license. When using or\n+ * redistributing this file, you may do so under either license.\n+ *\n+ *   BSD LICENSE\n+ *\n+ * Copyright 2017 NXP\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in the\n+ * documentation and/or other materials provided with the distribution.\n+ * * Neither the name of the above-listed copyright holders nor the\n+ * names of any contributors may be used to endorse or promote products\n+ * derived from this software without specific prior written permission.\n+ *\n+ *   GPL LICENSE SUMMARY\n+ *\n+ * ALTERNATIVELY, this software may be distributed under the terms of the\n+ * GNU General Public License (\"GPL\") as published by the Free Software\n+ * Foundation, either version 2 of that License or (at your option) any\n+ * later version.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+#include <fsl_mc_sys.h>\n+#include <fsl_mc_cmd.h>\n+#include <fsl_dpkg.h>\n+\n+/**\n+ * dpkg_prepare_key_cfg() - function prepare extract parameters\n+ * @cfg: defining a full Key Generation profile (rule)\n+ * @key_cfg_buf: Zeroed 256 bytes of memory before mapping it to DMA\n+ *\n+ * This function has to be called before the following functions:\n+ *\t- dpni_set_rx_tc_dist()\n+ *\t- dpni_set_qos_table()\n+ *\t- dpkg_prepare_key_cfg()\n+ */\n+int\n+dpkg_prepare_key_cfg(const struct dpkg_profile_cfg *cfg, uint8_t *key_cfg_buf)\n+{\n+\tint i, j;\n+\tstruct dpni_ext_set_rx_tc_dist *dpni_ext;\n+\tstruct dpni_dist_extract *extr;\n+\n+\tif (cfg->num_extracts > DPKG_MAX_NUM_OF_EXTRACTS)\n+\t\treturn -EINVAL;\n+\n+\tdpni_ext = (struct dpni_ext_set_rx_tc_dist *)key_cfg_buf;\n+\tdpni_ext->num_extracts = cfg->num_extracts;\n+\n+\tfor (i = 0; i < cfg->num_extracts; i++) {\n+\t\textr = &dpni_ext->extracts[i];\n+\n+\t\tswitch (cfg->extracts[i].type) {\n+\t\tcase DPKG_EXTRACT_FROM_HDR:\n+\t\t\textr->prot = cfg->extracts[i].extract.from_hdr.prot;\n+\t\t\tdpkg_set_field(extr->efh_type, EFH_TYPE,\n+\t\t\t\t       cfg->extracts[i].extract.from_hdr.type);\n+\t\t\textr->size = cfg->extracts[i].extract.from_hdr.size;\n+\t\t\textr->offset = cfg->extracts[i].extract.from_hdr.offset;\n+\t\t\textr->field = cpu_to_le32(\n+\t\t\t\tcfg->extracts[i].extract.from_hdr.field);\n+\t\t\textr->hdr_index =\n+\t\t\t\tcfg->extracts[i].extract.from_hdr.hdr_index;\n+\t\t\tbreak;\n+\t\tcase DPKG_EXTRACT_FROM_DATA:\n+\t\t\textr->size = cfg->extracts[i].extract.from_data.size;\n+\t\t\textr->offset =\n+\t\t\t\tcfg->extracts[i].extract.from_data.offset;\n+\t\t\tbreak;\n+\t\tcase DPKG_EXTRACT_FROM_PARSE:\n+\t\t\textr->size = cfg->extracts[i].extract.from_parse.size;\n+\t\t\textr->offset =\n+\t\t\t\tcfg->extracts[i].extract.from_parse.offset;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\textr->num_of_byte_masks = cfg->extracts[i].num_of_byte_masks;\n+\t\tdpkg_set_field(extr->extract_type, EXTRACT_TYPE,\n+\t\t\t       cfg->extracts[i].type);\n+\n+\t\tfor (j = 0; j < DPKG_NUM_OF_MASKS; j++) {\n+\t\t\textr->masks[j].mask = cfg->extracts[i].masks[j].mask;\n+\t\t\textr->masks[j].offset =\n+\t\t\t\tcfg->extracts[i].masks[j].offset;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\ndiff --git a/drivers/net/dpaa2/mc/dpni.c b/drivers/net/dpaa2/mc/dpni.c\nindex c2d3969..f95e669 100644\n--- a/drivers/net/dpaa2/mc/dpni.c\n+++ b/drivers/net/dpaa2/mc/dpni.c\n@@ -42,100 +42,39 @@\n #include <fsl_dpni.h>\n #include <fsl_dpni_cmd.h>\n \n-int dpni_prepare_key_cfg(const struct dpkg_profile_cfg *cfg,\n-\t\t\t uint8_t *key_cfg_buf)\n-{\n-\tint i, j;\n-\tint offset = 0;\n-\tint param = 1;\n-\tuint64_t *params = (uint64_t *)key_cfg_buf;\n-\n-\tif (!key_cfg_buf || !cfg)\n-\t\treturn -EINVAL;\n-\n-\tparams[0] |= mc_enc(0, 8, cfg->num_extracts);\n-\tparams[0] = cpu_to_le64(params[0]);\n-\n-\tif (cfg->num_extracts >= DPKG_MAX_NUM_OF_EXTRACTS)\n-\t\treturn -EINVAL;\n-\n-\tfor (i = 0; i < cfg->num_extracts; i++) {\n-\t\tswitch (cfg->extracts[i].type) {\n-\t\tcase DPKG_EXTRACT_FROM_HDR:\n-\t\t\tparams[param] |= mc_enc(0, 8,\n-\t\t\t\t\tcfg->extracts[i].extract.from_hdr.prot);\n-\t\t\tparams[param] |= mc_enc(8, 4,\n-\t\t\t\t\tcfg->extracts[i].extract.from_hdr.type);\n-\t\t\tparams[param] |= mc_enc(16, 8,\n-\t\t\t\t\tcfg->extracts[i].extract.from_hdr.size);\n-\t\t\tparams[param] |= mc_enc(24, 8,\n-\t\t\t\t\tcfg->extracts[i].extract.\n-\t\t\t\t\tfrom_hdr.offset);\n-\t\t\tparams[param] |= mc_enc(32, 32,\n-\t\t\t\t\tcfg->extracts[i].extract.\n-\t\t\t\t\tfrom_hdr.field);\n-\t\t\tparams[param] = cpu_to_le64(params[param]);\n-\t\t\tparam++;\n-\t\t\tparams[param] |= mc_enc(0, 8,\n-\t\t\t\t\tcfg->extracts[i].extract.\n-\t\t\t\t\tfrom_hdr.hdr_index);\n-\t\t\tbreak;\n-\t\tcase DPKG_EXTRACT_FROM_DATA:\n-\t\t\tparams[param] |= mc_enc(16, 8,\n-\t\t\t\t\tcfg->extracts[i].extract.\n-\t\t\t\t\tfrom_data.size);\n-\t\t\tparams[param] |= mc_enc(24, 8,\n-\t\t\t\t\tcfg->extracts[i].extract.\n-\t\t\t\t\tfrom_data.offset);\n-\t\t\tparams[param] = cpu_to_le64(params[param]);\n-\t\t\tparam++;\n-\t\t\tbreak;\n-\t\tcase DPKG_EXTRACT_FROM_PARSE:\n-\t\t\tparams[param] |= mc_enc(16, 8,\n-\t\t\t\t\tcfg->extracts[i].extract.\n-\t\t\t\t\tfrom_parse.size);\n-\t\t\tparams[param] |= mc_enc(24, 8,\n-\t\t\t\t\tcfg->extracts[i].extract.\n-\t\t\t\t\tfrom_parse.offset);\n-\t\t\tparams[param] = cpu_to_le64(params[param]);\n-\t\t\tparam++;\n-\t\t\tbreak;\n-\t\tdefault:\n-\t\t\treturn -EINVAL;\n-\t\t}\n-\t\tparams[param] |= mc_enc(\n-\t\t\t24, 8, cfg->extracts[i].num_of_byte_masks);\n-\t\tparams[param] |= mc_enc(32, 4, cfg->extracts[i].type);\n-\t\tparams[param] = cpu_to_le64(params[param]);\n-\t\tparam++;\n-\t\tfor (offset = 0, j = 0;\n-\t\t\tj < DPKG_NUM_OF_MASKS;\n-\t\t\toffset += 16, j++) {\n-\t\t\tparams[param] |= mc_enc(\n-\t\t\t\t(offset), 8, cfg->extracts[i].masks[j].mask);\n-\t\t\tparams[param] |= mc_enc(\n-\t\t\t\t(offset + 8), 8,\n-\t\t\t\tcfg->extracts[i].masks[j].offset);\n-\t\t}\n-\t\tparams[param] = cpu_to_le64(params[param]);\n-\t\tparam++;\n-\t}\n-\treturn 0;\n-}\n-\n+/**\n+ * dpni_open() - Open a control session for the specified object\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @dpni_id:\tDPNI unique ID\n+ * @token:\tReturned token; use in subsequent API calls\n+ *\n+ * This function can be used to open a control session for an\n+ * already created object; an object may have been declared in\n+ * the DPL or by calling the dpni_create() function.\n+ * This function returns a unique authentication token,\n+ * associated with the specific object ID and the specific MC\n+ * portal; this token must be used in all subsequent commands for\n+ * this specific object.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_open(struct fsl_mc_io *mc_io,\n \t      uint32_t cmd_flags,\n \t      int dpni_id,\n \t      uint16_t *token)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_open *cmd_params;\n+\n \tint err;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_OPEN,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  0);\n-\tDPNI_CMD_OPEN(cmd, dpni_id);\n+\tcmd_params = (struct dpni_cmd_open *)cmd.params;\n+\tcmd_params->dpni_id = cpu_to_le32(dpni_id);\n \n \t/* send command to mc*/\n \terr = mc_send_command(mc_io, &cmd);\n@@ -143,11 +82,22 @@ int dpni_open(struct fsl_mc_io *mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\t*token = MC_CMD_HDR_READ_TOKEN(cmd.header);\n+\t*token = mc_cmd_hdr_read_token(&cmd);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_close() - Close the control session of the object\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ *\n+ * After this function is called, no further operations are\n+ * allowed on the object without opening a new control session.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_close(struct fsl_mc_io *mc_io,\n \t       uint32_t cmd_flags,\n \t       uint16_t token)\n@@ -163,12 +113,35 @@ int dpni_close(struct fsl_mc_io *mc_io,\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n-int dpni_create(struct fsl_mc_io\t*mc_io,\n-\t\tuint16_t\tdprc_token,\n-\t\tuint32_t\tcmd_flags,\n-\t\tconst struct dpni_cfg\t*cfg,\n-\t\tuint32_t\t*obj_id)\n+/**\n+ * dpni_create() - Create the DPNI object\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @dprc_token:\tParent container token; '0' for default container\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @cfg:\tConfiguration structure\n+ * @obj_id:\tReturned object id\n+ *\n+ * Create the DPNI object, allocate required resources and\n+ * perform required initialization.\n+ *\n+ * The object can be created either by declaring it in the\n+ * DPL file, or by calling this function.\n+ *\n+ * The function accepts an authentication token of a parent\n+ * container that this object should be assigned to. The token\n+ * can be '0' so the object will be assigned to the default container.\n+ * The newly created object can be opened with the returned\n+ * object id and using the container's associated tokens and MC portals.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_create(struct fsl_mc_io *mc_io,\n+\t\tuint16_t dprc_token,\n+\t\tuint32_t cmd_flags,\n+\t\tconst struct dpni_cfg *cfg,\n+\t\tuint32_t *obj_id)\n {\n+\tstruct dpni_cmd_create *cmd_params;\n \tstruct mc_command cmd = { 0 };\n \tint err;\n \n@@ -176,7 +149,14 @@ int dpni_create(struct fsl_mc_io\t*mc_io,\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_CREATE,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  dprc_token);\n-\tDPNI_CMD_CREATE(cmd, cfg);\n+\tcmd_params = (struct dpni_cmd_create *)cmd.params;\n+\tcmd_params->options = cpu_to_le32(cfg->options);\n+\tcmd_params->num_queues = cfg->num_queues;\n+\tcmd_params->num_tcs = cfg->num_tcs;\n+\tcmd_params->mac_filter_entries = cfg->mac_filter_entries;\n+\tcmd_params->vlan_filter_entries =  cfg->vlan_filter_entries;\n+\tcmd_params->qos_entries = cfg->qos_entries;\n+\tcmd_params->fs_entries = cpu_to_le16(cfg->fs_entries);\n \n \t/* send command to mc*/\n \terr = mc_send_command(mc_io, &cmd);\n@@ -184,16 +164,32 @@ int dpni_create(struct fsl_mc_io\t*mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tCMD_CREATE_RSP_GET_OBJ_ID_PARAM0(cmd, *obj_id);\n+\t*obj_id = mc_cmd_read_object_id(&cmd);\n \n \treturn 0;\n }\n \n-int dpni_destroy(struct fsl_mc_io\t*mc_io,\n-\t\t uint16_t\tdprc_token,\n-\t\tuint32_t\tcmd_flags,\n-\t\tuint32_t\tobject_id)\n+/**\n+ * dpni_destroy() - Destroy the DPNI object and release all its resources.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @dprc_token: Parent container token; '0' for default container\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @object_id:\tThe object id; it must be a valid id within the container that\n+ * created this object;\n+ *\n+ * The function accepts the authentication token of the parent container that\n+ * created the object (not the one that currently owns the object). The object\n+ * is searched within parent using the provided 'object_id'.\n+ * All tokens to the object must be closed before calling destroy.\n+ *\n+ * Return:\t'0' on Success; error code otherwise.\n+ */\n+int dpni_destroy(struct fsl_mc_io *mc_io,\n+\t\t uint16_t dprc_token,\n+\t\t uint32_t cmd_flags,\n+\t\t uint32_t object_id)\n {\n+\tstruct dpni_cmd_destroy *cmd_params;\n \tstruct mc_command cmd = { 0 };\n \n \t/* prepare command */\n@@ -201,28 +197,63 @@ int dpni_destroy(struct fsl_mc_io\t*mc_io,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  dprc_token);\n \t/* set object id to destroy */\n-\tCMD_DESTROY_SET_OBJ_ID_PARAM0(cmd, object_id);\n+\tcmd_params = (struct dpni_cmd_destroy *)cmd.params;\n+\tcmd_params->dpsw_id = cpu_to_le32(object_id);\n+\n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_set_pools() - Set buffer pools configuration\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @cfg:\tBuffer pools configuration\n+ *\n+ * mandatory for DPNI operation\n+ * warning:Allowed only when DPNI is disabled\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_set_pools(struct fsl_mc_io *mc_io,\n \t\t   uint32_t cmd_flags,\n \t\t   uint16_t token,\n \t\t   const struct dpni_pools_cfg *cfg)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_set_pools *cmd_params;\n+\tint i;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_POOLS,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_POOLS(cmd, cfg);\n+\tcmd_params = (struct dpni_cmd_set_pools *)cmd.params;\n+\tcmd_params->num_dpbp = cfg->num_dpbp;\n+\tfor (i = 0; i < DPNI_MAX_DPBP; i++) {\n+\t\tcmd_params->pool[i].dpbp_id =\n+\t\t\tcpu_to_le16(cfg->pools[i].dpbp_id);\n+\t\tcmd_params->pool[i].priority_mask =\n+\t\t\tcfg->pools[i].priority_mask;\n+\t\tcmd_params->buffer_size[i] =\n+\t\t\tcpu_to_le16(cfg->pools[i].buffer_size);\n+\t\tcmd_params->backup_pool_mask |=\n+\t\t\tDPNI_BACKUP_POOL(cfg->pools[i].backup_pool, i);\n+\t}\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_enable() - Enable the DPNI, allow sending and receiving frames.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_enable(struct fsl_mc_io *mc_io,\n \t\tuint32_t cmd_flags,\n \t\tuint16_t token)\n@@ -238,6 +269,14 @@ int dpni_enable(struct fsl_mc_io *mc_io,\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_disable() - Disable the DPNI, stop sending and receiving frames.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_disable(struct fsl_mc_io *mc_io,\n \t\t uint32_t cmd_flags,\n \t\t uint16_t token)\n@@ -253,15 +292,27 @@ int dpni_disable(struct fsl_mc_io *mc_io,\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_is_enabled() - Check if the DPNI is enabled.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @en:\t\tReturns '1' if object is enabled; '0' otherwise\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_is_enabled(struct fsl_mc_io *mc_io,\n \t\t    uint32_t cmd_flags,\n \t\t    uint16_t token,\n \t\t    int *en)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_rsp_is_enabled *rsp_params;\n \tint err;\n+\n \t/* prepare command */\n-\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_IS_ENABLED, cmd_flags,\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_IS_ENABLED,\n+\t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n \n \t/* send command to mc*/\n@@ -270,11 +321,20 @@ int dpni_is_enabled(struct fsl_mc_io *mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_IS_ENABLED(cmd, *en);\n+\trsp_params = (struct dpni_rsp_is_enabled *)cmd.params;\n+\t*en = dpni_get_field(rsp_params->enabled, ENABLE);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_reset() - Reset the DPNI, returns the object to initial state.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_reset(struct fsl_mc_io *mc_io,\n \t       uint32_t cmd_flags,\n \t       uint16_t token)\n@@ -290,12 +350,23 @@ int dpni_reset(struct fsl_mc_io *mc_io,\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_get_attributes() - Retrieve DPNI attributes.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @attr:\tObject's attributes\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_get_attributes(struct fsl_mc_io *mc_io,\n \t\t\tuint32_t cmd_flags,\n \t\t\tuint16_t token,\n \t\t\tstruct dpni_attr *attr)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_rsp_get_attr *rsp_params;\n+\n \tint err;\n \n \t/* prepare command */\n@@ -309,28 +380,65 @@ int dpni_get_attributes(struct fsl_mc_io *mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_ATTR(cmd, attr);\n+\trsp_params = (struct dpni_rsp_get_attr *)cmd.params;\n+\tattr->options = le32_to_cpu(rsp_params->options);\n+\tattr->num_queues = rsp_params->num_queues;\n+\tattr->num_rx_tcs = rsp_params->num_rx_tcs;\n+\tattr->num_tx_tcs = rsp_params->num_tx_tcs;\n+\tattr->mac_filter_entries = rsp_params->mac_filter_entries;\n+\tattr->vlan_filter_entries = rsp_params->vlan_filter_entries;\n+\tattr->qos_entries = rsp_params->qos_entries;\n+\tattr->fs_entries = le16_to_cpu(rsp_params->fs_entries);\n+\tattr->qos_key_size = rsp_params->qos_key_size;\n+\tattr->fs_key_size = rsp_params->fs_key_size;\n+\tattr->wriop_version = le16_to_cpu(rsp_params->wriop_version);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_set_errors_behavior() - Set errors behavior\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @cfg:\tErrors configuration\n+ *\n+ * This function may be called numerous times with different\n+ * error masks\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_set_errors_behavior(struct fsl_mc_io *mc_io,\n \t\t\t     uint32_t cmd_flags,\n \t\t\t     uint16_t token,\n-\t\t\t      struct dpni_error_cfg *cfg)\n+\t\t\t     struct dpni_error_cfg *cfg)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_set_errors_behavior *cmd_params;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_ERRORS_BEHAVIOR,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_ERRORS_BEHAVIOR(cmd, cfg);\n+\tcmd_params = (struct dpni_cmd_set_errors_behavior *)cmd.params;\n+\tcmd_params->errors = cpu_to_le32(cfg->errors);\n+\tdpni_set_field(cmd_params->flags, ERROR_ACTION, cfg->error_action);\n+\tdpni_set_field(cmd_params->flags, FRAME_ANN, cfg->set_frame_annotation);\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_get_buffer_layout() - Retrieve buffer layout attributes.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @qtype:\tType of queue to retrieve configuration for\n+ * @layout:\tReturns buffer layout attributes\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_get_buffer_layout(struct fsl_mc_io *mc_io,\n \t\t\t   uint32_t cmd_flags,\n \t\t\t   uint16_t token,\n@@ -338,13 +446,16 @@ int dpni_get_buffer_layout(struct fsl_mc_io *mc_io,\n \t\t\t   struct dpni_buffer_layout *layout)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_get_buffer_layout *cmd_params;\n+\tstruct dpni_rsp_get_buffer_layout *rsp_params;\n \tint err;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_BUFFER_LAYOUT,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_GET_BUFFER_LAYOUT(cmd, qtype);\n+\tcmd_params = (struct dpni_cmd_get_buffer_layout *)cmd.params;\n+\tcmd_params->qtype = qtype;\n \n \t/* send command to mc*/\n \terr = mc_send_command(mc_io, &cmd);\n@@ -352,29 +463,72 @@ int dpni_get_buffer_layout(struct fsl_mc_io *mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_BUFFER_LAYOUT(cmd, layout);\n+\trsp_params = (struct dpni_rsp_get_buffer_layout *)cmd.params;\n+\tlayout->pass_timestamp = dpni_get_field(rsp_params->flags, PASS_TS);\n+\tlayout->pass_parser_result = dpni_get_field(rsp_params->flags, PASS_PR);\n+\tlayout->pass_frame_status = dpni_get_field(rsp_params->flags, PASS_FS);\n+\tlayout->private_data_size = le16_to_cpu(rsp_params->private_data_size);\n+\tlayout->data_align = le16_to_cpu(rsp_params->data_align);\n+\tlayout->data_head_room = le16_to_cpu(rsp_params->head_room);\n+\tlayout->data_tail_room = le16_to_cpu(rsp_params->tail_room);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_set_buffer_layout() - Set buffer layout configuration.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @qtype:\tType of queue this configuration applies to\n+ * @layout:\tBuffer layout configuration\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ *\n+ * @warning\tAllowed only when DPNI is disabled\n+ */\n int dpni_set_buffer_layout(struct fsl_mc_io *mc_io,\n \t\t\t   uint32_t cmd_flags,\n-\t\t\t      uint16_t token,\n-\t\t\t      enum dpni_queue_type qtype,\n-\t\t\t      const struct dpni_buffer_layout *layout)\n+\t\t\t   uint16_t token,\n+\t\t\t   enum dpni_queue_type qtype,\n+\t\t\t   const struct dpni_buffer_layout *layout)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_set_buffer_layout *cmd_params;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_BUFFER_LAYOUT,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_BUFFER_LAYOUT(cmd, qtype, layout);\n+\tcmd_params = (struct dpni_cmd_set_buffer_layout *)cmd.params;\n+\tcmd_params->qtype = qtype;\n+\tcmd_params->options = cpu_to_le16(layout->options);\n+\tdpni_set_field(cmd_params->flags, PASS_TS, layout->pass_timestamp);\n+\tdpni_set_field(cmd_params->flags, PASS_PR, layout->pass_parser_result);\n+\tdpni_set_field(cmd_params->flags, PASS_FS, layout->pass_frame_status);\n+\tcmd_params->private_data_size = cpu_to_le16(layout->private_data_size);\n+\tcmd_params->data_align = cpu_to_le16(layout->data_align);\n+\tcmd_params->head_room = cpu_to_le16(layout->data_head_room);\n+\tcmd_params->tail_room = cpu_to_le16(layout->data_tail_room);\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_set_offload() - Set DPNI offload configuration.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @type:\tType of DPNI offload\n+ * @config:\tOffload configuration.\n+ *\t\tFor checksum offloads, non-zero value enables the offload\n+ *\n+ * Return:     '0' on Success; Error code otherwise.\n+ *\n+ * @warning    Allowed only when DPNI is disabled\n+ */\n+\n int dpni_set_offload(struct fsl_mc_io *mc_io,\n \t\t     uint32_t cmd_flags,\n \t\t     uint16_t token,\n@@ -382,17 +536,32 @@ int dpni_set_offload(struct fsl_mc_io *mc_io,\n \t\t     uint32_t config)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_set_offload *cmd_params;\n \n-\t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_OFFLOAD,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_OFFLOAD(cmd, type, config);\n+\tcmd_params = (struct dpni_cmd_set_offload *)cmd.params;\n+\tcmd_params->dpni_offload = type;\n+\tcmd_params->config = cpu_to_le32(config);\n \n-\t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_get_offload() - Get DPNI offload configuration.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @type:\tType of DPNI offload\n+ * @config:\tOffload configuration.\n+ *\t\t\tFor checksum offloads, a value of 1 indicates that the\n+ *\t\t\toffload is enabled.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ *\n+ * @warning\tAllowed only when DPNI is disabled\n+ */\n int dpni_get_offload(struct fsl_mc_io *mc_io,\n \t\t     uint32_t cmd_flags,\n \t\t     uint16_t token,\n@@ -400,13 +569,16 @@ int dpni_get_offload(struct fsl_mc_io *mc_io,\n \t\t     uint32_t *config)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_get_offload *cmd_params;\n+\tstruct dpni_rsp_get_offload *rsp_params;\n \tint err;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_OFFLOAD,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_GET_OFFLOAD(cmd, type);\n+\tcmd_params = (struct dpni_cmd_get_offload *)cmd.params;\n+\tcmd_params->dpni_offload = type;\n \n \t/* send command to mc*/\n \terr = mc_send_command(mc_io, &cmd);\n@@ -414,11 +586,24 @@ int dpni_get_offload(struct fsl_mc_io *mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_OFFLOAD(cmd, *config);\n+\trsp_params = (struct dpni_rsp_get_offload *)cmd.params;\n+\t*config = le32_to_cpu(rsp_params->config);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_get_qdid() - Get the Queuing Destination ID (QDID) that should be used\n+ *\t\t\tfor enqueue operations\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @qtype:\tType of queue to receive QDID for\n+ * @qdid:\tReturned virtual QDID value that should be used as an argument\n+ *\t\t\tin all enqueue operations\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_get_qdid(struct fsl_mc_io *mc_io,\n \t\t  uint32_t cmd_flags,\n \t\t  uint16_t token,\n@@ -426,13 +611,51 @@ int dpni_get_qdid(struct fsl_mc_io *mc_io,\n \t\t  uint16_t *qdid)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_get_qdid *cmd_params;\n+\tstruct dpni_rsp_get_qdid *rsp_params;\n \tint err;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_QDID,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_GET_QDID(cmd, qtype);\n+\tcmd_params = (struct dpni_cmd_get_qdid *)cmd.params;\n+\tcmd_params->qtype = qtype;\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\trsp_params = (struct dpni_rsp_get_qdid *)cmd.params;\n+\t*qdid = le16_to_cpu(rsp_params->qdid);\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * dpni_get_tx_data_offset() - Get the Tx data offset (from start of buffer)\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @data_offset: Tx data offset (from start of buffer)\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io,\n+\t\t\t    uint32_t cmd_flags,\n+\t\t\t    uint16_t token,\n+\t\t\t    uint16_t *data_offset)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tstruct dpni_rsp_get_tx_data_offset *rsp_params;\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_TX_DATA_OFFSET,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n \n \t/* send command to mc*/\n \terr = mc_send_command(mc_io, &cmd);\n@@ -440,34 +663,57 @@ int dpni_get_qdid(struct fsl_mc_io *mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_QDID(cmd, *qdid);\n+\trsp_params = (struct dpni_rsp_get_tx_data_offset *)cmd.params;\n+\t*data_offset = le16_to_cpu(rsp_params->data_offset);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_set_link_cfg() - set the link configuration.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @cfg:\tLink configuration\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_set_link_cfg(struct fsl_mc_io *mc_io,\n \t\t      uint32_t cmd_flags,\n \t\t      uint16_t token,\n \t\t      const struct dpni_link_cfg *cfg)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_set_link_cfg *cmd_params;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_LINK_CFG,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_LINK_CFG(cmd, cfg);\n+\tcmd_params = (struct dpni_cmd_set_link_cfg *)cmd.params;\n+\tcmd_params->rate = cpu_to_le32(cfg->rate);\n+\tcmd_params->options = cpu_to_le64(cfg->options);\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_get_link_state() - Return the link state (either up or down)\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @state:\tReturned link state;\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_get_link_state(struct fsl_mc_io *mc_io,\n \t\t\tuint32_t cmd_flags,\n \t\t\tuint16_t token,\n \t\t\tstruct dpni_link_state *state)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_rsp_get_link_state *rsp_params;\n \tint err;\n \n \t/* prepare command */\n@@ -481,34 +727,60 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_LINK_STATE(cmd, state);\n+\trsp_params = (struct dpni_rsp_get_link_state *)cmd.params;\n+\tstate->up = dpni_get_field(rsp_params->flags, LINK_STATE);\n+\tstate->rate = le32_to_cpu(rsp_params->rate);\n+\tstate->options = le64_to_cpu(rsp_params->options);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_set_max_frame_length() - Set the maximum received frame length.\n+ * @mc_io:\t\tPointer to MC portal's I/O object\n+ * @cmd_flags:\t\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\t\tToken of DPNI object\n+ * @max_frame_length:\tMaximum received frame length (in bytes);\n+ *\t\t\tframe is discarded if its length exceeds this value\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_set_max_frame_length(struct fsl_mc_io *mc_io,\n \t\t\t      uint32_t cmd_flags,\n \t\t\t      uint16_t token,\n \t\t\t      uint16_t max_frame_length)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_set_max_frame_length *cmd_params;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_MAX_FRAME_LENGTH,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_MAX_FRAME_LENGTH(cmd, max_frame_length);\n+\tcmd_params = (struct dpni_cmd_set_max_frame_length *)cmd.params;\n+\tcmd_params->max_frame_length = cpu_to_le16(max_frame_length);\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_get_max_frame_length() - Get the maximum received frame length.\n+ * @mc_io:\t\tPointer to MC portal's I/O object\n+ * @cmd_flags:\t\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\t\tToken of DPNI object\n+ * @max_frame_length:\tMaximum received frame length (in bytes);\n+ *\t\t\tframe is discarded if its length exceeds this value\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_get_max_frame_length(struct fsl_mc_io *mc_io,\n \t\t\t      uint32_t cmd_flags,\n \t\t\t      uint16_t token,\n \t\t\t      uint16_t *max_frame_length)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_rsp_get_max_frame_length *rsp_params;\n \tint err;\n \n \t/* prepare command */\n@@ -522,34 +794,56 @@ int dpni_get_max_frame_length(struct fsl_mc_io *mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_MAX_FRAME_LENGTH(cmd, *max_frame_length);\n+\trsp_params = (struct dpni_rsp_get_max_frame_length *)cmd.params;\n+\t*max_frame_length = le16_to_cpu(rsp_params->max_frame_length);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_set_multicast_promisc() - Enable/disable multicast promiscuous mode\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @en:\t\tSet to '1' to enable; '0' to disable\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_set_multicast_promisc(struct fsl_mc_io *mc_io,\n \t\t\t       uint32_t cmd_flags,\n \t\t\t       uint16_t token,\n \t\t\t       int en)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_set_multicast_promisc *cmd_params;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_MCAST_PROMISC,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_MULTICAST_PROMISC(cmd, en);\n+\tcmd_params = (struct dpni_cmd_set_multicast_promisc *)cmd.params;\n+\tdpni_set_field(cmd_params->enable, ENABLE, en);\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_get_multicast_promisc() - Get multicast promiscuous mode\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @en:\t\tReturns '1' if enabled; '0' otherwise\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_get_multicast_promisc(struct fsl_mc_io *mc_io,\n \t\t\t       uint32_t cmd_flags,\n \t\t\t       uint16_t token,\n \t\t\t       int *en)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_rsp_get_multicast_promisc *rsp_params;\n \tint err;\n \n \t/* prepare command */\n@@ -563,34 +857,56 @@ int dpni_get_multicast_promisc(struct fsl_mc_io *mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_MULTICAST_PROMISC(cmd, *en);\n+\trsp_params = (struct dpni_rsp_get_multicast_promisc *)cmd.params;\n+\t*en = dpni_get_field(rsp_params->enabled, ENABLE);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_set_unicast_promisc() - Enable/disable unicast promiscuous mode\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @en:\t\tSet to '1' to enable; '0' to disable\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_set_unicast_promisc(struct fsl_mc_io *mc_io,\n \t\t\t     uint32_t cmd_flags,\n \t\t\t     uint16_t token,\n \t\t\t     int en)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_set_unicast_promisc *cmd_params;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_UNICAST_PROMISC,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_UNICAST_PROMISC(cmd, en);\n+\tcmd_params = (struct dpni_cmd_set_unicast_promisc *)cmd.params;\n+\tdpni_set_field(cmd_params->enable, ENABLE, en);\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_get_unicast_promisc() - Get unicast promiscuous mode\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @en:\t\tReturns '1' if enabled; '0' otherwise\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_get_unicast_promisc(struct fsl_mc_io *mc_io,\n \t\t\t     uint32_t cmd_flags,\n \t\t\t     uint16_t token,\n \t\t\t     int *en)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_rsp_get_unicast_promisc *rsp_params;\n \tint err;\n \n \t/* prepare command */\n@@ -604,35 +920,59 @@ int dpni_get_unicast_promisc(struct fsl_mc_io *mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_UNICAST_PROMISC(cmd, *en);\n+\trsp_params = (struct dpni_rsp_get_unicast_promisc *)cmd.params;\n+\t*en = dpni_get_field(rsp_params->enabled, ENABLE);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_set_primary_mac_addr() - Set the primary MAC address\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @mac_addr:\tMAC address to set as primary address\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io,\n \t\t\t      uint32_t cmd_flags,\n \t\t\t      uint16_t token,\n \t\t\t      const uint8_t mac_addr[6])\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_set_primary_mac_addr *cmd_params;\n+\tint i;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_PRIM_MAC,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_PRIMARY_MAC_ADDR(cmd, mac_addr);\n+\tcmd_params = (struct dpni_cmd_set_primary_mac_addr *)cmd.params;\n+\tfor (i = 0; i < 6; i++)\n+\t\tcmd_params->mac_addr[i] = mac_addr[5 - i];\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_get_primary_mac_addr() - Get the primary MAC address\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @mac_addr:\tReturned MAC address\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io,\n \t\t\t      uint32_t cmd_flags,\n \t\t\t      uint16_t token,\n \t\t\t      uint8_t mac_addr[6])\n {\n \tstruct mc_command cmd = { 0 };\n-\tint err;\n+\tstruct dpni_rsp_get_primary_mac_addr *rsp_params;\n+\tint i, err;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_PRIM_MAC,\n@@ -645,45 +985,85 @@ int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_PRIMARY_MAC_ADDR(cmd, mac_addr);\n+\trsp_params = (struct dpni_rsp_get_primary_mac_addr *)cmd.params;\n+\tfor (i = 0; i < 6; i++)\n+\t\tmac_addr[5 - i] = rsp_params->mac_addr[i];\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_add_mac_addr() - Add MAC address filter\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @mac_addr:\tMAC address to add\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_add_mac_addr(struct fsl_mc_io *mc_io,\n \t\t      uint32_t cmd_flags,\n \t\t      uint16_t token,\n \t\t      const uint8_t mac_addr[6])\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_add_mac_addr *cmd_params;\n+\tint i;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_ADD_MAC_ADDR,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_ADD_MAC_ADDR(cmd, mac_addr);\n+\tcmd_params = (struct dpni_cmd_add_mac_addr *)cmd.params;\n+\tfor (i = 0; i < 6; i++)\n+\t\tcmd_params->mac_addr[i] = mac_addr[5 - i];\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_remove_mac_addr() - Remove MAC address filter\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @mac_addr:\tMAC address to remove\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_remove_mac_addr(struct fsl_mc_io *mc_io,\n \t\t\t uint32_t cmd_flags,\n \t\t\t uint16_t token,\n \t\t\t const uint8_t mac_addr[6])\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_remove_mac_addr *cmd_params;\n+\tint i;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_REMOVE_MAC_ADDR,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_REMOVE_MAC_ADDR(cmd, mac_addr);\n+\tcmd_params = (struct dpni_cmd_remove_mac_addr *)cmd.params;\n+\tfor (i = 0; i < 6; i++)\n+\t\tcmd_params->mac_addr[i] = mac_addr[5 - i];\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_clear_mac_filters() - Clear all unicast and/or multicast MAC filters\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @unicast:\tSet to '1' to clear unicast addresses\n+ * @multicast:\tSet to '1' to clear multicast addresses\n+ *\n+ * The primary MAC address is not cleared by this operation.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_clear_mac_filters(struct fsl_mc_io *mc_io,\n \t\t\t   uint32_t cmd_flags,\n \t\t\t   uint16_t token,\n@@ -691,24 +1071,40 @@ int dpni_clear_mac_filters(struct fsl_mc_io *mc_io,\n \t\t\t   int multicast)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_clear_mac_filters *cmd_params;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_CLR_MAC_FILTERS,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_CLEAR_MAC_FILTERS(cmd, unicast, multicast);\n+\tcmd_params = (struct dpni_cmd_clear_mac_filters *)cmd.params;\n+\tdpni_set_field(cmd_params->flags, UNICAST_FILTERS, unicast);\n+\tdpni_set_field(cmd_params->flags, MULTICAST_FILTERS, multicast);\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_get_port_mac_addr() - Retrieve MAC address associated to the physical\n+ *\t\t\tport the DPNI is attached to\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @mac_addr:\tMAC address of the physical port, if any, otherwise 0\n+ *\n+ * The primary MAC address is not cleared by this operation.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_get_port_mac_addr(struct fsl_mc_io *mc_io,\n \t\t\t   uint32_t cmd_flags,\n \t\t\t   uint16_t token,\n \t\t\t   uint8_t mac_addr[6])\n {\n \tstruct mc_command cmd = { 0 };\n-\tint err;\n+\tstruct dpni_rsp_get_port_mac_addr *rsp_params;\n+\tint i, err;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_PORT_MAC_ADDR,\n@@ -721,62 +1117,105 @@ int dpni_get_port_mac_addr(struct fsl_mc_io *mc_io,\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_PORT_MAC_ADDR(cmd, mac_addr);\n+\trsp_params = (struct dpni_rsp_get_port_mac_addr *)cmd.params;\n+\tfor (i = 0; i < 6; i++)\n+\t\tmac_addr[5 - i] = rsp_params->mac_addr[i];\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_enable_vlan_filter() - Enable/disable VLAN filtering mode\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @en:\t\tSet to '1' to enable; '0' to disable\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_enable_vlan_filter(struct fsl_mc_io *mc_io,\n \t\t\t    uint32_t cmd_flags,\n-\t\t\t  uint16_t token,\n-\t\t\t  int en)\n+\t\t\t    uint16_t token,\n+\t\t\t    int en)\n {\n+\tstruct dpni_cmd_enable_vlan_filter *cmd_params;\n \tstruct mc_command cmd = { 0 };\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_ENABLE_VLAN_FILTER,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_ENABLE_VLAN_FILTER(cmd, en);\n+\tcmd_params = (struct dpni_cmd_enable_vlan_filter *)cmd.params;\n+\tdpni_set_field(cmd_params->en, ENABLE, en);\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_add_vlan_id() - Add VLAN ID filter\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @vlan_id:\tVLAN ID to add\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_add_vlan_id(struct fsl_mc_io *mc_io,\n \t\t     uint32_t cmd_flags,\n \t\t     uint16_t token,\n \t\t     uint16_t vlan_id)\n {\n+\tstruct dpni_cmd_vlan_id *cmd_params;\n \tstruct mc_command cmd = { 0 };\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_ADD_VLAN_ID,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_ADD_VLAN_ID(cmd, vlan_id);\n+\tcmd_params = (struct dpni_cmd_vlan_id *)cmd.params;\n+\tcmd_params->vlan_id = cpu_to_le16(vlan_id);\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_remove_vlan_id() - Remove VLAN ID filter\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @vlan_id:\tVLAN ID to remove\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_remove_vlan_id(struct fsl_mc_io *mc_io,\n \t\t\tuint32_t cmd_flags,\n \t\t\tuint16_t token,\n \t\t\tuint16_t vlan_id)\n {\n+\tstruct dpni_cmd_vlan_id *cmd_params;\n \tstruct mc_command cmd = { 0 };\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_REMOVE_VLAN_ID,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_REMOVE_VLAN_ID(cmd, vlan_id);\n+\tcmd_params = (struct dpni_cmd_vlan_id *)cmd.params;\n+\tcmd_params->vlan_id = cpu_to_le16(vlan_id);\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_clear_vlan_filters() - Clear all VLAN filters\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_clear_vlan_filters(struct fsl_mc_io *mc_io,\n \t\t\t    uint32_t cmd_flags,\n \t\t\t    uint16_t token)\n@@ -792,6 +1231,19 @@ int dpni_clear_vlan_filters(struct fsl_mc_io *mc_io,\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_set_rx_tc_dist() - Set Rx traffic class distribution configuration\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @tc_id:\tTraffic class selection (0-7)\n+ * @cfg:\tTraffic class distribution configuration\n+ *\n+ * warning: if 'dist_mode != DPNI_DIST_MODE_NONE', call dpkg_prepare_key_cfg()\n+ *\t\t\tfirst to prepare the key_cfg_iova parameter\n+ *\n+ * Return:\t'0' on Success; error code otherwise.\n+ */\n int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io,\n \t\t\tuint32_t cmd_flags,\n \t\t\tuint16_t token,\n@@ -799,87 +1251,185 @@ int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io,\n \t\t\tconst struct dpni_rx_tc_dist_cfg *cfg)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_set_rx_tc_dist *cmd_params;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_RX_TC_DIST,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_RX_TC_DIST(cmd, tc_id, cfg);\n+\tcmd_params = (struct dpni_cmd_set_rx_tc_dist *)cmd.params;\n+\tcmd_params->dist_size = cpu_to_le16(cfg->dist_size);\n+\tcmd_params->tc_id = tc_id;\n+\tcmd_params->default_flow_id = cpu_to_le16(cfg->fs_cfg.default_flow_id);\n+\tcmd_params->key_cfg_iova = cpu_to_le64(cfg->key_cfg_iova);\n+\tdpni_set_field(cmd_params->flags,\n+\t\t       DIST_MODE,\n+\t\t       cfg->dist_mode);\n+\tdpni_set_field(cmd_params->flags,\n+\t\t       MISS_ACTION,\n+\t\t       cfg->fs_cfg.miss_action);\n+\tdpni_set_field(cmd_params->keep_hash_key,\n+\t\t       KEEP_HASH_KEY,\n+\t\t       cfg->fs_cfg.keep_hash_key);\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n-int dpni_set_tx_confirmation_mode(struct fsl_mc_io\t*mc_io,\n-\t\t\t\t  uint32_t\t\tcmd_flags,\n-\t\t\t    uint16_t\t\ttoken,\n-\t\t\t    enum dpni_confirmation_mode mode)\n+/**\n+ * dpni_set_tx_confirmation_mode() - Tx confirmation mode\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @mode:\tTx confirmation mode\n+ *\n+ * This function is useful only when 'DPNI_OPT_TX_CONF_DISABLED' is not\n+ * selected at DPNI creation.\n+ * Calling this function with 'mode' set to DPNI_CONF_DISABLE disables all\n+ * transmit confirmation (including the private confirmation queues), regardless\n+ * of previous settings; Note that in this case, Tx error frames are still\n+ * enqueued to the general transmit errors queue.\n+ * Calling this function with 'mode' set to DPNI_CONF_SINGLE switches all\n+ * Tx confirmations to a shared Tx conf queue. 'index' field in dpni_get_queue\n+ * command will be ignored.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dpni_set_tx_confirmation_mode(struct fsl_mc_io *mc_io,\n+\t\t\t\t  uint32_t cmd_flags,\n+\t\t\t\t  uint16_t token,\n+\t\t\t\t  enum dpni_confirmation_mode mode)\n {\n+\tstruct dpni_tx_confirmation_mode *cmd_params;\n \tstruct mc_command cmd = { 0 };\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_TX_CONFIRMATION_MODE,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_TX_CONFIRMATION_MODE(cmd, mode);\n+\tcmd_params = (struct dpni_tx_confirmation_mode *)cmd.params;\n+\tcmd_params->confirmation_mode = mode;\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n-int dpni_set_congestion_notification(\n-\t\t\tstruct fsl_mc_io\t*mc_io,\n-\t\t\tuint32_t\t\tcmd_flags,\n-\t\t\tuint16_t\t\ttoken,\n-\t\t\tenum dpni_queue_type qtype,\n-\t\t\tuint8_t\t\ttc_id,\n+/**\n+ * dpni_set_congestion_notification() - Set traffic class congestion\n+ *\tnotification configuration\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @qtype:\tType of queue - Rx, Tx and Tx confirm types are supported\n+ * @tc_id:\tTraffic class selection (0-7)\n+ * @cfg:\tcongestion notification configuration\n+ *\n+ * Return:\t'0' on Success; error code otherwise.\n+ */\n+int dpni_set_congestion_notification(struct fsl_mc_io *mc_io,\n+\t\t\t\t     uint32_t cmd_flags,\n+\t\t\t\t     uint16_t token,\n+\t\t\t\t     enum dpni_queue_type qtype,\n+\t\t\t\t     uint8_t tc_id,\n \t\t\tconst struct dpni_congestion_notification_cfg *cfg)\n {\n+\tstruct dpni_cmd_set_congestion_notification *cmd_params;\n \tstruct mc_command cmd = { 0 };\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(\n-\t\t\tDPNI_CMDID_SET_CONGESTION_NOTIFICATION,\n-\t\t\tcmd_flags,\n-\t\t\ttoken);\n-\tDPNI_CMD_SET_CONGESTION_NOTIFICATION(cmd, qtype, tc_id, cfg);\n+\t\t\t\t\tDPNI_CMDID_SET_CONGESTION_NOTIFICATION,\n+\t\t\t\t\tcmd_flags,\n+\t\t\t\t\ttoken);\n+\tcmd_params = (struct dpni_cmd_set_congestion_notification *)cmd.params;\n+\tcmd_params->qtype = qtype;\n+\tcmd_params->tc = tc_id;\n+\tcmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id);\n+\tcmd_params->notification_mode = cpu_to_le16(cfg->notification_mode);\n+\tcmd_params->dest_priority = cfg->dest_cfg.priority;\n+\tcmd_params->message_iova = cpu_to_le64(cfg->message_iova);\n+\tcmd_params->message_ctx = cpu_to_le64(cfg->message_ctx);\n+\tcmd_params->threshold_entry = cpu_to_le32(cfg->threshold_entry);\n+\tcmd_params->threshold_exit = cpu_to_le32(cfg->threshold_exit);\n+\tdpni_set_field(cmd_params->type_units,\n+\t\t       DEST_TYPE,\n+\t\t       cfg->dest_cfg.dest_type);\n+\tdpni_set_field(cmd_params->type_units,\n+\t\t       CONG_UNITS,\n+\t\t       cfg->units);\n \n \t/* send command to mc*/\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n-int dpni_get_congestion_notification(struct fsl_mc_io\t*mc_io,\n-\t\t\t\t     uint32_t\t\tcmd_flags,\n-\t\t\t\t\t   uint16_t\t\ttoken,\n+/**\n+ * dpni_get_congestion_notification() - Get traffic class congestion\n+ *\tnotification configuration\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @qtype:\tType of queue - Rx, Tx and Tx confirm types are supported\n+ * @tc_id:\tTraffic class selection (0-7)\n+ * @cfg:\tcongestion notification configuration\n+ *\n+ * Return:\t'0' on Success; error code otherwise.\n+ */\n+int dpni_get_congestion_notification(struct fsl_mc_io *mc_io,\n+\t\t\t\t     uint32_t cmd_flags,\n+\t\t\t\t     uint16_t token,\n \t\t\t\t     enum dpni_queue_type qtype,\n-\t\t\t\t\t   uint8_t\t\ttc_id,\n+\t\t\t\t     uint8_t tc_id,\n \t\t\t\tstruct dpni_congestion_notification_cfg *cfg)\n {\n+\tstruct dpni_rsp_get_congestion_notification *rsp_params;\n+\tstruct dpni_cmd_get_congestion_notification *cmd_params;\n \tstruct mc_command cmd = { 0 };\n \tint err;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(\n-\t\t\tDPNI_CMDID_GET_CONGESTION_NOTIFICATION,\n-\t\t\tcmd_flags,\n-\t\t\ttoken);\n-\tDPNI_CMD_GET_CONGESTION_NOTIFICATION(cmd, qtype, tc_id);\n+\t\t\t\t\tDPNI_CMDID_GET_CONGESTION_NOTIFICATION,\n+\t\t\t\t\tcmd_flags,\n+\t\t\t\t\ttoken);\n+\tcmd_params = (struct dpni_cmd_get_congestion_notification *)cmd.params;\n+\tcmd_params->qtype = qtype;\n+\tcmd_params->tc = tc_id;\n \n \t/* send command to mc*/\n \terr = mc_send_command(mc_io, &cmd);\n \tif (err)\n \t\treturn err;\n \n-\tDPNI_RSP_GET_CONGESTION_NOTIFICATION(cmd, cfg);\n+\trsp_params = (struct dpni_rsp_get_congestion_notification *)cmd.params;\n+\tcfg->units = dpni_get_field(rsp_params->type_units, CONG_UNITS);\n+\tcfg->threshold_entry = le32_to_cpu(rsp_params->threshold_entry);\n+\tcfg->threshold_exit = le32_to_cpu(rsp_params->threshold_exit);\n+\tcfg->message_ctx = le64_to_cpu(rsp_params->message_ctx);\n+\tcfg->message_iova = le64_to_cpu(rsp_params->message_iova);\n+\tcfg->notification_mode = le16_to_cpu(rsp_params->notification_mode);\n+\tcfg->dest_cfg.dest_id = le32_to_cpu(rsp_params->dest_id);\n+\tcfg->dest_cfg.priority = rsp_params->dest_priority;\n+\tcfg->dest_cfg.dest_type = dpni_get_field(rsp_params->type_units,\n+\t\t\t\t\t\t DEST_TYPE);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_get_api_version() - Get Data Path Network Interface API version\n+ * @mc_io:  Pointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @major_ver:\tMajor version of data path network interface API\n+ * @minor_ver:\tMinor version of data path network interface API\n+ *\n+ * Return:  '0' on Success; Error code otherwise.\n+ */\n int dpni_get_api_version(struct fsl_mc_io *mc_io,\n \t\t\t uint32_t cmd_flags,\n-\t\t\t   uint16_t *major_ver,\n-\t\t\t   uint16_t *minor_ver)\n+\t\t\t uint16_t *major_ver,\n+\t\t\t uint16_t *minor_ver)\n {\n+\tstruct dpni_rsp_get_api_version *rsp_params;\n \tstruct mc_command cmd = { 0 };\n \tint err;\n \n@@ -891,87 +1441,177 @@ int dpni_get_api_version(struct fsl_mc_io *mc_io,\n \tif (err)\n \t\treturn err;\n \n-\tDPNI_RSP_GET_API_VERSION(cmd, *major_ver, *minor_ver);\n+\trsp_params = (struct dpni_rsp_get_api_version *)cmd.params;\n+\t*major_ver = le16_to_cpu(rsp_params->major);\n+\t*minor_ver = le16_to_cpu(rsp_params->minor);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_set_queue() - Set queue parameters\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @qtype:\tType of queue - all queue types are supported, although\n+ *\t\tthe command is ignored for Tx\n+ * @tc:\t\tTraffic class, in range 0 to NUM_TCS - 1\n+ * @index:\tSelects the specific queue out of the set allocated for the\n+ *\t\tsame TC. Value must be in range 0 to NUM_QUEUES - 1\n+ * @options:\tA combination of DPNI_QUEUE_OPT_ values that control what\n+ *\t\tconfiguration options are set on the queue\n+ * @queue:\tQueue structure\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_set_queue(struct fsl_mc_io *mc_io,\n \t\t   uint32_t cmd_flags,\n-\t\t     uint16_t token,\n+\t\t   uint16_t token,\n \t\t   enum dpni_queue_type qtype,\n-\t\t\t uint8_t tc,\n-\t\t\t uint8_t index,\n+\t\t   uint8_t tc,\n+\t\t   uint8_t index,\n \t\t   uint8_t options,\n-\t\t     const struct dpni_queue *queue)\n+\t\t   const struct dpni_queue *queue)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_set_queue *cmd_params;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_QUEUE,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_QUEUE(cmd, qtype, tc, index, options, queue);\n-\n-\t/* send command to mc*/\n+\tcmd_params = (struct dpni_cmd_set_queue *)cmd.params;\n+\tcmd_params->qtype = qtype;\n+\tcmd_params->tc = tc;\n+\tcmd_params->index = index;\n+\tcmd_params->options = options;\n+\tcmd_params->dest_id = cpu_to_le32(queue->destination.id);\n+\tcmd_params->dest_prio = queue->destination.priority;\n+\tdpni_set_field(cmd_params->flags, DEST_TYPE, queue->destination.type);\n+\tdpni_set_field(cmd_params->flags, STASH_CTRL, queue->flc.stash_control);\n+\tdpni_set_field(cmd_params->flags, HOLD_ACTIVE,\n+\t\t       queue->destination.hold_active);\n+\tcmd_params->flc = cpu_to_le64(queue->flc.value);\n+\tcmd_params->user_context = cpu_to_le64(queue->user_context);\n+\n+\t/* send command to mc */\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_get_queue() - Get queue parameters\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @qtype:\tType of queue - all queue types are supported\n+ * @tc:\t\tTraffic class, in range 0 to NUM_TCS - 1\n+ * @index:\tSelects the specific queue out of the set allocated for the\n+ *\t\tsame TC. Value must be in range 0 to NUM_QUEUES - 1\n+ * @queue:\tQueue configuration structure\n+ * @qid:\tQueue identification\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_get_queue(struct fsl_mc_io *mc_io,\n \t\t   uint32_t cmd_flags,\n-\t\t     uint16_t token,\n+\t\t   uint16_t token,\n \t\t   enum dpni_queue_type qtype,\n-\t\t\t uint8_t tc,\n-\t\t\t uint8_t index,\n+\t\t   uint8_t tc,\n+\t\t   uint8_t index,\n \t\t   struct dpni_queue *queue,\n \t\t   struct dpni_queue_id *qid)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_get_queue *cmd_params;\n+\tstruct dpni_rsp_get_queue *rsp_params;\n \tint err;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_QUEUE,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_GET_QUEUE(cmd, qtype, tc, index);\n+\tcmd_params = (struct dpni_cmd_get_queue *)cmd.params;\n+\tcmd_params->qtype = qtype;\n+\tcmd_params->tc = tc;\n+\tcmd_params->index = index;\n \n-\t/* send command to mc*/\n+\t/* send command to mc */\n \terr = mc_send_command(mc_io, &cmd);\n \tif (err)\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_QUEUE(cmd, queue, qid);\n+\trsp_params = (struct dpni_rsp_get_queue *)cmd.params;\n+\tqueue->destination.id = le32_to_cpu(rsp_params->dest_id);\n+\tqueue->destination.priority = rsp_params->dest_prio;\n+\tqueue->destination.type = dpni_get_field(rsp_params->flags,\n+\t\t\t\t\t\t     DEST_TYPE);\n+\tqueue->flc.stash_control = dpni_get_field(rsp_params->flags,\n+\t\t\t\t\t\t  STASH_CTRL);\n+\tqueue->destination.hold_active = dpni_get_field(rsp_params->flags,\n+\t\t\t\t\t\t\tHOLD_ACTIVE);\n+\tqueue->flc.value = le64_to_cpu(rsp_params->flc);\n+\tqueue->user_context = le64_to_cpu(rsp_params->user_context);\n+\tqid->fqid = le32_to_cpu(rsp_params->fqid);\n+\tqid->qdbin = le16_to_cpu(rsp_params->qdbin);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_get_statistics() - Get DPNI statistics\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @page:\tSelects the statistics page to retrieve, see\n+ *\t\tDPNI_GET_STATISTICS output. Pages are numbered 0 to 2.\n+ * @param:  Custom parameter for some pages used to select\n+ *\t\ta certain statistic source, for example the TC.\n+ * @stat:\tStructure containing the statistics\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_get_statistics(struct fsl_mc_io *mc_io,\n \t\t\tuint32_t cmd_flags,\n \t\t\tuint16_t token,\n \t\t\tuint8_t page,\n+\t\t\tuint8_t param,\n \t\t\tunion dpni_statistics *stat)\n {\n \tstruct mc_command cmd = { 0 };\n-\tint err;\n+\tstruct dpni_cmd_get_statistics *cmd_params;\n+\tstruct dpni_rsp_get_statistics *rsp_params;\n+\tint i, err;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_STATISTICS,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_GET_STATISTICS(cmd, page);\n+\tcmd_params = (struct dpni_cmd_get_statistics *)cmd.params;\n+\tcmd_params->page_number = page;\n+\tcmd_params->param = param;\n \n-\t/* send command to mc*/\n+\t/* send command to mc */\n \terr = mc_send_command(mc_io, &cmd);\n \tif (err)\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_STATISTICS(cmd, stat);\n+\trsp_params = (struct dpni_rsp_get_statistics *)cmd.params;\n+\tfor (i = 0; i < DPNI_STATISTICS_CNT; i++)\n+\t\tstat->raw.counter[i] = le64_to_cpu(rsp_params->counter[i]);\n \n \treturn 0;\n }\n \n+/**\n+ * dpni_reset_statistics() - Clears DPNI statistics\n+ * @mc_io:\t\tPointer to MC portal's I/O object\n+ * @cmd_flags:\t\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\t\tToken of DPNI object\n+ *\n+ * Return:  '0' on Success; Error code otherwise.\n+ */\n int dpni_reset_statistics(struct fsl_mc_io *mc_io,\n \t\t\t  uint32_t cmd_flags,\n \t\t     uint16_t token)\n@@ -987,52 +1627,117 @@ int dpni_reset_statistics(struct fsl_mc_io *mc_io,\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_set_taildrop() - Set taildrop per queue or TC\n+ *\n+ * Setting a per-TC taildrop (cg_point = DPNI_CP_GROUP) will reset any current\n+ * congestion notification or early drop (WRED) configuration previously applied\n+ * to the same TC.\n+ *\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @cg_point:\tCongestion point, DPNI_CP_QUEUE is only supported in\n+ *\t\tcombination with DPNI_QUEUE_RX.\n+ * @q_type:\tQueue type, can be DPNI_QUEUE_RX or DPNI_QUEUE_TX.\n+ * @tc:\t\tTraffic class to apply this taildrop to\n+ * @q_index:\tIndex of the queue if the DPNI supports multiple queues for\n+ *\t\ttraffic distribution.\n+ *\t\tIgnored if CONGESTION_POINT is not DPNI_CP_QUEUE.\n+ * @taildrop:\tTaildrop structure\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_set_taildrop(struct fsl_mc_io *mc_io,\n \t\t      uint32_t cmd_flags,\n \t\t      uint16_t token,\n \t\t      enum dpni_congestion_point cg_point,\n-\t\t      enum dpni_queue_type q_type,\n+\t\t      enum dpni_queue_type qtype,\n \t\t      uint8_t tc,\n-\t\t      uint8_t q_index,\n+\t\t      uint8_t index,\n \t\t      struct dpni_taildrop *taildrop)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_set_taildrop *cmd_params;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_SET_TAILDROP,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_SET_TAILDROP(cmd, cg_point, q_type, tc, q_index, taildrop);\n-\n-\t/* send command to mc*/\n+\tcmd_params = (struct dpni_cmd_set_taildrop *)cmd.params;\n+\tcmd_params->congestion_point = cg_point;\n+\tcmd_params->qtype = qtype;\n+\tcmd_params->tc = tc;\n+\tcmd_params->index = index;\n+\tcmd_params->units = taildrop->units;\n+\tcmd_params->threshold = cpu_to_le32(taildrop->threshold);\n+\tdpni_set_field(cmd_params->enable_oal_lo, ENABLE, taildrop->enable);\n+\tdpni_set_field(cmd_params->enable_oal_lo, OAL_LO, taildrop->oal);\n+\tdpni_set_field(cmd_params->oal_hi,\n+\t\t       OAL_HI,\n+\t\t       taildrop->oal >> DPNI_OAL_LO_SIZE);\n+\n+\t/* send command to mc */\n \treturn mc_send_command(mc_io, &cmd);\n }\n \n+/**\n+ * dpni_get_taildrop() - Get taildrop information\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPNI object\n+ * @cg_point:\tCongestion point\n+ * @q_type:\tQueue type on which the taildrop is configured.\n+ *\t\tOnly Rx queues are supported for now\n+ * @tc:\t\tTraffic class to apply this taildrop to\n+ * @q_index:\tIndex of the queue if the DPNI supports multiple queues for\n+ *\t\ttraffic distribution. Ignored if CONGESTION_POINT is not 0.\n+ * @taildrop:\tTaildrop structure\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n int dpni_get_taildrop(struct fsl_mc_io *mc_io,\n \t\t      uint32_t cmd_flags,\n-\t\t     uint16_t token,\n-\t\t\t enum dpni_congestion_point cg_point,\n-\t\t\t enum dpni_queue_type q_type,\n-\t\t\t uint8_t tc,\n-\t\t\t uint8_t q_index,\n-\t\t\t struct dpni_taildrop *taildrop)\n+\t\t      uint16_t token,\n+\t\t      enum dpni_congestion_point cg_point,\n+\t\t      enum dpni_queue_type qtype,\n+\t\t      uint8_t tc,\n+\t\t      uint8_t index,\n+\t\t      struct dpni_taildrop *taildrop)\n {\n \tstruct mc_command cmd = { 0 };\n+\tstruct dpni_cmd_get_taildrop *cmd_params;\n+\tstruct dpni_rsp_get_taildrop *rsp_params;\n+\tuint8_t oal_lo, oal_hi;\n \tint err;\n \n \t/* prepare command */\n \tcmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_TAILDROP,\n \t\t\t\t\t  cmd_flags,\n \t\t\t\t\t  token);\n-\tDPNI_CMD_GET_TAILDROP(cmd, cg_point, q_type, tc, q_index);\n+\tcmd_params = (struct dpni_cmd_get_taildrop *)cmd.params;\n+\tcmd_params->congestion_point = cg_point;\n+\tcmd_params->qtype = qtype;\n+\tcmd_params->tc = tc;\n+\tcmd_params->index = index;\n \n-\t/* send command to mc*/\n+\t/* send command to mc */\n \terr = mc_send_command(mc_io, &cmd);\n \tif (err)\n \t\treturn err;\n \n \t/* retrieve response parameters */\n-\tDPNI_RSP_GET_TAILDROP(cmd, taildrop);\n+\trsp_params = (struct dpni_rsp_get_taildrop *)cmd.params;\n+\ttaildrop->enable = dpni_get_field(rsp_params->enable_oal_lo, ENABLE);\n+\ttaildrop->units = rsp_params->units;\n+\ttaildrop->threshold = le32_to_cpu(rsp_params->threshold);\n+\toal_lo = dpni_get_field(rsp_params->enable_oal_lo, OAL_LO);\n+\toal_hi = dpni_get_field(rsp_params->oal_hi, OAL_HI);\n+\ttaildrop->oal = oal_hi << DPNI_OAL_LO_SIZE | oal_lo;\n+\n+\t/* Fill the first 4 bits, 'oal' is a 2's complement value of 12 bits */\n+\tif (taildrop->oal >= 0x0800)\n+\t\ttaildrop->oal |= 0xF000;\n \n \treturn 0;\n }\ndiff --git a/drivers/net/dpaa2/mc/fsl_dpkg.h b/drivers/net/dpaa2/mc/fsl_dpkg.h\nindex 2391e40..7f46baf 100644\n--- a/drivers/net/dpaa2/mc/fsl_dpkg.h\n+++ b/drivers/net/dpaa2/mc/fsl_dpkg.h\n@@ -5,7 +5,7 @@\n  *   BSD LICENSE\n  *\n  * Copyright 2013-2015 Freescale Semiconductor Inc.\n- * Copyright 2016 NXP.\n+ * Copyright 2016-2017 NXP.\n  *\n  * Redistribution and use in source and binary forms, with or without\n  * modification, are permitted provided that the following conditions are met:\n@@ -93,6 +93,15 @@ struct dpkg_mask {\n \tuint8_t offset;\n };\n \n+/* Macros for accessing command fields smaller than 1byte */\n+#define DPKG_MASK(field)\t\\\n+\tGENMASK(DPKG_##field##_SHIFT + DPKG_##field##_SIZE - 1, \\\n+\t\tDPKG_##field##_SHIFT)\n+#define dpkg_set_field(var, field, val)\t\\\n+\t((var) |= (((val) << DPKG_##field##_SHIFT) & DPKG_MASK(field)))\n+#define dpkg_get_field(var, field)\t\\\n+\t(((var) & DPKG_MASK(field)) >> DPKG_##field##_SHIFT)\n+\n /**\n  * struct dpkg_extract - A structure for defining a single extraction\n  * @type: Determines how the union below is interpreted:\n@@ -136,12 +145,12 @@ struct dpkg_extract {\n \t\t */\n \n \t\tstruct {\n-\t\t\tenum net_prot\t\t\tprot;\n+\t\t\tenum net_prot prot;\n \t\t\tenum dpkg_extract_from_hdr_type type;\n-\t\t\tuint32_t\t\t\tfield;\n-\t\t\tuint8_t\t\t\t\tsize;\n-\t\t\tuint8_t\t\t\t\toffset;\n-\t\t\tuint8_t\t\t\t\thdr_index;\n+\t\t\tuint32_t field;\n+\t\t\tuint8_t size;\n+\t\t\tuint8_t offset;\n+\t\t\tuint8_t hdr_index;\n \t\t} from_hdr;\n \t\t/**\n \t\t * struct from_data\n@@ -166,8 +175,8 @@ struct dpkg_extract {\n \t\t} from_parse;\n \t} extract;\n \n-\tuint8_t\t\t\tnum_of_byte_masks;\n-\tstruct dpkg_mask\tmasks[DPKG_NUM_OF_MASKS];\n+\tuint8_t num_of_byte_masks;\n+\tstruct dpkg_mask masks[DPKG_NUM_OF_MASKS];\n };\n \n /**\n@@ -181,4 +190,48 @@ struct dpkg_profile_cfg {\n \tstruct dpkg_extract extracts[DPKG_MAX_NUM_OF_EXTRACTS];\n };\n \n+/* dpni_set_rx_tc_dist extension (structure of the DMA-able memory at\n+ * key_cfg_iova)\n+ */\n+struct dpni_mask_cfg {\n+\tuint8_t mask;\n+\tuint8_t offset;\n+};\n+\n+#define DPKG_EFH_TYPE_SHIFT\t\t0\n+#define DPKG_EFH_TYPE_SIZE\t\t4\n+#define DPKG_EXTRACT_TYPE_SHIFT\t\t0\n+#define DPKG_EXTRACT_TYPE_SIZE\t\t4\n+\n+struct dpni_dist_extract {\n+\t/* word 0 */\n+\tuint8_t prot;\n+\t/* EFH type stored in the 4 least significant bits */\n+\tuint8_t efh_type;\n+\tuint8_t size;\n+\tuint8_t offset;\n+\tuint32_t field;\n+\t/* word 1 */\n+\tuint8_t hdr_index;\n+\tuint8_t constant;\n+\tuint8_t num_of_repeats;\n+\tuint8_t num_of_byte_masks;\n+\t/* Extraction type is stored in the 4 LSBs */\n+\tuint8_t extract_type;\n+\tuint8_t pad[3];\n+\t/* word 2 */\n+\tstruct dpni_mask_cfg masks[4];\n+};\n+\n+struct dpni_ext_set_rx_tc_dist {\n+\t/* extension word 0 */\n+\tuint8_t num_extracts;\n+\tuint8_t pad[7];\n+\t/* words 1..25 */\n+\tstruct dpni_dist_extract extracts[10];\n+};\n+\n+int dpkg_prepare_key_cfg(const struct dpkg_profile_cfg *cfg,\n+\t\t\t uint8_t *key_cfg_buf);\n+\n #endif /* __FSL_DPKG_H_ */\ndiff --git a/drivers/net/dpaa2/mc/fsl_dpni.h b/drivers/net/dpaa2/mc/fsl_dpni.h\nindex 64db70d..092d3b3 100644\n--- a/drivers/net/dpaa2/mc/fsl_dpni.h\n+++ b/drivers/net/dpaa2/mc/fsl_dpni.h\n@@ -5,7 +5,7 @@\n  *   BSD LICENSE\n  *\n  * Copyright 2013-2016 Freescale Semiconductor Inc.\n- * Copyright 2016 NXP.\n+ * Copyright 2016-2017 NXP.\n  *\n  * Redistribution and use in source and binary forms, with or without\n  * modification, are permitted provided that the following conditions are met:\n@@ -110,47 +110,19 @@ struct fsl_mc_io;\n  */\n #define DPNI_OPT_NO_FS\t\t\t\t0x000020\n \n-/**\n- * dpni_open() - Open a control session for the specified object\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @dpni_id:\tDPNI unique ID\n- * @token:\tReturned token; use in subsequent API calls\n- *\n- * This function can be used to open a control session for an\n- * already created object; an object may have been declared in\n- * the DPL or by calling the dpni_create() function.\n- * This function returns a unique authentication token,\n- * associated with the specific object ID and the specific MC\n- * portal; this token must be used in all subsequent commands for\n- * this specific object.\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_open(struct fsl_mc_io\t*mc_io,\n-\t      uint32_t\t\tcmd_flags,\n-\t      int\t\tdpni_id,\n-\t      uint16_t\t\t*token);\n+int dpni_open(struct fsl_mc_io *mc_io,\n+\t      uint32_t cmd_flags,\n+\t      int dpni_id,\n+\t      uint16_t *token);\n \n-/**\n- * dpni_close() - Close the control session of the object\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- *\n- * After this function is called, no further operations are\n- * allowed on the object without opening a new control session.\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_close(struct fsl_mc_io\t*mc_io,\n-\t       uint32_t\t\tcmd_flags,\n-\t       uint16_t\t\ttoken);\n+int dpni_close(struct fsl_mc_io *mc_io,\n+\t       uint32_t cmd_flags,\n+\t       uint16_t token);\n \n /**\n  * struct dpni_cfg - Structure representing DPNI configuration\n- * @mac_addr: Primary MAC address\n- * @adv: Advanced parameters; default is all zeros;\n+ * @mac_addr:\tPrimary MAC address\n+ * @adv:\tAdvanced parameters; default is all zeros;\n  *\t\tuse this structure to change default settings\n  */\n struct dpni_cfg {\n@@ -217,141 +189,62 @@ struct dpni_cfg {\n \tuint8_t  qos_entries;\n };\n \n-/**\n- * dpni_create() - Create the DPNI object\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @dprc_token:\tParent container token; '0' for default container\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @cfg:\tConfiguration structure\n- * @obj_id: returned object id\n- *\n- * Create the DPNI object, allocate required resources and\n- * perform required initialization.\n- *\n- * The object can be created either by declaring it in the\n- * DPL file, or by calling this function.\n- *\n- * The function accepts an authentication token of a parent\n- * container that this object should be assigned to. The token\n- * can be '0' so the object will be assigned to the default container.\n- * The newly created object can be opened with the returned\n- * object id and using the container's associated tokens and MC portals.\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_create(struct fsl_mc_io\t*mc_io,\n-\t\tuint16_t\t\tdprc_token,\n-\t\tuint32_t\t\tcmd_flags,\n-\t\tconst struct dpni_cfg\t*cfg,\n-\t\tuint32_t\t\t*obj_id);\n+int dpni_create(struct fsl_mc_io *mc_io,\n+\t\tuint16_t dprc_token,\n+\t\tuint32_t cmd_flags,\n+\t\tconst struct dpni_cfg *cfg,\n+\t\tuint32_t *obj_id);\n \n-/**\n- * dpni_destroy() - Destroy the DPNI object and release all its resources.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @dprc_token: Parent container token; '0' for default container\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @object_id:\tThe object id; it must be a valid id within the container that\n- * created this object;\n- *\n- * The function accepts the authentication token of the parent container that\n- * created the object (not the one that currently owns the object). The object\n- * is searched within parent using the provided 'object_id'.\n- * All tokens to the object must be closed before calling destroy.\n- *\n- * Return:\t'0' on Success; error code otherwise.\n- */\n-int dpni_destroy(struct fsl_mc_io\t*mc_io,\n-\t\t uint16_t\t\tdprc_token,\n-\t\t uint32_t\t\tcmd_flags,\n-\t\t uint32_t\t\tobject_id);\n+int dpni_destroy(struct fsl_mc_io *mc_io,\n+\t\t uint16_t dprc_token,\n+\t\t uint32_t cmd_flags,\n+\t\t uint32_t object_id);\n \n /**\n  * struct dpni_pools_cfg - Structure representing buffer pools configuration\n- * @num_dpbp: Number of DPBPs\n- * @pools: Array of buffer pools parameters; The number of valid entries\n- *\tmust match 'num_dpbp' value\n+ * @num_dpbp:\tNumber of DPBPs\n+ * @pools:\tArray of buffer pools parameters; The number of valid entries\n+ *\t\tmust match 'num_dpbp' value\n  */\n struct dpni_pools_cfg {\n-\tuint8_t\t\tnum_dpbp;\n+\tuint8_t num_dpbp;\n \t/**\n \t * struct pools - Buffer pools parameters\n \t * @dpbp_id: DPBP object ID\n+\t * @priority: priority mask that indicates TC's used with this buffer.\n+\t * I set to 0x00 MC will assume value 0xff.\n \t * @buffer_size: Buffer size\n \t * @backup_pool: Backup pool\n \t */\n \tstruct {\n \t\tint\t\tdpbp_id;\n+\t\tuint8_t\t\tpriority_mask;\n \t\tuint16_t\tbuffer_size;\n \t\tint\t\tbackup_pool;\n \t} pools[DPNI_MAX_DPBP];\n };\n \n-/**\n- * dpni_set_pools() - Set buffer pools configuration\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @cfg:\tBuffer pools configuration\n- *\n- * mandatory for DPNI operation\n- * warning:Allowed only when DPNI is disabled\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_set_pools(struct fsl_mc_io\t\t*mc_io,\n-\t\t   uint32_t\t\t\tcmd_flags,\n-\t\t   uint16_t\t\t\ttoken,\n-\t\t   const struct dpni_pools_cfg\t*cfg);\n+int dpni_set_pools(struct fsl_mc_io *mc_io,\n+\t\t   uint32_t cmd_flags,\n+\t\t   uint16_t token,\n+\t\t   const struct dpni_pools_cfg *cfg);\n \n-/**\n- * dpni_enable() - Enable the DPNI, allow sending and receiving frames.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\t\tToken of DPNI object\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_enable(struct fsl_mc_io\t*mc_io,\n-\t\tuint32_t\t\tcmd_flags,\n-\t\tuint16_t\t\ttoken);\n+int dpni_enable(struct fsl_mc_io *mc_io,\n+\t\tuint32_t cmd_flags,\n+\t\tuint16_t token);\n \n-/**\n- * dpni_disable() - Disable the DPNI, stop sending and receiving frames.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_disable(struct fsl_mc_io\t*mc_io,\n-\t\t uint32_t\t\tcmd_flags,\n-\t\t uint16_t\t\ttoken);\n+int dpni_disable(struct fsl_mc_io *mc_io,\n+\t\t uint32_t cmd_flags,\n+\t\t uint16_t token);\n \n-/**\n- * dpni_is_enabled() - Check if the DPNI is enabled.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @en:\t\tReturns '1' if object is enabled; '0' otherwise\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_is_enabled(struct fsl_mc_io\t*mc_io,\n-\t\t    uint32_t\t\tcmd_flags,\n-\t\t    uint16_t\t\ttoken,\n-\t\t    int\t\t\t*en);\n+int dpni_is_enabled(struct fsl_mc_io *mc_io,\n+\t\t    uint32_t cmd_flags,\n+\t\t    uint16_t token,\n+\t\t    int *en);\n \n-/**\n- * dpni_reset() - Reset the DPNI, returns the object to initial state.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_reset(struct fsl_mc_io\t*mc_io,\n-\t       uint32_t\t\tcmd_flags,\n-\t       uint16_t\t\ttoken);\n+int dpni_reset(struct fsl_mc_io *mc_io,\n+\t       uint32_t cmd_flags,\n+\t       uint16_t token);\n \n /**\n  * struct dpni_attr - Structure representing DPNI attributes\n@@ -363,7 +256,8 @@ int dpni_reset(struct fsl_mc_io\t*mc_io,\n  *\t\tDPNI_OPT_HAS_KEY_MASKING\n  *\t\tDPNI_OPT_NO_FS\n  * @num_queues: Number of Tx and Rx queues used for traffic distribution.\n- * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI.\n+ * @num_rx_tcs: Number of RX traffic classes (TCs), reserved for the DPNI.\n+ * @num_tx_tcs: Number of TX traffic classes (TCs), reserved for the DPNI.\n  * @mac_filter_entries: Number of entries in the MAC address filtering\n  *\t\ttable.\n  * @vlan_filter_entries: Number of entries in the VLAN address filtering\n@@ -390,7 +284,8 @@ int dpni_reset(struct fsl_mc_io\t*mc_io,\n struct dpni_attr {\n \tuint32_t options;\n \tuint8_t  num_queues;\n-\tuint8_t  num_tcs;\n+\tuint8_t  num_rx_tcs;\n+\tuint8_t  num_tx_tcs;\n \tuint8_t  mac_filter_entries;\n \tuint8_t  vlan_filter_entries;\n \tuint8_t  qos_entries;\n@@ -400,19 +295,10 @@ struct dpni_attr {\n \tuint16_t wriop_version;\n };\n \n-/**\n- * dpni_get_attributes() - Retrieve DPNI attributes.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @attr:\tObject's attributes\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_get_attributes(struct fsl_mc_io\t*mc_io,\n-\t\t\tuint32_t\t\tcmd_flags,\n-\t\t\tuint16_t\t\ttoken,\n-\t\t\tstruct dpni_attr\t*attr);\n+int dpni_get_attributes(struct fsl_mc_io *mc_io,\n+\t\t\tuint32_t cmd_flags,\n+\t\t\tuint16_t token,\n+\t\t\tstruct dpni_attr *attr);\n \n /**\n  * DPNI errors\n@@ -457,33 +343,22 @@ enum dpni_error_action {\n \n /**\n  * struct dpni_error_cfg - Structure representing DPNI errors treatment\n- * @errors: Errors mask; use 'DPNI_ERROR__<X>\n- * @error_action: The desired action for the errors mask\n- * @set_frame_annotation: Set to '1' to mark the errors in frame annotation\n- *\t\tstatus (FAS); relevant only for the non-discard action\n+ * @errors:\t\t\tErrors mask; use 'DPNI_ERROR__<X>\n+ * @error_action:\t\tThe desired action for the errors mask\n+ * @set_frame_annotation:\tSet to '1' to mark the errors in frame\n+ *\t\t\t\tannotation status (FAS); relevant only\n+ *\t\t\t\tfor the non-discard action\n  */\n struct dpni_error_cfg {\n-\tuint32_t\t\terrors;\n-\tenum dpni_error_action\terror_action;\n-\tint\t\t\tset_frame_annotation;\n+\tuint32_t errors;\n+\tenum dpni_error_action error_action;\n+\tint set_frame_annotation;\n };\n \n-/**\n- * dpni_set_errors_behavior() - Set errors behavior\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @cfg:\tErrors configuration\n- *\n- * this function may be called numerous times with different\n- * error masks\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_set_errors_behavior(struct fsl_mc_io\t\t*mc_io,\n-\t\t\t     uint32_t\t\t\tcmd_flags,\n-\t\t\t     uint16_t\t\t\ttoken,\n-\t\t\t     struct dpni_error_cfg\t*cfg);\n+int dpni_set_errors_behavior(struct fsl_mc_io *mc_io,\n+\t\t\t     uint32_t cmd_flags,\n+\t\t\t     uint16_t token,\n+\t\t\t     struct dpni_error_cfg *cfg);\n \n /**\n  * DPNI buffer layout modification options\n@@ -520,25 +395,26 @@ int dpni_set_errors_behavior(struct fsl_mc_io\t\t*mc_io,\n \n /**\n  * struct dpni_buffer_layout - Structure representing DPNI buffer layout\n- * @options: Flags representing the suggested modifications to the buffer\n- *\t\tlayout; Use any combination of 'DPNI_BUF_LAYOUT_OPT_<X>' flags\n- * @pass_timestamp: Pass timestamp value\n- * @pass_parser_result: Pass parser results\n- * @pass_frame_status: Pass frame status\n- * @private_data_size: Size kept for private data (in bytes)\n- * @data_align: Data alignment\n- * @data_head_room: Data head room\n- * @data_tail_room: Data tail room\n+ * @options:\t\tFlags representing the suggested modifications to the\n+ *\t\t\tbuffer layout;\n+ *\t\t\tUse any combination of 'DPNI_BUF_LAYOUT_OPT_<X>' flags\n+ * @pass_timestamp:\tPass timestamp value\n+ * @pass_parser_result:\tPass parser results\n+ * @pass_frame_status:\tPass frame status\n+ * @private_data_size:\tSize kept for private data (in bytes)\n+ * @data_align:\t\tData alignment\n+ * @data_head_room:\tData head room\n+ * @data_tail_room:\tData tail room\n  */\n struct dpni_buffer_layout {\n-\tuint32_t\toptions;\n-\tint\t\tpass_timestamp;\n-\tint\t\tpass_parser_result;\n-\tint\t\tpass_frame_status;\n-\tuint16_t\tprivate_data_size;\n-\tuint16_t\tdata_align;\n-\tuint16_t\tdata_head_room;\n-\tuint16_t\tdata_tail_room;\n+\tuint32_t options;\n+\tint pass_timestamp;\n+\tint pass_parser_result;\n+\tint pass_frame_status;\n+\tuint16_t private_data_size;\n+\tuint16_t data_align;\n+\tuint16_t data_head_room;\n+\tuint16_t data_tail_room;\n };\n \n /**\n@@ -547,45 +423,24 @@ struct dpni_buffer_layout {\n  * @DPNI_QUEUE_TX: Tx queue\n  * @DPNI_QUEUE_TX_CONFIRM: Tx confirmation queue\n  * @DPNI_QUEUE_RX_ERR: Rx error queue\n- */enum dpni_queue_type {\n+ */\n+enum dpni_queue_type {\n \tDPNI_QUEUE_RX,\n \tDPNI_QUEUE_TX,\n \tDPNI_QUEUE_TX_CONFIRM,\n \tDPNI_QUEUE_RX_ERR,\n };\n \n-/**\n- * dpni_get_buffer_layout() - Retrieve buffer layout attributes.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @qtype:\tType of queue to get the layout from\n- * @layout:\tReturns buffer layout attributes\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_get_buffer_layout(struct fsl_mc_io\t\t*mc_io,\n-\t\t\t   uint32_t\t\t\tcmd_flags,\n-\t\t\t   uint16_t\t\t\ttoken,\n-\t\t\t   enum dpni_queue_type\t\tqtype,\n-\t\t\t   struct dpni_buffer_layout\t*layout);\n+int dpni_get_buffer_layout(struct fsl_mc_io *mc_io,\n+\t\t\t   uint32_t cmd_flags,\n+\t\t\t   uint16_t token,\n+\t\t\t   enum dpni_queue_type qtype,\n+\t\t\t   struct dpni_buffer_layout *layout);\n \n-/**\n- * dpni_set_buffer_layout() - Set buffer layout configuration.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @qtype:\tType of queue to set layout on\n- * @layout:\tBuffer layout configuration\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- *\n- * @warning\tAllowed only when DPNI is disabled\n- */\n-int dpni_set_buffer_layout(struct fsl_mc_io\t\t   *mc_io,\n-\t\t\t   uint32_t\t\t\t   cmd_flags,\n-\t\t\t   uint16_t\t\t\t   token,\n-\t\t\t   enum dpni_queue_type\t\t   qtype,\n+int dpni_set_buffer_layout(struct fsl_mc_io *mc_io,\n+\t\t\t   uint32_t cmd_flags,\n+\t\t\t   uint16_t token,\n+\t\t\t   enum dpni_queue_type qtype,\n \t\t\t   const struct dpni_buffer_layout *layout);\n \n /**\n@@ -594,72 +449,39 @@ int dpni_set_buffer_layout(struct fsl_mc_io\t\t   *mc_io,\n  * @DPNI_OFF_RX_L4_CSUM: Rx L4 checksum validation\n  * @DPNI_OFF_TX_L3_CSUM: Tx L3 checksum generation\n  * @DPNI_OFF_TX_L4_CSUM: Tx L4 checksum generation\n+ * @DPNI_OPT_FLCTYPE_HASH: flow context will be generated by WRIOP for AIOP or\n+ *\t\t\t   for CPU\n  */\n enum dpni_offload {\n \tDPNI_OFF_RX_L3_CSUM,\n \tDPNI_OFF_RX_L4_CSUM,\n \tDPNI_OFF_TX_L3_CSUM,\n \tDPNI_OFF_TX_L4_CSUM,\n+\tDPNI_FLCTYPE_HASH,\n };\n \n-/**\n- * dpni_set_offload() - Set DPNI offload configuration.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @type:\tType of DPNI offload\n- * @config:\tOffload configuration.\n- *\t\t\tFor checksum offloads, non-zero value enables\n- *\t\t\tthe offload.\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- *\n- * @warning\tAllowed only when DPNI is disabled\n- */\n int dpni_set_offload(struct fsl_mc_io *mc_io,\n \t\t     uint32_t cmd_flags,\n \t\t     uint16_t token,\n \t\t     enum dpni_offload type,\n \t\t     uint32_t config);\n \n-/**\n- * dpni_get_offload() - Get DPNI offload configuration.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @type:\tType of DPNI offload\n- * @config:\tOffload configuration.\n- *\t\t\tFor checksum offloads, a value of 1 indicates that the\n- *\t\t\toffload is enabled.\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- *\n- * @warning\tAllowed only when DPNI is disabled\n- */\n int dpni_get_offload(struct fsl_mc_io *mc_io,\n \t\t     uint32_t cmd_flags,\n \t\t     uint16_t token,\n \t\t     enum dpni_offload type,\n \t\t     uint32_t *config);\n \n-/**\n- * dpni_get_qdid() - Get the Queuing Destination ID (QDID) that should be used\n- *\t\t\tfor enqueue operations\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @qtype:\tType of queue to get QDID for.  For applications lookig to\n- *\t\ttransmit traffic this should be set to DPNI_QUEUE_TX\n- * @qdid:\tReturned virtual QDID value that should be used as an argument\n- *\t\t\tin all enqueue operations\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_get_qdid(struct fsl_mc_io\t*mc_io,\n-\t\t  uint32_t\t\tcmd_flags,\n-\t\t  uint16_t\t\ttoken,\n-\t\t  enum dpni_queue_type\tqtype,\n-\t\t  uint16_t\t\t*qdid);\n+int dpni_get_qdid(struct fsl_mc_io *mc_io,\n+\t\t  uint32_t cmd_flags,\n+\t\t  uint16_t token,\n+\t\t  enum dpni_queue_type qtype,\n+\t\t  uint16_t *qdid);\n+\n+int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io,\n+\t\t\t    uint32_t cmd_flags,\n+\t\t\t    uint16_t token,\n+\t\t\t    uint16_t *data_offset);\n \n #define DPNI_STATISTICS_CNT\t\t7\n \n@@ -715,6 +537,23 @@ union dpni_statistics {\n \t\tuint64_t egress_confirmed_frames;\n \t} page_2;\n \t/**\n+\t * struct page_3 - Page_3 statistics structure with values for the\n+\t *\t\t\tselected TC\n+\t * @ceetm_dequeue_bytes: Cumulative count of the number of bytes\n+\t *\t\t\tdequeued\n+\t * @ceetm_dequeue_frames: Cumulative count of the number of frames\n+\t *\t\t\tdequeued\n+\t * @ceetm_reject_bytes: Cumulative count of the number of bytes in all\n+\t *\t\t\tframes whose enqueue was rejected\n+\t * @ceetm_reject_frames: Cumulative count of all frame enqueues rejected\n+\t */\n+\tstruct {\n+\t\tuint64_t ceetm_dequeue_bytes;\n+\t\tuint64_t ceetm_dequeue_frames;\n+\t\tuint64_t ceetm_reject_bytes;\n+\t\tuint64_t ceetm_reject_frames;\n+\t} page_3;\n+\t/**\n \t * struct raw - raw statistics structure, used to index counters\n \t */\n \tstruct {\n@@ -738,6 +577,10 @@ union dpni_statistics {\n  * Enable a-symmetric pause frames\n  */\n #define DPNI_LINK_OPT_ASYM_PAUSE\t0x0000000000000008ULL\n+/**\n+ * Enable priority flow control pause frames\n+ */\n+#define DPNI_LINK_OPT_PFC_PAUSE\t0x0000000000000010ULL\n \n /**\n  * struct - Structure representing DPNI link configuration\n@@ -749,278 +592,117 @@ struct dpni_link_cfg {\n \tuint64_t options;\n };\n \n-/**\n- * dpni_set_link_cfg() - set the link configuration.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @cfg:\tLink configuration\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_set_link_cfg(struct fsl_mc_io\t\t\t*mc_io,\n-\t\t      uint32_t\t\t\t\tcmd_flags,\n-\t\t      uint16_t\t\t\t\ttoken,\n-\t\t      const struct dpni_link_cfg\t*cfg);\n+int dpni_set_link_cfg(struct fsl_mc_io *mc_io,\n+\t\t      uint32_t cmd_flags,\n+\t\t      uint16_t token,\n+\t\t      const struct dpni_link_cfg *cfg);\n \n /**\n  * struct dpni_link_state - Structure representing DPNI link state\n- * @rate: Rate\n- * @options: Mask of available options; use 'DPNI_LINK_OPT_<X>' values\n- * @up: Link state; '0' for down, '1' for up\n+ * @rate:\tRate\n+ * @options:\tMask of available options; use 'DPNI_LINK_OPT_<X>' values\n+ * @up:\t\tLink state; '0' for down, '1' for up\n  */\n struct dpni_link_state {\n-\tuint32_t\trate;\n-\tuint64_t\toptions;\n-\tint\t\tup;\n+\tuint32_t rate;\n+\tuint64_t options;\n+\tint up;\n };\n \n-/**\n- * dpni_get_link_state() - Return the link state (either up or down)\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @state:\tReturned link state;\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_get_link_state(struct fsl_mc_io\t*mc_io,\n-\t\t\tuint32_t\t\tcmd_flags,\n-\t\t\tuint16_t\t\ttoken,\n-\t\t\tstruct dpni_link_state\t*state);\n-\n-/**\n- * dpni_set_max_frame_length() - Set the maximum received frame length.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @max_frame_length:\tMaximum received frame length (in\n- *\t\t\t\tbytes); frame is discarded if its\n- *\t\t\t\tlength exceeds this value\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_set_max_frame_length(struct fsl_mc_io\t*mc_io,\n-\t\t\t      uint32_t\t\tcmd_flags,\n-\t\t\t      uint16_t\t\ttoken,\n-\t\t\t      uint16_t\t\tmax_frame_length);\n-\n-/**\n- * dpni_get_max_frame_length() - Get the maximum received frame length.\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @max_frame_length:\tMaximum received frame length (in\n- *\t\t\t\tbytes); frame is discarded if its\n- *\t\t\t\tlength exceeds this value\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_get_max_frame_length(struct fsl_mc_io\t*mc_io,\n-\t\t\t      uint32_t\t\tcmd_flags,\n-\t\t\t      uint16_t\t\ttoken,\n-\t\t\t      uint16_t\t\t*max_frame_length);\n-\n-/**\n- * dpni_set_multicast_promisc() - Enable/disable multicast promiscuous mode\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @en:\t\tSet to '1' to enable; '0' to disable\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_set_multicast_promisc(struct fsl_mc_io\t*mc_io,\n-\t\t\t       uint32_t\t\tcmd_flags,\n-\t\t\t       uint16_t\t\ttoken,\n-\t\t\t       int\t\ten);\n-\n-/**\n- * dpni_get_multicast_promisc() - Get multicast promiscuous mode\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @en:\t\tReturns '1' if enabled; '0' otherwise\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_get_multicast_promisc(struct fsl_mc_io\t*mc_io,\n-\t\t\t       uint32_t\t\tcmd_flags,\n-\t\t\t       uint16_t\t\ttoken,\n-\t\t\t       int\t\t*en);\n-\n-/**\n- * dpni_set_unicast_promisc() - Enable/disable unicast promiscuous mode\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @en:\t\tSet to '1' to enable; '0' to disable\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_set_unicast_promisc(struct fsl_mc_io\t*mc_io,\n-\t\t\t     uint32_t\t\tcmd_flags,\n-\t\t\t     uint16_t\t\ttoken,\n-\t\t\t     int\t\ten);\n-\n-/**\n- * dpni_get_unicast_promisc() - Get unicast promiscuous mode\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @en:\t\tReturns '1' if enabled; '0' otherwise\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_get_unicast_promisc(struct fsl_mc_io\t*mc_io,\n-\t\t\t     uint32_t\t\tcmd_flags,\n-\t\t\t     uint16_t\t\ttoken,\n-\t\t\t     int\t\t*en);\n-\n-/**\n- * dpni_set_primary_mac_addr() - Set the primary MAC address\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @mac_addr:\tMAC address to set as primary address\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_set_primary_mac_addr(struct fsl_mc_io\t*mc_io,\n-\t\t\t      uint32_t\t\tcmd_flags,\n-\t\t\t      uint16_t\t\ttoken,\n-\t\t\t      const uint8_t\tmac_addr[6]);\n-\n-/**\n- * dpni_get_primary_mac_addr() - Get the primary MAC address\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @mac_addr:\tReturned MAC address\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_get_primary_mac_addr(struct fsl_mc_io\t*mc_io,\n-\t\t\t      uint32_t\t\tcmd_flags,\n-\t\t\t      uint16_t\t\ttoken,\n-\t\t\t      uint8_t\t\tmac_addr[6]);\n-\n-/**\n- * dpni_add_mac_addr() - Add MAC address filter\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @mac_addr:\tMAC address to add\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_add_mac_addr(struct fsl_mc_io\t*mc_io,\n-\t\t      uint32_t\t\tcmd_flags,\n-\t\t      uint16_t\t\ttoken,\n-\t\t      const uint8_t\tmac_addr[6]);\n-\n-/**\n- * dpni_remove_mac_addr() - Remove MAC address filter\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @mac_addr:\tMAC address to remove\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_remove_mac_addr(struct fsl_mc_io\t*mc_io,\n-\t\t\t uint32_t\t\tcmd_flags,\n-\t\t\t uint16_t\t\ttoken,\n-\t\t\t const uint8_t\t\tmac_addr[6]);\n-\n-/**\n- * dpni_clear_mac_filters() - Clear all unicast and/or multicast MAC filters\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @unicast:\tSet to '1' to clear unicast addresses\n- * @multicast:\tSet to '1' to clear multicast addresses\n- *\n- * The primary MAC address is not cleared by this operation.\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_clear_mac_filters(struct fsl_mc_io\t*mc_io,\n-\t\t\t   uint32_t\t\tcmd_flags,\n-\t\t\t   uint16_t\t\ttoken,\n-\t\t\t   int\t\t\tunicast,\n-\t\t\t   int\t\t\tmulticast);\n-\n-/**\n- * dpni_get_port_mac_addr() - Retrieve MAC address associated to the physical\n- *\t\tport the DPNI is attached to\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @mac_addr:\tMAC address of the physical port, if any, otherwise 0\n- *\n- * The primary MAC address is not modified by this operation.\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_get_port_mac_addr(struct fsl_mc_io\t*mc_io,\n-\t\t\t   uint32_t\t\tcmd_flags,\n-\t\t\t   uint16_t\t\ttoken,\n-\t\t\t   uint8_t\t\tmac_addr[6]);\n-\n-/**\n- * dpni_enable_vlan_filter() - Enable/disable VLAN filtering mode\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @en:\t\tSet to '1' to enable; '0' to disable\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_enable_vlan_filter(struct fsl_mc_io\t*mc_io,\n-\t\t\t    uint32_t\t\tcmd_flags,\n-\t\t\t    uint16_t\t\ttoken,\n-\t\t\t    int\t\t\ten);\n+int dpni_get_link_state(struct fsl_mc_io *mc_io,\n+\t\t\tuint32_t cmd_flags,\n+\t\t\tuint16_t token,\n+\t\t\tstruct dpni_link_state *state);\n+\n+int dpni_set_max_frame_length(struct fsl_mc_io *mc_io,\n+\t\t\t      uint32_t cmd_flags,\n+\t\t\t      uint16_t token,\n+\t\t\t      uint16_t max_frame_length);\n+\n+int dpni_get_max_frame_length(struct fsl_mc_io *mc_io,\n+\t\t\t      uint32_t cmd_flags,\n+\t\t\t      uint16_t token,\n+\t\t\t      uint16_t *max_frame_length);\n+\n+int dpni_set_mtu(struct fsl_mc_io *mc_io,\n+\t\t uint32_t cmd_flags,\n+\t\t uint16_t token,\n+\t\t uint16_t mtu);\n+\n+int dpni_get_mtu(struct fsl_mc_io *mc_io,\n+\t\t uint32_t cmd_flags,\n+\t\t uint16_t token,\n+\t\t uint16_t *mtu);\n+\n+int dpni_set_multicast_promisc(struct fsl_mc_io *mc_io,\n+\t\t\t       uint32_t cmd_flags,\n+\t\t\t       uint16_t token,\n+\t\t\t       int en);\n+\n+int dpni_get_multicast_promisc(struct fsl_mc_io *mc_io,\n+\t\t\t       uint32_t cmd_flags,\n+\t\t\t       uint16_t token,\n+\t\t\t       int *en);\n+\n+int dpni_set_unicast_promisc(struct fsl_mc_io *mc_io,\n+\t\t\t     uint32_t cmd_flags,\n+\t\t\t     uint16_t token,\n+\t\t\t     int en);\n+\n+int dpni_get_unicast_promisc(struct fsl_mc_io *mc_io,\n+\t\t\t     uint32_t cmd_flags,\n+\t\t\t     uint16_t token,\n+\t\t\t     int *en);\n+\n+int dpni_set_primary_mac_addr(struct fsl_mc_io *mc_io,\n+\t\t\t      uint32_t cmd_flags,\n+\t\t\t      uint16_t token,\n+\t\t\t      const uint8_t mac_addr[6]);\n+\n+int dpni_get_primary_mac_addr(struct fsl_mc_io *mc_io,\n+\t\t\t      uint32_t cmd_flags,\n+\t\t\t      uint16_t token,\n+\t\t\t      uint8_t mac_addr[6]);\n+\n+int dpni_add_mac_addr(struct fsl_mc_io *mc_io,\n+\t\t      uint32_t cmd_flags,\n+\t\t      uint16_t token,\n+\t\t      const uint8_t mac_addr[6]);\n \n-/**\n- * dpni_add_vlan_id() - Add VLAN ID filter\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @vlan_id:\tVLAN ID to add\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_add_vlan_id(struct fsl_mc_io\t*mc_io,\n-\t\t     uint32_t\t\tcmd_flags,\n-\t\t     uint16_t\t\ttoken,\n-\t\t     uint16_t\t\tvlan_id);\n+int dpni_remove_mac_addr(struct fsl_mc_io *mc_io,\n+\t\t\t uint32_t cmd_flags,\n+\t\t\t uint16_t token,\n+\t\t\t const uint8_t mac_addr[6]);\n+\n+int dpni_clear_mac_filters(struct fsl_mc_io *mc_io,\n+\t\t\t   uint32_t cmd_flags,\n+\t\t\t   uint16_t token,\n+\t\t\t   int unicast,\n+\t\t\t   int multicast);\n+\n+int dpni_get_port_mac_addr(struct fsl_mc_io *mc_io,\n+\t\t\t   uint32_t cmd_flags,\n+\t\t\t   uint16_t token,\n+\t\t\t   uint8_t mac_addr[6]);\n+\n+int dpni_enable_vlan_filter(struct fsl_mc_io *mc_io,\n+\t\t\t    uint32_t cmd_flags,\n+\t\t\t    uint16_t token,\n+\t\t\t    int en);\n+\n+int dpni_add_vlan_id(struct fsl_mc_io *mc_io,\n+\t\t     uint32_t cmd_flags,\n+\t\t     uint16_t token,\n+\t\t     uint16_t vlan_id);\n \n-/**\n- * dpni_remove_vlan_id() - Remove VLAN ID filter\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @vlan_id:\tVLAN ID to remove\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_remove_vlan_id(struct fsl_mc_io\t*mc_io,\n-\t\t\tuint32_t\t\tcmd_flags,\n-\t\t\tuint16_t\t\ttoken,\n-\t\t\tuint16_t\t\tvlan_id);\n+int dpni_remove_vlan_id(struct fsl_mc_io *mc_io,\n+\t\t\tuint32_t cmd_flags,\n+\t\t\tuint16_t token,\n+\t\t\tuint16_t vlan_id);\n \n-/**\n- * dpni_clear_vlan_filters() - Clear all VLAN filters\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_clear_vlan_filters(struct fsl_mc_io\t*mc_io,\n-\t\t\t    uint32_t\t\tcmd_flags,\n-\t\t\t    uint16_t\t\ttoken);\n+int dpni_clear_vlan_filters(struct fsl_mc_io *mc_io,\n+\t\t\t    uint32_t cmd_flags,\n+\t\t\t    uint16_t token);\n \n /**\n  * enum dpni_dist_mode - DPNI distribution mode\n@@ -1050,27 +732,16 @@ enum dpni_fs_miss_action {\n \n /**\n  * struct dpni_fs_tbl_cfg - Flow Steering table configuration\n- * @miss_action: Miss action selection\n- * @default_flow_id: Used when 'miss_action = DPNI_FS_MISS_EXPLICIT_FLOWID'\n+ * @miss_action:\tMiss action selection\n+ * @default_flow_id:\tUsed when 'miss_action = DPNI_FS_MISS_EXPLICIT_FLOWID'\n  */\n struct dpni_fs_tbl_cfg {\n-\tenum dpni_fs_miss_action\tmiss_action;\n-\tuint16_t\t\t\tdefault_flow_id;\n+\tenum dpni_fs_miss_action miss_action;\n+\tuint16_t default_flow_id;\n+\tchar keep_hash_key;\n };\n \n /**\n- * dpni_prepare_key_cfg() - function prepare extract parameters\n- * @cfg: defining a full Key Generation profile (rule)\n- * @key_cfg_buf: Zeroed 256 bytes of memory before mapping it to DMA\n- *\n- * This function has to be called before the following functions:\n- *\t- dpni_set_rx_tc_dist()\n- *\t- dpni_set_qos_table()\n- */\n-int dpni_prepare_key_cfg(const struct dpkg_profile_cfg\t*cfg,\n-\t\t\t uint8_t\t\t\t*key_cfg_buf);\n-\n-/**\n  * struct dpni_rx_tc_dist_cfg - Rx traffic class distribution configuration\n  * @dist_size: Set the distribution size;\n  *\tsupported values: 1,2,3,4,6,7,8,12,14,16,24,28,32,48,56,64,96,\n@@ -1078,36 +749,24 @@ int dpni_prepare_key_cfg(const struct dpkg_profile_cfg\t*cfg,\n  * @dist_mode: Distribution mode\n  * @key_cfg_iova: I/O virtual address of 256 bytes DMA-able memory filled with\n  *\t\tthe extractions to be used for the distribution key by calling\n- *\t\tdpni_prepare_key_cfg() relevant only when\n+ *\t\tdpkg_prepare_key_cfg() relevant only when\n  *\t\t'dist_mode != DPNI_DIST_MODE_NONE', otherwise it can be '0'\n  * @fs_cfg: Flow Steering table configuration; only relevant if\n  *\t\t'dist_mode = DPNI_DIST_MODE_FS'\n  */\n struct dpni_rx_tc_dist_cfg {\n-\tuint16_t\t\tdist_size;\n-\tenum dpni_dist_mode\tdist_mode;\n-\tuint64_t\t\tkey_cfg_iova;\n-\tstruct dpni_fs_tbl_cfg\tfs_cfg;\n+\tuint16_t dist_size;\n+\tenum dpni_dist_mode dist_mode;\n+\tuint64_t key_cfg_iova;\n+\tstruct dpni_fs_tbl_cfg fs_cfg;\n };\n \n-/**\n- * dpni_set_rx_tc_dist() - Set Rx traffic class distribution configuration\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @tc_id:\tTraffic class selection (0-7)\n- * @cfg:\tTraffic class distribution configuration\n- *\n- * warning: if 'dist_mode != DPNI_DIST_MODE_NONE', call dpni_prepare_key_cfg()\n- *\t\t\tfirst to prepare the key_cfg_iova parameter\n- *\n- * Return:\t'0' on Success; error code otherwise.\n- */\n-int dpni_set_rx_tc_dist(struct fsl_mc_io\t\t\t*mc_io,\n-\t\t\tuint32_t\t\t\t\tcmd_flags,\n-\t\t\tuint16_t\t\t\t\ttoken,\n-\t\t\tuint8_t\t\t\t\t\ttc_id,\n-\t\t\tconst struct dpni_rx_tc_dist_cfg\t*cfg);\n+int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io,\n+\t\t\tuint32_t cmd_flags,\n+\t\t\tuint16_t token,\n+\t\t\tuint8_t tc_id,\n+\t\t\tconst struct dpni_rx_tc_dist_cfg *cfg);\n+\n /**\n  * enum dpni_congestion_unit - DPNI congestion units\n  * @DPNI_CONGESTION_UNIT_BYTES: bytes units\n@@ -1147,9 +806,9 @@ enum dpni_dest {\n  *\t\tchannel; not relevant for 'DPNI_DEST_NONE' option\n  */\n struct dpni_dest_cfg {\n-\tenum dpni_dest\tdest_type;\n-\tint\t\tdest_id;\n-\tuint8_t\t\tpriority;\n+\tenum dpni_dest dest_type;\n+\tint dest_id;\n+\tuint8_t priority;\n };\n \n /* DPNI congestion options */\n@@ -1186,6 +845,11 @@ struct dpni_dest_cfg {\n  * sw-portal's DQRR, the DQRI interrupt is asserted immediately (if enabled)\n  */\n #define DPNI_CONG_OPT_INTR_COALESCING_DISABLED\t0x00000020\n+/**\n+ * This congestion will trigger flow control or priority flow control. This\n+ * will have effect only if flow control is enabled with dpni_set_link_cfg()\n+ */\n+#define DPNI_CONG_OPT_FLOW_CONTROL\t0x00000040\n \n /**\n  * struct dpni_congestion_notification_cfg - congestion notification\n@@ -1203,54 +867,35 @@ struct dpni_dest_cfg {\n  */\n \n struct dpni_congestion_notification_cfg {\n-\tenum dpni_congestion_unit\tunits;\n-\tuint32_t\t\t\tthreshold_entry;\n-\tuint32_t\t\t\tthreshold_exit;\n-\tuint64_t\t\t\tmessage_ctx;\n-\tuint64_t\t\t\tmessage_iova;\n-\tstruct dpni_dest_cfg\t\tdest_cfg;\n-\tuint16_t\t\t\tnotification_mode;\n+\tenum dpni_congestion_unit units;\n+\tuint32_t threshold_entry;\n+\tuint32_t threshold_exit;\n+\tuint64_t message_ctx;\n+\tuint64_t message_iova;\n+\tstruct dpni_dest_cfg dest_cfg;\n+\tuint16_t notification_mode;\n };\n \n-/**\n- * dpni_set_congestion_notification() - Set traffic class congestion\n- *\tnotification configuration\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @qtype:\tType of queue - Rx, Tx and Tx confirm types are supported\n- * @tc_id:\tTraffic class selection (0-7)\n- * @cfg:\tcongestion notification configuration\n- *\n- * Return:\t'0' on Success; error code otherwise.\n- */\n-int dpni_set_congestion_notification(\n-\t\t\tstruct fsl_mc_io\t\t*mc_io,\n-\t\t\tuint32_t\t\t\tcmd_flags,\n-\t\t\tuint16_t\t\t\ttoken,\n-\t\t\tenum dpni_queue_type\t\tqtype,\n-\t\t\tuint8_t\t\t\t\ttc_id,\n+int dpni_set_congestion_notification(struct fsl_mc_io *mc_io,\n+\t\t\t\t     uint32_t cmd_flags,\n+\t\t\t\t     uint16_t token,\n+\t\t\t\t     enum dpni_queue_type qtype,\n+\t\t\t\t     uint8_t tc_id,\n \t\t\tconst struct dpni_congestion_notification_cfg *cfg);\n \n-/**\n- * dpni_get_congestion_notification() - Get traffic class congestion\n- *\tnotification configuration\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @qtype:\tType of queue - Rx, Tx and Tx confirm types are supported\n- * @tc_id:\tTraffic class selection (0-7)\n- * @cfg:\tcongestion notification configuration\n- *\n- * Return:\t'0' on Success; error code otherwise.\n- */\n-int dpni_get_congestion_notification(struct fsl_mc_io\t\t*mc_io,\n-\t\t\t\t     uint32_t\t\t\tcmd_flags,\n-\t\t\t\t     uint16_t\t\t\ttoken,\n-\t\t\t\t     enum dpni_queue_type\tqtype,\n-\t\t\t\t     uint8_t\t\t\ttc_id,\n+int dpni_get_congestion_notification(struct fsl_mc_io *mc_io,\n+\t\t\t\t     uint32_t cmd_flags,\n+\t\t\t\t     uint16_t token,\n+\t\t\t\t     enum dpni_queue_type qtype,\n+\t\t\t\t     uint8_t tc_id,\n \t\t\t\tstruct dpni_congestion_notification_cfg *cfg);\n \n+/* DPNI FLC stash options */\n+\n+/**\n+ * stashes the whole annotation area (up to 192 bytes)\n+ */\n+#define DPNI_FLC_STASH_FRAME_ANNOTATION\t0x00000001\n \n /**\n  * struct dpni_queue - Queue structure\n@@ -1291,9 +936,25 @@ struct dpni_queue {\n \tuint64_t user_context;\n \t/**\n \t * struct flc - FD FLow Context structure\n-\t * @value:\t\tFLC value to set\n-\t * @stash_control:\tBoolean, indicates whether the 6 lowest\n-\t *\t\t\tsignificant bits are used for stash control.\n+\t * @value: Default FLC value for traffic dequeued from\n+\t *      this queue.  Please check description of FD\n+\t *      structure for more information.\n+\t *      Note that FLC values set using dpni_add_fs_entry,\n+\t *      if any, take precedence over values per queue.\n+\t * @stash_control: Boolean, indicates whether the 6 lowest\n+\t *      - significant bits are used for stash control.\n+\t *      significant bits are used for stash control.  If set, the 6\n+\t *      least significant bits in value are interpreted as follows:\n+\t *      - bits 0-1: indicates the number of 64 byte units of context\n+\t *      that are stashed.  FLC value is interpreted as a memory address\n+\t *      in this case, excluding the 6 LS bits.\n+\t *      - bits 2-3: indicates the number of 64 byte units of frame\n+\t *      annotation to be stashed.  Annotation is placed at FD[ADDR].\n+\t *      - bits 4-5: indicates the number of 64 byte units of frame\n+\t *      data to be stashed.  Frame data is placed at FD[ADDR] +\n+\t *      FD[OFFSET].\n+\t *      For more details check the Frame Descriptor section in the\n+\t *      hardware documentation.\n \t */\n \tstruct {\n \t\tuint64_t value;\n@@ -1331,41 +992,16 @@ enum dpni_confirmation_mode {\n \tDPNI_CONF_DISABLE,\n };\n \n-/**\n- * dpni_set_tx_confirmation_mode() - Tx confirmation mode\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @mode:\tTx confirmation mode\n- *\n- * This function is useful only when 'DPNI_OPT_TX_CONF_DISABLED' is not\n- * selected at DPNI creation.\n- * Calling this function with 'mode' set to DPNI_CONF_DISABLE disables all\n- * transmit confirmation (including the private confirmation queues), regardless\n- * of previous settings; Note that in this case, Tx error frames are still\n- * enqueued to the general transmit errors queue.\n- * Calling this function with 'mode' set to DPNI_CONF_SINGLE switches all\n- * Tx confirmations to a shared Tx conf queue.  The ID of the queue when\n- * calling dpni_set/get_queue is -1.\n- * Tx confirmation mode can only be changed while the DPNI is disabled.\n- * Executing this command while the DPNI is enabled will return an error.\n- *\n- * Return:\t'0' on Success; Error code otherwise.\n- */\n-int dpni_set_tx_confirmation_mode(struct fsl_mc_io\t\t*mc_io,\n-\t\t\t\t  uint32_t\t\t\tcmd_flags,\n-\t\t\t\t  uint16_t\t\t\ttoken,\n-\t\t\t\t  enum dpni_confirmation_mode\tmode);\n+int dpni_set_tx_confirmation_mode(struct fsl_mc_io *mc_io,\n+\t\t\t\t  uint32_t cmd_flags,\n+\t\t\t\t  uint16_t token,\n+\t\t\t\t  enum dpni_confirmation_mode mode);\n+\n+int dpni_get_tx_confirmation_mode(struct fsl_mc_io *mc_io,\n+\t\t\t\t  uint32_t cmd_flags,\n+\t\t\t\t  uint16_t token,\n+\t\t\t\t  enum dpni_confirmation_mode *mode);\n \n-/**\n- * dpni_get_api_version() - Get Data Path Network Interface API version\n- * @mc_io:  Pointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @major_ver:\tMajor version of data path network interface API\n- * @minor_ver:\tMinor version of data path network interface API\n- *\n- * Return:  '0' on Success; Error code otherwise.\n- */\n int dpni_get_api_version(struct fsl_mc_io *mc_io,\n \t\t\t uint32_t cmd_flags,\n \t\t\t uint16_t *major_ver,\n@@ -1396,23 +1032,6 @@ int dpni_get_api_version(struct fsl_mc_io *mc_io,\n  */\n #define DPNI_QUEUE_OPT_HOLD_ACTIVE\t0x00000008\n \n-/**\n- * dpni_set_queue() - Set queue parameters\n- * @mc_io:\t\tPointer to MC portal's I/O object\n- * @cmd_flags:\t\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\t\tToken of DPNI object\n- * @qtype:\t\tType of queue - all queue types are supported, although\n- *\t\t\t\tthe command is ignored for Tx\n- * @tc:\t\t\tTraffic class, in range 0 to NUM_TCS - 1\n- * @index:\t\tSelects the specific queue out of the set\n- *\t\t\t\tallocated for the same TC.Value must be in\n- *\t\t\t\trange 0 to NUM_QUEUES - 1\n- * @options:\t\tA combination of DPNI_QUEUE_OPT_ values that control\n- *\t\t\t\twhat configuration options are set on the queue\n- * @queue:\t\tQueue configuration structure\n- *\n- * Return:  '0' on Success; Error code otherwise.\n- */\n int dpni_set_queue(struct fsl_mc_io *mc_io,\n \t\t   uint32_t cmd_flags,\n \t\t   uint16_t token,\n@@ -1422,31 +1041,6 @@ int dpni_set_queue(struct fsl_mc_io *mc_io,\n \t\t   uint8_t options,\n \t\t   const struct dpni_queue *queue);\n \n-/**\n- * dpni_get_queue() - Get queue parameters\n- * @mc_io:\t\tPointer to MC portal's I/O object\n- * @cmd_flags:\t\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\t\tToken of DPNI object\n- * @qtype:\t\tType of queue - all queue types are supported\n- * @tc:\t\t\tTraffic class, in range 0 to NUM_TCS - 1\n- * @index:\t\tSelects the specific queue out of the set allocated\n- *\t\t\t\tfor the same TC. Value must be in range 0 to\n- *\t\t\t\tNUM_QUEUES - 1\n- * @queue:\t\tQueue configuration structure\n- * @qid:\t\tQueue identification\n- *\n- * This function returns current queue configuration which can be changed by\n- * calling dpni_set_queue, and queue identification information.\n- * Returned qid.fqid and/or qid.qdbin values can be used to:\n- * - enqueue traffic for Tx queues,\n- * - perform volatile dequeue for Rx and, if applicable, Tx confirmation\n- *   clean-up,\n- * - retrieve queue state.\n- *\n- * All these operations are supported through the DPIO run-time API.\n- *\n- * Return:  '0' on Success; Error code otherwise.\n- */\n int dpni_get_queue(struct fsl_mc_io *mc_io,\n \t\t   uint32_t cmd_flags,\n \t\t   uint16_t token,\n@@ -1456,32 +1050,13 @@ int dpni_get_queue(struct fsl_mc_io *mc_io,\n \t\t   struct dpni_queue *queue,\n \t\t   struct dpni_queue_id *qid);\n \n-/**\n- * dpni_get_statistics() - Get DPNI statistics\n- * @mc_io:\t\tPointer to MC portal's I/O object\n- * @cmd_flags:\t\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\t\tToken of DPNI object\n- * @page:\t\tSelects the statistics page to retrieve, see\n- *\t\t\t\tDPNI_GET_STATISTICS output.\n- *\t\t\t\tPages are numbered 0 to 2.\n- * @stat:\t\tStructure containing the statistics\n- *\n- * Return:  '0' on Success; Error code otherwise.\n- */\n int dpni_get_statistics(struct fsl_mc_io *mc_io,\n \t\t\tuint32_t cmd_flags,\n \t\t\tuint16_t token,\n \t\t\tuint8_t page,\n+\t\t\tuint8_t param,\n \t\t\tunion dpni_statistics *stat);\n \n-/**\n- * dpni_reset_statistics() - Clears DPNI statistics\n- * @mc_io:\t\tPointer to MC portal's I/O object\n- * @cmd_flags:\t\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\t\tToken of DPNI object\n- *\n- * Return:  '0' on Success; Error code otherwise.\n- */\n int dpni_reset_statistics(struct fsl_mc_io *mc_io,\n \t\t\t  uint32_t cmd_flags,\n \t\t\t  uint16_t token);\n@@ -1505,40 +1080,25 @@ enum dpni_congestion_point {\n  * struct dpni_taildrop - Structure representing the taildrop\n  * @enable:\tIndicates whether the taildrop is active or not.\n  * @units:\tIndicates the unit of THRESHOLD. Queue taildrop only\n- *\t\t\tsupports byte units, this field is ignored and\n- *\t\t\tassumed = 0 if CONGESTION_POINT is 0.\n+ *\t\tsupports byte units, this field is ignored and\n+ *\t\tassumed = 0 if CONGESTION_POINT is 0.\n  * @threshold:\tThreshold value, in units identified by UNITS field. Value 0\n- *\t\t\tcannot be used as a valid taildrop threshold,\n- *\t\t\tTHRESHOLD must be > 0 if the taildrop is\n- *\t\t\tenabled.\n+ *\t\tcannot be used as a valid taildrop threshold,\n+ *\t\tTHRESHOLD must be > 0 if the taildrop is\n+ *\t\tenabled.\n+ * @oal\t:\tOverhead Accounting Length, a 12-bit, 2's complement value\n+ *\t\twith range (-2048 to +2047) representing a fixed per-frame\n+ *\t\toverhead to be added to the actual length of a frame when\n+ *\t\tperforming WRED and tail drop calculations and threshold\n+ *\t\tcomparisons.\n  */\n struct dpni_taildrop {\n \tchar enable;\n \tenum dpni_congestion_unit units;\n \tuint32_t threshold;\n+\tint16_t oal;\n };\n \n-/**\n- * dpni_set_taildrop() - Set taildrop per queue or TC\n- *\n- * Setting a per-TC taildrop (cg_point = DPNI_CP_GROUP) will reset any current\n- * congestion notification or early drop (WRED) configuration previously applied\n- * to the same TC.\n- *\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @cg_point:\tCongestion point.  DPNI_CP_QUEUE is only supported in\n- *\t\tcombination with DPNI_QUEUE_RX.\n- * @q_type:\tQueue type, can be DPNI_QUEUE_RX or DPNI_QUEUE_TX.\n- * @tc:\t\tTraffic class to apply this taildrop to\n- * @q_index:\tIndex of the queue if the DPNI supports multiple queues for\n- *\t\t\ttraffic distribution.\n- *\t\t\tIgnored if CONGESTION_POINT is not DPNI_CP_QUEUE.\n- * @taildrop:\tTaildrop structure\n- *\n- * Return:  '0' on Success; Error code otherwise.\n- */\n int dpni_set_taildrop(struct fsl_mc_io *mc_io,\n \t\t      uint32_t cmd_flags,\n \t\t      uint16_t token,\n@@ -1548,21 +1108,6 @@ int dpni_set_taildrop(struct fsl_mc_io *mc_io,\n \t\t      uint8_t q_index,\n \t\t      struct dpni_taildrop *taildrop);\n \n-/**\n- * dpni_get_taildrop() - Get taildrop information\n- * @mc_io:\tPointer to MC portal's I/O object\n- * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n- * @token:\tToken of DPNI object\n- * @cg_point:\tCongestion point\n- * @q_type:\n- * @tc:\t\tTraffic class to apply this taildrop to\n- * @q_index:\tIndex of the queue if the DPNI supports multiple queues for\n- *\t\t\ttraffic distribution. Ignored if CONGESTION_POINT\n- *\t\t\tis not 0.\n- * @taildrop:\tTaildrop structure\n- *\n- * Return:  '0' on Success; Error code otherwise.\n- */\n int dpni_get_taildrop(struct fsl_mc_io *mc_io,\n \t\t      uint32_t cmd_flags,\n \t\t      uint16_t token,\ndiff --git a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h\nindex 2ac397c..81226aa 100644\n--- a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h\n+++ b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h\n@@ -5,7 +5,7 @@\n  *   BSD LICENSE\n  *\n  * Copyright 2013-2016 Freescale Semiconductor Inc.\n- * Copyright 2016 NXP.\n+ * Copyright 2016-2017 NXP.\n  *\n  * Redistribution and use in source and binary forms, with or without\n  * modification, are permitted provided that the following conditions are met:\n@@ -42,435 +42,547 @@\n \n /* DPNI Version */\n #define DPNI_VER_MAJOR\t\t\t\t7\n-#define DPNI_VER_MINOR\t\t\t\t0\n+#define DPNI_VER_MINOR\t\t\t\t3\n+\n+#define DPNI_CMD_BASE_VERSION\t\t\t1\n+#define DPNI_CMD_VERSION_2\t\t\t2\n+#define DPNI_CMD_ID_OFFSET\t\t\t4\n+\n+#define DPNI_CMD(id)\t(((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_BASE_VERSION)\n+#define DPNI_CMD_V2(id)\t(((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_2)\n \n /* Command IDs */\n-#define DPNI_CMDID_OPEN                                ((0x801 << 4) | (0x1))\n-#define DPNI_CMDID_CLOSE                               ((0x800 << 4) | (0x1))\n-#define DPNI_CMDID_CREATE                              ((0x901 << 4) | (0x1))\n-#define DPNI_CMDID_DESTROY                             ((0x981 << 4) | (0x1))\n-#define DPNI_CMDID_GET_API_VERSION                     ((0xa01 << 4) | (0x1))\n-\n-#define DPNI_CMDID_ENABLE                              ((0x002 << 4) | (0x1))\n-#define DPNI_CMDID_DISABLE                             ((0x003 << 4) | (0x1))\n-#define DPNI_CMDID_GET_ATTR                            ((0x004 << 4) | (0x1))\n-#define DPNI_CMDID_RESET                               ((0x005 << 4) | (0x1))\n-#define DPNI_CMDID_IS_ENABLED                          ((0x006 << 4) | (0x1))\n-\n-#define DPNI_CMDID_SET_POOLS                           ((0x200 << 4) | (0x1))\n-#define DPNI_CMDID_SET_ERRORS_BEHAVIOR                 ((0x20B << 4) | (0x1))\n-\n-#define DPNI_CMDID_GET_QDID                            ((0x210 << 4) | (0x1))\n-#define DPNI_CMDID_GET_LINK_STATE                      ((0x215 << 4) | (0x1))\n-#define DPNI_CMDID_SET_MAX_FRAME_LENGTH                ((0x216 << 4) | (0x1))\n-#define DPNI_CMDID_GET_MAX_FRAME_LENGTH                ((0x217 << 4) | (0x1))\n-#define DPNI_CMDID_SET_LINK_CFG                        ((0x21a << 4) | (0x1))\n-\n-#define DPNI_CMDID_SET_MCAST_PROMISC                   ((0x220 << 4) | (0x1))\n-#define DPNI_CMDID_GET_MCAST_PROMISC                   ((0x221 << 4) | (0x1))\n-#define DPNI_CMDID_SET_UNICAST_PROMISC                 ((0x222 << 4) | (0x1))\n-#define DPNI_CMDID_GET_UNICAST_PROMISC                 ((0x223 << 4) | (0x1))\n-#define DPNI_CMDID_SET_PRIM_MAC                        ((0x224 << 4) | (0x1))\n-#define DPNI_CMDID_GET_PRIM_MAC                        ((0x225 << 4) | (0x1))\n-#define DPNI_CMDID_ADD_MAC_ADDR                        ((0x226 << 4) | (0x1))\n-#define DPNI_CMDID_REMOVE_MAC_ADDR                     ((0x227 << 4) | (0x1))\n-#define DPNI_CMDID_CLR_MAC_FILTERS                     ((0x228 << 4) | (0x1))\n-\n-#define DPNI_CMDID_ENABLE_VLAN_FILTER                  ((0x230 << 4) | (0x1))\n-#define DPNI_CMDID_ADD_VLAN_ID                         ((0x231 << 4) | (0x1))\n-#define DPNI_CMDID_REMOVE_VLAN_ID                      ((0x232 << 4) | (0x1))\n-#define DPNI_CMDID_CLR_VLAN_FILTERS                    ((0x233 << 4) | (0x1))\n-\n-#define DPNI_CMDID_SET_RX_TC_DIST                      ((0x235 << 4) | (0x1))\n-\n-#define DPNI_CMDID_GET_STATISTICS                      ((0x25D << 4) | (0x1))\n-#define DPNI_CMDID_RESET_STATISTICS                    ((0x25E << 4) | (0x1))\n-#define DPNI_CMDID_GET_QUEUE                           ((0x25F << 4) | (0x1))\n-#define DPNI_CMDID_SET_QUEUE                           ((0x260 << 4) | (0x1))\n-#define DPNI_CMDID_GET_TAILDROP                        ((0x261 << 4) | (0x1))\n-#define DPNI_CMDID_SET_TAILDROP                        ((0x262 << 4) | (0x1))\n-\n-#define DPNI_CMDID_GET_PORT_MAC_ADDR                   ((0x263 << 4) | (0x1))\n-\n-#define DPNI_CMDID_GET_BUFFER_LAYOUT                   ((0x264 << 4) | (0x1))\n-#define DPNI_CMDID_SET_BUFFER_LAYOUT                   ((0x265 << 4) | (0x1))\n-\n-#define DPNI_CMDID_SET_CONGESTION_NOTIFICATION         ((0x267 << 4) | (0x1))\n-#define DPNI_CMDID_GET_CONGESTION_NOTIFICATION         ((0x268 << 4) | (0x1))\n-#define DPNI_CMDID_GET_OFFLOAD                         ((0x26B << 4) | (0x1))\n-#define DPNI_CMDID_SET_OFFLOAD                         ((0x26C << 4) | (0x1))\n-#define DPNI_CMDID_SET_TX_CONFIRMATION_MODE            ((0x266 << 4) | (0x1))\n-#define DPNI_CMDID_GET_TX_CONFIRMATION_MODE            ((0x26D << 4) | (0x1))\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_OPEN(cmd, dpni_id) \\\n-\tMC_CMD_OP(cmd,\t 0,\t0,\t32,\tint,\tdpni_id)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_CREATE(cmd, cfg) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0,  0, 32, uint32_t,  (cfg)->options); \\\n-\tMC_CMD_OP(cmd, 0, 32,  8,  uint8_t,  (cfg)->num_queues); \\\n-\tMC_CMD_OP(cmd, 0, 40,  8,  uint8_t,  (cfg)->num_tcs); \\\n-\tMC_CMD_OP(cmd, 0, 48,  8,  uint8_t,  (cfg)->mac_filter_entries); \\\n-\tMC_CMD_OP(cmd, 1,  0,  8,  uint8_t,  (cfg)->vlan_filter_entries); \\\n-\tMC_CMD_OP(cmd, 1, 16,  8,  uint8_t,  (cfg)->qos_entries); \\\n-\tMC_CMD_OP(cmd, 1, 32, 16, uint16_t,  (cfg)->fs_entries); \\\n-} while (0)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_SET_POOLS(cmd, cfg) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0, 0,  8,  uint8_t,  cfg->num_dpbp); \\\n-\tMC_CMD_OP(cmd, 0, 8,  1,  int,      cfg->pools[0].backup_pool); \\\n-\tMC_CMD_OP(cmd, 0, 9,  1,  int,      cfg->pools[1].backup_pool); \\\n-\tMC_CMD_OP(cmd, 0, 10, 1,  int,      cfg->pools[2].backup_pool); \\\n-\tMC_CMD_OP(cmd, 0, 11, 1,  int,      cfg->pools[3].backup_pool); \\\n-\tMC_CMD_OP(cmd, 0, 12, 1,  int,      cfg->pools[4].backup_pool); \\\n-\tMC_CMD_OP(cmd, 0, 13, 1,  int,      cfg->pools[5].backup_pool); \\\n-\tMC_CMD_OP(cmd, 0, 14, 1,  int,      cfg->pools[6].backup_pool); \\\n-\tMC_CMD_OP(cmd, 0, 15, 1,  int,      cfg->pools[7].backup_pool); \\\n-\tMC_CMD_OP(cmd, 0, 32, 32, int,      cfg->pools[0].dpbp_id); \\\n-\tMC_CMD_OP(cmd, 4, 32, 16, uint16_t, cfg->pools[0].buffer_size);\\\n-\tMC_CMD_OP(cmd, 1, 0,  32, int,      cfg->pools[1].dpbp_id); \\\n-\tMC_CMD_OP(cmd, 4, 48, 16, uint16_t, cfg->pools[1].buffer_size);\\\n-\tMC_CMD_OP(cmd, 1, 32, 32, int,      cfg->pools[2].dpbp_id); \\\n-\tMC_CMD_OP(cmd, 5, 0,  16, uint16_t, cfg->pools[2].buffer_size);\\\n-\tMC_CMD_OP(cmd, 2, 0,  32, int,      cfg->pools[3].dpbp_id); \\\n-\tMC_CMD_OP(cmd, 5, 16, 16, uint16_t, cfg->pools[3].buffer_size);\\\n-\tMC_CMD_OP(cmd, 2, 32, 32, int,      cfg->pools[4].dpbp_id); \\\n-\tMC_CMD_OP(cmd, 5, 32, 16, uint16_t, cfg->pools[4].buffer_size);\\\n-\tMC_CMD_OP(cmd, 3, 0,  32, int,      cfg->pools[5].dpbp_id); \\\n-\tMC_CMD_OP(cmd, 5, 48, 16, uint16_t, cfg->pools[5].buffer_size);\\\n-\tMC_CMD_OP(cmd, 3, 32, 32, int,      cfg->pools[6].dpbp_id); \\\n-\tMC_CMD_OP(cmd, 6, 0,  16, uint16_t, cfg->pools[6].buffer_size);\\\n-\tMC_CMD_OP(cmd, 4, 0,  32, int,      cfg->pools[7].dpbp_id); \\\n-\tMC_CMD_OP(cmd, 6, 16, 16, uint16_t, cfg->pools[7].buffer_size);\\\n-} while (0)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_RSP_IS_ENABLED(cmd, en) \\\n-\tMC_RSP_OP(cmd, 0, 0,  1,  int,\t    en)\n-\n-/* DPNI_CMD_GET_ATTR is not used, no input parameters */\n-\n-#define DPNI_RSP_GET_ATTR(cmd, attr) \\\n-do { \\\n-\tMC_RSP_OP(cmd, 0,  0, 32, uint32_t, (attr)->options); \\\n-\tMC_RSP_OP(cmd, 0, 32,  8, uint8_t,  (attr)->num_queues); \\\n-\tMC_RSP_OP(cmd, 0, 40,  8, uint8_t,  (attr)->num_tcs); \\\n-\tMC_RSP_OP(cmd, 0, 48,  8, uint8_t,  (attr)->mac_filter_entries); \\\n-\tMC_RSP_OP(cmd, 1,  0,  8, uint8_t, (attr)->vlan_filter_entries); \\\n-\tMC_RSP_OP(cmd, 1, 16,  8, uint8_t,  (attr)->qos_entries); \\\n-\tMC_RSP_OP(cmd, 1, 32, 16, uint16_t, (attr)->fs_entries); \\\n-\tMC_RSP_OP(cmd, 2,  0,  8, uint8_t,  (attr)->qos_key_size); \\\n-\tMC_RSP_OP(cmd, 2,  8,  8, uint8_t,  (attr)->fs_key_size); \\\n-\tMC_RSP_OP(cmd, 2, 16, 16, uint16_t, (attr)->wriop_version); \\\n-} while (0)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_SET_ERRORS_BEHAVIOR(cmd, cfg) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0, 0,  32, uint32_t, cfg->errors); \\\n-\tMC_CMD_OP(cmd, 0, 32, 4,  enum dpni_error_action, cfg->error_action); \\\n-\tMC_CMD_OP(cmd, 0, 36, 1,  int,      cfg->set_frame_annotation); \\\n-} while (0)\n-\n-#define DPNI_CMD_GET_BUFFER_LAYOUT(cmd, qtype) \\\n-\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_queue_type, qtype)\n-\n-#define DPNI_RSP_GET_BUFFER_LAYOUT(cmd, layout) \\\n-do { \\\n-\tMC_RSP_OP(cmd, 0, 48,  1, char, (layout)->pass_timestamp); \\\n-\tMC_RSP_OP(cmd, 0, 49,  1, char, (layout)->pass_parser_result); \\\n-\tMC_RSP_OP(cmd, 0, 50,  1, char, (layout)->pass_frame_status); \\\n-\tMC_RSP_OP(cmd, 1,  0, 16, uint16_t, (layout)->private_data_size); \\\n-\tMC_RSP_OP(cmd, 1, 16, 16, uint16_t, (layout)->data_align); \\\n-\tMC_RSP_OP(cmd, 1, 32, 16, uint16_t, (layout)->data_head_room); \\\n-\tMC_RSP_OP(cmd, 1, 48, 16, uint16_t, (layout)->data_tail_room); \\\n-} while (0)\n-\n-#define DPNI_CMD_SET_BUFFER_LAYOUT(cmd, qtype, layout) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_queue_type, qtype); \\\n-\tMC_CMD_OP(cmd, 0, 32, 16, uint16_t, (layout)->options); \\\n-\tMC_CMD_OP(cmd, 0, 48,  1, char, (layout)->pass_timestamp); \\\n-\tMC_CMD_OP(cmd, 0, 49,  1, char, (layout)->pass_parser_result); \\\n-\tMC_CMD_OP(cmd, 0, 50,  1, char, (layout)->pass_frame_status); \\\n-\tMC_CMD_OP(cmd, 1,  0, 16, uint16_t, (layout)->private_data_size); \\\n-\tMC_CMD_OP(cmd, 1, 16, 16, uint16_t, (layout)->data_align); \\\n-\tMC_CMD_OP(cmd, 1, 32, 16, uint16_t, (layout)->data_head_room); \\\n-\tMC_CMD_OP(cmd, 1, 48, 16, uint16_t, (layout)->data_tail_room); \\\n-} while (0)\n-\n-#define DPNI_CMD_SET_OFFLOAD(cmd, type, config) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0, 24,  8, enum dpni_offload, type); \\\n-\tMC_CMD_OP(cmd, 0, 32, 32, uint32_t, config); \\\n-} while (0)\n-\n-#define DPNI_CMD_GET_OFFLOAD(cmd, type) \\\n-\tMC_CMD_OP(cmd, 0, 24,  8, enum dpni_offload, type)\n-\n-#define DPNI_RSP_GET_OFFLOAD(cmd, config) \\\n-\tMC_RSP_OP(cmd, 0, 32, 32, uint32_t, config)\n-\n-#define DPNI_CMD_GET_QDID(cmd, qtype) \\\n-\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_queue_type, qtype)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_RSP_GET_QDID(cmd, qdid) \\\n-\tMC_RSP_OP(cmd, 0, 0,  16, uint16_t, qdid)\n-\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_GET_STATISTICS(cmd, page) \\\n-\tMC_CMD_OP(cmd, 0, 0, 8, uint8_t, page)\n-\n-#define DPNI_RSP_GET_STATISTICS(cmd, stat) \\\n-do { \\\n-\tMC_RSP_OP(cmd, 0, 0, 64, uint64_t, (stat)->raw.counter[0]); \\\n-\tMC_RSP_OP(cmd, 1, 0, 64, uint64_t, (stat)->raw.counter[1]); \\\n-\tMC_RSP_OP(cmd, 2, 0, 64, uint64_t, (stat)->raw.counter[2]); \\\n-\tMC_RSP_OP(cmd, 3, 0, 64, uint64_t, (stat)->raw.counter[3]); \\\n-\tMC_RSP_OP(cmd, 4, 0, 64, uint64_t, (stat)->raw.counter[4]); \\\n-\tMC_RSP_OP(cmd, 5, 0, 64, uint64_t, (stat)->raw.counter[5]); \\\n-\tMC_RSP_OP(cmd, 6, 0, 64, uint64_t, (stat)->raw.counter[6]); \\\n-} while (0)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_SET_LINK_CFG(cmd, cfg) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 1, 0,  32, uint32_t, cfg->rate);\\\n-\tMC_CMD_OP(cmd, 2, 0,  64, uint64_t, cfg->options);\\\n-} while (0)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_RSP_GET_LINK_STATE(cmd, state) \\\n-do { \\\n-\tMC_RSP_OP(cmd, 0, 32,  1, int,      state->up);\\\n-\tMC_RSP_OP(cmd, 1, 0,  32, uint32_t, state->rate);\\\n-\tMC_RSP_OP(cmd, 2, 0,  64, uint64_t, state->options);\\\n-} while (0)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_SET_MAX_FRAME_LENGTH(cmd, max_frame_length) \\\n-\tMC_CMD_OP(cmd, 0, 0,  16, uint16_t, max_frame_length)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_RSP_GET_MAX_FRAME_LENGTH(cmd, max_frame_length) \\\n-\tMC_RSP_OP(cmd, 0, 0,  16, uint16_t, max_frame_length)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_SET_MULTICAST_PROMISC(cmd, en) \\\n-\tMC_CMD_OP(cmd, 0, 0,  1,  int,      en)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_RSP_GET_MULTICAST_PROMISC(cmd, en) \\\n-\tMC_RSP_OP(cmd, 0, 0,  1,  int,\t    en)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_SET_UNICAST_PROMISC(cmd, en) \\\n-\tMC_CMD_OP(cmd, 0, 0,  1,  int,      en)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_RSP_GET_UNICAST_PROMISC(cmd, en) \\\n-\tMC_RSP_OP(cmd, 0, 0,  1,  int,\t    en)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_SET_PRIMARY_MAC_ADDR(cmd, mac_addr) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0, 16, 8,  uint8_t,  mac_addr[5]); \\\n-\tMC_CMD_OP(cmd, 0, 24, 8,  uint8_t,  mac_addr[4]); \\\n-\tMC_CMD_OP(cmd, 0, 32, 8,  uint8_t,  mac_addr[3]); \\\n-\tMC_CMD_OP(cmd, 0, 40, 8,  uint8_t,  mac_addr[2]); \\\n-\tMC_CMD_OP(cmd, 0, 48, 8,  uint8_t,  mac_addr[1]); \\\n-\tMC_CMD_OP(cmd, 0, 56, 8,  uint8_t,  mac_addr[0]); \\\n-} while (0)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_RSP_GET_PRIMARY_MAC_ADDR(cmd, mac_addr) \\\n-do { \\\n-\tMC_RSP_OP(cmd, 0, 16, 8,  uint8_t,  mac_addr[5]); \\\n-\tMC_RSP_OP(cmd, 0, 24, 8,  uint8_t,  mac_addr[4]); \\\n-\tMC_RSP_OP(cmd, 0, 32, 8,  uint8_t,  mac_addr[3]); \\\n-\tMC_RSP_OP(cmd, 0, 40, 8,  uint8_t,  mac_addr[2]); \\\n-\tMC_RSP_OP(cmd, 0, 48, 8,  uint8_t,  mac_addr[1]); \\\n-\tMC_RSP_OP(cmd, 0, 56, 8,  uint8_t,  mac_addr[0]); \\\n-} while (0)\n-\n-#define DPNI_RSP_GET_PORT_MAC_ADDR(cmd, mac_addr) \\\n-do { \\\n-\tMC_RSP_OP(cmd, 0, 16, 8,  uint8_t,  mac_addr[5]); \\\n-\tMC_RSP_OP(cmd, 0, 24, 8,  uint8_t,  mac_addr[4]); \\\n-\tMC_RSP_OP(cmd, 0, 32, 8,  uint8_t,  mac_addr[3]); \\\n-\tMC_RSP_OP(cmd, 0, 40, 8,  uint8_t,  mac_addr[2]); \\\n-\tMC_RSP_OP(cmd, 0, 48, 8,  uint8_t,  mac_addr[1]); \\\n-\tMC_RSP_OP(cmd, 0, 56, 8,  uint8_t,  mac_addr[0]); \\\n-} while (0)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_ADD_MAC_ADDR(cmd, mac_addr) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0, 16, 8,  uint8_t,  mac_addr[5]); \\\n-\tMC_CMD_OP(cmd, 0, 24, 8,  uint8_t,  mac_addr[4]); \\\n-\tMC_CMD_OP(cmd, 0, 32, 8,  uint8_t,  mac_addr[3]); \\\n-\tMC_CMD_OP(cmd, 0, 40, 8,  uint8_t,  mac_addr[2]); \\\n-\tMC_CMD_OP(cmd, 0, 48, 8,  uint8_t,  mac_addr[1]); \\\n-\tMC_CMD_OP(cmd, 0, 56, 8,  uint8_t,  mac_addr[0]); \\\n-} while (0)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_REMOVE_MAC_ADDR(cmd, mac_addr) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0, 16, 8,  uint8_t,  mac_addr[5]); \\\n-\tMC_CMD_OP(cmd, 0, 24, 8,  uint8_t,  mac_addr[4]); \\\n-\tMC_CMD_OP(cmd, 0, 32, 8,  uint8_t,  mac_addr[3]); \\\n-\tMC_CMD_OP(cmd, 0, 40, 8,  uint8_t,  mac_addr[2]); \\\n-\tMC_CMD_OP(cmd, 0, 48, 8,  uint8_t,  mac_addr[1]); \\\n-\tMC_CMD_OP(cmd, 0, 56, 8,  uint8_t,  mac_addr[0]); \\\n-} while (0)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_CLEAR_MAC_FILTERS(cmd, unicast, multicast) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0, 0,  1,  int,      unicast); \\\n-\tMC_CMD_OP(cmd, 0, 1,  1,  int,      multicast); \\\n-} while (0)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_ENABLE_VLAN_FILTER(cmd, en) \\\n-\tMC_CMD_OP(cmd, 0, 0,  1,  int,\t    en)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_ADD_VLAN_ID(cmd, vlan_id) \\\n-\tMC_CMD_OP(cmd, 0, 32, 16, uint16_t, vlan_id)\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_REMOVE_VLAN_ID(cmd, vlan_id) \\\n-\tMC_CMD_OP(cmd, 0, 32, 16, uint16_t, vlan_id)\n-\n-\n-/*                cmd, param, offset, width, type, arg_name */\n-#define DPNI_CMD_SET_RX_TC_DIST(cmd, tc_id, cfg) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0, 0,  16, uint16_t,  cfg->dist_size); \\\n-\tMC_CMD_OP(cmd, 0, 16, 8,  uint8_t,  tc_id); \\\n-\tMC_CMD_OP(cmd, 0, 24, 4,  enum dpni_dist_mode, cfg->dist_mode); \\\n-\tMC_CMD_OP(cmd, 0, 28, 4,  enum dpni_fs_miss_action, \\\n-\t\t\t\t\t\t  cfg->fs_cfg.miss_action); \\\n-\tMC_CMD_OP(cmd, 0, 48, 16, uint16_t, cfg->fs_cfg.default_flow_id); \\\n-\tMC_CMD_OP(cmd, 6, 0,  64, uint64_t, cfg->key_cfg_iova); \\\n-} while (0)\n-\n-#define DPNI_CMD_GET_QUEUE(cmd, qtype, tc, index) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_queue_type, qtype); \\\n-\tMC_CMD_OP(cmd, 0,  8,  8,  uint8_t, tc); \\\n-\tMC_CMD_OP(cmd, 0, 16,  8,  uint8_t, index); \\\n-} while (0)\n-\n-#define DPNI_RSP_GET_QUEUE(cmd, queue, queue_id) \\\n-do { \\\n-\tMC_RSP_OP(cmd, 1,  0, 32, uint32_t, (queue)->destination.id); \\\n-\tMC_RSP_OP(cmd, 1, 48,  8, uint8_t, (queue)->destination.priority); \\\n-\tMC_RSP_OP(cmd, 1, 56,  4, enum dpni_dest, (queue)->destination.type); \\\n-\tMC_RSP_OP(cmd, 1, 62,  1, char, (queue)->flc.stash_control); \\\n-\tMC_RSP_OP(cmd, 1, 63,  1, char, (queue)->destination.hold_active); \\\n-\tMC_RSP_OP(cmd, 2,  0, 64, uint64_t, (queue)->flc.value); \\\n-\tMC_RSP_OP(cmd, 3,  0, 64, uint64_t, (queue)->user_context); \\\n-\tMC_RSP_OP(cmd, 4,  0, 32, uint32_t, (queue_id)->fqid); \\\n-\tMC_RSP_OP(cmd, 4, 32, 16, uint16_t, (queue_id)->qdbin); \\\n-} while (0)\n-\n-#define DPNI_CMD_SET_QUEUE(cmd, qtype, tc, index, options, queue) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_queue_type, qtype); \\\n-\tMC_CMD_OP(cmd, 0,  8,  8,  uint8_t, tc); \\\n-\tMC_CMD_OP(cmd, 0, 16,  8,  uint8_t, index); \\\n-\tMC_CMD_OP(cmd, 0, 24,  8,  uint8_t, options); \\\n-\tMC_CMD_OP(cmd, 1,  0, 32, uint32_t, (queue)->destination.id); \\\n-\tMC_CMD_OP(cmd, 1, 48,  8, uint8_t, (queue)->destination.priority); \\\n-\tMC_CMD_OP(cmd, 1, 56,  4, enum dpni_dest, (queue)->destination.type); \\\n-\tMC_CMD_OP(cmd, 1, 62,  1, char, (queue)->flc.stash_control); \\\n-\tMC_CMD_OP(cmd, 1, 63,  1, char, (queue)->destination.hold_active); \\\n-\tMC_CMD_OP(cmd, 2,  0, 64, uint64_t, (queue)->flc.value); \\\n-\tMC_CMD_OP(cmd, 3,  0, 64, uint64_t, (queue)->user_context); \\\n-} while (0)\n-\n-/*                cmd, param, offset, width, type,      arg_name */\n-#define DPNI_RSP_GET_API_VERSION(cmd, major, minor) \\\n-do { \\\n-\tMC_RSP_OP(cmd, 0, 0,  16, uint16_t, major);\\\n-\tMC_RSP_OP(cmd, 0, 16, 16, uint16_t, minor);\\\n-} while (0)\n-\n-#define DPNI_CMD_GET_TAILDROP(cmd, cp, q_type, tc, q_index) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_congestion_point, cp); \\\n-\tMC_CMD_OP(cmd, 0,  8,  8, enum dpni_queue_type, q_type); \\\n-\tMC_CMD_OP(cmd, 0, 16,  8, uint8_t, tc); \\\n-\tMC_CMD_OP(cmd, 0, 24,  8, uint8_t, q_index); \\\n-} while (0)\n-\n-#define DPNI_RSP_GET_TAILDROP(cmd, taildrop) \\\n-do { \\\n-\tMC_RSP_OP(cmd, 1,  0,  1, char, (taildrop)->enable); \\\n-\tMC_RSP_OP(cmd, 1, 16,  8, enum dpni_congestion_unit, \\\n-\t\t\t\t(taildrop)->units); \\\n-\tMC_RSP_OP(cmd, 1, 32, 32, uint32_t, (taildrop)->threshold); \\\n-} while (0)\n-\n-#define DPNI_CMD_SET_TAILDROP(cmd, cp, q_type, tc, q_index, taildrop) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_congestion_point, cp); \\\n-\tMC_CMD_OP(cmd, 0,  8,  8, enum dpni_queue_type, q_type); \\\n-\tMC_CMD_OP(cmd, 0, 16,  8, uint8_t, tc); \\\n-\tMC_CMD_OP(cmd, 0, 24,  8, uint8_t, q_index); \\\n-\tMC_CMD_OP(cmd, 1,  0,  1, char, (taildrop)->enable); \\\n-\tMC_CMD_OP(cmd, 1, 16,  8, enum dpni_congestion_unit, \\\n-\t\t\t\t(taildrop)->units); \\\n-\tMC_CMD_OP(cmd, 1, 32, 32, uint32_t, (taildrop)->threshold); \\\n-} while (0)\n-\n-#define DPNI_CMD_SET_TX_CONFIRMATION_MODE(cmd, mode) \\\n-\tMC_CMD_OP(cmd, 0, 32, 8, enum dpni_confirmation_mode, mode)\n-\n-#define DPNI_RSP_GET_TX_CONFIRMATION_MODE(cmd, mode) \\\n-\tMC_RSP_OP(cmd, 0, 32, 8, enum dpni_confirmation_mode, mode)\n-\n-#define DPNI_CMD_SET_CONGESTION_NOTIFICATION(cmd, qtype, tc, cfg) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_queue_type, qtype); \\\n-\tMC_CMD_OP(cmd, 0,  8,  8, uint8_t, tc); \\\n-\tMC_CMD_OP(cmd, 1,  0, 32, uint32_t, (cfg)->dest_cfg.dest_id); \\\n-\tMC_CMD_OP(cmd, 1, 32, 16, uint16_t, (cfg)->notification_mode); \\\n-\tMC_CMD_OP(cmd, 1, 48,  8, uint8_t, (cfg)->dest_cfg.priority); \\\n-\tMC_CMD_OP(cmd, 1, 56,  4, enum dpni_dest, (cfg)->dest_cfg.dest_type); \\\n-\tMC_CMD_OP(cmd, 1, 60,  2, enum dpni_congestion_unit, (cfg)->units); \\\n-\tMC_CMD_OP(cmd, 2,  0, 64, uint64_t, (cfg)->message_iova); \\\n-\tMC_CMD_OP(cmd, 3,  0, 64, uint64_t, (cfg)->message_ctx); \\\n-\tMC_CMD_OP(cmd, 4,  0, 32, uint32_t, (cfg)->threshold_entry); \\\n-\tMC_CMD_OP(cmd, 4, 32, 32, uint32_t, (cfg)->threshold_exit); \\\n-} while (0)\n-\n-#define DPNI_CMD_GET_CONGESTION_NOTIFICATION(cmd, qtype, tc) \\\n-do { \\\n-\tMC_CMD_OP(cmd, 0,  0,  8, enum dpni_queue_type, qtype); \\\n-\tMC_CMD_OP(cmd, 0,  8,  8, uint8_t, tc); \\\n-} while (0)\n-\n-#define DPNI_RSP_GET_CONGESTION_NOTIFICATION(cmd, cfg) \\\n-do { \\\n-\tMC_RSP_OP(cmd, 1,  0, 32, uint32_t, (cfg)->dest_cfg.dest_id); \\\n-\tMC_RSP_OP(cmd, 1,  0, 16, uint16_t, (cfg)->notification_mode); \\\n-\tMC_RSP_OP(cmd, 1, 48,  8, uint8_t, (cfg)->dest_cfg.priority); \\\n-\tMC_RSP_OP(cmd, 1, 56,  4, enum dpni_dest, (cfg)->dest_cfg.dest_type); \\\n-\tMC_RSP_OP(cmd, 1, 60,  2, enum dpni_congestion_unit, (cfg)->units); \\\n-\tMC_RSP_OP(cmd, 2,  0, 64, uint64_t, (cfg)->message_iova); \\\n-\tMC_RSP_OP(cmd, 3,  0, 64, uint64_t, (cfg)->message_ctx); \\\n-\tMC_RSP_OP(cmd, 4,  0, 32, uint32_t, (cfg)->threshold_entry); \\\n-\tMC_RSP_OP(cmd, 4, 32, 32, uint32_t, (cfg)->threshold_exit); \\\n-} while (0)\n+#define DPNI_CMDID_OPEN\t\t\t\tDPNI_CMD(0x801)\n+#define DPNI_CMDID_CLOSE\t\t\tDPNI_CMD(0x800)\n+#define DPNI_CMDID_CREATE\t\t\tDPNI_CMD(0x901)\n+#define DPNI_CMDID_DESTROY\t\t\tDPNI_CMD(0x981)\n+#define DPNI_CMDID_GET_API_VERSION\t\tDPNI_CMD(0xa01)\n+\n+#define DPNI_CMDID_ENABLE\t\t\tDPNI_CMD(0x002)\n+#define DPNI_CMDID_DISABLE\t\t\tDPNI_CMD(0x003)\n+#define DPNI_CMDID_GET_ATTR\t\t\tDPNI_CMD_V2(0x004)\n+#define DPNI_CMDID_RESET\t\t\tDPNI_CMD(0x005)\n+#define DPNI_CMDID_IS_ENABLED\t\t\tDPNI_CMD(0x006)\n+\n+#define DPNI_CMDID_SET_POOLS\t\t\tDPNI_CMD_V2(0x200)\n+#define DPNI_CMDID_SET_ERRORS_BEHAVIOR\t\tDPNI_CMD(0x20B)\n+\n+#define DPNI_CMDID_GET_QDID\t\t\tDPNI_CMD(0x210)\n+#define DPNI_CMDID_GET_SP_INFO\t\t\tDPNI_CMD(0x211)\n+#define DPNI_CMDID_GET_TX_DATA_OFFSET\t\tDPNI_CMD(0x212)\n+#define DPNI_CMDID_GET_LINK_STATE\t\tDPNI_CMD(0x215)\n+#define DPNI_CMDID_SET_MAX_FRAME_LENGTH\t\tDPNI_CMD(0x216)\n+#define DPNI_CMDID_GET_MAX_FRAME_LENGTH\t\tDPNI_CMD(0x217)\n+#define DPNI_CMDID_SET_LINK_CFG\t\t\tDPNI_CMD(0x21A)\n+#define DPNI_CMDID_SET_TX_SHAPING\t\tDPNI_CMD_V2(0x21B)\n+\n+#define DPNI_CMDID_SET_MCAST_PROMISC\t\tDPNI_CMD(0x220)\n+#define DPNI_CMDID_GET_MCAST_PROMISC\t\tDPNI_CMD(0x221)\n+#define DPNI_CMDID_SET_UNICAST_PROMISC\t\tDPNI_CMD(0x222)\n+#define DPNI_CMDID_GET_UNICAST_PROMISC\t\tDPNI_CMD(0x223)\n+#define DPNI_CMDID_SET_PRIM_MAC\t\t\tDPNI_CMD(0x224)\n+#define DPNI_CMDID_GET_PRIM_MAC\t\t\tDPNI_CMD(0x225)\n+#define DPNI_CMDID_ADD_MAC_ADDR\t\t\tDPNI_CMD(0x226)\n+#define DPNI_CMDID_REMOVE_MAC_ADDR\t\tDPNI_CMD(0x227)\n+#define DPNI_CMDID_CLR_MAC_FILTERS\t\tDPNI_CMD(0x228)\n+\n+#define DPNI_CMDID_ENABLE_VLAN_FILTER\t\tDPNI_CMD(0x230)\n+#define DPNI_CMDID_ADD_VLAN_ID\t\t\tDPNI_CMD(0x231)\n+#define DPNI_CMDID_REMOVE_VLAN_ID\t\tDPNI_CMD(0x232)\n+#define DPNI_CMDID_CLR_VLAN_FILTERS\t\tDPNI_CMD(0x233)\n+\n+#define DPNI_CMDID_SET_RX_TC_DIST\t\tDPNI_CMD_V2(0x235)\n+\n+#define DPNI_CMDID_GET_STATISTICS\t\tDPNI_CMD_V2(0x25D)\n+#define DPNI_CMDID_RESET_STATISTICS\t\tDPNI_CMD(0x25E)\n+#define DPNI_CMDID_GET_QUEUE\t\t\tDPNI_CMD(0x25F)\n+#define DPNI_CMDID_SET_QUEUE\t\t\tDPNI_CMD(0x260)\n+#define DPNI_CMDID_GET_TAILDROP\t\t\tDPNI_CMD_V2(0x261)\n+#define DPNI_CMDID_SET_TAILDROP\t\t\tDPNI_CMD_V2(0x262)\n+\n+#define DPNI_CMDID_GET_PORT_MAC_ADDR\t\tDPNI_CMD(0x263)\n+\n+#define DPNI_CMDID_GET_BUFFER_LAYOUT\t\tDPNI_CMD(0x264)\n+#define DPNI_CMDID_SET_BUFFER_LAYOUT\t\tDPNI_CMD(0x265)\n+\n+#define DPNI_CMDID_SET_CONGESTION_NOTIFICATION\tDPNI_CMD(0x267)\n+#define DPNI_CMDID_GET_CONGESTION_NOTIFICATION\tDPNI_CMD(0x268)\n+#define DPNI_CMDID_SET_EARLY_DROP\t\tDPNI_CMD_V2(0x269)\n+#define DPNI_CMDID_GET_EARLY_DROP\t\tDPNI_CMD_V2(0x26A)\n+#define DPNI_CMDID_GET_OFFLOAD\t\t\tDPNI_CMD(0x26B)\n+#define DPNI_CMDID_SET_OFFLOAD\t\t\tDPNI_CMD(0x26C)\n+#define DPNI_CMDID_SET_TX_CONFIRMATION_MODE\tDPNI_CMD(0x266)\n+#define DPNI_CMDID_GET_TX_CONFIRMATION_MODE\tDPNI_CMD(0x26D)\n+\n+/* Macros for accessing command fields smaller than 1byte */\n+#define DPNI_MASK(field)\t\\\n+\tGENMASK(DPNI_##field##_SHIFT + DPNI_##field##_SIZE - 1, \\\n+\t\tDPNI_##field##_SHIFT)\n+#define dpni_set_field(var, field, val)\t\\\n+\t((var) |= (((val) << DPNI_##field##_SHIFT) & DPNI_MASK(field)))\n+#define dpni_get_field(var, field)\t\\\n+\t(((var) & DPNI_MASK(field)) >> DPNI_##field##_SHIFT)\n+\n+#pragma pack(push, 1)\n+struct dpni_cmd_open {\n+\tuint32_t dpni_id;\n+};\n+\n+struct dpni_cmd_create {\n+\tuint32_t options;\n+\tuint8_t num_queues;\n+\tuint8_t num_tcs;\n+\tuint8_t mac_filter_entries;\n+\tuint8_t pad1;\n+\tuint8_t vlan_filter_entries;\n+\tuint8_t pad2;\n+\tuint8_t qos_entries;\n+\tuint8_t pad3;\n+\tuint16_t fs_entries;\n+};\n+\n+struct dpni_cmd_destroy {\n+\tuint32_t dpsw_id;\n+};\n+\n+#define DPNI_BACKUP_POOL(val, order)\t(((val) & 0x1) << (order))\n+\n+struct dpni_cmd_pool {\n+\tuint16_t dpbp_id;\n+\tuint8_t priority_mask;\n+\tuint8_t pad;\n+};\n+\n+struct dpni_cmd_set_pools {\n+\tuint8_t num_dpbp;\n+\tuint8_t backup_pool_mask;\n+\tuint16_t pad;\n+\tstruct dpni_cmd_pool pool[8];\n+\tuint16_t buffer_size[8];\n+};\n+\n+/* The enable indication is always the least significant bit */\n+#define DPNI_ENABLE_SHIFT\t\t0\n+#define DPNI_ENABLE_SIZE\t\t1\n+\n+struct dpni_rsp_is_enabled {\n+\tuint8_t enabled;\n+};\n+\n+struct dpni_rsp_get_attr {\n+\t/* response word 0 */\n+\tuint32_t options;\n+\tuint8_t num_queues;\n+\tuint8_t num_rx_tcs;\n+\tuint8_t mac_filter_entries;\n+\tuint8_t num_tx_tcs;\n+\t/* response word 1 */\n+\tuint8_t vlan_filter_entries;\n+\tuint8_t pad1;\n+\tuint8_t qos_entries;\n+\tuint8_t pad2;\n+\tuint16_t fs_entries;\n+\tuint16_t pad3;\n+\t/* response word 2 */\n+\tuint8_t qos_key_size;\n+\tuint8_t fs_key_size;\n+\tuint16_t wriop_version;\n+};\n+\n+#define DPNI_ERROR_ACTION_SHIFT\t\t0\n+#define DPNI_ERROR_ACTION_SIZE\t\t4\n+#define DPNI_FRAME_ANN_SHIFT\t\t4\n+#define DPNI_FRAME_ANN_SIZE\t\t1\n+\n+struct dpni_cmd_set_errors_behavior {\n+\tuint32_t errors;\n+\t/* from least significant bit: error_action:4, set_frame_annotation:1 */\n+\tuint8_t flags;\n+};\n+\n+/* There are 3 separate commands for configuring Rx, Tx and Tx confirmation\n+ * buffer layouts, but they all share the same parameters.\n+ * If one of the functions changes, below structure needs to be split.\n+ */\n \n+#define DPNI_PASS_TS_SHIFT\t\t0\n+#define DPNI_PASS_TS_SIZE\t\t1\n+#define DPNI_PASS_PR_SHIFT\t\t1\n+#define DPNI_PASS_PR_SIZE\t\t1\n+#define DPNI_PASS_FS_SHIFT\t\t2\n+#define DPNI_PASS_FS_SIZE\t\t1\n+\n+struct dpni_cmd_get_buffer_layout {\n+\tuint8_t qtype;\n+};\n+\n+struct dpni_rsp_get_buffer_layout {\n+\t/* response word 0 */\n+\tuint8_t pad0[6];\n+\t/* from LSB: pass_timestamp:1, parser_result:1, frame_status:1 */\n+\tuint8_t flags;\n+\tuint8_t pad1;\n+\t/* response word 1 */\n+\tuint16_t private_data_size;\n+\tuint16_t data_align;\n+\tuint16_t head_room;\n+\tuint16_t tail_room;\n+};\n+\n+struct dpni_cmd_set_buffer_layout {\n+\t/* cmd word 0 */\n+\tuint8_t qtype;\n+\tuint8_t pad0[3];\n+\tuint16_t options;\n+\t/* from LSB: pass_timestamp:1, parser_result:1, frame_status:1 */\n+\tuint8_t flags;\n+\tuint8_t pad1;\n+\t/* cmd word 1 */\n+\tuint16_t private_data_size;\n+\tuint16_t data_align;\n+\tuint16_t head_room;\n+\tuint16_t tail_room;\n+};\n+\n+struct dpni_cmd_set_offload {\n+\tuint8_t pad[3];\n+\tuint8_t dpni_offload;\n+\tuint32_t config;\n+};\n+\n+struct dpni_cmd_get_offload {\n+\tuint8_t pad[3];\n+\tuint8_t dpni_offload;\n+};\n+\n+struct dpni_rsp_get_offload {\n+\tuint32_t pad;\n+\tuint32_t config;\n+};\n+\n+struct dpni_cmd_get_qdid {\n+\tuint8_t qtype;\n+};\n+\n+struct dpni_rsp_get_qdid {\n+\tuint16_t qdid;\n+};\n+\n+struct dpni_rsp_get_sp_info {\n+\tuint16_t spids[2];\n+};\n+\n+struct dpni_rsp_get_tx_data_offset {\n+\tuint16_t data_offset;\n+};\n+\n+struct dpni_cmd_get_statistics {\n+\tuint8_t page_number;\n+\tuint8_t param;\n+};\n+\n+struct dpni_rsp_get_statistics {\n+\tuint64_t counter[7];\n+};\n+\n+struct dpni_cmd_set_link_cfg {\n+\tuint64_t pad0;\n+\tuint32_t rate;\n+\tuint32_t pad1;\n+\tuint64_t options;\n+};\n+\n+#define DPNI_LINK_STATE_SHIFT\t\t0\n+#define DPNI_LINK_STATE_SIZE\t\t1\n+\n+struct dpni_rsp_get_link_state {\n+\tuint32_t pad0;\n+\t/* from LSB: up:1 */\n+\tuint8_t flags;\n+\tuint8_t pad1[3];\n+\tuint32_t rate;\n+\tuint32_t pad2;\n+\tuint64_t options;\n+};\n+\n+struct dpni_cmd_set_max_frame_length {\n+\tuint16_t max_frame_length;\n+};\n+\n+struct dpni_rsp_get_max_frame_length {\n+\tuint16_t max_frame_length;\n+};\n+\n+struct dpni_cmd_set_multicast_promisc {\n+\tuint8_t enable;\n+};\n+\n+struct dpni_rsp_get_multicast_promisc {\n+\tuint8_t enabled;\n+};\n+\n+struct dpni_cmd_set_unicast_promisc {\n+\tuint8_t enable;\n+};\n+\n+struct dpni_rsp_get_unicast_promisc {\n+\tuint8_t enabled;\n+};\n+\n+struct dpni_cmd_set_primary_mac_addr {\n+\tuint16_t pad;\n+\tuint8_t mac_addr[6];\n+};\n+\n+struct dpni_rsp_get_primary_mac_addr {\n+\tuint16_t pad;\n+\tuint8_t mac_addr[6];\n+};\n+\n+struct dpni_rsp_get_port_mac_addr {\n+\tuint16_t pad;\n+\tuint8_t mac_addr[6];\n+};\n+\n+struct dpni_cmd_add_mac_addr {\n+\tuint16_t pad;\n+\tuint8_t mac_addr[6];\n+};\n+\n+struct dpni_cmd_remove_mac_addr {\n+\tuint16_t pad;\n+\tuint8_t mac_addr[6];\n+};\n+\n+#define DPNI_UNICAST_FILTERS_SHIFT\t0\n+#define DPNI_UNICAST_FILTERS_SIZE\t1\n+#define DPNI_MULTICAST_FILTERS_SHIFT\t1\n+#define DPNI_MULTICAST_FILTERS_SIZE\t1\n+\n+struct dpni_cmd_clear_mac_filters {\n+\t/* from LSB: unicast:1, multicast:1 */\n+\tuint8_t flags;\n+};\n+\n+struct dpni_cmd_enable_vlan_filter {\n+\t/* only the LSB */\n+\tuint8_t en;\n+};\n+\n+struct dpni_cmd_vlan_id {\n+\tuint32_t pad;\n+\tuint16_t vlan_id;\n+};\n+\n+#define DPNI_SEPARATE_GRP_SHIFT 0\n+#define DPNI_SEPARATE_GRP_SIZE  1\n+#define DPNI_MODE_1_SHIFT\t\t0\n+#define DPNI_MODE_1_SIZE\t\t4\n+#define DPNI_MODE_2_SHIFT\t\t4\n+#define DPNI_MODE_2_SIZE\t\t4\n+\n+struct dpni_cmd_set_tx_priorities {\n+\tuint16_t flags;\n+\tuint8_t prio_group_A;\n+\tuint8_t prio_group_B;\n+\tuint32_t pad0;\n+\tuint8_t modes[4];\n+\tuint32_t pad1;\n+\tuint64_t pad2;\n+\tuint16_t delta_bandwidth[8];\n+};\n+\n+#define DPNI_DIST_MODE_SHIFT\t\t0\n+#define DPNI_DIST_MODE_SIZE\t\t4\n+#define DPNI_MISS_ACTION_SHIFT\t\t4\n+#define DPNI_MISS_ACTION_SIZE\t\t4\n+#define DPNI_KEEP_HASH_KEY_SHIFT\t7\n+#define DPNI_KEEP_HASH_KEY_SIZE\t\t1\n+\n+struct dpni_cmd_set_rx_tc_dist {\n+\tuint16_t dist_size;\n+\tuint8_t tc_id;\n+\t/* from LSB: dist_mode:4, miss_action:4 */\n+\tuint8_t flags;\n+\tuint8_t pad0;\n+\t/* only the LSB */\n+\tuint8_t keep_hash_key;\n+\tuint16_t default_flow_id;\n+\tuint64_t pad1[5];\n+\tuint64_t key_cfg_iova;\n+};\n+\n+struct dpni_cmd_get_queue {\n+\tuint8_t qtype;\n+\tuint8_t tc;\n+\tuint8_t index;\n+};\n+\n+#define DPNI_DEST_TYPE_SHIFT\t\t0\n+#define DPNI_DEST_TYPE_SIZE\t\t4\n+#define DPNI_STASH_CTRL_SHIFT\t\t6\n+#define DPNI_STASH_CTRL_SIZE\t\t1\n+#define DPNI_HOLD_ACTIVE_SHIFT\t\t7\n+#define DPNI_HOLD_ACTIVE_SIZE\t\t1\n+\n+struct dpni_rsp_get_queue {\n+\t/* response word 0 */\n+\tuint64_t pad0;\n+\t/* response word 1 */\n+\tuint32_t dest_id;\n+\tuint16_t pad1;\n+\tuint8_t dest_prio;\n+\t/* From LSB: dest_type:4, pad:2, flc_stash_ctrl:1, hold_active:1 */\n+\tuint8_t flags;\n+\t/* response word 2 */\n+\tuint64_t flc;\n+\t/* response word 3 */\n+\tuint64_t user_context;\n+\t/* response word 4 */\n+\tuint32_t fqid;\n+\tuint16_t qdbin;\n+};\n+\n+struct dpni_cmd_set_queue {\n+\t/* cmd word 0 */\n+\tuint8_t qtype;\n+\tuint8_t tc;\n+\tuint8_t index;\n+\tuint8_t options;\n+\tuint32_t pad0;\n+\t/* cmd word 1 */\n+\tuint32_t dest_id;\n+\tuint16_t pad1;\n+\tuint8_t dest_prio;\n+\tuint8_t flags;\n+\t/* cmd word 2 */\n+\tuint64_t flc;\n+\t/* cmd word 3 */\n+\tuint64_t user_context;\n+};\n+\n+#define DPNI_DROP_ENABLE_SHIFT\t0\n+#define DPNI_DROP_ENABLE_SIZE\t1\n+#define DPNI_DROP_UNITS_SHIFT\t2\n+#define DPNI_DROP_UNITS_SIZE\t2\n+\n+struct dpni_early_drop {\n+\t/* from LSB: enable:1 units:2 */\n+\tuint8_t flags;\n+\tuint8_t pad0[3];\n+\tuint32_t pad1;\n+\tuint8_t green_drop_probability;\n+\tuint8_t pad2[7];\n+\tuint64_t green_max_threshold;\n+\tuint64_t green_min_threshold;\n+\tuint64_t pad3;\n+\tuint8_t yellow_drop_probability;\n+\tuint8_t pad4[7];\n+\tuint64_t yellow_max_threshold;\n+\tuint64_t yellow_min_threshold;\n+\tuint64_t pad5;\n+\tuint8_t red_drop_probability;\n+\tuint8_t pad6[7];\n+\tuint64_t red_max_threshold;\n+\tuint64_t red_min_threshold;\n+};\n+\n+struct dpni_cmd_early_drop {\n+\tuint8_t qtype;\n+\tuint8_t tc;\n+\tuint8_t pad[6];\n+\tuint64_t early_drop_iova;\n+};\n+\n+struct dpni_rsp_get_api_version {\n+\tuint16_t major;\n+\tuint16_t minor;\n+};\n+\n+struct dpni_cmd_get_taildrop {\n+\tuint8_t congestion_point;\n+\tuint8_t qtype;\n+\tuint8_t tc;\n+\tuint8_t index;\n+};\n+\n+struct dpni_rsp_get_taildrop {\n+\t/* cmd word 0 */\n+\tuint64_t pad0;\n+\t/* cmd word 1 */\n+\t/* from LSB: enable:1 oal_lo:7 */\n+\tuint8_t enable_oal_lo;\n+\t/* from LSB: oal_hi:5 */\n+\tuint8_t oal_hi;\n+\tuint8_t units;\n+\tuint8_t pad2;\n+\tuint32_t threshold;\n+};\n+\n+#define DPNI_OAL_LO_SHIFT\t1\n+#define DPNI_OAL_LO_SIZE\t7\n+#define DPNI_OAL_HI_SHIFT\t0\n+#define DPNI_OAL_HI_SIZE\t5\n+\n+struct dpni_cmd_set_taildrop {\n+\t/* cmd word 0 */\n+\tuint8_t congestion_point;\n+\tuint8_t qtype;\n+\tuint8_t tc;\n+\tuint8_t index;\n+\tuint32_t pad0;\n+\t/* cmd word 1 */\n+\t/* from LSB: enable:1 oal_lo:7 */\n+\tuint8_t enable_oal_lo;\n+\t/* from LSB: oal_hi:5 */\n+\tuint8_t oal_hi;\n+\tuint8_t units;\n+\tuint8_t pad2;\n+\tuint32_t threshold;\n+};\n+\n+struct dpni_tx_confirmation_mode {\n+\tuint32_t pad;\n+\tuint8_t confirmation_mode;\n+};\n+\n+#define DPNI_DEST_TYPE_SHIFT\t\t0\n+#define DPNI_DEST_TYPE_SIZE\t\t4\n+#define DPNI_CONG_UNITS_SHIFT\t\t4\n+#define DPNI_CONG_UNITS_SIZE\t\t2\n+\n+struct dpni_cmd_set_congestion_notification {\n+\tuint8_t qtype;\n+\tuint8_t tc;\n+\tuint8_t pad[6];\n+\tuint32_t dest_id;\n+\tuint16_t notification_mode;\n+\tuint8_t dest_priority;\n+\t/* from LSB: dest_type: 4 units:2 */\n+\tuint8_t type_units;\n+\tuint64_t message_iova;\n+\tuint64_t message_ctx;\n+\tuint32_t threshold_entry;\n+\tuint32_t threshold_exit;\n+};\n+\n+struct dpni_cmd_get_congestion_notification {\n+\tuint8_t qtype;\n+\tuint8_t tc;\n+};\n+\n+struct dpni_rsp_get_congestion_notification {\n+\tuint64_t pad;\n+\tuint32_t dest_id;\n+\tuint16_t notification_mode;\n+\tuint8_t dest_priority;\n+\t/* from LSB: dest_type: 4 units:2 */\n+\tuint8_t type_units;\n+\tuint64_t message_iova;\n+\tuint64_t message_ctx;\n+\tuint32_t threshold_entry;\n+\tuint32_t threshold_exit;\n+};\n+\n+#pragma pack(pop)\n #endif /* _FSL_DPNI_CMD_H */\ndiff --git a/drivers/net/dpaa2/mc/fsl_net.h b/drivers/net/dpaa2/mc/fsl_net.h\nindex ef7e4da..dbec306 100644\n--- a/drivers/net/dpaa2/mc/fsl_net.h\n+++ b/drivers/net/dpaa2/mc/fsl_net.h\n@@ -213,7 +213,7 @@\n #define NH_FLD_SCTP_CHUNK_DATA_STREAM_SQN     (NH_FLD_SCTP_CHUNK_DATA_TYPE << 5)\n #define NH_FLD_SCTP_CHUNK_DATA_PAYLOAD_PID    (NH_FLD_SCTP_CHUNK_DATA_TYPE << 6)\n #define NH_FLD_SCTP_CHUNK_DATA_UNORDERED      (NH_FLD_SCTP_CHUNK_DATA_TYPE << 7)\n-#define NH_FLD_SCTP_CHUNK_DATA_BEGINNING      (NH_FLD_SCTP_CHUNK_DATA_TYPE << 8)\n+#define NH_FLD_SCTP_CHUNK_DATA_BEGGINNING     (NH_FLD_SCTP_CHUNK_DATA_TYPE << 8)\n #define NH_FLD_SCTP_CHUNK_DATA_END            (NH_FLD_SCTP_CHUNK_DATA_TYPE << 9)\n #define NH_FLD_SCTP_CHUNK_DATA_ALL_FIELDS \\\n \t((NH_FLD_SCTP_CHUNK_DATA_TYPE << 10) - 1)\n",
    "prefixes": [
        "dpdk-dev",
        "10/27"
    ]
}