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 5D976A0C3F for ; Sat, 19 Jun 2021 17:40:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4872C41109; Sat, 19 Jun 2021 17:40:34 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2073.outbound.protection.outlook.com [40.107.237.73]) by mails.dpdk.org (Postfix) with ESMTP id B40184003F; Sat, 19 Jun 2021 17:40:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bxlIhRxM/dXWXcZxSG7w0K7hJRHCn0NylWmHhbcxKHnA4CWUoZ+NjkgDuJdQY6CP2tGr2ns6ApcLAYefLugFje7Z8SJt4LKmn74CJxMRlSHSZg7ZZLQRzuHEUSF3pLdtoZvscdGdNm3UkRsAtsb3sUbeBPYyKt25J1ScXaXH65UvTSCzu0JfqFrqnu4CADLdMx8l4HzuX9bJUNMuQkGJ88KdwIo9xnhEMVxQ9hikG5vRIkGGhEQg/srZSIANGpR2GWBo/4/YV4AornNjbD3M+kFu0wQbGM5fL15LfeFXiII0OymuGGvtFYSGmbqrAU2qUtL9rM8uRl1XTaMqiNOiXg== 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-SenderADCheck; bh=wx+qUDfNaPEi/Z7NN0+2EZyhAkHlv9SYoPc4OJhNV5g=; b=KJDIApKqZyfbdTMIASQIuTmsDJVnp79jvdcvabNA3+Oa1RNFrMQii37TENAYRJxq6jNRs2oaE/ePCD73Z/BrZNLjJPuNd9UZGeOKYtFLZAMxxff5eQSjjoXqIpi1HdUQtkLSEFv/CSk8SNuf4aOSSQFgI7J/vMpfApQ6CCSJFd/pYzaJRxA6awotFviH4EwfkhxX/jKYaaxCE7+Ys/UxioFrUWiclxWcQ+Ta6RqdRzcweAfZgbdBmUrIDy1Ayw0yVI3rmJcQaC8NZIMFnqq66sUXSwn+HUKbrVu1LJ/q6T0vyvQk8J1zAYElOsHNwdwsCKlIy2qrBFPSOm8IqmK4bg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wx+qUDfNaPEi/Z7NN0+2EZyhAkHlv9SYoPc4OJhNV5g=; b=NuZYUXb49183qtVtkE8IWPGORwSIWeWprwTB3S/QMqObP3hGEnxLejfrCvv5jBLY9ttqjQDqoDV4g+BmdVje2WopxprS4IOgWg0sv68zzLkvhVB+T0ynF/Vc28ZKAGdCWWzWcTcQccq18seQgAh/cLKBnqyg+A1iz0aGT0oJV5PoMFfN2vfXlI+HmCl3m/0vaPhCtWQatFHfWkwGyfeaVXeU7e0Rfg7mJIphHySuzEA6ptJZvVtd8f6O4yvJnQ6FZ2Eu74tTorwI8A1LPWD6ywbYMal4N46v/rT84I69Yy3EeEJAicafSw/GKWb2s02Ml22FogZxoqVOJSnpbUCwPg== Received: from BN9PR03CA0500.namprd03.prod.outlook.com (2603:10b6:408:130::25) by MWHPR1201MB2477.namprd12.prod.outlook.com (2603:10b6:300:e6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.18; Sat, 19 Jun 2021 15:40:29 +0000 Received: from BN8NAM11FT061.eop-nam11.prod.protection.outlook.com (2603:10b6:408:130:cafe::f0) by BN9PR03CA0500.outlook.office365.com (2603:10b6:408:130::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.21 via Frontend Transport; Sat, 19 Jun 2021 15:40:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT061.mail.protection.outlook.com (10.13.177.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4242.16 via Frontend Transport; Sat, 19 Jun 2021 15:40:29 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 19 Jun 2021 15:40:27 +0000 From: Viacheslav Ovsiienko To: CC: Date: Sat, 19 Jun 2021 18:40:12 +0300 Message-ID: <20210619154012.27295-1-viacheslavo@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aae8bca4-44fd-4f8f-1698-08d9333890fc X-MS-TrafficTypeDiagnostic: MWHPR1201MB2477: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8gILxU8Ffubs1Unk1FhyMJzt60hsOp+8Fp37X2Ho8MlxAZm0uPBdUFXuSB/PmXYeejlJ9w+GVrz5AwlS5mXGMYwT/oKHT/9eSjIdeNjs2asfxUUkqAAxUI6x3223jdwQ0Go67a4TN3yJLWOKR3PQ7fwPM4d5yb48U2FL/CQWpkwcIfiiMDOqyMjK9e49NIxo82KIMqTdxOhPlR1eh02Dw+emjvuhBl7Zg2nPSwMNk7O3gHNPok4iMTI/xCdcOkurkQeclhvA1usMV3E0oeS4GwOCatLHiajxKBmp6UCHrsTZmtR5mFHeH59FwHrtjJToAazxA5w8GOuDSwB2dOVY4quZFsNEL50ZyOGPEi4/sT+JbAx14DtS9vNcnxy9+V42NnRbotXoO1SNYsS0HGGgSZC5md1v8gFlOFP3M61OZO2kKFL8TLAA6rf8f2OetzvKMKpm7MRE/CrPWrXMkI9JofztSlNp9hPYJH8Z9Eg5Dw//wSq4kIVPGIiXGFhIJoeKHQDgH40+1QwvQ0/yTUBXMU8WYmTkxAQWf9DHCox+LJIiAvwo2BE55Ri1G645aOsEoMFQ8ti1WtVOg66ozPfSWnMwBLcW0kGJZnyAvVxqeBl7tURX9PFOnTRQ816sAjEvkEXkeROE2+2nx9U5mZJFCr+KDAV+RysVWqYklUNC06E= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(346002)(376002)(39860400002)(396003)(136003)(36840700001)(46966006)(7696005)(36756003)(36906005)(426003)(55016002)(82310400003)(186003)(70586007)(336012)(6916009)(6666004)(4326008)(82740400003)(316002)(47076005)(8676002)(26005)(2616005)(36860700001)(86362001)(7636003)(450100002)(8936002)(70206006)(2906002)(83380400001)(16526019)(1076003)(5660300002)(6286002)(478600001)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2021 15:40:29.1412 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aae8bca4-44fd-4f8f-1698-08d9333890fc X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT061.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB2477 Subject: [dpdk-stable] [PATCH] app/testpmd: fix offloads for the newly attached port 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 Sender: "stable" For the newly attached ports (with "port attach" command) the default offloads settings, configured from application command line, were not applied, causing port start failure following the attach. For example, if scattering offload was configured in command line and rxpkts was configured for multiple segments, the newly attached port start was failed due to missing scattering offload enable in the new port settings. The missing code to apply the offloads to the new device and its queues is added. Cc: stable@dpdk.org Fixes: c9cce42876f5 ("ethdev: remove deprecated attach/detach functions") Signed-off-by: Viacheslav Ovsiienko --- app/test-pmd/testpmd.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 8ed1b97dec..b4ec182423 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1599,6 +1599,7 @@ reconfig(portid_t new_port_id, unsigned socket_id) { struct rte_port *port; int ret; + int i; /* Reconfiguration of Ethernet ports. */ port = &ports[new_port_id]; @@ -1611,7 +1612,38 @@ reconfig(portid_t new_port_id, unsigned socket_id) port->need_reconfig = 1; port->need_reconfig_queues = 1; port->socket_id = socket_id; + port->tx_metadata = 0; + + /* Apply default TxRx configuration to the port */ + port->dev_conf.txmode = tx_mode; + port->dev_conf.rxmode = rx_mode; + + if (!(port->dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)) + port->dev_conf.txmode.offloads &= + ~DEV_TX_OFFLOAD_MBUF_FAST_FREE; + + /* Apply Rx offloads configuration */ + for (i = 0; i < port->dev_info.max_rx_queues; i++) + port->rx_conf[i].offloads = port->dev_conf.rxmode.offloads; + /* Apply Tx offloads configuration */ + for (i = 0; i < port->dev_info.max_tx_queues; i++) + port->tx_conf[i].offloads = port->dev_conf.txmode.offloads; + + /* Check for maximum number of segments per MTU. Accordingly + * update the mbuf data size. + */ + if (port->dev_info.rx_desc_lim.nb_mtu_seg_max != UINT16_MAX && + port->dev_info.rx_desc_lim.nb_mtu_seg_max != 0) { + uint16_t data_size = rx_mode.max_rx_pkt_len / + port->dev_info.rx_desc_lim.nb_mtu_seg_max; + if ((data_size + RTE_PKTMBUF_HEADROOM) > mbuf_data_size[0]) { + mbuf_data_size[0] = data_size + RTE_PKTMBUF_HEADROOM; + TESTPMD_LOG(WARNING, + "Adjusted mbuf size of the first segment %hu\n", + mbuf_data_size[0]); + } + } init_port_config(); } -- 2.18.1