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 65F5CA0032; Thu, 1 Sep 2022 14:50:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E3F241155; Thu, 1 Sep 2022 14:50:13 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2065.outbound.protection.outlook.com [40.107.92.65]) by mails.dpdk.org (Postfix) with ESMTP id 8578A41155 for ; Thu, 1 Sep 2022 14:50:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V1PEETnWTmSQV8Fhe19bdMISjUKYdoWp264+HVFFoalqXQPLeB3LV2O2Mn4Lm1wHZkrhCx/d5o/ctOGH0p+FseGAJe+8JEe/gDD1l1hQ1janGpQN8PilLQ4a5HV1YL360/95FrvHtQ45/cGDwipw20ZipLuxHV+jCRuUMNvjEIzHXgamk/QlIz59nlcwMHyOsU9NSz3u2zq6E/SIQMnuWJkwa7JpTw02Ws3Re/8fj2mWKwR0SF79YMR2oQAvAHeN2mHNxn3d7wDGMQi+/Uw8E++95eV41IuS1W6g8ufzdn17SL+uVKNJcSi/7pcgIc9SgKDtNVmtzAHUuhAwf4yjJw== 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=caFPBBcRnSodgdU7gVspnS5w/yhlF68PSAd9qdyrtX4=; b=UAojwBa0bR+j+HCsRd6uan5wExp8ZJGkUsn5IVIWAK9nluo8QerNNmvu8hR/MvIJlc7z51+4sbODl/RCYwCtb+NJ94CBm/f5eAvCbOnua2pumAyHbfGndeUj0cncSZMLlk+Of768WG99Bir5Wrb5H5jdNbQ8XEz8Szr7OsqlkyTOTlyzxrbGG03zwa0WdOs5Q/IkbUiRwYXbNxusuRvvhbfI2OCxRfDHdFRB90SnQfdQE3GSidV1LNAs7IMF0EszmTIlrNCwxxLgUzvF1mHm0kqXlNfXd3x1Lz5WSw8aWf+A28nHG/zhvj0gUxojfTtYMeXeU9cvHZG9isMiLPMhOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=caFPBBcRnSodgdU7gVspnS5w/yhlF68PSAd9qdyrtX4=; b=ImZ3SitWMm7BTh0ih56LZgu/zwzf3W063tvknP1zoNbpuTZGw0NFOakceRqJEqWh5aUgpOAlYjG210bJz5CXPxAIIxRLvvJZoDl6NdC0emzuvUASSw4LabWt5J/eckf8SZRgsY8t/38sYGijEfAi+nwG3aU+Yl21o0GDX8Oe/Y4= Received: from BN9PR03CA0599.namprd03.prod.outlook.com (2603:10b6:408:10d::34) by DS7PR12MB5813.namprd12.prod.outlook.com (2603:10b6:8:75::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Thu, 1 Sep 2022 12:50:10 +0000 Received: from BN8NAM11FT079.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10d:cafe::5e) by BN9PR03CA0599.outlook.office365.com (2603:10b6:408:10d::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10 via Frontend Transport; Thu, 1 Sep 2022 12:50:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT079.mail.protection.outlook.com (10.13.177.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5588.10 via Frontend Transport; Thu, 1 Sep 2022 12:50:09 +0000 Received: from cae-Selwin.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 1 Sep 2022 07:50:07 -0500 From: Bhagyada Modali To: , CC: , Bhagyada Modali Subject: [PATCH v2 2/4] net/axgbe: fix mbuf lengths in scattered Rx Date: Thu, 1 Sep 2022 08:49:46 -0400 Message-ID: <20220901124948.97063-2-bhagyada.modali@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220901124948.97063-1-bhagyada.modali@amd.com> References: <20220901053311.92964-1-bhagyada.modali@amd.com> <20220901124948.97063-1-bhagyada.modali@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0d16d633-7aec-49cf-6f0f-08da8c1880d2 X-MS-TrafficTypeDiagnostic: DS7PR12MB5813:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PrxeYoUzN+EGBbAXTVyNc+nzxDwfVfUqucdAFcf4nqrvOHqgdF0BZnTVDCXQhTeGS8qYRKkLjddILf+YTiRBOrRdNii1XcOIscjFrWrZtlJvmyIhnOKL3qpaILM/LXeVuU1LUo+DRSVtbvMAcquk3ATKuDba1k/56KQgUurukjDHBrd4imIojb4XqtXXhPEMosPYjL1T+e9FVazUW0OdGPOU6PQKznvw5rDTYpBQhkRaALaPSXh+qAvAMJ+49Q1rS9mvGaGxMIAJAkkv1+G32dxdfLG2raqwOGmRIhpI/AiyfUlUBU1M/nRrZWdJ+8zsewGSfkpmwkBBNANkSEsR7yTDXZ1sdMAFjhTqh2YW0F2m0vEL3eniPKBTDWcPwZMlNIFkN7KlHwDeOchP/qtHP5IhiUaOPnDS3NdJ5nGF6/AjCoKdhckbEgA4dNYejOwirkQmwEYhf2b+1eL8jznC3lliSoDRU3qw3LrvVNteFxO/sUgbz0qhjX+1jEvvRXHsJIx+NUv9sT+LsC4vY0KdUPZH6Ucx1NkBY6DLALa2n/3GGKQcfs6veldiejbqFNkpYzHigjVLslAEPfrpcjxwH476yd1OT5y1A7wjn96R5AmL8647FTnKLbmaLmKMa8ksH9AOjmJZjWtqCeWN9moMPCfNm7oEdP4au7tBgYc13F+AiRd8tVSlV6gPvYXnGBu3hIRDsSFWiFFb+lP5pOR25kFNGzAMdmW0o6T05uw+qjEtgZFJMq/usjU3tk4f7x9xHBRQuFlKjKvgYkJN2qvFRlH/huKOZlmYcu/44Wp7TovxU0fJzbP82WDpUFaQpz4UwbJUJkoSFo17Z7H0lyRCzw== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(346002)(136003)(376002)(396003)(36840700001)(46966006)(40470700004)(2906002)(82740400003)(4326008)(8676002)(86362001)(70206006)(16526019)(356005)(316002)(40460700003)(110136005)(26005)(1076003)(336012)(54906003)(6636002)(2616005)(44832011)(186003)(81166007)(70586007)(7696005)(47076005)(426003)(5660300002)(4744005)(82310400005)(36860700001)(478600001)(41300700001)(36756003)(83380400001)(8936002)(40480700001)(6666004)(83323001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2022 12:50:09.4099 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d16d633-7aec-49cf-6f0f-08da8c1880d2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT079.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5813 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 Updated pkt_len and data_len in the last segment of the packet. Fixes: 965b3127d425 ("net/axgbe: support scattered Rx") Signed-off-by: Bhagyada Modali --- drivers/net/axgbe/axgbe_rxtx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index 89ed6fd74a..2c2554e900 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -391,8 +391,8 @@ uint16_t eth_axgbe_recv_scattered_pkts(void *rx_queue, } else { eop = 1; pkt_len = AXGMAC_GET_BITS_LE(desc->write.desc3, - RX_NORMAL_DESC3, PL); - data_len = pkt_len - rxq->crc_len; + RX_NORMAL_DESC3, PL) - rxq->crc_len; + data_len = pkt_len % rxq->buf_size; /* Check for any errors and free mbuf*/ err = AXGMAC_GET_BITS_LE(desc->write.desc3, RX_NORMAL_DESC3, ES); -- 2.25.1