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 8458941D40; Wed, 22 Feb 2023 17:09:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 770D240693; Wed, 22 Feb 2023 17:09:26 +0100 (CET) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id 74F7240689 for ; Wed, 22 Feb 2023 17:09:25 +0100 (CET) Received: by mail-pl1-f172.google.com with SMTP id bh1so9289633plb.11 for ; Wed, 22 Feb 2023 08:09:25 -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=1VT3Lf6aG70swyvaQZ1+5xtAfTuMUtLdQj0tjtkO+SNBkLfINMomFdcBX7sgOBJkyf NjauCt7zYaEO1E6affyWWRoYqQcFfSGKvskHisj1ciGc18+Oyma+t9FGGXcmkgtrLz9G vg7uYZBN7Mk5vpWj3X4c75YfpGaI/Fxkm5z2K4xMoaLzl7dWQFvSfPHZ7kE0cPncZbFr k7r2I3kFgxhkZM0Ge1qyoO0rRWKzb7XTgMeqH7UKgJVMLkfal5HUo/SJct10YUpxPP8K 2VTkEpq5+q1y9lxWRAfNPYoficZaXxho+ZdR3KGbNHUiQfWKBqCiZ6GUfiJgcJcB0PDB xNGA== 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=wSgCXBFI1ojpNxdGxg748cyXpgRwjnTmUAFym4AM2/HYWghlhs6K6leXNFKxQOStYp Sb/V5gg0G8KNvC++SsPLIai7Hx5NtTeWYwJzbzSs/l/NTl2ZJ2M64zJl8F2HEZ8PDp37 HEjU5x1mYoSRXfkBPaMoaTVpllgjlkv+PGGPCKwRWwRnbOSry+I2s39sXGeB183v+h94 fXxoTldN/lxzUM1I+CWGsSBRXclUp1H8CTT/DvATELcFAOKt8svTWw5NGhLgtF7hZaDg GHNidxGyjgXrM6+JMNmfFRImN6CbUk3eJNia/yiwuv31zAArIjW4ATaxYUF3zlbfoWdQ hHKg== X-Gm-Message-State: AO0yUKXDIS950ReYutg4pcsOuV2jr5+afSOcdL7r80N+4jCnEyz3I8Hu DIJuD23BRn1+6wX9U5PCsk9mH3Kq9xeUvZbR0Ak= X-Google-Smtp-Source: AK7set9fU8sYkVCIPQBVEKx2uvPu4NPQh0XZ0wJsjgGuTvRmkr1h1G4g2EE9Hz0H0XY/B/KZoW6ARg== X-Received: by 2002:a17:903:41cd:b0:19a:a520:b203 with SMTP id u13-20020a17090341cd00b0019aa520b203mr12629897ple.25.1677082164206; Wed, 22 Feb 2023 08:09:24 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:23 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jiayu Hu , Mark Kavanagh Subject: [PATCH v10 01/22] gso: don't log message on non TCP/UDP Date: Wed, 22 Feb 2023 08:07:41 -0800 Message-Id: <20230222160802.123611-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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