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); From patchwork Tue Feb 8 14:00:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1589847 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=IcJaOYey; 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 4JtPmM67Qkz9sFN for ; Wed, 9 Feb 2022 01:00:35 +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 1nHR2h-0006yM-Ek; Tue, 08 Feb 2022 14:00:27 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nHR2f-0006xN-Ej for kernel-team@lists.ubuntu.com; Tue, 08 Feb 2022 14:00:25 +0000 Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (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-1.canonical.com (Postfix) with ESMTPS id 4055B40049 for ; Tue, 8 Feb 2022 14:00:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1644328825; bh=Uhl3S3ZuZJhZNqrDfRVTJ7b9RmGGlnjQl0Rs0145Tko=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IcJaOYeyVT4PsprIjUJUxumyXS0IFfWSFe2DZ4ZK3fWCQVa7ktZPvk/sZxzE83M94 gwFimNqXyca+l6lTToJJ6k4ZpabTyp7vmFSRU4Trd5irZMd5cWYWagoFq3EZnr68F2 DQ+mn9vp6CmAsTv9miMRBSxQnlCUzD14KesYPEhqOBi6BzNQ1+EZbBQLiO9FKvnkAq O0ovPEzp5WDZqUbCSvhN8GQ579dbQrdapnJfP1EVgUOkxnlsmV2RQINKKjUpfZeP17 my1YB0/NMCFEREyS3Zc9/NYobJZSOBG0Wm0vTEG/j1eUdQV2m963XaW1egIO9BU98g lqpuZrR0lrT0Q== Received: by mail-pj1-f70.google.com with SMTP id e1-20020a17090ada0100b001b83a55e809so2245346pjv.7 for ; Tue, 08 Feb 2022 06:00:25 -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=Uhl3S3ZuZJhZNqrDfRVTJ7b9RmGGlnjQl0Rs0145Tko=; b=ZLs6+u/kCiLHvuphYfumAWXTvTvwtg0aZLwpOQ2+nq2tdYMl6W+SvXdnxf5Fnj6J10 gH8dtTKqjt81nF21ZzeWjHcVQ9Jqe59d0DpMCv01qQWVGlvHo/hNq9uP83L4DGbVdbhT wGY3NQFquFGB6wnABHLU10ly4cGkd5+RlC8y9Ewtuamk122Akbm66ymRe4zJ1k8OET8Z sSgs3HDhHO5btlTPV/XIKFKgV0Oq32P3CVuTF+NrzKC8e8b2hl484a26bDkR6CAXAjig MN8oYAzdm9nX/U9yRQM9uLizHhnvjB1LZDRgjLtcifgcBDqXg25L8z7BqpljkvlyGWlJ 05pg== X-Gm-Message-State: AOAM530RPv685KEj98IUNaZepxDJSUKTbK/t9XsUxYueMx4ClbwdM+OL RykfYfhP0o3c7TB8QSt3uDjBAvcSAgwJ7Il1hi0UXT/KT/f/XG1ZaOJn4l9X2GBjhrMQXtMKDy4 C77scbE7WriBJH1rdxnBRyq2+gI1bSnfIq/6qNbLEhg== X-Received: by 2002:a17:90b:4d05:: with SMTP id mw5mr1548398pjb.34.1644328823545; Tue, 08 Feb 2022 06:00:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzoOqTsLUTZvWrAJmxqq+XUJdc4/a0YFmW8m12bCmm811slCAsXiS595ssAHObez4QnHd7Blw== X-Received: by 2002:a17:90b:4d05:: with SMTP id mw5mr1548352pjb.34.1644328823024; Tue, 08 Feb 2022 06:00:23 -0800 (PST) Received: from localhost.localdomain ([69.163.84.166]) by smtp.gmail.com with ESMTPSA id t1sm16708327pfj.115.2022.02.08.06.00.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 06:00:22 -0800 (PST) From: Tim Gardner To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2] net: mana: Remove unnecessary check of cqe_type in mana_process_rx_cqe() Date: Tue, 8 Feb 2022 07:00:17 -0700 Message-Id: <20220208140017.15902-3-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 switch statement already ensures cqe_type == CQE_RX_OKAY at that point. Signed-off-by: Haiyang Zhang Reviewed-by: Dexuan Cui Signed-off-by: David S. Miller (cherry picked from commit 68f831355052706e1f8498653f6c4d36643c0db8 linux-next next-20220208) Signed-off-by: Tim Gardner --- drivers/net/ethernet/microsoft/mana/mana_en.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c index 5203f8824231a..591c052b5d8ed 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -1010,9 +1010,6 @@ static void mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq, return; } - if (oob->cqe_hdr.cqe_type != CQE_RX_OKAY) - return; - pktlen = oob->ppi[0].pkt_len; if (pktlen == 0) {