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 B3508A00C2 for ; Fri, 7 Oct 2022 05:28:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED75242B9C; Fri, 7 Oct 2022 05:28:53 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60084.outbound.protection.outlook.com [40.107.6.84]) by mails.dpdk.org (Postfix) with ESMTP id 6AD2F42B99; Fri, 7 Oct 2022 05:28:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k5xzJbKI8NIRwU2JbpT7eR/Vr3auRU1vtr65YZAYiy0LB/2GVv8KxVH+6D5DopDUgM3v0914cAZ2bnHUgE5ZUaNSdP7oS4UDWBPoXgBd1SDgkmT+R5B2jgwJz5hBipDUdB7O+LnCRIwoKQz08jdc1xpi0pD3IGax6o65c09dV8vUZEB0tcAXNtV7sNb3jav8+gJCvEC2WzgpaHdCl0n5kaf7y9jHwxU4XhGEEimRNfqInRR6qwaG+gwgPHt12Do1EXk1WA7doM3+Yyyj5Mtxp+YCXzWWwPvAINT87z/54lHoD/aaNslt8NVeyEUtWiZjd1hWS0iduWhTbzabgorbCA== 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=9cjrQDWwb9ZknpEISAKXKN9f1ig6/RUKPhdivoI/bGo=; b=agZw+aMGzl1U4Fw3gFPEKpA6GYbvCDR8JEpmnsHgnOH/YrIvdIrvrBvQ8lkjN9j00t8j0MFayLeoL9r+1LE099P5l5/DrfSEO4wOtE7NIPdBcTmF2cFO22QcT5lsqItb5auSDAx53M9pWTo1aabVbr+e9bZLyWMrO7dkD/4eLL2836L0Ua0R59ykO27VZte3d+anIvK0yIsXfcQuLY4RefuOJWGOZQtDd7O/xGWgw8Pkc1KI0UnG/n99NZEm4PChvQLkw/tAq7uRpkfzXCRoc45VkAT45l+q0bgtpzQJhoszllRXlWBIeYHjoSKGgbmdFRvhSDKP3LqH3WretOEvxQ== 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=9cjrQDWwb9ZknpEISAKXKN9f1ig6/RUKPhdivoI/bGo=; b=S5PBXr73FyBEVEFV5kSRFhGio++RVOavXkJjxSCcHIh6iGj4HsxVu2lmm1I5RqF+ATSH/RF8VVksFRNYQh/QoZXgqTp1nTKhteY50SMNucup8joB+yBeLR/gHQWvqIY6EKuBsI0E8CVlcCKSOXj2wfrL7YH7z/2Th0bWCAOXfY4= 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 PAXPR04MB9326.eurprd04.prod.outlook.com (2603:10a6:102:2b8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Fri, 7 Oct 2022 03:28:52 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::9ee7:dafa:ba51:c71e]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::9ee7:dafa:ba51:c71e%7]) with mapi id 15.20.5676.032; Fri, 7 Oct 2022 03:28:52 +0000 From: Gagandeep Singh To: ferruh.yigit@amd.com, dev@dpdk.org Cc: Rohit Raj , stable@dpdk.org, Hemant Agrawal Subject: [PATCH v2 10/16] net/dpaa: fix Jumbo packet Rx in case of VSP Date: Fri, 7 Oct 2022 08:57:37 +0530 Message-Id: <20221007032743.2129353-11-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221007032743.2129353-1-g.singh@nxp.com> References: <20220928052516.1279442-1-g.singh@nxp.com> <20221007032743.2129353-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2P153CA0033.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::20) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|PAXPR04MB9326:EE_ X-MS-Office365-Filtering-Correlation-Id: 029dc076-46c3-467e-4932-08daa8140e7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NpAwUmQENAkgE+WTRLs+wmScQYJLnN+h5IcCfcyrJbw+0d9IdgDQZwWTpVHppQpazUvi3LNaZ+L9ANEUqE5Zr2LJckNAdAFSFzAA/QH4yXjf7aCphmYlXI9RsrgZolv043oUAUaVX/inzZ0n/lN9Puo00p5NuOJlI2TmJai6haZgsjhSAFyEigyIaNyKZMzoKsQpHh+V446cb+c4ylHzPHr33xaUQQBxhXK2zMe6OEaMP1j3nxbj4m0AChTHkeZkmbjZyfz0TkXMpkfbhhfXaJI4LhnZqnmtk2EqKBn0XzGZar3A3vaXzI+cutQxE6LNUF+JvaK6uM2eHZ81TyKYkuoJX3Z93wavnVa4s/m51zuhIWVuXmKEWJ6YrZGltqjdwt4zW8Gr0v50Fls0aohU4HqP3vtVEHFHrDJwdJGrPAHliWZ1PL6n1tTr1wtzXc1YhrzD8mPUuJaSS35s2dXTVG8k+Hjom+Z7+kulkHt9UW6x24maLncjYAQit+QnuEteJoXLmM/k6zwrE3dhSIVfTfa4YY5/5C9w2z8790ZkNBvIltz2C0n8tOvxHlb1C/fSPoxrsO/9k62wNMbTQd+tixPz4/mIBeoX4ZmKwmTtMPQUqczSiWOixtH3ufR3xq0FMJ1Ud9/XIogPJqvgA5qiFbh1FH4BCcJNVJx4xjxJmCRB5fECL+3jpMj37V1mpFGlTkeKxE4u8JxQgOd3IGOegBvFcRWSW3OB9g3g537qDdXCBWGM2cIDRlgeTXcFn7vdVHKOoOerBJnI6w8O6jDzNQ== 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)(376002)(136003)(396003)(39860400002)(346002)(366004)(451199015)(2906002)(5660300002)(66946007)(66556008)(66476007)(54906003)(478600001)(8676002)(316002)(86362001)(6486002)(4326008)(41300700001)(6666004)(6506007)(38100700002)(26005)(52116002)(6512007)(38350700002)(83380400001)(8936002)(36756003)(2616005)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?MVOqO1jUL45wQgMCS19J52mU/sp1zICAWWQZKpmmHDprn4m1p9bVwFZQUVxW?= =?us-ascii?Q?GGEueICx8ewghgXRpz9boWw+/r4DxYT5OSG9QXNBftrH8dL6t9lIgy4qGA7M?= =?us-ascii?Q?Y4SanZkaSI36rtri6P/TFpab9C1CRnYFLaytRWgGGgyYvDbhODLPOZG4yQDN?= =?us-ascii?Q?QdsbVpX8SLAVrnNRiWxMiYMM+9/HQqBUcn32qeMsT+yiSkO2U2dL+JHmdFLj?= =?us-ascii?Q?aJTGFLlzoz8SFYDGeV8lHCQrOR/129r3r4cDxKlOOv3+HGS1IZ2m647m01g0?= =?us-ascii?Q?JScXHQCLKmG18u23+Uz1JB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t4aLx44?= =?us-ascii?Q?lLW1cZAegUmgvJl0FRuFbgXRzjgMsuFF8qU6idP/IueSIO6pSVNLHrsVWZF4?= =?us-ascii?Q?/n0om+c1pgt/2+IXZaIKo5TFLS9idtw4Wp4kSqrbCIw2DQqX2RISXiEyVPRj?= =?us-ascii?Q?nliDwgBo9MucoEdyX9LYNWLVqIkHw0IZY15OdGiI01OcgpJSJoZ2C0Xl9ARl?= =?us-ascii?Q?HMe2kt8/oOioe6uM/Z4YmaRHIAtLqk/QzGh9j0AMLx6lNmQ0IzIoOAKJLKYG?= =?us-ascii?Q?0b5gk/d18fi7KL5AjaIfc+mVufBQcW9lGHigAP4ex+fBhXUagReWuJIQNWQu?= =?us-ascii?Q?a/RR9+EBC6NG97+rUAEsDA48nUJcH1piovWYto6Mp+tkY5hRuCUoYMi2/F/j?= =?us-ascii?Q?lsU0Hx4C2F8FuOgRlKOLg0q1HJReLJI6iP8qflV9?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 029dc076-46c3-467e-4932-08daa8140e7f X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2022 03:28:52.4568 (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: LoUrW397oTNsnOMdfRFket3ah16aGzdL6gmqGmJ0hpLetCVqJOuiP7tWj9grFFnS X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9326 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 configuring 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 Acked-by: Hemant Agrawal --- 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 c4aac424b4..3b4d6575c9 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -989,8 +989,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); @@ -1005,7 +1004,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