From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 08B7F4574A; Tue, 6 Aug 2024 12:28:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D23542DC1; Tue, 6 Aug 2024 12:27:59 +0200 (CEST) Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011018.outbound.protection.outlook.com [52.101.65.18]) by mails.dpdk.org (Postfix) with ESMTP id 0BE6542DB4 for ; Tue, 6 Aug 2024 12:27:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dFjLx3tGNSzB1nb7SU9BHJbsZ0DP0bgsE7sH02L7Xl9XVpYhrrLg3rNzSH4kOPnvW7F+Si9u2+oeQ44hLDpfKwk4aGY6/kVMbMxknHYON5kn8iVOI7ei44XTvuubA2zpoc9w3Z+t82eUDL+ym0QHPH95GQFOl4vfYZKPQG3NTMnGLeMtVzAb1/lhQM4Lt1EvDa8UKHuMXAGwZeD57qxVmFOkf2kkI9UCLcYAusO1PSumiAlJZYSksEm6TMzJefTlrQ9EO8fTSu1KPZsGsRtBaYnB5h8KzK7wH5J7aFS/1nrty2O4ibuVOOaFeLOA5pf1u9LxWhBiR8pNgb/8r5KtiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xGiK7sT5uYpQkq/r62awx7p8eU5X0pEBgtHxPeFC6tA=; b=JKTHg+gej2eZHgHM41qAlR3ycPnH2xhHlI+2EJ6H+HBU4DyLfySmoG8HTuQwEa9aCimx2tRo4gfrzxitKPlaybzZLndTPhPK3ErXmeKx1EeNlI67GNeloB2tYDd/GwYDmwp3QVfuXqQJh/MBLwpOZy8H6BOWYYwHcUy3iJqyyDmkNEv2r5YWQ9Lqemr2RW6sZwPyTHPRTIqns5lPNr3suf4cSCD54zJgk0HaV+NqMxHPU/UqOSDgAH+6bQrwgGxXiG/Lh1TSNHK5xewUstgOCWvGKkRRu7MKxMDRTygykb0Hkf1j4LEiCCBs30lQIYPcufhYzw0DmB1xWUXLLcPsOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none 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=xGiK7sT5uYpQkq/r62awx7p8eU5X0pEBgtHxPeFC6tA=; b=C0+9LZP7QyFbeZvjCiKi10URU2iYhlteRm7czjXG7UeJ153mux+uBHGikktOIwogyTdw3rkTyRbDH6wIBkzR6AIE8mPwuiNr5R6ZgSdTSAyYKQ77c/syzIJ4qpXlhKq8hebip8HOXJ2ri+FC33x4yEMwHVOuIvM0Te5GI4K6H1Lz3nMLkZeDBCIc5ee/uXhAt8YIAFpjMKZ/sGFrFTfiwbjvhQoak4YToj8xK63L70iumohFHgXbx/aIbgkxFH4d17EM2Vv939l4xXuyfoXfNaZ023X74ol0LYiTDhjgcfhqrxkXn4Qt8RJ3Bi5aXQr3ImB18B1XbW6Xjyxji6k0yg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) by VI1PR04MB6974.eurprd04.prod.outlook.com (2603:10a6:803:133::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug 2024 10:27:55 +0000 Received: from AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325]) by AS8SPR01MB0024.eurprd04.prod.outlook.com ([fe80::c634:479e:8f8a:a325%7]) with mapi id 15.20.7828.023; Tue, 6 Aug 2024 10:27:55 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Jun Yang Subject: [v2 3/7] net/dpaa2: support FLC stashing API Date: Tue, 6 Aug 2024 15:57:28 +0530 Message-Id: <20240806102732.3225536-4-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240806102732.3225536-1-g.singh@nxp.com> References: <20240806084136.3212615-1-g.singh@nxp.com> <20240806102732.3225536-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR04CA0188.apcprd04.prod.outlook.com (2603:1096:4:14::26) To AS8SPR01MB0024.eurprd04.prod.outlook.com (2603:10a6:20b:3d0::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8SPR01MB0024:EE_|VI1PR04MB6974:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a3d6f40-1f67-41f3-d784-08dcb6026f2a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?EWFfp+fYjytecJGQviSW60fbN7NFihf/Pvf5iVBADhIPhb3HeFUn0+fNhEe/?= =?us-ascii?Q?Gfg58FmUr3dKfAjffGdtG8qjbUL1vF4KA25JNuo6sHchQkM5UZkepVtGDYAV?= =?us-ascii?Q?B+i/Jis/2yWlTn7urntMJysYiXzEUOW5hEzQDDXTgCIJ33jXCYXPqBqXxpFN?= =?us-ascii?Q?HrrnKL9At+wdwUifwbowkFb05iTf/9xpeL93RTGMD/hjTggHX9iQB9Gl8Qps?= =?us-ascii?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5V6aA?= =?us-ascii?Q?5DRH8/GUia1P+q+G+INrlTsWkaZ6uJfk5ST2U7lqcPd5ulAjss1fJC6LygtW?= =?us-ascii?Q?rpAzxSwkFNHQMCxGMdPT5B4/8JLt05kHZ/Ueq64xC0OrRZnz82x3GyVmYmQu?= =?us-ascii?Q?1Z/kVimrpYc4iq0glc/A6tBiKoDxWWCgrgsw2ujeg92NXAsrmo9HVmHYDrF9?= =?us-ascii?Q?7mdZp0mtJTiGxiUwtJTEg81BSU002J74PwaBfSniAveLsSIGtqAKGudZaKI4?= =?us-ascii?Q?ijUMKcbaRKqYmZmNRE2uX72Bn2grF0oRYWv/4Vb8y0ryH7K1/Q=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8SPR01MB0024.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(376014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HjBuDvW5HV7fUI3OrQ1G8FgGuIzcN9waP5Ta434U9AbieW3ZTMBttXVSVFdZ?= =?us-ascii?Q?Kws5FwqO8umL1Soa90FCsHC3McB9btwiWCV/JyWSOFIRf9JupkOiwOE3fI0s?= =?us-ascii?Q?ysuGa5t15CXvfa+g3bgQds06X77BNhSOqv8zNjSp+se2uDcBxAOR6aQDhhf4?= =?us-ascii?Q?HFk2CArbT8NVwwFSOJ71fzuc07Cz9ARsRjwwgxvGLEAPpWyfHoLEPIxpz+W6?= =?us-ascii?Q?Sw33d1Sx5BDFj57wzldl8YfvnD35La/QYVzEOo8ox3wC+szv8onTdpdX6o8Z?= =?us-ascii?Q?TYQUKeE4MuVajE+kVcOTY6P8PPDTR6o3N9S5r7K8gZmA4kDP5fSan90uSZab?= =?us-ascii?Q?LfBqNuNA4YO/Vg299c87HDDziQ6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?0R31hOhv8sA6PAx+gwGwHJ90IgiXE3ggK82Suo3UwRqWB+o60VhLUVRzq4Zw?= =?us-ascii?Q?JhUhlri19BNcus2/XB85qCuz2dJthaJ7cAoMDHXAhVlv0zk4zLQZJL0Rqne/?= =?us-ascii?Q?jMwi3QPGZrG1N7liMC330teep/VZ87mY06pR1rNl6GpAooofkBKTBh7oKYPV?= =?us-ascii?Q?80NYb032PTOlPNEmCLIWw/zBVIGJ50KVgywMEsKL4dURaVVyJkkeLys7yrf+?= =?us-ascii?Q?noLf7pkYTeRk+d9hYUBI3FaxPg1xjX9fxqgQP++TtbFr2zerKwqS2Wmo73Z1?= =?us-ascii?Q?MMOF6jSHEegjVhvgog9Cj5F+yJi1DOoNcMGCsxXA?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a3d6f40-1f67-41f3-d784-08dcb6026f2a X-MS-Exchange-CrossTenant-AuthSource: AS8SPR01MB0024.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 10:27:55.3120 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: h7SOg3deY2P6AwxYBw8QYsTaXdzySG199v0RfoHEMFUwrGzoIuj7qvMgyjvvuQeE X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6974 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jun Yang Configure flow steering action with FLC enabled to align stashing setting with RSS configuration. Signed-off-by: Jun Yang Acked-by: Hemant Agrawal --- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 44 +++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_ethdev.c | 25 +++++++------- 2 files changed, 58 insertions(+), 11 deletions(-) diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 169c7917ea..4c30e6db18 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -179,6 +179,7 @@ struct __rte_cache_aligned dpaa2_queue { uint16_t resv; uint64_t offloads; uint64_t lpbk_cntx; + uint8_t data_stashing_off; }; struct swp_active_dqs { @@ -463,6 +464,49 @@ struct qbman_result *get_swp_active_dqs(uint16_t dpio_index) return rte_global_active_dqs_list[dpio_index].global_active_dqs; } +/* 00 00 00 - last 6 bit represent data, annotation, + * context stashing setting 01 01 00 (0x14) + * (in following order ->DS AS CS) + * to enable 1 line data, 1 line annotation. + * For LX2, this setting should be 01 00 00 (0x10) + */ +#define DPAA2_FLC_STASHING_MAX_BIT_SIZE 2 +#define DPAA2_FLC_STASHING_MAX_CACHE_LINE \ + ((1ULL << DPAA2_FLC_STASHING_MAX_BIT_SIZE) - 1) + +enum dpaa2_flc_stashing_type { + DPAA2_FLC_CNTX_STASHING = 0, + DPAA2_FLC_ANNO_STASHING = + DPAA2_FLC_CNTX_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE, + DPAA2_FLC_DATA_STASHING = + DPAA2_FLC_ANNO_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE, + DPAA2_FLC_END_STASHING = + DPAA2_FLC_DATA_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE +}; + +#define DPAA2_STASHING_ALIGN_SIZE (1 << DPAA2_FLC_END_STASHING) + +static inline void +dpaa2_flc_stashing_set(enum dpaa2_flc_stashing_type type, + uint8_t cache_line, uint64_t *flc) +{ + RTE_ASSERT(cache_line <= DPAA2_FLC_STASHING_MAX_CACHE_LINE); + RTE_ASSERT(type == DPAA2_FLC_CNTX_STASHING || + type == DPAA2_FLC_ANNO_STASHING || + type == DPAA2_FLC_DATA_STASHING); + + (*flc) &= ~(DPAA2_FLC_STASHING_MAX_CACHE_LINE << type); + (*flc) |= (cache_line << type); +} + +static inline void +dpaa2_flc_stashing_clear_all(uint64_t *flc) +{ + dpaa2_flc_stashing_set(DPAA2_FLC_CNTX_STASHING, 0, flc); + dpaa2_flc_stashing_set(DPAA2_FLC_ANNO_STASHING, 0, flc); + dpaa2_flc_stashing_set(DPAA2_FLC_DATA_STASHING, 0, flc); +} + static inline void set_swp_active_dqs(uint16_t dpio_index, struct qbman_result *dqs) { diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 449bbda7ca..726bc0cf3e 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -786,17 +786,20 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, if ((dpaa2_svr_family & 0xffff0000) != SVR_LS2080A) { options |= DPNI_QUEUE_OPT_FLC; cfg.flc.stash_control = true; - cfg.flc.value &= 0xFFFFFFFFFFFFFFC0; - /* 00 00 00 - last 6 bit represent annotation, context stashing, - * data stashing setting 01 01 00 (0x14) - * (in following order ->DS AS CS) - * to enable 1 line data, 1 line annotation. - * For LX2, this setting should be 01 00 00 (0x10) - */ - if ((dpaa2_svr_family & 0xffff0000) == SVR_LX2160A) - cfg.flc.value |= 0x10; - else - cfg.flc.value |= 0x14; + dpaa2_flc_stashing_clear_all(&cfg.flc.value); + if (getenv("DPAA2_DATA_STASHING_OFF")) { + dpaa2_flc_stashing_set(DPAA2_FLC_DATA_STASHING, 0, + &cfg.flc.value); + dpaa2_q->data_stashing_off = 1; + } else { + dpaa2_flc_stashing_set(DPAA2_FLC_DATA_STASHING, 1, + &cfg.flc.value); + dpaa2_q->data_stashing_off = 0; + } + if ((dpaa2_svr_family & 0xffff0000) != SVR_LX2160A) { + dpaa2_flc_stashing_set(DPAA2_FLC_ANNO_STASHING, 1, + &cfg.flc.value); + } } ret = dpni_set_queue(dpni, CMD_PRI_LOW, priv->token, DPNI_QUEUE_RX, dpaa2_q->tc_index, flow_id, options, &cfg); -- 2.25.1