From patchwork Tue Feb 8 14:00:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1589848 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=BsdzJy+k; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JtPmN5NT5z9sFn for ; Wed, 9 Feb 2022 01:00:36 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nHR2g-0006xj-8b; Tue, 08 Feb 2022 14:00:26 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nHR2e-0006wY-3Z for kernel-team@lists.ubuntu.com; Tue, 08 Feb 2022 14:00:24 +0000 Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id E47FE3F19C for ; Tue, 8 Feb 2022 14:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1644328823; bh=3C1fIRJYuJ9MKzCXzzg5VLA9JKSLS0N6WRqpwPK+uSM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BsdzJy+kvRXLgE+2835SxCOYqRKIN12yNwTMTjUNP+eqYSn4m40GsFzPWWlx7cqvl ikzJ/nbR3/7SBGQ6cfXEzNXS3Sexm17uKo4RF7oEJaWPBUnGT5+Av3JEYRv3PXdpqn o8bsjCcM9VVYb9aMMOh724QQSkjuY9OwW+j9yvH2jTIyyCpeVofbZcTz9mHHej+5hV B8j/YYhB9Bmryuvqp+cnVWlxxkyLhdvM/p3I1XBvGcW1DkTZEreljO2sygUuZqH5gQ ivlwHb2u5Fiyl8u3iu38UulmqUJWmNN1HfanMH9I/0nAfZ6zPZc32YQg9jLlC6zByd 9U2gyt0AVHGGQ== Received: by mail-pf1-f200.google.com with SMTP id b11-20020aa7950b000000b004df185959c4so7569825pfp.8 for ; Tue, 08 Feb 2022 06:00:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3C1fIRJYuJ9MKzCXzzg5VLA9JKSLS0N6WRqpwPK+uSM=; b=uTSaxzaeN15gLsnxgjrcZbQvZZenGlbTVNul8rEY948+VmoiaRzkjr8okeVTjxJeVg g0iS51iBzZVGlBCrbjCMQOh2kDkP6oYmlpPLaDz6rEHb1QybpyXNgNmduNjvyspJqvMx imAkYmEJ4tYVO1eoOMm7vwo2e3fhA78PkJCcXdla+sqf1/l53nNlGPF/eV/vs214DjIm +/lmsZ5uJ0AUJyDniZuD0/eT17ic+tlB/tn6tBtzV4f7F0VlCrZiR2CaiTlPH6B5kQOo N/kU2ODP+S5/tWUUo/5JFEAQ0ph7J15zo8GCGUALhjWhY9vOUI2cVzZfupV9AGh9xSl4 N8Hg== X-Gm-Message-State: AOAM530nn0ZR0hxih4dPMX1ou5VaRPd9K/wM7c+0NdxO3SdjimrJXCsc GMDy9JpNUEVYfaoBoy6AOKeh6p1yvsgUEfov2cKHrFLX9kwLu94ZVNPI4OCw1hMcbAaOCKY9o9S t1etEYER80vSceYEw+NwHgi58j1Ub0o8N2y1TDgOKJg== X-Received: by 2002:a17:90a:de10:: with SMTP id m16mr1488247pjv.157.1644328822223; Tue, 08 Feb 2022 06:00:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyF9AVDZsLqBBh21LD+BCZ6vfvnlzMZKPnvbgcJ8hG1/nLCgSdBw/rK0RMmNVLDAP0AnH/7Bg== X-Received: by 2002:a17:90a:de10:: with SMTP id m16mr1488220pjv.157.1644328821905; Tue, 08 Feb 2022 06:00:21 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id t1sm16708327pfj.115.2022.02.08.06.00.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 06:00:21 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/2] net: mana: Add handling of CQE_RX_TRUNCATED Date: Tue, 8 Feb 2022 07:00:16 -0700 Message-Id: <20220208140017.15902-2-tim.gardner@canonical.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220208140017.15902-1-tim.gardner@canonical.com> References: <20220208140017.15902-1-tim.gardner@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Haiyang Zhang BugLink: https://bugs.launchpad.net/bugs/1960322 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 Signed-off-by: David S. Miller (cherry picked from commit e4b7621982d29f26ff4d39af389e5e675a4ffed4 linux-next next-20220208) Signed-off-by: Tim Gardner --- 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 987e11c02f727..5203f8824231a 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -991,8 +991,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"); @@ -1054,6 +1056,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);