From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00050.outbound.protection.outlook.com [40.107.0.50]) by dpdk.org (Postfix) with ESMTP id D061E1C494 for ; Fri, 6 Jul 2018 10:12:16 +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=OkFq+pupzUd2y+jDFi/Y2B3JyDuIIwTLcpk1rVVwK9I=; b=h5prCXO/6bpsR16fheWhMiAaCjP5sBxGRz6qSkQ0J7welMCzlY5NNHNgZg8JaUa0QmdQ8o6XPd4Zap+vLPGjJtNY2UJOQLbATtVmxv7dQ13MN9TV/sxlzE9bLeoBBjeZ51WH1B12WrnwsLiH0lYC19xSjhdtX84a61DfUDd5ALs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by AM2PR04MB0755.eurprd04.prod.outlook.com (2a01:111:e400:8411::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.23; Fri, 6 Jul 2018 08:12:14 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: shreyansh.jain@nxp.com Date: Fri, 6 Jul 2018 13:40:12 +0530 Message-Id: <1530864613-11754-15-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530864613-11754-1-git-send-email-hemant.agrawal@nxp.com> References: <1530697431-1244-1-git-send-email-hemant.agrawal@nxp.com> <1530864613-11754-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR01CA0076.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::16) To AM2PR04MB0755.eurprd04.prod.outlook.com (2a01:111:e400:8411::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 80cd8093-406e-4ed6-09e5-08d5e3182ef1 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AM2PR04MB0755; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 3:rVnqkzAiVQJ3tJyEiT09VDuYsjgENzgXCWQQVvcbnT7d1QUVWP/cDBQfmVmWzOxeJ0IV6IDvEjPWKKJiEP5Vz0bAl6YZoBXcsLuVC2IJKIEG++b/u4/4w66fpD+L0eJUmG3ImEiURfi5CYnz9BDXDbT8FZ047AQO14I4cjhHUODPl8IKRSZni4qtjNpvEgFZMNWrggw0sBCDUR97ODcEmfBA74mX088mTpgMrE+K716bXLe6rJeIu3PKqRwzS4eH; 25:t64hkRw1nJw63aDrivtQm3viHLpQfEHMMScyPwyGtbiqBbUPm031EpHkiXh7P9PEQrBIPdJUymsAambgZgvNOjj/ZlnlGjv5uyFLQFIFrKMEAYZlIyDM4RHOvkUAac9Ipef0Z/vkjcp6IBWIfbFwlLzo2Xbn+ruFCSVqKKxg2T/ScE7YERrUdEzg4HS35qrWWEfM8dl3YoTMCNn3HWCqPL5ntiME4rAylF1+ITPwiQzyrQh2Xp/2HcAqzot1LYjgxRIJHUixf3Icyn9GCRHAtwou1/mNvmEfsKePwa1fEFDMo9+YPvsi9b0wUYq0UwiFJAVdlmxeG7DvZ50lSuwYjw==; 31:rPt+c717d6nGiQML4SNTaMxmpn1NhVTiEJtfBVawZOCfvuxvtjWB0GuqoZ+09KbXvnMpPkV02GEU+uaDBsyFyifiUvHvkPjzMCIl0yZPVyTrVTODYeVKR3T/yX6DCOW1YIuVeoksX99uyVkvjgje/KpBEjf0Q9ag0puO/FCmAnzS/0uvLM5cnLbVszQEvGqT1NHkXdZrKanEv44Zo2jB04KK1uYWLYUFPYqSDE7coNY= X-MS-TrafficTypeDiagnostic: AM2PR04MB0755: X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 20:Dry6Qald/+tLyMUK1+niM8zSlwJ83U01RC0Up79JV2PVzTO2JZ/cwEa13pl44doGX6JoKZ3quuu9o92kplSAGWu/FcMabPsO9+ABFzuQyYrrcfOkLcX3kWkNcuk8vyGWgbXhcOFsCSq9F/5/afgzaPXp8kdKEij2ptfMZOqakhsF98/wEPxKdsbZ05qNspNAcADTO1bGlzKNdvYgdimz73Hrh6TbIUJxbmQb/IgH/SYXw5o67PM63xU8gQprAHm61keFQrhZKax0CYi7ETqAT7dV/cFHgvGXVTF3pzEGlY27/oFZa0OX+wZxXaNfUA9O2av0SHOegUj5YFhwz9XWxVpUxFuxr0aDjFOeztSKcMVmqAiKOKc29oObeo2x5pjWzwWHE+g0ITFDrwRZpf6Xe3JsMas0a27wg6cCDMheJsNGVCaQ0DV/uvp7HwTBx5B69EC+NgETTSYUqlTJpdedG19f5cXnCbKhP7yzWdSmb2vxTqKX2IIBcQeaRfBUNgow; 4:oRXO7EOk+f1+MuFDLrbixCU1WBwLxacKf/M/kHmWdvZgWGJiljyAz8pgYmwz79V2pdPmK4uQCrOUb8p1cHW1LcotwOALBC1PbsmXdMWpxIhvAkyviesbYkxcH7kx7rtSYsPHDkvd3Fpl57nwO6Pnq1IjeKqTw15neX6IXJiJz/lVQ2EPjBnNfwLgYiThelSsrN3inqqhKs30gAi3KGrm2wEEamHHDP8EqWgqrIqAVPJ1ALg9KoHfaOtHniCsicBKXIc8vyLRTTrMD42MOfOHtQfn9sZhROTvomDWihgrzz1tw+GW7nzNXVTmeAQsegzg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM2PR04MB0755; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0755; X-Forefront-PRVS: 0725D9E8D0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(136003)(366004)(346002)(376002)(199004)(189003)(956004)(66066001)(446003)(6116002)(2616005)(476003)(5009440100003)(6916009)(76176011)(186003)(16586007)(14444005)(16526019)(575784001)(105586002)(478600001)(86362001)(44832011)(106356001)(3846002)(4326008)(486006)(11346002)(6486002)(2906002)(25786009)(305945005)(47776003)(50466002)(2361001)(7736002)(5660300001)(6512007)(48376002)(8936002)(68736007)(36756003)(97736004)(55236004)(6506007)(53936002)(26005)(51416003)(50226002)(8676002)(2351001)(81156014)(81166006)(386003)(52116002)(316002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0755; H:bf-netperf1.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; AM2PR04MB0755; 23:6OjYFlpOSK0TN8JnlhjpbQi4/z5/OJPtO+ap+0YsB?= =?us-ascii?Q?W5g124xRiUl/z4zmj6yhuO5e5BcdGZ4eMZn5f2HmsOFNSvu8u3hfIEmfGdK4?= =?us-ascii?Q?gAK26mod3C//IbqG2yVbiy2Q6MDz+UT1J3LcKV0QahmkYoQTq2HNus4Tc4Sf?= =?us-ascii?Q?yjgzMcUT8MQ8vjqhH2RTSsLwLBxYcQA513XZGUoIJOCDu0VpSiGD9s+EM6Zi?= =?us-ascii?Q?M77UseChUG+HSFC9Qbkm6qHt1P/5G/Vq6rb8R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JxRvzTVC7Keohm5rQbmVWEjYwNuISfT1Yf5D0kXR9zGWwiGdmJwfn4S?= =?us-ascii?Q?6t+EJ+P7AlEbn9dLicw59HCLSuvpxBuQ+La3lHt6rYF/V8568Y3wp5Xylvkj?= =?us-ascii?Q?y5kbgo7ygBP+9vdn1fyPQx3R7ZHFLfTmobs7uleNWmWI/MAVS7638Len3nsj?= =?us-ascii?Q?oHVh+C/B/2VwQwURbmSvnJWs8bec6aewPmQNnbkO26e?= X-Microsoft-Antispam-Message-Info: DZoyFivc/5K8jf369NZTgWEoI3INFHOhkRTFFy/lMJex65oxvyjSWT4KQJNLVIMdNr9H8BZjdjwVk7ZrUh4+y2JT+ttFkjkVG6LwBF3eXOH/AK2IqdIOKI8fer/hJnCMMnQV5cCrhukN5Tg91+qtLbSz+K5c14x8QPp41Ml4S3wgO755a8VjItVwGH1CiiqDsu7BWhbW1wpszyC/RJtqN+sU+O69i5dfS6S31UQc7+m4+G7+r7q7ADEdTmUjPjdq6zc+cced8uRpsz7j9aHHgwJbgM1FEP1NfctGR59nVKqgkpXuqgf801VywtCxij7Pct7Rk9umFxNtUA8Z4Xzw3SIxpMcTpI/szRfQkJndiv4= X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 6:r7feRHgAYn9EKmHEFtYBs55KJM5A9EGQTkS6JHZUDzgIJVT7fDmBRXDmiyo++QttPpbYbvHr06C9WPnyXs0G1vfYPkuk5L1B6/4YtqVkHk5H4TMP07FY+ELnQdKQnu6N1G932hZHapfSWptcfqaV7JDpZuA0ade2d6fBd5Mp4WcEBMluN/61PnVrwbGEQnZb5acBxY1dGsQZ5krhMPvhfTgtILp0PkeFmcKcUnj3YMawT4JlOSnA57z4DotIIUE23KGQx2OCp9QYbQIOPO3DLT1l9F2HE7sIQkFjO995udm0laAXMts/uWYLS8TJgobiTNO5ZPVbT/58APbdDbLmB19b+/hHYfTy7fm8AhINDc3sXiOvyO7tBrJZWFgWsET5q0LmPAWK08xRXEUAqB5k4lsbh4iCXWDoIPfIv33kGGT8n88rk8qpmdIItNzwZx34aRzsDzfmOY+jf1Ek4498Kg==; 5:Gy/9RzpO/yVUIJmjBzWb8b9S2Z5u+HhpNntaYTSIiM1zeSCy2/CvKe9MpLWYQPC/ymVbSgwO+B+tVRYrjXHsDuTV/x9SVat9Pfk00anHzcx3djpmb7mpHN9ScuP7o7xTQ01mXyN6IvqGDCQRj+z+aTf1Zi+gkqOMsheCOr9BPP8=; 24:uE1+XCXF6k1ZRYikpaGMMFk1NSxPOeMx1AAWuqIOH1DQHB1HYAZ+GYP6bTy2dJMqqG9iZsiwlXDVTJhZyIGF7EKdh9Pm0vVojLgatYHdnw4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 7:IFzS8hkvqVbNBKyqc6PP+k8rYbMJuVQbGRvsvdVyyno1nPbTNzZdZSZ3ZX2STWdc5748miNbSuwx1ZXd+nbyTTWmH5PTC14z1ouNev/BC2oyJlzbXZam6VX4IyJ35ZRGyBovL+P52rjKlAA94yZmW3CDYd6WPaY8LzTqGw0A7aWA67En4zmich/8MD05jIMY4B9qMZdIpxKbGfnNXmgxd2yEhl9XpuP+Qo0KkluCU178cMgx3jAMOObsCI0Wxh+V X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2018 08:12:14.1786 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 80cd8093-406e-4ed6-09e5-08d5e3182ef1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0755 Subject: [dpdk-dev] [PATCH v3 15/16] bus/dpaa: add support for SG config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2018 08:12:17 -0000 Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/fman/fman_hw.c | 42 +++++++++++++++++++++++++++++++ drivers/bus/dpaa/include/fsl_fman.h | 6 +++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 2 ++ 3 files changed, 50 insertions(+) diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c index 7ada7fa..4ebbc3d 100644 --- a/drivers/bus/dpaa/base/fman/fman_hw.c +++ b/drivers/bus/dpaa/base/fman/fman_hw.c @@ -16,6 +16,7 @@ #include #include +#define FMAN_SP_SG_DISABLE 0x80000000 #define FMAN_SP_EXT_BUF_MARG_START_SHIFT 16 /* Instantiate the global variable that the inline CRC64 implementation (in @@ -538,6 +539,47 @@ fman_if_get_maxfrm(struct fman_if *fm_if) return (in_be32(reg_maxfrm) | 0x0000FFFF); } +/* MSB in fmbm_rebm register + * 0 - If BMI cannot store the frame in a single buffer it may select a buffer + * of smaller size and store the frame in scatter gather (S/G) buffers + * 1 - Scatter gather format is not enabled for frame storage. If BMI cannot + * store the frame in a single buffer, the frame is discarded. + */ + +int +fman_if_get_sg_enable(struct fman_if *fm_if) +{ + u32 fmbm_rebm; + + struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); + + assert(fman_ccsr_map_fd != -1); + + fmbm_rebm = in_be32(&((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm); + + return (fmbm_rebm & FMAN_SP_SG_DISABLE) ? 0 : 1; +} + +void +fman_if_set_sg(struct fman_if *fm_if, int enable) +{ + struct __fman_if *__if = container_of(fm_if, struct __fman_if, __if); + unsigned int *fmbm_rebm; + int val; + int fmbm_mask = FMAN_SP_SG_DISABLE; + + if (enable) + val = 0; + else + val = FMAN_SP_SG_DISABLE; + + assert(fman_ccsr_map_fd != -1); + + fmbm_rebm = &((struct rx_bmi_regs *)__if->bmi_map)->fmbm_rebm; + + out_be32(fmbm_rebm, (in_be32(fmbm_rebm) & ~fmbm_mask) | val); +} + void fman_if_set_dnia(struct fman_if *fm_if, uint32_t nia) { diff --git a/drivers/bus/dpaa/include/fsl_fman.h b/drivers/bus/dpaa/include/fsl_fman.h index c0ef1bf..1d1ce86 100644 --- a/drivers/bus/dpaa/include/fsl_fman.h +++ b/drivers/bus/dpaa/include/fsl_fman.h @@ -108,6 +108,12 @@ int fman_if_get_fdoff(struct fman_if *fm_if); /* Set interface fd->offset value */ void fman_if_set_fdoff(struct fman_if *fm_if, uint32_t fd_offset); +/* Get interface SG enable status value */ +int fman_if_get_sg_enable(struct fman_if *fm_if); + +/* Set interface SG support mode */ +void fman_if_set_sg(struct fman_if *fm_if, int enable); + /* Get interface Max Frame length (MTU) */ uint16_t fman_if_get_maxfrm(struct fman_if *fm_if); diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index e00c911..7d6d624 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -96,6 +96,8 @@ DPDK_18.02 { DPDK_18.08 { global: + fman_if_get_sg_enable; + fman_if_set_sg; of_get_mac_address; local: *; -- 2.7.4