From patchwork Fri Feb 4 22:45:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haiyang Zhang X-Patchwork-Id: 12735783 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCE72C4332F for ; Fri, 4 Feb 2022 22:46:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352889AbiBDWq6 (ORCPT ); Fri, 4 Feb 2022 17:46:58 -0500 Received: from mail-eus2azon11021015.outbound.protection.outlook.com ([52.101.57.15]:22676 "EHLO na01-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1352975AbiBDWq4 (ORCPT ); Fri, 4 Feb 2022 17:46:56 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IHIsAis+JhmOmsmPEnf6jN0Ejb1GOtmreyOlZdghohZ/rkwyfeMkElS6kazdk5R6+6S1+aA5/q0jQgxtYOw7gf6ZPpozHbHuxQVMlTGFayM5y0PIAhR4I5FF0G750qO2EndJZBdkB2nswTCwsEKdC7K/1JWy5KpqPnJHxCiegLSCBHGkDxx2a0FvTv38g9bilFtXTAR5pu4icUVWYeSamz8gjmyvWtfdBj3yF1mbJS2YqBFtXklB9azYZF5m3/cyXOWvcZsXMrFeoKmvZKm7lL3D86Ihv4zS+IqQRPfZ1V/k4za+Pt+JTaZKrS2J8KD2/3n05aN3KKsZGQqmd+BFHg== 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=tbBUNOLD7BMOfYDtPZBbnS+3wEL/rvXJ2wjDVFCzebc=; b=cwsdlefNetPKQujUBJo2jIwKg24ehutdKpIbcsm0BBqpGNZaGeWGz4MrS3JozrRG51/ZiZZvfAXcSJHIV/IMAIEJ4vUmwiwjRr2wD6j7tdFnH7uwngYWNmdv3jxAszyx6veuf4s1mte0/XMJhScva+9csFNewnE5Frolotz1fXyV5+5ZiQ/zgWM1+UcNV6FEpr1LnGxawAHumum6Vw671ZG6gkcEdU++gOvgLwdWfKf3lhPOtadY35qSszT1JjpBTo7R+PkrJsIFQtqQySLD8csdvYHmqnWagf6K6uxeyliUHvFBzFzg6ZPx4hn4wZK5ziWFA0aXEyAzDNA5WIQMtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tbBUNOLD7BMOfYDtPZBbnS+3wEL/rvXJ2wjDVFCzebc=; b=UTWmOIdrzsxaEyIeB92LoIIACkyThZ8rFBWJQsDycrDW7QsjKxAUbliusklACSxLb0C+yhSflAW6BCLOM7cxxSEoIs671VW428VuGthv/OeGQqZ2vmlVyPzq5ib5GsYXV3iERec01wfJtLow5C8pcCv66l3Eg+DpczKRlQz85X4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; Received: from DM6PR21MB1340.namprd21.prod.outlook.com (2603:10b6:5:175::19) by BN8PR21MB1155.namprd21.prod.outlook.com (2603:10b6:408:73::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.8; Fri, 4 Feb 2022 22:46:51 +0000 Received: from DM6PR21MB1340.namprd21.prod.outlook.com ([fe80::1d9b:cd14:e6bb:43fd]) by DM6PR21MB1340.namprd21.prod.outlook.com ([fe80::1d9b:cd14:e6bb:43fd%8]) with mapi id 15.20.4975.005; Fri, 4 Feb 2022 22:46:51 +0000 From: Haiyang Zhang To: linux-hyperv@vger.kernel.org, netdev@vger.kernel.org Cc: haiyangz@microsoft.com, decui@microsoft.com, kys@microsoft.com, sthemmin@microsoft.com, paulros@microsoft.com, shacharr@microsoft.com, olaf@aepfle.de, vkuznets@redhat.com, davem@davemloft.net, linux-kernel@vger.kernel.org Subject: [PATCH net-next, 1/2] net: mana: Add handling of CQE_RX_TRUNCATED Date: Fri, 4 Feb 2022 14:45:44 -0800 Message-Id: <1644014745-22261-2-git-send-email-haiyangz@microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1644014745-22261-1-git-send-email-haiyangz@microsoft.com> References: <1644014745-22261-1-git-send-email-haiyangz@microsoft.com> X-ClientProxiedBy: MW3PR06CA0018.namprd06.prod.outlook.com (2603:10b6:303:2a::23) To DM6PR21MB1340.namprd21.prod.outlook.com (2603:10b6:5:175::19) MIME-Version: 1.0 Sender: LKML haiyangz X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 852d9192-8f68-4c68-30c4-08d9e8303bf6 X-MS-TrafficTypeDiagnostic: BN8PR21MB1155:EE_ X-LD-Processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr X-MS-Exchange-AtpMessageProperties: SA|SL X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XELMGnA0u+dy3KjHegRLHuvx3tsZMEpgd3pi3psViVkHiEnCe8JFhpk6tGee9SpJRvH8H5dBz4q8533z7UhT7rtlEOaBYZ/UyM4jcuyBTEpw9Byy++Ur6AG8v1UVxZVOM+yxyi2Nt5zXSdqIsylleDrXzdquq0z8NSppwTZ/YtRKVUxJ4rvfYWq6NYVj/G5JXSChTPbDPzyzq4dZ2isiEJgicjA1hcmqsoO754VJNfWLMgifh10A1sLqLQj1skma6MT/epXAu8xSkGJMnl1BlMcuty1hK8CyKq1ey6X9reJ+CnalMgN7a3Qlja04uV+VeimMBq49OIH6XNXVB8Log7DiJ+unlhJTuFkNka4CsoWQvu12J7qypkNTjFidAHLxdGZQ4r4bX8h0zCviXbXF8I/k6RhhEj1JpmZhj9R22+0VB906G5xcaO+3Hb8qtPwJzKFMkpRKe7xHeppvClSstEmUxka0g9KTITlXVGsXaduqe5WSgweyvqBZTnLhdcIjSDKdxX2yuDTDE4MNiOl8u5G7hh78aichMGf8DvmloSFhifrapTgEsz4RAKk4lqEujDK6uBHSk9bCSdDriBBGcMsIlOy83eq1s7bLXG02eg3mk4Bgx9Xd19in/kTmnlZwptgdLm5WyVBwut6XEL9SwqbwnPUN8yoHHqGctxQaWOY7ZottRDrMlUcArh+POSl3N0rXh/NUPT4uckFFkHXnv2tZB0VT5NbHbSPUJt1UgWKr7syWn7G7Mknm/7g85A0A X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR21MB1340.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(38100700002)(38350700002)(4326008)(83380400001)(2906002)(5660300002)(8936002)(36756003)(2616005)(316002)(6486002)(8676002)(52116002)(7846003)(6512007)(6506007)(26005)(66946007)(66476007)(82950400001)(82960400001)(6666004)(508600001)(66556008)(186003)(10290500003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Mn2xtK45zGq+//qC+Y8+R3TL9oEik2O6uTviGZU2KM3P8JGJHG5k2XVWZzoOjdZqVx846AOU+I2tGY0ipPcwaETX6wAzH5cO8+1cDoQ+6RfuSIy37xqCE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wg962uL+17wBrw1fGRQngY/YxBQgRgtUhJx/DkzDbJCZsHkWLBOGcs5OYvdoLJkiokARVyMMdDizcy4P5mcGwo22YeLHQ6ikzzYYz8/zoDxawCqUX/3VbzLSv7seJnMiORsvJbdHR4f+8dUIKYKqKW2Xqu15w6NBkvkkXX23Yjbf6tBxGRtp8rsG5gyyvhllPG6zsWCbyqAYZpzmbdwyB6n/3maxguc/Fbn3b0ZPrj8vPuyJprUZ1LEykVTUAgN2jQ9BOaON0PR3yIjyMrddIl7rmmavi7D/SlFx2Lna5jz1YAiTT5kdhAqHGO4UWhmso846JH4K4rqGSpCTMaYhz1D2cPRnMAtYNb6Sk92dSINF+TdnPvu+P+8c0cQJWXFY2RsTSoZbmkzrKUwemNiBf8dLpohK+gZtApi94JCmQCznka6IbcpyEEuH04HWvPLCMjIaNOwHwQA= X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 852d9192-8f68-4c68-30c4-08d9e8303bf6 X-MS-Exchange-CrossTenant-AuthSource: DM6PR21MB1340.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2022 22:46:51.3749 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: M8/7m1ZsM2nmWZyyg+1wrt8f+JwN7d6bPzxbwcpjyw+aqyLiuWaPl7GcXW1DYmCUs57jnrsEjaXfn7CtiRliuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR21MB1155 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The proper way to drop this kind of CQE is advancing rxq tail without indicating the packet to the upper network layer. Signed-off-by: Haiyang Zhang Reviewed-by: Dexuan Cui --- drivers/net/ethernet/microsoft/mana/mana_en.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c index 69e791e6abc4..d2481a500654 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -1085,8 +1085,10 @@ static void mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq, break; case CQE_RX_TRUNCATED: - netdev_err(ndev, "Dropped a truncated packet\n"); - return; + ++ndev->stats.rx_dropped; + rxbuf_oob = &rxq->rx_oobs[rxq->buf_index]; + netdev_warn_once(ndev, "Dropped a truncated packet\n"); + goto drop; case CQE_RX_COALESCED_4: netdev_err(ndev, "RX coalescing is unsupported\n"); @@ -1154,6 +1156,7 @@ static void mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq, mana_rx_skb(old_buf, oob, rxq); +drop: mana_move_wq_tail(rxq->gdma_rq, rxbuf_oob->wqe_inf.wqe_size_in_bu); mana_post_pkt_rxq(rxq);