From patchwork Fri Oct 12 10:04:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 148736 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp538422lji; Fri, 12 Oct 2018 03:06:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV6121umA0o1TR+H4ENVw9L1Sp3LyboExChdFYK4pJer/rQLxF6nemV5QBwsyW/T/CwCVJyuR X-Received: by 2002:a5d:5501:: with SMTP id b1-v6mr4468339wrv.228.1539338783677; Fri, 12 Oct 2018 03:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539338783; cv=none; d=google.com; s=arc-20160816; b=XzKdjVNGBuEoxGUs7+hEbJ1g3v0BK8p1t1V6Z66l8NKQNdg1gIuN4XZN1N/9O4x85X IjojIsvJ19wEksYAz9AcuC61E8b1wrvLfAlsKriF1jUsHnZ7uQerOkSFjoI9j/NoruNB dXTjEf2fJojPoxjMO1sqMLMUCRnfTMK0wAEbrj9Yu/SAlSL4C9TBU98rlIqaYPk8NNmw o6ADZx/AJn5FzjHZ3yT2xuToEJsOdbHgNvei0OsOkLX8wvKj0gCv5BWzn/I+hNG6FHWK AXHpSV73ySmpkLAekjDfWiile/ajBFFcDFrUjwCsBGLu686a/ZWlGE7/x5omiAGM2o3w V8vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=xvOIhLMwzMVBijrF9LB9GW/POPKZYN7Om2mEvIySQFc=; b=c6gde1l+1lmB98Ze9lZJGnuSC3c5ovJ5jef0Y5J7vIwsHlBGcho4SnbcnwvHGstkcd DuhP8rUuPOOFtMyNu8+ZrnFLENCqK2v76LDxFdh5HMLLN6YhNRUXYaFnWsbB9OVn6cLQ ohgysqOd7msAPfwJMsGhFFseaMAc8MVDpo74sRAnhbWsMY8aUDZ65VNyrWbMzyZgMOTx XN6a+1QSr8jfumOOBLjKnvznVY0Idv/gNcjNg+IStK0YIW0NteoQ/xavQq2XdAdriQ5b DmAwAsqw7pDyR5rh/Kt3vN7X2L2JfSFTbCmTJrnHBQ7wp/iYmaMXkORKotkMS+ll3vFe qFxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=xSuER5zO; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id v188-v6si854380wmg.63.2018.10.12.03.06.23; Fri, 12 Oct 2018 03:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=xSuER5zO; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CC5A31B499; Fri, 12 Oct 2018 12:05:53 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00058.outbound.protection.outlook.com [40.107.0.58]) by dpdk.org (Postfix) with ESMTP id F08B91B481 for ; Fri, 12 Oct 2018 12:05:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xvOIhLMwzMVBijrF9LB9GW/POPKZYN7Om2mEvIySQFc=; b=xSuER5zONFQxmQMLBMwHFiVSPEzRXYQHlyUs6jRxleYPmScFs+BbvxUVwNqWjPBqAxF0uD7GTF1Jy2qfHyFb1sEuLDIK3Ho0mVie2PIHxzqymdWskiBU7L4aLFr9C4sTKTq1QuC2BOkr3xDtoiwizVVcVWMCv80KPRDIepXFPeg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 10:05:45 +0000 From: Shreyansh Jain To: thomas@monjalon.net Cc: ferruh.yigit@intel.com, dev@dpdk.org, Hemant Agrawal Date: Fri, 12 Oct 2018 15:34:15 +0530 Message-Id: <20181012100426.29349-5-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012100426.29349-1-shreyansh.jain@nxp.com> References: <20180926180440.31726-1-shreyansh.jain@nxp.com> <20181012100426.29349-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BMXPR01CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::14) To AM0PR04MB4676.eurprd04.prod.outlook.com (2603:10a6:208:75::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2888f251-3412-457f-b619-08d6302a4774 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4676; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4676;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wpIENMCFgK/k6UB7GDFkjcfIt5zD7wZaEigg+wSAyIZ27Mh4tn/Pg4WBvh8y+lj+sh0ExF4/Yr2LoVXjq3aSf5E1alBqO7FvG9FO1nMjIblxwixo9VYSkekfVueZ4Z8ve1E56z/qI6m2ejW6My97nAdBl3dw8PWWPQI6dpSvLQzEKralsqaGvaVkRyp9PrmFrdloADEggBb99qFgFAgmq3hTFQQRQ5a8cucx2P1acIxzIz6ZnmOoWhRLU19vu2b0439N/v9USwHs6OB+ybJuQzqjzVYVevaa5zQmANXppOvAMR5H0kAhPsh31Y/UYidXk50S6ncSHtnUXm/s9989uTP9zpCxRjYSqK; 4:JB6UPdxO/AHTESrsDZ/tsyIhaCUdeJDbA9l0q0GvKxjncYHTjtgAcp+TND7ao9i0196PKxmpay/YCbmIXlkKoiFwVLqS51qFC8vGH/Y31Yo96NYvr4zk0+Vhdp16vc2tms5vVK6+DxYIgH2z49Xsnqpenx9DpIogUQ1dNkda21PAmMPbWzvi4XT7x6nrACVzcp7WBd5XK1Hmjttn1YxmH0XO6Je8bDadNmCSrf1jtFLSU9G3CpEtADNXOOqm8ipiPbaejj1FU8tIduOZccJX4F6J0tZb/YRJ/PzKTPOet7WChG/NHTFAbNGh8LQ82x0UysYaRYOzgIVh/IhgWO8LTdSseEN16KdUhl6AIorkmu0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR04MB4676; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4676; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(136003)(39860400002)(199004)(189003)(2906002)(52116002)(16526019)(14444005)(53936002)(8676002)(478600001)(186003)(386003)(446003)(105586002)(7736002)(106356001)(6512007)(6116002)(86362001)(3846002)(575784001)(81156014)(50226002)(68736007)(1076002)(47776003)(5660300001)(6506007)(8936002)(78486009)(36756003)(316002)(26005)(66066001)(53946003)(6666004)(25786009)(55236004)(81166006)(11346002)(48376002)(76176011)(44832011)(2361001)(956004)(51416003)(2616005)(97736004)(1006002)(50466002)(4744004)(486006)(476003)(305945005)(16586007)(6916009)(4326008)(6486002)(2351001)(110426005)(579004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4676; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4676; 23:SHDwa4Cue7cGFvGjwbRhE+AxjXUJf4a50bLIQCFjH?= 3T/UUKa/zgS2UECedfHaaP++KNK1Y5xKx/WpK5c1rSnodt8pDiUGfR0LA4p7jonvxbMAdvjMKS2HnhnYgWB6oFSczZsYJKN1WqutfZxzNJKqEqEG0RhzlmkyYOaam1jCl06WF6v0wEhBRbw2btpsoupGJtryFsLZ+S506kOtC0PA0nMN3sD9jvy4mtP8H3YgPuxeilj1NTRoSsFPaJ0IG5qXiIV2OKGKHsEtuSx6KpkscMlDbwk70XGEuF4v5X3fnoE5qFNThxWym4u1vaSpG+qVO1Zehb6zEuErwEgB9/aVXCc9Uw2/6d0DsLGS8bp2bEGVwSJCkyXnTf9jk/dzp//iLbpgaxKxPg7NnaksNNenyO+BjBw3heQmtC92HdFEwT0z556scNkbavcpBQ61oFttZpGrNjZBOl4Eaq2aX1tyRAoP/ekNff08wl2Yv/voM98D4bmdhkd86WDTGYKgv5Vh2bvVTf2bzJLdv0jP/y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bBfF21fL2gFc+JZ+Aq9BxVZDaB/S8oPq2dOUW539tRkT1fwMfL/JD5b/a+Xv/yZfMEIVmteERiRkQw3+/ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 10:05:45.5117 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2888f251-3412-457f-b619-08d6302a4774 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4676 Subject: [dpdk-dev] [PATCH v3 04/15] net/dpaa2: upgrade dpni to mc FW APIs to 10.10.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal New feature includes ordering support and link related enhancements Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/mc/dpni.c | 134 +++++++++- drivers/net/dpaa2/mc/fsl_dpkg.h | 71 ++---- drivers/net/dpaa2/mc/fsl_dpni.h | 378 ++++++++++++++++------------ drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 87 ++++++- drivers/net/dpaa2/mc/fsl_net.h | 2 +- 5 files changed, 460 insertions(+), 212 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/mc/dpni.c b/drivers/net/dpaa2/mc/dpni.c index 9f228169a..44b5604d3 100644 --- a/drivers/net/dpaa2/mc/dpni.c +++ b/drivers/net/dpaa2/mc/dpni.c @@ -121,6 +121,7 @@ int dpni_create(struct fsl_mc_io *mc_io, cmd_params->num_queues = cfg->num_queues; cmd_params->num_tcs = cfg->num_tcs; cmd_params->mac_filter_entries = cfg->mac_filter_entries; + cmd_params->num_rx_tcs = cfg->num_rx_tcs; cmd_params->vlan_filter_entries = cfg->vlan_filter_entries; cmd_params->qos_entries = cfg->qos_entries; cmd_params->fs_entries = cpu_to_le16(cfg->fs_entries); @@ -664,9 +665,14 @@ int dpni_get_buffer_layout(struct fsl_mc_io *mc_io, /* retrieve response parameters */ rsp_params = (struct dpni_rsp_get_buffer_layout *)cmd.params; - layout->pass_timestamp = dpni_get_field(rsp_params->flags, PASS_TS); - layout->pass_parser_result = dpni_get_field(rsp_params->flags, PASS_PR); - layout->pass_frame_status = dpni_get_field(rsp_params->flags, PASS_FS); + layout->pass_timestamp = + (int)dpni_get_field(rsp_params->flags, PASS_TS); + layout->pass_parser_result = + (int)dpni_get_field(rsp_params->flags, PASS_PR); + layout->pass_frame_status = + (int)dpni_get_field(rsp_params->flags, PASS_FS); + layout->pass_sw_opaque = + (int)dpni_get_field(rsp_params->flags, PASS_SWO); layout->private_data_size = le16_to_cpu(rsp_params->private_data_size); layout->data_align = le16_to_cpu(rsp_params->data_align); layout->data_head_room = le16_to_cpu(rsp_params->head_room); @@ -702,10 +708,11 @@ int dpni_set_buffer_layout(struct fsl_mc_io *mc_io, token); cmd_params = (struct dpni_cmd_set_buffer_layout *)cmd.params; cmd_params->qtype = qtype; - cmd_params->options = cpu_to_le16(layout->options); + cmd_params->options = cpu_to_le16((uint16_t)layout->options); dpni_set_field(cmd_params->flags, PASS_TS, layout->pass_timestamp); dpni_set_field(cmd_params->flags, PASS_PR, layout->pass_parser_result); dpni_set_field(cmd_params->flags, PASS_FS, layout->pass_frame_status); + dpni_set_field(cmd_params->flags, PASS_SWO, layout->pass_sw_opaque); cmd_params->private_data_size = cpu_to_le16(layout->private_data_size); cmd_params->data_align = cpu_to_le16(layout->data_align); cmd_params->head_room = cpu_to_le16(layout->data_head_room); @@ -893,6 +900,7 @@ int dpni_set_link_cfg(struct fsl_mc_io *mc_io, cmd_params = (struct dpni_cmd_set_link_cfg *)cmd.params; cmd_params->rate = cpu_to_le32(cfg->rate); cmd_params->options = cpu_to_le64(cfg->options); + cmd_params->advertising = cpu_to_le64(cfg->advertising); /* send command to mc*/ return mc_send_command(mc_io, &cmd); @@ -929,8 +937,11 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io, /* retrieve response parameters */ rsp_params = (struct dpni_rsp_get_link_state *)cmd.params; state->up = dpni_get_field(rsp_params->flags, LINK_STATE); + state->state_valid = dpni_get_field(rsp_params->flags, STATE_VALID); state->rate = le32_to_cpu(rsp_params->rate); state->options = le64_to_cpu(rsp_params->options); + state->supported = le64_to_cpu(rsp_params->supported); + state->advertising = le64_to_cpu(rsp_params->advertising); return 0; } @@ -1471,6 +1482,9 @@ int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io, dpni_set_field(cmd_params->keep_hash_key, KEEP_HASH_KEY, cfg->fs_cfg.keep_hash_key); + dpni_set_field(cmd_params->keep_hash_key, + KEEP_ENTRIES, + cfg->fs_cfg.keep_entries); /* send command to mc*/ return mc_send_command(mc_io, &cmd); @@ -1764,8 +1778,8 @@ int dpni_get_queue(struct fsl_mc_io *mc_io, * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPNI object * @page: Selects the statistics page to retrieve, see - * DPNI_GET_STATISTICS output. Pages are numbered 0 to 2. - * @param: Custom parameter for some pages used to select + * DPNI_GET_STATISTICS output. Pages are numbered 0 to 3. + * @param: Custom parameter for some pages used to select * a certain statistic source, for example the TC. * @stat: Structure containing the statistics * @@ -1941,3 +1955,111 @@ int dpni_get_taildrop(struct fsl_mc_io *mc_io, return 0; } + +/** + * dpni_set_opr() - Set Order Restoration configuration. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @tc: Traffic class, in range 0 to NUM_TCS - 1 + * @index: Selects the specific queue out of the set allocated + * for the same TC. Value must be in range 0 to + * NUM_QUEUES - 1 + * @options: Configuration mode options + * can be OPR_OPT_CREATE or OPR_OPT_RETIRE + * @cfg: Configuration options for the OPR + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_set_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t tc, + uint8_t index, + uint8_t options, + struct opr_cfg *cfg) +{ + struct dpni_cmd_set_opr *cmd_params; + struct mc_command cmd = { 0 }; + + /* prepare command */ + cmd.header = mc_encode_cmd_header( + DPNI_CMDID_SET_OPR, + cmd_flags, + token); + cmd_params = (struct dpni_cmd_set_opr *)cmd.params; + cmd_params->tc_id = tc; + cmd_params->index = index; + cmd_params->options = options; + cmd_params->oloe = cfg->oloe; + cmd_params->oeane = cfg->oeane; + cmd_params->olws = cfg->olws; + cmd_params->oa = cfg->oa; + cmd_params->oprrws = cfg->oprrws; + + /* send command to mc*/ + return mc_send_command(mc_io, &cmd); +} + +/** + * dpni_get_opr() - Retrieve Order Restoration config and query. + * @mc_io: Pointer to MC portal's I/O object + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' + * @token: Token of DPNI object + * @tc: Traffic class, in range 0 to NUM_TCS - 1 + * @index: Selects the specific queue out of the set allocated + * for the same TC. Value must be in range 0 to + * NUM_QUEUES - 1 + * @cfg: Returned OPR configuration + * @qry: Returned OPR query + * + * Return: '0' on Success; Error code otherwise. + */ +int dpni_get_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t tc, + uint8_t index, + struct opr_cfg *cfg, + struct opr_qry *qry) +{ + struct dpni_rsp_get_opr *rsp_params; + struct dpni_cmd_get_opr *cmd_params; + struct mc_command cmd = { 0 }; + int err; + + /* prepare command */ + cmd.header = mc_encode_cmd_header(DPNI_CMDID_GET_OPR, + cmd_flags, + token); + cmd_params = (struct dpni_cmd_get_opr *)cmd.params; + cmd_params->index = index; + cmd_params->tc_id = tc; + + /* send command to mc*/ + err = mc_send_command(mc_io, &cmd); + if (err) + return err; + + /* retrieve response parameters */ + rsp_params = (struct dpni_rsp_get_opr *)cmd.params; + cfg->oloe = rsp_params->oloe; + cfg->oeane = rsp_params->oeane; + cfg->olws = rsp_params->olws; + cfg->oa = rsp_params->oa; + cfg->oprrws = rsp_params->oprrws; + qry->rip = dpni_get_field(rsp_params->flags, RIP); + qry->enable = dpni_get_field(rsp_params->flags, OPR_ENABLE); + qry->nesn = le16_to_cpu(rsp_params->nesn); + qry->ndsn = le16_to_cpu(rsp_params->ndsn); + qry->ea_tseq = le16_to_cpu(rsp_params->ea_tseq); + qry->tseq_nlis = dpni_get_field(rsp_params->tseq_nlis, TSEQ_NLIS); + qry->ea_hseq = le16_to_cpu(rsp_params->ea_hseq); + qry->hseq_nlis = dpni_get_field(rsp_params->hseq_nlis, HSEQ_NLIS); + qry->ea_hptr = le16_to_cpu(rsp_params->ea_hptr); + qry->ea_tptr = le16_to_cpu(rsp_params->ea_tptr); + qry->opr_vid = le16_to_cpu(rsp_params->opr_vid); + qry->opr_id = le16_to_cpu(rsp_params->opr_id); + + return 0; +} diff --git a/drivers/net/dpaa2/mc/fsl_dpkg.h b/drivers/net/dpaa2/mc/fsl_dpkg.h index 4de70f307..02fe8d50e 100644 --- a/drivers/net/dpaa2/mc/fsl_dpkg.h +++ b/drivers/net/dpaa2/mc/fsl_dpkg.h @@ -71,45 +71,41 @@ struct dpkg_mask { /** * struct dpkg_extract - A structure for defining a single extraction * @type: Determines how the union below is interpreted: - * DPKG_EXTRACT_FROM_HDR: selects 'from_hdr'; - * DPKG_EXTRACT_FROM_DATA: selects 'from_data'; - * DPKG_EXTRACT_FROM_PARSE: selects 'from_parse' + * DPKG_EXTRACT_FROM_HDR: selects 'from_hdr'; + * DPKG_EXTRACT_FROM_DATA: selects 'from_data'; + * DPKG_EXTRACT_FROM_PARSE: selects 'from_parse' * @extract: Selects extraction method + * @extract.from_hdr: Used when 'type = DPKG_EXTRACT_FROM_HDR' + * @extract.from_data: Used when 'type = DPKG_EXTRACT_FROM_DATA' + * @extract.from_parse: Used when 'type = DPKG_EXTRACT_FROM_PARSE' + * @extract.from_hdr.prot: Any of the supported headers + * @extract.from_hdr.type: Defines the type of header extraction: + * DPKG_FROM_HDR: use size & offset below; + * DPKG_FROM_FIELD: use field, size and offset below; + * DPKG_FULL_FIELD: use field below + * @extract.from_hdr.field: One of the supported fields (NH_FLD_) + * @extract.from_hdr.size: Size in bytes + * @extract.from_hdr.offset: Byte offset + * @extract.from_hdr.hdr_index: Clear for cases not listed below; + * Used for protocols that may have more than a single + * header, 0 indicates an outer header; + * Supported protocols (possible values): + * NET_PROT_VLAN (0, HDR_INDEX_LAST); + * NET_PROT_MPLS (0, 1, HDR_INDEX_LAST); + * NET_PROT_IP(0, HDR_INDEX_LAST); + * NET_PROT_IPv4(0, HDR_INDEX_LAST); + * NET_PROT_IPv6(0, HDR_INDEX_LAST); + * @extract.from_data.size: Size in bytes + * @extract.from_data.offset: Byte offset + * @extract.from_parse.size: Size in bytes + * @extract.from_parse.offset: Byte offset * @num_of_byte_masks: Defines the number of valid entries in the array below; * This is also the number of bytes to be used as masks * @masks: Masks parameters */ struct dpkg_extract { enum dpkg_extract_type type; - /** - * union extract - Selects extraction method - * @from_hdr - Used when 'type = DPKG_EXTRACT_FROM_HDR' - * @from_data - Used when 'type = DPKG_EXTRACT_FROM_DATA' - * @from_parse - Used when 'type = DPKG_EXTRACT_FROM_PARSE' - */ union { - /** - * struct from_hdr - Used when 'type = DPKG_EXTRACT_FROM_HDR' - * @prot: Any of the supported headers - * @type: Defines the type of header extraction: - * DPKG_FROM_HDR: use size & offset below; - * DPKG_FROM_FIELD: use field, size and offset below; - * DPKG_FULL_FIELD: use field below - * @field: One of the supported fields (NH_FLD_) - * - * @size: Size in bytes - * @offset: Byte offset - * @hdr_index: Clear for cases not listed below; - * Used for protocols that may have more than a single - * header, 0 indicates an outer header; - * Supported protocols (possible values): - * NET_PROT_VLAN (0, HDR_INDEX_LAST); - * NET_PROT_MPLS (0, 1, HDR_INDEX_LAST); - * NET_PROT_IP(0, HDR_INDEX_LAST); - * NET_PROT_IPv4(0, HDR_INDEX_LAST); - * NET_PROT_IPv6(0, HDR_INDEX_LAST); - */ - struct { enum net_prot prot; enum dpkg_extract_from_hdr_type type; @@ -118,23 +114,10 @@ struct dpkg_extract { uint8_t offset; uint8_t hdr_index; } from_hdr; - /** - * struct from_data - * Used when 'type = DPKG_EXTRACT_FROM_DATA' - * @size: Size in bytes - * @offset: Byte offset - */ struct { uint8_t size; uint8_t offset; } from_data; - - /** - * struct from_parse - * Used when 'type = DPKG_EXTRACT_FROM_PARSE' - * @size: Size in bytes - * @offset: Byte offset - */ struct { uint8_t size; uint8_t offset; diff --git a/drivers/net/dpaa2/mc/fsl_dpni.h b/drivers/net/dpaa2/mc/fsl_dpni.h index f0edcd270..de1bcb5bf 100644 --- a/drivers/net/dpaa2/mc/fsl_dpni.h +++ b/drivers/net/dpaa2/mc/fsl_dpni.h @@ -8,6 +8,7 @@ #define __FSL_DPNI_H #include +#include struct fsl_mc_io; @@ -77,6 +78,20 @@ struct fsl_mc_io; */ #define DPNI_OPT_NO_FS 0x000020 +/** + * Enable the Order Restoration support + */ +#define DPNI_OPT_HAS_OPR 0x000040 + +/** + * Order Point Records are shared for the entire TC + */ +#define DPNI_OPT_OPR_PER_TC 0x000080 +/** + * All Tx traffic classes will use a single sender (ignore num_queueus for tx) + */ +#define DPNI_OPT_SINGLE_SENDER 0x000100 + int dpni_open(struct fsl_mc_io *mc_io, uint32_t cmd_flags, int dpni_id, @@ -88,71 +103,74 @@ int dpni_close(struct fsl_mc_io *mc_io, /** * struct dpni_cfg - Structure representing DPNI configuration - * @mac_addr: Primary MAC address - * @adv: Advanced parameters; default is all zeros; - * use this structure to change default settings + * @options: Any combination of the following options: + * DPNI_OPT_TX_FRM_RELEASE + * DPNI_OPT_NO_MAC_FILTER + * DPNI_OPT_HAS_POLICING + * DPNI_OPT_SHARED_CONGESTION + * DPNI_OPT_HAS_KEY_MASKING + * DPNI_OPT_NO_FS + * DPNI_OPT_SINGLE_SENDER + * @fs_entries: Number of entries in the flow steering table. + * This table is used to select the ingress queue for + * ingress traffic, targeting a GPP core or another. + * In addition it can be used to discard traffic that + * matches the set rule. It is either an exact match table + * or a TCAM table, depending on DPNI_OPT_ HAS_KEY_MASKING + * bit in OPTIONS field. This field is ignored if + * DPNI_OPT_NO_FS bit is set in OPTIONS field. Otherwise, + * value 0 defaults to 64. Maximum supported value is 1024. + * Note that the total number of entries is limited on the + * SoC to as low as 512 entries if TCAM is used. + * @vlan_filter_entries: Number of entries in the VLAN address filtering + * table. This is an exact match table used to filter + * ingress traffic based on VLAN IDs. Value 0 disables VLAN + * filtering. Maximum supported value is 16. + * @mac_filter_entries: Number of entries in the MAC address filtering + * table. This is an exact match table and allows both + * unicast and multicast entries. The primary MAC address + * of the network interface is not part of this table, + * this contains only entries in addition to it. This + * field is ignored if DPNI_OPT_ NO_MAC_FILTER is set in + * OPTIONS field. Otherwise, value 0 defaults to 80. + * Maximum supported value is 80. + * @num_queues: Number of Tx and Rx queues used for traffic + * distribution. This is orthogonal to QoS and is only + * used to distribute traffic to multiple GPP cores. + * This configuration affects the number of Tx queues + * (logical FQs, all associated with a single CEETM queue), + * Rx queues and Tx confirmation queues, if applicable. + * Value 0 defaults to one queue. Maximum supported value + * is 8. + * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI. + * TCs can have different priority levels for the purpose + * of Tx scheduling (see DPNI_SET_TX_PRIORITIES), different + * BPs (DPNI_ SET_POOLS), policers. There are dedicated QM + * queues for traffic classes (including class queues on + * Tx). Value 0 defaults to one TC. Maximum supported value + * is 16. There are maximum 16 TCs for Tx and 8 TCs for Rx. + * When num_tcs>8 Tx will use this value but Rx will have + * only 8 traffic classes. + * @num_rx_tcs: if set to other value than zero represents number + * of TCs used for Rx. Maximum value is 8. If set to zero the + * number of Rx TCs will be initialized with the value provided + * in num_tcs parameter. + * @qos_entries: Number of entries in the QoS classification table. This + * table is used to select the TC for ingress traffic. It + * is either an exact match or a TCAM table, depending on + * DPNI_OPT_ HAS_KEY_MASKING bit in OPTIONS field. This + * field is ignored if the DPNI has a single TC. Otherwise, + * a value of 0 defaults to 64. Maximum supported value + * is 64. */ struct dpni_cfg { - /** - * @options: Any combination of the following options: - * DPNI_OPT_TX_FRM_RELEASE - * DPNI_OPT_NO_MAC_FILTER - * DPNI_OPT_HAS_POLICING - * DPNI_OPT_SHARED_CONGESTION - * DPNI_OPT_HAS_KEY_MASKING - * DPNI_OPT_NO_FS - * @fs_entries: Number of entries in the flow steering table. - * This table is used to select the ingress queue for - * ingress traffic, targeting a GPP core or another. - * In addition it can be used to discard traffic that - * matches the set rule. It is either an exact match table - * or a TCAM table, depending on DPNI_OPT_ HAS_KEY_MASKING - * bit in OPTIONS field. This field is ignored if - * DPNI_OPT_NO_FS bit is set in OPTIONS field. Otherwise, - * value 0 defaults to 64. Maximum supported value is 1024. - * Note that the total number of entries is limited on the - * SoC to as low as 512 entries if TCAM is used. - * @vlan_filter_entries: Number of entries in the VLAN address filtering - * table. This is an exact match table used to filter - * ingress traffic based on VLAN IDs. Value 0 disables VLAN - * filtering. Maximum supported value is 16. - * @mac_filter_entries: Number of entries in the MAC address filtering - * table. This is an exact match table and allows both - * unicast and multicast entries. The primary MAC address - * of the network interface is not part of this table, - * this contains only entries in addition to it. This - * field is ignored if DPNI_OPT_ NO_MAC_FILTER is set in - * OPTIONS field. Otherwise, value 0 defaults to 80. - * Maximum supported value is 80. - * @num_queues: Number of Tx and Rx queues used for traffic - * distribution. This is orthogonal to QoS and is only - * used to distribute traffic to multiple GPP cores. - * This configuration affects the number of Tx queues - * (logical FQs, all associated with a single CEETM queue), - * Rx queues and Tx confirmation queues, if applicable. - * Value 0 defaults to one queue. Maximum supported value - * is 8. - * @num_tcs: Number of traffic classes (TCs), reserved for the DPNI. - * TCs can have different priority levels for the purpose - * of Tx scheduling (see DPNI_SET_TX_SELECTION), different - * BPs (DPNI_ SET_POOLS), policers. There are dedicated QM - * queues for traffic classes (including class queues on - * Tx). Value 0 defaults to one TC. Maximum supported value - * is 8. - * @qos_entries: Number of entries in the QoS classification table. This - * table is used to select the TC for ingress traffic. It - * is either an exact match or a TCAM table, depending on - * DPNI_OPT_ HAS_KEY_MASKING bit in OPTIONS field. This - * field is ignored if the DPNI has a single TC. Otherwise, - * a value of 0 defaults to 64. Maximum supported value - * is 64. - */ uint32_t options; uint16_t fs_entries; uint8_t vlan_filter_entries; uint8_t mac_filter_entries; uint8_t num_queues; uint8_t num_tcs; + uint8_t num_rx_tcs; uint8_t qos_entries; }; @@ -172,17 +190,14 @@ int dpni_destroy(struct fsl_mc_io *mc_io, * @num_dpbp: Number of DPBPs * @pools: Array of buffer pools parameters; The number of valid entries * must match 'num_dpbp' value + * @pools.dpbp_id: DPBP object ID + * @pools.priority: Priority mask that indicates TC's used with this buffer. + * I set to 0x00 MC will assume value 0xff. + * @pools.buffer_size: Buffer size + * @pools.backup_pool: Backup pool */ struct dpni_pools_cfg { uint8_t num_dpbp; - /** - * struct pools - Buffer pools parameters - * @dpbp_id: DPBP object ID - * @priority: priority mask that indicates TC's used with this buffer. - * I set to 0x00 MC will assume value 0xff. - * @buffer_size: Buffer size - * @backup_pool: Backup pool - */ struct { int dpbp_id; uint8_t priority_mask; @@ -296,6 +311,8 @@ int dpni_clear_irq_status(struct fsl_mc_io *mc_io, * variants, * - 0x422 - WRIOP version 1.1.2, used on LS1088 and * variants. + * - 0xC00 - WRIOP version 3.0.0, used on LX2160 and + * variants. */ struct dpni_attr { uint32_t options; @@ -320,6 +337,13 @@ int dpni_get_attributes(struct fsl_mc_io *mc_io, * DPNI errors */ +/** + * Discard error. When set all discarded frames in wriop will be enqueued to + * error queue. To be used in dpni_set_errors_behavior() only if error_action + * parameter is set to DPNI_ERROR_ACTION_SEND_TO_ERROR_QUEUE. + */ +#define DPNI_ERROR_DISC 0x80000000 + /** * Extract out of frame header error */ @@ -408,6 +432,10 @@ int dpni_set_errors_behavior(struct fsl_mc_io *mc_io, * Select to modify the data-tail-room setting */ #define DPNI_BUF_LAYOUT_OPT_DATA_TAIL_ROOM 0x00000040 +/** + * Select to modify the sw-opaque value setting + */ +#define DPNI_BUF_LAYOUT_OPT_SW_OPAQUE 0x00000080 /** * struct dpni_buffer_layout - Structure representing DPNI buffer layout @@ -427,6 +455,7 @@ struct dpni_buffer_layout { int pass_timestamp; int pass_parser_result; int pass_frame_status; + int pass_sw_opaque; uint16_t private_data_size; uint16_t data_align; uint16_t data_head_room; @@ -501,16 +530,48 @@ int dpni_get_tx_data_offset(struct fsl_mc_io *mc_io, #define DPNI_STATISTICS_CNT 7 +/** + * union dpni_statistics - Union describing the DPNI statistics + * @page_0: Page_0 statistics structure + * @page_0.ingress_all_frames: Ingress frame count + * @page_0.ingress_all_bytes: Ingress byte count + * @page_0.ingress_multicast_frames: Ingress multicast frame count + * @page_0.ingress_multicast_bytes: Ingress multicast byte count + * @page_0.ingress_broadcast_frames: Ingress broadcast frame count + * @page_0.ingress_broadcast_bytes: Ingress broadcast byte count + * @page_1: Page_1 statistics structure + * @page_1.egress_all_frames: Egress frame count + * @page_1.egress_all_bytes: Egress byte count + * @page_1.egress_multicast_frames: Egress multicast frame count + * @page_1.egress_multicast_bytes: Egress multicast byte count + * @page_1.egress_broadcast_frames: Egress broadcast frame count + * @page_1.egress_broadcast_bytes: Egress broadcast byte count + * @page_2: Page_2 statistics structure + * @page_2.ingress_filtered_frames: Ingress filtered frame count + * @page_2.ingress_discarded_frames: Ingress discarded frame count + * @page_2.ingress_nobuffer_discards: Ingress discarded frame count due to + * lack of buffers + * @page_2.egress_discarded_frames: Egress discarded frame count + * @page_2.egress_confirmed_frames: Egress confirmed frame count + * @page_3: Page_3 statistics structure with values for the selected TC + * @page_3.ceetm_dequeue_bytes: Cumulative count of the number of bytes dequeued + * @page_3.ceetm_dequeue_frames: Cumulative count of the number of frames + * dequeued + * @page_3.ceetm_reject_bytes: Cumulative count of the number of bytes in all + * frames whose enqueue was rejected + * @page_3.ceetm_reject_frames: Cumulative count of all frame enqueues rejected + * @page_4: congestion point drops for seleted TC + * @page_4.cgr_reject_frames: number of rejected frames due to congestion point + * @page_4.cgr_reject_bytes: number of rejected bytes due to congestion point + * @page_5: policer statistics per TC + * @page_5.policer_cnt_red: NUmber of red colored frames + * @page_5.policer_cnt_yellow: number of yellow colored frames + * @page_5.policer_cnt_green: number of green colored frames + * @page_5.policer_cnt_re_red: number of recolored red frames + * @page_5.policer_cnt_re_yellow: number of recolored yellow frames + * @raw: raw statistics structure, used to index counters + */ union dpni_statistics { - /** - * struct page_0 - Page_0 statistics structure - * @ingress_all_frames: Ingress frame count - * @ingress_all_bytes: Ingress byte count - * @ingress_multicast_frames: Ingress multicast frame count - * @ingress_multicast_bytes: Ingress multicast byte count - * @ingress_broadcast_frames: Ingress broadcast frame count - * @ingress_broadcast_bytes: Ingress broadcast byte count - */ struct { uint64_t ingress_all_frames; uint64_t ingress_all_bytes; @@ -519,15 +580,6 @@ union dpni_statistics { uint64_t ingress_broadcast_frames; uint64_t ingress_broadcast_bytes; } page_0; - /** - * struct page_1 - Page_1 statistics structure - * @egress_all_frames: Egress frame count - * @egress_all_bytes: Egress byte count - * @egress_multicast_frames: Egress multicast frame count - * @egress_multicast_bytes: Egress multicast byte count - * @egress_broadcast_frames: Egress broadcast frame count - * @egress_broadcast_bytes: Egress broadcast byte count - */ struct { uint64_t egress_all_frames; uint64_t egress_all_bytes; @@ -536,15 +588,6 @@ union dpni_statistics { uint64_t egress_broadcast_frames; uint64_t egress_broadcast_bytes; } page_1; - /** - * struct page_2 - Page_2 statistics structure - * @ingress_filtered_frames: Ingress filtered frame count - * @ingress_discarded_frames: Ingress discarded frame count - * @ingress_nobuffer_discards: Ingress discarded frame count due to - * lack of buffers - * @egress_discarded_frames: Egress discarded frame count - * @egress_confirmed_frames: Egress confirmed frame count - */ struct { uint64_t ingress_filtered_frames; uint64_t ingress_discarded_frames; @@ -552,26 +595,23 @@ union dpni_statistics { uint64_t egress_discarded_frames; uint64_t egress_confirmed_frames; } page_2; - /** - * struct page_3 - Page_3 statistics structure with values for the - * selected TC - * @ceetm_dequeue_bytes: Cumulative count of the number of bytes - * dequeued - * @ceetm_dequeue_frames: Cumulative count of the number of frames - * dequeued - * @ceetm_reject_bytes: Cumulative count of the number of bytes in all - * frames whose enqueue was rejected - * @ceetm_reject_frames: Cumulative count of all frame enqueues rejected - */ struct { uint64_t ceetm_dequeue_bytes; uint64_t ceetm_dequeue_frames; uint64_t ceetm_reject_bytes; uint64_t ceetm_reject_frames; } page_3; - /** - * struct raw - raw statistics structure, used to index counters - */ + struct { + uint64_t cgr_reject_frames; + uint64_t cgr_reject_bytes; + } page_4; + struct { + uint64_t policer_cnt_red; + uint64_t policer_cnt_yellow; + uint64_t policer_cnt_green; + uint64_t policer_cnt_re_red; + uint64_t policer_cnt_re_yellow; + } page_5; struct { uint64_t counter[DPNI_STATISTICS_CNT]; } raw; @@ -602,10 +642,12 @@ union dpni_statistics { * struct - Structure representing DPNI link configuration * @rate: Rate * @options: Mask of available options; use 'DPNI_LINK_OPT_' values + * @advertising: Speeds that are advertised for autoneg (bitmap) */ struct dpni_link_cfg { uint32_t rate; uint64_t options; + uint64_t advertising; }; int dpni_set_link_cfg(struct fsl_mc_io *mc_io, @@ -618,11 +660,17 @@ int dpni_set_link_cfg(struct fsl_mc_io *mc_io, * @rate: Rate * @options: Mask of available options; use 'DPNI_LINK_OPT_' values * @up: Link state; '0' for down, '1' for up + * @state_valid: Ignore/Update the state of the link + * @supported: Speeds capability of the phy (bitmap) + * @advertising: Speeds that are advertised for autoneg (bitmap) */ struct dpni_link_state { uint32_t rate; uint64_t options; int up; + int state_valid; + uint64_t supported; + uint64_t advertising; }; int dpni_get_link_state(struct fsl_mc_io *mc_io, @@ -750,11 +798,20 @@ enum dpni_fs_miss_action { * struct dpni_fs_tbl_cfg - Flow Steering table configuration * @miss_action: Miss action selection * @default_flow_id: Used when 'miss_action = DPNI_FS_MISS_EXPLICIT_FLOWID' + * @keep_hash_key: used only when miss_action is set to DPNI_FS_MISS_HASH. When + * set to one unclassified frames will be distributed according to previous + * used hash key. If set to zero hash key will be replaced with the key + * provided for flow steering. + * @keep_entries: if set to one command will not delete the entries that already + * exist into FS table. Use this option with caution: if the table + * entries are not compatible with the distribution key the packets + * will not be classified properly. */ struct dpni_fs_tbl_cfg { enum dpni_fs_miss_action miss_action; uint16_t default_flow_id; char keep_hash_key; + uint8_t keep_entries; }; /** @@ -915,34 +972,52 @@ int dpni_get_congestion_notification(struct fsl_mc_io *mc_io, /** * struct dpni_queue - Queue structure - * @user_context: User data, presented to the user along with any frames - * from this queue. Not relevant for Tx queues. + * @destination - Destination structure + * @destination.id: ID of the destination, only relevant if DEST_TYPE is > 0. + * Identifies either a DPIO or a DPCON object. + * Not relevant for Tx queues. + * @destination.type: May be one of the following: + * 0 - No destination, queue can be manually + * queried, but will not push traffic or + * notifications to a DPIO; + * 1 - The destination is a DPIO. When traffic + * becomes available in the queue a FQDAN + * (FQ data available notification) will be + * generated to selected DPIO; + * 2 - The destination is a DPCON. The queue is + * associated with a DPCON object for the + * purpose of scheduling between multiple + * queues. The DPCON may be independently + * configured to generate notifications. + * Not relevant for Tx queues. + * @destination.hold_active: Hold active, maintains a queue scheduled for longer + * in a DPIO during dequeue to reduce spread of traffic. + * Only relevant if queues are + * not affined to a single DPIO. + * @user_context: User data, presented to the user along with any frames + * from this queue. Not relevant for Tx queues. + * @flc: FD FLow Context structure + * @flc.value: Default FLC value for traffic dequeued from + * this queue. Please check description of FD + * structure for more information. + * Note that FLC values set using dpni_add_fs_entry, + * if any, take precedence over values per queue. + * @flc.stash_control: Boolean, indicates whether the 6 lowest + * - significant bits are used for stash control. + * significant bits are used for stash control. If set, the 6 + * least significant bits in value are interpreted as follows: + * - bits 0-1: indicates the number of 64 byte units of context + * that are stashed. FLC value is interpreted as a memory address + * in this case, excluding the 6 LS bits. + * - bits 2-3: indicates the number of 64 byte units of frame + * annotation to be stashed. Annotation is placed at FD[ADDR]. + * - bits 4-5: indicates the number of 64 byte units of frame + * data to be stashed. Frame data is placed at FD[ADDR] + + * FD[OFFSET]. + * For more details check the Frame Descriptor section in the + * hardware documentation. */ struct dpni_queue { - /** - * struct destination - Destination structure - * @id: ID of the destination, only relevant if DEST_TYPE is > 0. - * Identifies either a DPIO or a DPCON object. - * Not relevant for Tx queues. - * @type: May be one of the following: - * 0 - No destination, queue can be manually - * queried, but will not push traffic or - * notifications to a DPIO; - * 1 - The destination is a DPIO. When traffic - * becomes available in the queue a FQDAN - * (FQ data available notification) will be - * generated to selected DPIO; - * 2 - The destination is a DPCON. The queue is - * associated with a DPCON object for the - * purpose of scheduling between multiple - * queues. The DPCON may be independently - * configured to generate notifications. - * Not relevant for Tx queues. - * @hold_active: Hold active, maintains a queue scheduled for longer - * in a DPIO during dequeue to reduce spread of traffic. - * Only relevant if queues are - * not affined to a single DPIO. - */ struct { uint16_t id; enum dpni_dest type; @@ -950,28 +1025,6 @@ struct dpni_queue { uint8_t priority; } destination; uint64_t user_context; - /** - * struct flc - FD FLow Context structure - * @value: Default FLC value for traffic dequeued from - * this queue. Please check description of FD - * structure for more information. - * Note that FLC values set using dpni_add_fs_entry, - * if any, take precedence over values per queue. - * @stash_control: Boolean, indicates whether the 6 lowest - * - significant bits are used for stash control. - * significant bits are used for stash control. If set, the 6 - * least significant bits in value are interpreted as follows: - * - bits 0-1: indicates the number of 64 byte units of context - * that are stashed. FLC value is interpreted as a memory address - * in this case, excluding the 6 LS bits. - * - bits 2-3: indicates the number of 64 byte units of frame - * annotation to be stashed. Annotation is placed at FD[ADDR]. - * - bits 4-5: indicates the number of 64 byte units of frame - * data to be stashed. Frame data is placed at FD[ADDR] + - * FD[OFFSET]. - * For more details check the Frame Descriptor section in the - * hardware documentation. - */ struct { uint64_t value; char stash_control; @@ -1132,4 +1185,21 @@ int dpni_get_taildrop(struct fsl_mc_io *mc_io, uint8_t tc, uint8_t q_index, struct dpni_taildrop *taildrop); + +int dpni_set_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t tc, + uint8_t index, + uint8_t options, + struct opr_cfg *cfg); + +int dpni_get_opr(struct fsl_mc_io *mc_io, + uint32_t cmd_flags, + uint16_t token, + uint8_t tc, + uint8_t index, + struct opr_cfg *cfg, + struct opr_qry *qry); + #endif /* __FSL_DPNI_H */ diff --git a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h index eb3e99878..3df5bcf1f 100644 --- a/drivers/net/dpaa2/mc/fsl_dpni_cmd.h +++ b/drivers/net/dpaa2/mc/fsl_dpni_cmd.h @@ -9,19 +9,21 @@ /* DPNI Version */ #define DPNI_VER_MAJOR 7 -#define DPNI_VER_MINOR 3 +#define DPNI_VER_MINOR 8 #define DPNI_CMD_BASE_VERSION 1 #define DPNI_CMD_VERSION_2 2 +#define DPNI_CMD_VERSION_3 3 #define DPNI_CMD_ID_OFFSET 4 #define DPNI_CMD(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_BASE_VERSION) #define DPNI_CMD_V2(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_2) +#define DPNI_CMD_V3(id) (((id) << DPNI_CMD_ID_OFFSET) | DPNI_CMD_VERSION_3) /* Command IDs */ #define DPNI_CMDID_OPEN DPNI_CMD(0x801) #define DPNI_CMDID_CLOSE DPNI_CMD(0x800) -#define DPNI_CMDID_CREATE DPNI_CMD(0x901) +#define DPNI_CMDID_CREATE DPNI_CMD_V2(0x901) #define DPNI_CMDID_DESTROY DPNI_CMD(0x981) #define DPNI_CMDID_GET_API_VERSION DPNI_CMD(0xa01) @@ -44,10 +46,10 @@ #define DPNI_CMDID_GET_QDID DPNI_CMD(0x210) #define DPNI_CMDID_GET_SP_INFO DPNI_CMD(0x211) #define DPNI_CMDID_GET_TX_DATA_OFFSET DPNI_CMD(0x212) -#define DPNI_CMDID_GET_LINK_STATE DPNI_CMD(0x215) +#define DPNI_CMDID_GET_LINK_STATE DPNI_CMD_V2(0x215) #define DPNI_CMDID_SET_MAX_FRAME_LENGTH DPNI_CMD(0x216) #define DPNI_CMDID_GET_MAX_FRAME_LENGTH DPNI_CMD(0x217) -#define DPNI_CMDID_SET_LINK_CFG DPNI_CMD(0x21A) +#define DPNI_CMDID_SET_LINK_CFG DPNI_CMD_V2(0x21A) #define DPNI_CMDID_SET_TX_SHAPING DPNI_CMD_V2(0x21B) #define DPNI_CMDID_SET_MCAST_PROMISC DPNI_CMD(0x220) @@ -65,7 +67,7 @@ #define DPNI_CMDID_REMOVE_VLAN_ID DPNI_CMD(0x232) #define DPNI_CMDID_CLR_VLAN_FILTERS DPNI_CMD(0x233) -#define DPNI_CMDID_SET_RX_TC_DIST DPNI_CMD_V2(0x235) +#define DPNI_CMDID_SET_RX_TC_DIST DPNI_CMD_V3(0x235) #define DPNI_CMDID_GET_STATISTICS DPNI_CMD_V2(0x25D) #define DPNI_CMDID_RESET_STATISTICS DPNI_CMD(0x25E) @@ -76,8 +78,8 @@ #define DPNI_CMDID_GET_PORT_MAC_ADDR DPNI_CMD(0x263) -#define DPNI_CMDID_GET_BUFFER_LAYOUT DPNI_CMD(0x264) -#define DPNI_CMDID_SET_BUFFER_LAYOUT DPNI_CMD(0x265) +#define DPNI_CMDID_GET_BUFFER_LAYOUT DPNI_CMD_V2(0x264) +#define DPNI_CMDID_SET_BUFFER_LAYOUT DPNI_CMD_V2(0x265) #define DPNI_CMDID_SET_CONGESTION_NOTIFICATION DPNI_CMD(0x267) #define DPNI_CMDID_GET_CONGESTION_NOTIFICATION DPNI_CMD(0x268) @@ -87,6 +89,8 @@ #define DPNI_CMDID_SET_OFFLOAD DPNI_CMD(0x26C) #define DPNI_CMDID_SET_TX_CONFIRMATION_MODE DPNI_CMD(0x266) #define DPNI_CMDID_GET_TX_CONFIRMATION_MODE DPNI_CMD(0x26D) +#define DPNI_CMDID_SET_OPR DPNI_CMD(0x26e) +#define DPNI_CMDID_GET_OPR DPNI_CMD(0x26f) /* Macros for accessing command fields smaller than 1byte */ #define DPNI_MASK(field) \ @@ -113,6 +117,7 @@ struct dpni_cmd_create { uint8_t qos_entries; uint8_t pad3; uint16_t fs_entries; + uint8_t num_rx_tcs; }; struct dpni_cmd_destroy { @@ -228,6 +233,8 @@ struct dpni_cmd_set_errors_behavior { #define DPNI_PASS_PR_SIZE 1 #define DPNI_PASS_FS_SHIFT 2 #define DPNI_PASS_FS_SIZE 1 +#define DPNI_PASS_SWO_SHIFT 3 +#define DPNI_PASS_SWO_SIZE 1 struct dpni_cmd_get_buffer_layout { uint8_t qtype; @@ -307,10 +314,13 @@ struct dpni_cmd_set_link_cfg { uint32_t rate; uint32_t pad1; uint64_t options; + uint64_t advertising; }; #define DPNI_LINK_STATE_SHIFT 0 #define DPNI_LINK_STATE_SIZE 1 +#define DPNI_STATE_VALID_SHIFT 1 +#define DPNI_STATE_VALID_SIZE 1 struct dpni_rsp_get_link_state { uint32_t pad0; @@ -320,6 +330,8 @@ struct dpni_rsp_get_link_state { uint32_t rate; uint32_t pad2; uint64_t options; + uint64_t supported; + uint64_t advertising; }; struct dpni_cmd_set_max_frame_length { @@ -415,6 +427,8 @@ struct dpni_cmd_set_tx_priorities { #define DPNI_MISS_ACTION_SIZE 4 #define DPNI_KEEP_HASH_KEY_SHIFT 7 #define DPNI_KEEP_HASH_KEY_SIZE 1 +#define DPNI_KEEP_ENTRIES_SHIFT 6 +#define DPNI_KEEP_ENTRIES_SIZE 1 struct dpni_cmd_set_rx_tc_dist { uint16_t dist_size; @@ -601,5 +615,64 @@ struct dpni_rsp_get_congestion_notification { uint32_t threshold_exit; }; +struct dpni_cmd_set_opr { + uint8_t pad0; + uint8_t tc_id; + uint8_t index; + uint8_t options; + uint8_t pad1[7]; + uint8_t oloe; + uint8_t oeane; + uint8_t olws; + uint8_t oa; + uint8_t oprrws; +}; + +struct dpni_cmd_get_opr { + uint8_t pad; + uint8_t tc_id; + uint8_t index; +}; + +#define DPNI_RIP_SHIFT 0 +#define DPNI_RIP_SIZE 1 +#define DPNI_OPR_ENABLE_SHIFT 1 +#define DPNI_OPR_ENABLE_SIZE 1 +#define DPNI_TSEQ_NLIS_SHIFT 0 +#define DPNI_TSEQ_NLIS_SIZE 1 +#define DPNI_HSEQ_NLIS_SHIFT 0 +#define DPNI_HSEQ_NLIS_SIZE 1 + +struct dpni_rsp_get_opr { + uint64_t pad0; + /* from LSB: rip:1 enable:1 */ + uint8_t flags; + uint16_t pad1; + uint8_t oloe; + uint8_t oeane; + uint8_t olws; + uint8_t oa; + uint8_t oprrws; + uint16_t nesn; + uint16_t pad8; + uint16_t ndsn; + uint16_t pad2; + uint16_t ea_tseq; + /* only the LSB */ + uint8_t tseq_nlis; + uint8_t pad3; + uint16_t ea_hseq; + /* only the LSB */ + uint8_t hseq_nlis; + uint8_t pad4; + uint16_t ea_hptr; + uint16_t pad5; + uint16_t ea_tptr; + uint16_t pad6; + uint16_t opr_vid; + uint16_t pad7; + uint16_t opr_id; +}; + #pragma pack(pop) #endif /* _FSL_DPNI_CMD_H */ diff --git a/drivers/net/dpaa2/mc/fsl_net.h b/drivers/net/dpaa2/mc/fsl_net.h index 964870ba9..0dc0131bb 100644 --- a/drivers/net/dpaa2/mc/fsl_net.h +++ b/drivers/net/dpaa2/mc/fsl_net.h @@ -180,7 +180,7 @@ #define NH_FLD_SCTP_CHUNK_DATA_STREAM_SQN (NH_FLD_SCTP_CHUNK_DATA_TYPE << 5) #define NH_FLD_SCTP_CHUNK_DATA_PAYLOAD_PID (NH_FLD_SCTP_CHUNK_DATA_TYPE << 6) #define NH_FLD_SCTP_CHUNK_DATA_UNORDERED (NH_FLD_SCTP_CHUNK_DATA_TYPE << 7) -#define NH_FLD_SCTP_CHUNK_DATA_BEGGINNING (NH_FLD_SCTP_CHUNK_DATA_TYPE << 8) +#define NH_FLD_SCTP_CHUNK_DATA_BEGGINING (NH_FLD_SCTP_CHUNK_DATA_TYPE << 8) #define NH_FLD_SCTP_CHUNK_DATA_END (NH_FLD_SCTP_CHUNK_DATA_TYPE << 9) #define NH_FLD_SCTP_CHUNK_DATA_ALL_FIELDS \ ((NH_FLD_SCTP_CHUNK_DATA_TYPE << 10) - 1)