From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) by dpdk.org (Postfix) with ESMTP id AAC3A1BE8D for ; Wed, 4 Jul 2018 11:45:42 +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=0YtF83KgByhMY/IEZFPvhgB/j/fuWdyVCEqLQecEEtg=; b=lPN5Y9ahaQYTWnK+cDoKNWAUjGXc1F5i6WKGQBhAw+aKYnDeTxB2v9KgwGnf7a/cWYUSE0bHS86Zhj9B+KKobTmXCu1uuacGWIeG5oEuZzIw8nu7zEIlnunN8isNgCTQKbHFTj8aOLZxiYVtRa3qcJyIVuXb/cYsOBewDaQiUws= 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 DB4PR04MB0765.eurprd04.prod.outlook.com (2a01:111:e400:984d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.25; Wed, 4 Jul 2018 09:45:40 +0000 From: Hemant Agrawal To: dev@dpdk.org Date: Wed, 4 Jul 2018 15:13:50 +0530 Message-Id: <1530697431-1244-15-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530697431-1244-1-git-send-email-hemant.agrawal@nxp.com> References: <1529574244-18997-1-git-send-email-hemant.agrawal@nxp.com> <1530697431-1244-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: BM1PR0101CA0008.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::18) To DB4PR04MB0765.eurprd04.prod.outlook.com (2a01:111:e400:984d::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1043ac77-1aac-4a5e-1f9e-08d5e192e7e0 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:DB4PR04MB0765; X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 3:akKUe1wkTMgPFOAUDrP0eAvZivWJY0CcWMnHEoNXHtoL2WnM3lKmuqqekEeH2IGmpBFD9kIiAerA42rzWiczCNo+vCYSTJNWOy8Mti2oUGbyzEykxF0ZTLdE0O2gUyIpQhR6XWIK3OYGSt4QyalonKMvqr6zCACay51tyGpIuxFG5B8S0B5a1RlXqfVX7eKKu/cTqodD3w81mYUbOfUxglPaTvpp/550Q+m9Zn6yaffAaWB+m1gz9jHFyje+HnVU; 25:BiFAOsnp2RAXZKSKSnPgAry7wvYxXRTV0m57oiIkD4FaZVju57e8WULRhv6E/9DwrKhRHXDdzhv/vAmbTE29GeECXqKoy5CvYV1/odR4Vm+SZlvvm8ZYGN7FW9OEFmLdZob0GEIuNgg+DrLLQz1pJx8t3lHGlbbr4n8LN6wgLuyHpNhkX06RitVl8TOfamz8VXvJJJYix8Z8E+47aatYi/aU/Uup75+KzMJivkqYMh0PQOoWA3i3Slofg3perRFXZg+Fm+fCvN84A9+i+SQhL1dNi6EXFoXc1os16Yuuf2qbM7/Hi9D8imuqTlpGQvf33WAe0ZeQKn9QbsyCtpAjow==; 31:nV037SIm/sLzDtfTOVZLJp09DPjJDtpG7KRHAcYfzjwgUkDR6VXKFiAroAa+A5paXUfVazGsDyh/t4lrfTWwiNsak50MZZIclcTICZ/J57rAyYFjQZjXnJTnUBTy0+CXTZQAmxPxBemoOUkGvPkS1HtBO1S0gPwmEeK5pBx4fJhzzzPJP28oGT1AbOZp888nirpcUEPJugftYRYUmTKrbHayKKVikcXcuDmaEe4YgE8= X-MS-TrafficTypeDiagnostic: DB4PR04MB0765: X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 20:i2IPI30UUClyYE9b/feWPJoujvIInX09H22TNJtUGWiVUKy5gGN7hq/Oskzw+d1FEODoAgUm2gK4Swah3vZJHv2W6sFVpJod3rjYqG4iWbxcuPikpPENiNGHXTgj9+5bhh4j/RxJ8f0Qjl0EHEexIOWOloFXh2claaUHJT8UGdObhg7k5/zZV9oxB72KEY8SE4syMFe4vdmFPjTO41cswVLwaCwMFLFJV5f0nZSD5KVAeV1GL5PxWQviw0qeomLkoPQMazRkoxt4TNRVzj8xHbFFoko8D3QfxXN/4zYy/3M0LLvJpNTfD/fGl0KWyWnsD4pykpVLvBNYo7b/3fi6iprDotnct9F3SLWpLeCsAObkEkHPTZHFAU7V9uqWGNIJn0/TBumkZ0iotx8ydUpIqZz2Us4IOe+YER89QJmlUEjXF0CQdKVsG2kRkMSwS0/opixvVjYhYC96NwayDKkO5CEyh7O8whOBRis0X4JU1psJiTQc3MBysmi7bsQudnMa; 4:jTkG3heYK2OYcLPDJH+leWzBtPBC+Bn5sMLNfOMn1R/+wCznybQohr9nt6pzROzQ6ghdBBXCjVFwzTt07ywqmI6SYy2qlFQf0OE28r0tGfaUG8qdIHVWLwBTWik6JqNJR9FTyz6ABVdtrXJW0o/78ffu05qTXftE4uxatio/QAZVxyOqW03yQHqc5ybXQkbD9Hog7SzudD452HnkK4ips3zWl022X8yRthOBSxAnvQiQ0MGz/gU0iM9WWG0GTjkBFgdsPAZjGs2pHM8XjoPx6eZ5Gt7D+j0HFcInD6DNuVoOMvT/FXxeR+ItPoNV4K57 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)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DB4PR04MB0765; BCL:0; PCL:0; RULEID:; SRVR:DB4PR04MB0765; X-Forefront-PRVS: 0723A02764 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(1496009)(396003)(39860400002)(376002)(136003)(346002)(366004)(199004)(189003)(6512007)(11346002)(476003)(386003)(6506007)(55236004)(956004)(2616005)(5660300001)(44832011)(105586002)(575784001)(68736007)(16526019)(53936002)(446003)(50226002)(316002)(6666003)(5009440100003)(36756003)(16586007)(2351001)(6916009)(106356001)(14444005)(186003)(86362001)(26005)(6486002)(97736004)(305945005)(81166006)(7736002)(8936002)(66066001)(8676002)(478600001)(25786009)(51416003)(486006)(76176011)(3846002)(6116002)(81156014)(48376002)(50466002)(52116002)(2906002)(47776003)(2361001)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB4PR04MB0765; 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; DB4PR04MB0765; 23:IRpJRPB0j7AGO9VwfRTds7C8Nrl0rlDJcHg1+snw4?= =?us-ascii?Q?w+TUuvctqeTfG5XaDvz1LphZzey84hXuAFpr601YuNvoaPe6j+fOPCaOkNa5?= =?us-ascii?Q?HlJMGOE2MM0B3A/mhpFX+oOuOmP0e78XAovkO416hyCGc+m4sa3e78ivGZcp?= =?us-ascii?Q?e4YRgnAi71NwHYs+80AhjNLvrmdve40Tz0/8jvWK7B2mhRf7dBwiiceejnY9?= =?us-ascii?Q?Nt4N2cUzVUfU5MQVmADjTgx8bCgyAz98a1elivgkLqiSc9j81tavaNJ3nUT4?= =?us-ascii?Q?PydtGQrG1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Is+PPvN+2go75z3Ml8ZyLB/p4ZwBVjLAZtZvo5r7ANMchKugfEL2TyaPzclr6ghZXIU7p/9+wdTTvBVB70Q==; 5:u2QVL79+XeBvxGXyYNTMVNujWP9+ZFBK03knCLTYnsJBuzAWokBQ1UUPbTuQtiksdOXsXYd/aHptw5iUmIOayz0ANXHJRD/w4SGRqtmHBMX+aagiMhKt3uTWAa2y81SauPkum/KD/vnfQnrswZZQecTB8QJf5uZNwvglF4fl9oQ=; 24:XCuNRzc9rDwA21ndCQrX+9uLP1JWKxo3s7gszm9ynia2pDQwZdnM4rG8GPwEsXBpiDQRER9x8NlR60Fi21aw4snhI4AqYeIJGDaykLnsZ7Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 7:ZtDctobWtN7ODfH9AUPxL5JV5w8MQtE2qTml8C8wTKrKFxuBEfv0NJEntgo9yulSuCzNmiAjPWjS8EWzMd3XZh8FEVCSAebPA2Xl/Kt6aiRI4AZ1yDXZS6fRXYszPmNd4eowXLkUNCMFwEOc/N00kV5BwY2bXF3wyMwzP/Y3zDhFuyX1dd+9E0C8Lp/jEo9X8lHgnqwxq8rAlzOZcLQ8CYU4lJiAn9rYfWwBj1RxWsQAvo/fs2PoKM6efrEjnt9T X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2018 09:45:40.9989 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1043ac77-1aac-4a5e-1f9e-08d5e192e7e0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR04MB0765 Subject: [dpdk-dev] [PATCH v2 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: Wed, 04 Jul 2018 09:45:43 -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..fcfbb47 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -70,6 +70,8 @@ DPDK_18.02 { dpaa_logtype_eventdev; dpaa_svr_family; + fman_if_get_sg_enable; + fman_if_set_sg; per_lcore_dpaa_io; per_lcore_held_bufs; qm_channel_pool1; -- 2.7.4