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 8D49B41D32; Tue, 21 Feb 2023 20:02:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 80E8B41133; Tue, 21 Feb 2023 20:02:18 +0100 (CET) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 0899140691 for ; Tue, 21 Feb 2023 20:02:18 +0100 (CET) Received: by mail-pl1-f180.google.com with SMTP id c1so6391496plg.4 for ; Tue, 21 Feb 2023 11:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bRyRO3VTymBjGYshCckfveSSAEGjziLD70dZsRHNoIE=; b=6HPagWPx+gl/Ble3cOx4VEbB43V26EnooK5P3B4RMcVqJYe4wLyXi1tK4eKiDZfwiM NF8QSLFNG6+eZ8UOtRVt3cbtiLwr1d6YOpVyoDi7wYQH1iYq8MI1EvU5lPwvJ/s0vALA qRDvvFnLJTGOxUWTX03pOorXM0bvmUtyCqf6bbO7k3UDHxkCojq3uIOLT72Jfno+LdNo 9VC+v9FvbAH78POpGC1nSLtjQbDr8rwy9uGvKKSDrkf7Dk4RjraseAtsfL0qnuLAW5Nn In9jH4MmFvUAnh5jYih8UpzX3UiYSl/JZFt6PqeWBggqNgFQAEoZoURUNMpu7zMRp4hj 2AFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bRyRO3VTymBjGYshCckfveSSAEGjziLD70dZsRHNoIE=; b=JvlecwYPn+QLV2cGIsPNL1J+8SnMBdIB0wVCYrfty89YWdIagcke3tCX5j0yJM4vMb rhdJBeLtiDc689VRi6feOpLH2P/E0WU++gsf/WbWUOYPBAB8RJl1vSdXvClc8Yz1Vbuk 3VxgvXfehGl1Cl9pQcYztLdFxrjRZ5tT0uceilyZ1le3gOzMfn4b2VrymReCADs/JHlw +y9YWwTsZCILEHlptNN/suKk598us9L0RMV44FCIM8JlKu5EI2N0eJoid/oVd74pc8+B nyDu4fMul8A3rjruBTXanbNG2RrRo7gQW02I9z6aXdoBoO4o/5GO8Q+blNs1X5SSKodX 7nGw== X-Gm-Message-State: AO0yUKVLYNn/v37hNm4SUmYRfN6R+3LKy4wq/rOkAaaDHd7/m/dJ5Zpc zXyo6Jb9zo1bin4StlOCXFKZOuE1sF6ctP1rxGk= X-Google-Smtp-Source: AK7set8XetyPl/+4KKC6+M2ZD/it4t53j4FkC9iPTZcAK4HBbvGx4dtck6E8w97jnc4t/LnxSFiqDg== X-Received: by 2002:a17:902:ceca:b0:19a:85a7:dcb9 with SMTP id d10-20020a170902ceca00b0019a85a7dcb9mr5786398plg.2.1677006136930; Tue, 21 Feb 2023 11:02:16 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id jc4-20020a17090325c400b001991e59fde6sm10213018plb.216.2023.02.21.11.02.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 11:02:16 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jiayu Hu , Mark Kavanagh Subject: [PATCH v9 01/22] gso: don't log message on non TCP/UDP Date: Tue, 21 Feb 2023 11:01:47 -0800 Message-Id: <20230221190208.514276-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221190208.514276-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230221190208.514276-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 If a large packet is passed into GSO routines of unknown protocol then library would log a message. Better to tell the application instead of logging. Fixes: 119583797b6a ("gso: support TCP/IPv4 GSO") Reviewed-by: Jiayu Hu Signed-off-by: Stephen Hemminger --- lib/gso/rte_gso.c | 5 ++--- lib/gso/rte_gso.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gso/rte_gso.c b/lib/gso/rte_gso.c index 4b59217c16ee..c8e67c2d4b48 100644 --- a/lib/gso/rte_gso.c +++ b/lib/gso/rte_gso.c @@ -80,9 +80,8 @@ rte_gso_segment(struct rte_mbuf *pkt, ret = gso_udp4_segment(pkt, gso_size, direct_pool, indirect_pool, pkts_out, nb_pkts_out); } else { - /* unsupported packet, skip */ - RTE_LOG(DEBUG, GSO, "Unsupported packet type\n"); - ret = 0; + ret = -ENOTSUP; /* only UDP or TCP allowed */ + } if (ret < 0) { diff --git a/lib/gso/rte_gso.h b/lib/gso/rte_gso.h index 40922524df42..23d6980aff9f 100644 --- a/lib/gso/rte_gso.h +++ b/lib/gso/rte_gso.h @@ -114,6 +114,7 @@ struct rte_gso_ctx { * - The number of GSO segments filled in pkts_out on success. * - Return 0 if it does not need to be GSO'd. * - Return -ENOMEM if run out of memory in MBUF pools. + * - Return -ENOTSUP for protocols that can not be segmentd (not UDP or TCP) * - Return -EINVAL for invalid parameters. */ int rte_gso_segment(struct rte_mbuf *pkt, -- 2.39.1