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 7265D41CA8; Wed, 15 Feb 2023 18:23:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6266342D12; Wed, 15 Feb 2023 18:23:51 +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 A509A42D10 for ; Wed, 15 Feb 2023 18:23:49 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id bd35so8225248pfb.6 for ; Wed, 15 Feb 2023 09:23:49 -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=JABhM9EliUy4AM0IUN42iX1vJf7jKUkO2JHCV62H65w=; b=GEord1ub1FoOB8xY5NXt4nAresO+hGJS3zB2IaVHm57OrnAl23M1vZKgYv5tz88lv6 4Dn61sLQ0AypMrnwIcugCSReEjzz8wpOQJmSL1Ckoj6L6GX8daFrohmtW4jgaqtHwEy7 WoP9uzv3lBn7r2ppHqsaz0PBMO8ewdROg6+XOC/Zj/y6W0OVlyeMp2RGrjtsVylBoR0Y hqSTuytCxq6gL3DPn2Tk2yOljO1nX9BRVVo5UKBStg8lWNUz+K1zlH87YkjjnrmVAS4Z 1NtF7l1BtS33E5K7RcAsjEYywcZQ1Vsov/Rj1fk3LPnOGhppfELSAeOBdqGxmwCWCBej K9Cg== 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=JABhM9EliUy4AM0IUN42iX1vJf7jKUkO2JHCV62H65w=; b=H2Lrx9jEm6ziZKXT3ai7+TXLXbMTT/hc1IH7Xg2N4OYxQkUjNlfJ4HbgUPMUv0gVVY uY7ACya0bDm3CZ0PG86a6/A+CdwqUTDNdLr+PoCH7TMridxVaxNR7ubB/+luNUc1CTn+ fisAlPw28TcV5HzVK9KAOEPAGZ0T0Gt2TeWUUlgYisMvzWGOfWuJTZy03h9gJ6IvpRKq DfWmNA/0cgiNdoIb5HJ5DI2N7X3nvoo1MUikYy1x+HpDbxGWluE6K6+LNBOL1MU5cUTP OqSmMayNFPR7qjMqi+EoiGt2ZOtF62/0H8ckMoV1B91ygsEZPgB3bBpige4k10emZfRz DKVQ== X-Gm-Message-State: AO0yUKVN1iGs2xbgXzFDXMChWRZyn7TpUdXsTyqkbMruPUF8OGz3fDwn K+N+0jmLImC6Rx1PA7hkLkggWL6a77mAoUgXjQGFnA== X-Google-Smtp-Source: AK7set+OCxw6uzZ7tHSt/IA4uN1Wks2Z+x60tkLLSzDFwWfuuq63ouvF2oBTW+G3lTo9QPoGHtw1EQ== X-Received: by 2002:a62:14d7:0:b0:5a8:52d5:3bca with SMTP id 206-20020a6214d7000000b005a852d53bcamr2224694pfu.6.1676481828529; Wed, 15 Feb 2023 09:23:48 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id m7-20020aa79007000000b005a8da960fa8sm3705304pfo.144.2023.02.15.09.23.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 09:23:48 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , jiayu.hu@intel.com, Mark Kavanagh Subject: [PATCH v7 01/22] gso: don't log message on non TCP/UDP Date: Wed, 15 Feb 2023 09:23:20 -0800 Message-Id: <20230215172341.1525320-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230215172341.1525320-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230215172341.1525320-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") Cc: jiayu.hu@intel.com 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