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 88FA6A00C2 for ; Wed, 28 Sep 2022 07:26:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7E36242BA3; Wed, 28 Sep 2022 07:25:59 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60077.outbound.protection.outlook.com [40.107.6.77]) by mails.dpdk.org (Postfix) with ESMTP id 48DE7427EE; Wed, 28 Sep 2022 07:25:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SbhzCaCOaRknE3VPBO/QoNbQn0EDymkZbuHzvFfAJuVtkNuggkgRmkHmjRGJwEUhx6v15XL9EUtqE927cOLiMbMc0KyR7UAOiqToi33tt84lfM8dCN5MReZtRGkqe93TvC4PWmf1/BhmiDRD8Z/2ngMJ25VzBwmvjF9cLITEECS8OzOhyuU0xWU8zXnHUtCbpb35Yj7MFcwZtl0TnWn9B9fYh1TXrfFjySiGqUVl/R6GnPAZ0E+ePRciCgYteFdSmuGGQOaxgMx6AvCt/ZwzSqRI49LVx7HaoLBXbd6OoaK3SzY5LYm4M75YkU+9haxAomd2sLj0pVVt3iHH3hpziw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=+Ibhu1iVGJjc2vYUg/dcNY30bt6arqIotwxS9xXAip4=; b=doRR84K9nfPYQh7kz1hKpQRF5CFF48N1MDgbBbQ0ZTReeMMu9Ex/V5kUnbUnRnIyquxXdlaWKn1lynOlJZmpBfe1R+EOA3hP4u9aFeRVJKLwMuXgNXjNuDCsM9AV+E9vaboku2aL3XQFsINSy5kEOoVusWyezTUm5ZSdQbDceGI/WV9J2uj3kd6HeM6alCprb10+UB+EEQXV9l+PiF7+gDyY3NxIw5pFT46YEBvoTX3S4mWrpQrQI/bwL9vo21UQ0OlnnmFf3OVYYgo51zHnVCZCEm4dHDZBw/n32usQHIoiWJKy4/kcH9eIl4s9KFBeyQ9nELCp6UNx3HvfpvSO5Q== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+Ibhu1iVGJjc2vYUg/dcNY30bt6arqIotwxS9xXAip4=; b=Ad1KY46nNy14DVN6Lkrvm6bZ3XqxEB4yerejE7CxIA5UtWumdQGmPmSGDugXvg44Gn2gLgKUiCsQ/Yg+eGGEkJvzkXBPuBOICOzMtCCgpZE9tBtVMVGFVVIAj+sZcgIr6pHGd6rd+9JI913hVsqUcx78RoTbuUzTsSqI1/nAOfw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by PA4PR04MB7504.eurprd04.prod.outlook.com (2603:10a6:102:e6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Wed, 28 Sep 2022 05:25:55 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::14d0:4458:d6ec:b8b1]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::14d0:4458:d6ec:b8b1%7]) with mapi id 15.20.5676.017; Wed, 28 Sep 2022 05:25:55 +0000 From: Gagandeep Singh To: ferruh.yigit@amd.com, dev@dpdk.org Cc: Rohit Raj , stable@dpdk.org Subject: [PATCH 10/15] net/dpaa: fix Jumbo packet Rx in case of VSP Date: Wed, 28 Sep 2022 10:55:11 +0530 Message-Id: <20220928052516.1279442-11-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220928052516.1279442-1-g.singh@nxp.com> References: <20220928052516.1279442-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SGBP274CA0015.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::27) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|PA4PR04MB7504:EE_ X-MS-Office365-Filtering-Correlation-Id: a3d34cd7-686f-4923-39e3-08daa111ea9e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ErxZETSA4vrx2R2wFZpXqc0B9d0zikEZ0R9fne7t8FwutCT7RsA8UyXC1+i8YRS8xbRWAAHjTtjJ4EPtLAv3btw9TwoCNRTwEP50UI2XcQp+4mdK8fYmcrSylDsAzWw0kMkRr1TgxFUk58I/mo2o0pqHwh+SNWTaw1L/DsC6tFMskYGkC8YKh6JTb92G0tUMsRQfagbgrNHc2GNQNdB5hxEocSOCDqotmcOsjMiEXrKrfjWGtawYcxbIhaAg297U9HwlDmpgFbTVxwU4dlwtSiMCV4a7PbAY2g2jVzizc/6xTUoTsfn5B6KL+6fQPCiLGWySU15mYQjEpvCmmVX/KlWGZURHQEQCIhuEAQlIKhFIGKs0u/l1y5ywYUZ90EZGY2A8FT6DBawwxqL+2YG+yZePImJNrsfa2QOM7/OeoTvftAUGVh+PjRW9G72NwV4XrsgnP2gYKrmJSEdXN4Cnzrk/tLP0wlifHUS0S6eDK8MoLIygkbXAk55iIQASDupZiRxFWr3zAE444o3+MlpErKbWnxqJKTFqESzjyJGkUbzefOSgmBZlbxswLLJj5Jt6M5gR4Xrq0DBqHOFQmKq9Vmg+8NHUjvcsvSwMgmsOY62uXla2abifE0eEVaVY/Y/ju6jyrDYZ7JzDkhjBXOUqQlPRKmCiRDbuwVp+jUTKl6IrZPllV+7ozR+YIhiaPWIdZbRu5Wl1GKzAcBhbRtgRULMhOxOTc+lSrGWroPzotlFI36Xxxwa91xY3sJjsaWcQLrhFnCHOuGm+PY9cO5BWCA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(366004)(376002)(396003)(136003)(39860400002)(451199015)(1076003)(186003)(2616005)(8676002)(83380400001)(38350700002)(8936002)(6506007)(38100700002)(26005)(86362001)(6512007)(6666004)(2906002)(5660300002)(52116002)(478600001)(66556008)(66476007)(66946007)(316002)(36756003)(41300700001)(4326008)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HyT7B3vcu6JG4WCTy5eCY2FjcCrQX0Sy9So2r2BuZEjUoUWwp4knY3jKOuhu?= =?us-ascii?Q?exErq6BHv9iWcqz2LVdU+bIFeq9fjQ2zJfqxE6/ox1c12VLHffzy0he1z1e3?= =?us-ascii?Q?R7qBww4/MwImSHYem9zAS/ndl6WSGgVzwYG7ye/ux69gBBS65gmKiVKYDyYN?= =?us-ascii?Q?RLigKd8JCQlqsjEmuG+9NqSKoIn1jlKbDrM+4TVt+eA29kdkDf/mJGNFaT+3?= =?us-ascii?Q?NlJ6qD29jxbRl0+f4TGsML4o6n+KTbP7lHjkTWTKS6qVBPEDxEDYCAU3O7Rq?= =?us-ascii?Q?WkK2JmGYDGfwr7piJCtkR2CM1PUs6brFRoO/DECuT6E9B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pzw+fdVAnF22VCpc8cGNFrBLyu4U8SPE+8s9MApfqf?= =?us-ascii?Q?MRiWAx2rZD2ipUL/xNo1fff7ZagfJUJA6ofNjC+gXyiq2AOfhZMSVZEUEw7s?= =?us-ascii?Q?XCEPBFd5okpF4ZFgd6j/84JTXRAcdxtChxKSUQ7UARk9QkzTcwyj4/8Zd4Ez?= =?us-ascii?Q?HpYNIOHZxnA+p29h7jZja4ql1mbVoJaqAGEYMNfgCSRByZWR0ctfGzT+GS1c?= =?us-ascii?Q?CsdLPwc8v2+wZ/tT0r2F7y/TYm7rUNx6mB4FrWvBdKntY8F44Wl8ZGeo9AI/?= =?us-ascii?Q?hDp+dGo+yPOGh45sF372/TXmpEbXHNJnpFJiwKwg4PqqPJGm67OOIxlNFtCk?= =?us-ascii?Q?XgSP30MJLIFfzN5V5yDwmBLG72Swrs195sFoE8y1?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3d34cd7-686f-4923-39e3-08daa111ea9e X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2022 05:25:55.3005 (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: TSnmgqZPmKmBqAy8IC+ON87gKqrNhEZWPjGlgiqym9zRuuUrt1wTLi+MDsvQz22+ X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7504 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Rohit Raj For packet length of size more than 2K bytes, segmented packets were being received in DPDK even if mbuf size was greater than packet length. This is due to the configuration in VSP. This patch fixes the issue by configurating the VSP according to the mbuf size configured during mempool configuration. Fixes: e4abd4ff183c ("net/dpaa: support virtual storage profile") Cc: stable@dpdk.org Signed-off-by: Rohit Raj --- drivers/net/dpaa/dpaa_ethdev.c | 5 ++--- drivers/net/dpaa/dpaa_flow.c | 13 ++++++------- drivers/net/dpaa/dpaa_flow.h | 5 +++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index abcb1bc9ec..9b281ba8cb 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -988,8 +988,7 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, } else { DPAA_PMD_WARN("The requested maximum Rx packet size (%u) is" " larger than a single mbuf (%u) and scattered" - " mode has not been requested", - max_rx_pktlen, buffsz - RTE_PKTMBUF_HEADROOM); + " mode has not been requested", max_rx_pktlen, buffsz); } dpaa_intf->bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp); @@ -1004,7 +1003,7 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, if (vsp_id >= 0) { ret = dpaa_port_vsp_update(dpaa_intf, fmc_q, vsp_id, DPAA_MEMPOOL_TO_POOL_INFO(mp)->bpid, - fif); + fif, buffsz + RTE_PKTMBUF_HEADROOM); if (ret) { DPAA_PMD_ERR("dpaa_port_vsp_update failed"); return ret; diff --git a/drivers/net/dpaa/dpaa_flow.c b/drivers/net/dpaa/dpaa_flow.c index 1ccd036027..690ba6bcb3 100644 --- a/drivers/net/dpaa/dpaa_flow.c +++ b/drivers/net/dpaa/dpaa_flow.c @@ -939,7 +939,7 @@ int dpaa_fm_term(void) static int dpaa_port_vsp_configure(struct dpaa_if *dpaa_intf, uint8_t vsp_id, t_handle fman_handle, - struct fman_if *fif) + struct fman_if *fif, u32 mbuf_data_room_size) { t_fm_vsp_params vsp_params; t_fm_buffer_prefix_content buf_prefix_cont; @@ -976,10 +976,8 @@ static int dpaa_port_vsp_configure(struct dpaa_if *dpaa_intf, return -1; } vsp_params.ext_buf_pools.num_of_pools_used = 1; - vsp_params.ext_buf_pools.ext_buf_pool[0].id = - dpaa_intf->vsp_bpid[vsp_id]; - vsp_params.ext_buf_pools.ext_buf_pool[0].size = - RTE_MBUF_DEFAULT_BUF_SIZE; + vsp_params.ext_buf_pools.ext_buf_pool[0].id = dpaa_intf->vsp_bpid[vsp_id]; + vsp_params.ext_buf_pools.ext_buf_pool[0].size = mbuf_data_room_size; dpaa_intf->vsp_handle[vsp_id] = fm_vsp_config(&vsp_params); if (!dpaa_intf->vsp_handle[vsp_id]) { @@ -1023,7 +1021,7 @@ static int dpaa_port_vsp_configure(struct dpaa_if *dpaa_intf, int dpaa_port_vsp_update(struct dpaa_if *dpaa_intf, bool fmc_mode, uint8_t vsp_id, uint32_t bpid, - struct fman_if *fif) + struct fman_if *fif, u32 mbuf_data_room_size) { int ret = 0; t_handle fman_handle; @@ -1054,7 +1052,8 @@ int dpaa_port_vsp_update(struct dpaa_if *dpaa_intf, dpaa_intf->vsp_bpid[vsp_id] = bpid; - return dpaa_port_vsp_configure(dpaa_intf, vsp_id, fman_handle, fif); + return dpaa_port_vsp_configure(dpaa_intf, vsp_id, fman_handle, fif, + mbuf_data_room_size); } int dpaa_port_vsp_cleanup(struct dpaa_if *dpaa_intf, struct fman_if *fif) diff --git a/drivers/net/dpaa/dpaa_flow.h b/drivers/net/dpaa/dpaa_flow.h index f5e131acfa..4742b8dd0a 100644 --- a/drivers/net/dpaa/dpaa_flow.h +++ b/drivers/net/dpaa/dpaa_flow.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2017,2019 NXP + * Copyright 2017,2019,2022 NXP */ #ifndef __DPAA_FLOW_H__ @@ -11,7 +11,8 @@ int dpaa_fm_config(struct rte_eth_dev *dev, uint64_t req_dist_set); int dpaa_fm_deconfig(struct dpaa_if *dpaa_intf, struct fman_if *fif); void dpaa_write_fm_config_to_file(void); int dpaa_port_vsp_update(struct dpaa_if *dpaa_intf, - bool fmc_mode, uint8_t vsp_id, uint32_t bpid, struct fman_if *fif); + bool fmc_mode, uint8_t vsp_id, uint32_t bpid, struct fman_if *fif, + u32 mbuf_data_room_size); int dpaa_port_vsp_cleanup(struct dpaa_if *dpaa_intf, struct fman_if *fif); int dpaa_port_fmc_init(struct fman_if *fif, uint32_t *fqids, int8_t *vspids, int max_nb_rxq); -- 2.25.1