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 59A7741CF1; Tue, 21 Feb 2023 00:36:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEA104311D; Tue, 21 Feb 2023 00:36:01 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id ED4B443117 for ; Tue, 21 Feb 2023 00:35:59 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id n20so1396390pfu.12 for ; Mon, 20 Feb 2023 15:35:59 -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=ZvyRUz6LvTLPwn3sG/VeeBY34LuV8x0Yaq5Q6PVyyMnyWVEspBGvxScQ/o/Gyxm5f3 iqq1Ux8cbMETuVIggycxfkqlxz2S0RwV1uMTfbG07JGHJQrFNGoFhZ9NDJ7Nrj6ZYe13 d3a0m+5AY1LE9xzG0KDkLGphY/AfXtMZeDVmkIDUfQvK0FQ88lHPABGsK4pF9XAkd521 IbBamsCu/ivFsKYCx+KW7wcroFlp48zAZuLjgefpMCWrxep/AByEY/wjoCE2Vhetbgat 8qpdC3a8Emgfey8550B4GA1vyMdgHS3VMqCyS072zpWfdkVj3vf30WotPdneTOPs2RtD GjAw== 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=TJRkpRY3L8g91kABRQTMfDhfhokffXw47ZeOwYeP8mqGvxtB53iy61K8Vk6PN0qYrS 77ZEQqTr7wcJFaC5eA6NLTD/UroiobdZpuRPVeQ9Ld0PDPDJcknq+pHhH+t4HR5RSCeA 2+1eswm5dkpeh1rP1+lNaY48hqNu9j3+iU3HlUsI5DNic46dRn5ecdCsUl1DsyYySdav /ZDca/1Cr3l2n5Ui4BAAYUsLpvdVulwAxPoT289cVsl62PTG1Sj5IGm83RaaCbPQOvUr LF/M8W+aJ9hiP2C7UwqeLcOd4991R8S/4/9b2KmSc7sChdyfw11vEd+RPSrkYxbhf8tC DVMQ== X-Gm-Message-State: AO0yUKWqB34y+lcTnghWOLRus0senQb3BUsUHwWBKJn8pLdfCMqXAs++ /RAdGQYpRAHKaOlAo7TyZp3NgksBCyLzHm4qilQ= X-Google-Smtp-Source: AK7set/2x7I1T0qd9hAhFlFM1GIfHapNw8JGYtJwpPXQCvunARIvnk9G9JdvtHhR2aaM2TRB0i+UcQ== X-Received: by 2002:a05:6a00:86:b0:5a8:c044:663e with SMTP id c6-20020a056a00008600b005a8c044663emr3234383pfj.21.1676936158901; Mon, 20 Feb 2023 15:35:58 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:35:58 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jiayu Hu Subject: [PATCH v8 01/22] gso: don't log message on non TCP/UDP Date: Mon, 20 Feb 2023 15:35:35 -0800 Message-Id: <20230220233556.168553-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-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