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 60AB441D43; Wed, 22 Feb 2023 22:55:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0393B43171; Wed, 22 Feb 2023 22:55:52 +0100 (CET) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mails.dpdk.org (Postfix) with ESMTP id 6978343154 for ; Wed, 22 Feb 2023 22:55:50 +0100 (CET) Received: by mail-pf1-f182.google.com with SMTP id 16so5230050pfl.8 for ; Wed, 22 Feb 2023 13:55:50 -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=DLagXWn6bZtlMIdm7VhB7kSaz3taaWVglu63ZTAMXs9Z7ice9IyvCiWPTSuewZ8HE8 iqY3ZgsQ8Z0t9CMrwMdIX25aeT4MjFHLg7y3oAG0oei0wPoA9wTKUJkshiCcfcLMgb9E +UBorxyOLHErs/cUoUdE76jhrfOO+LdCnmj2rM07LilZl84GQlmme13zHVwnF0HQic/J w1jhgUYiE2CINTJ/oHRjUJAnO2FwH4NZ389guR/Mcql7N/MT/OpYgPY/jrcmcznImSRL DBHsImLa3TgtNS8e2Z3DQqt3D1fZHaXXemabZf+xuxpt65jAlyO93jgVDRC/VwsWerZD uldw== 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=23bXR7UXmwoSS+BZ1DXeaHUBDM/FSePIpbac3f8L99qiRLdwwWMr6IxOc1uCijDqA4 kdJO0wEwyNsyFuH6G/LdVMyK6dtS+Dr1bFgYfr8fOUA9uzwIk/5l3yTp8GjtD6gIdCiw 0OphugrErucVEK6JF/6/lrMIC5HpaEjaH3kvtQtZr82q99o+EPvEVEuw/4DwyjO46mvb KDdrYcDOnO7/oDn/hambUHdGwMgKEjTLLE+gR23k4kNUNEdh6yYa/kDJHDhptJCtpSN8 T2ck0NEvLg5IMPR9oPlIRO47d5hD3xQgJsuvocqvKrGcH5h6lZlopiZUba9O9QeOmnEk 1OtA== X-Gm-Message-State: AO0yUKVfES029F76MVnFK6+bePMUpSDBoJhvSe1uZ+gmMWJS6qduE+TV f3xBvoXfYme3lNLecDuXqM4IFOhKiRbhVTpj0YE= X-Google-Smtp-Source: AK7set9WlmDj5k0GrJ1oASsvNBeI8cQ9g3s37wYuVCBdK0zm+4cLYy5sgr5I7K0Ky8eFUrFgwjFS5w== X-Received: by 2002:aa7:9d83:0:b0:5a8:bd67:156d with SMTP id f3-20020aa79d83000000b005a8bd67156dmr7885396pfq.6.1677102949335; Wed, 22 Feb 2023 13:55:49 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id d7-20020aa78147000000b00571cdbd0771sm6400722pfn.102.2023.02.22.13.55.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 13:55:49 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jiayu Hu , Mark Kavanagh Subject: [PATCH v11 01/22] gso: don't log message on non TCP/UDP Date: Wed, 22 Feb 2023 13:55:20 -0800 Message-Id: <20230222215541.158205-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222215541.158205-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222215541.158205-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