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 9678941C33; Tue, 7 Feb 2023 21:44:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2964940EF0; Tue, 7 Feb 2023 21:44:38 +0100 (CET) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id E951D40151 for ; Tue, 7 Feb 2023 21:44:36 +0100 (CET) Received: by mail-pl1-f179.google.com with SMTP id iy2so6831455plb.11 for ; Tue, 07 Feb 2023 12:44:36 -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=xEjvKrBAUqZeBvyRL0ll8ue+hM/7XowkxMi6ngrjkWo=; b=wPdIdqEfJhh8BPfXDXTZ4y3IWlUTILQIqYXMvLl7sFkBFyDzmqiazCRhUjD1912hAB jBgZOKS1VBUQKpZgPEQds0syqgkLmgMqoaO1b5YdO/0I+wKfKPXl9Cj/0zEglVICFF4k JYVa2qmA5egBjzUOg6peQJPjvdMIDw4cbCBfleEX1d+J1aBv0z2iMsVkjA5bJFYUuiyu Q3TOepL3h2QfvAPkbwliJ9ldvtyLn0dstobDmUO8R6D5P4KEYP83CFjyDc6kkdTvUY+W L8u3AAMX+M9031vNU2MUkdduvgja+kQKMzVLNZAQYLXRZwQURjCp897EKUJtVb41pJ7n zyeQ== 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=xEjvKrBAUqZeBvyRL0ll8ue+hM/7XowkxMi6ngrjkWo=; b=xglY/r8sJGPdfQ+p71553gAddaKSSpEPpTW/6gRZATKLQEm72EkWmb+lobQMyTjkfJ 44b1zA/4SgheOBsmJZsFYxGoGdAojM08Z1yrE8jB/RFEmTIpN5Cj5VlbYBHF2fhmIawt opqbJjupxDFLFUyr7z5LU/8WtWOf/xGh/0c8YusuA36pDv3am/uls8nI7UpIG0hrpJOi r2Sau90E5NI/6Od8Wt0lKPvdf7rPC/PFnlPNg2edP5WUd/D3ZosLViC8HcuSNptV1odi Ke0YpRsKgW5yxN+60yyAcyhG1miv6fVDAXydDhqQII+scJ0Ifh4vF375I/nAfGn+/UI8 nsyQ== X-Gm-Message-State: AO0yUKWSGeT+8Cttk1WT/aTO3sQBpiJrbrgNmM+EzpiAQLt4BaCuaPX1 3MWXGWN+eZHzNttZsWoLwsqjGlFxWJaIQE/prMw= X-Google-Smtp-Source: AK7set9fMcL4BmYDR8g8hm8nCzIdrKsc/2MzxD5FijWg02GefnwbdvcepVdY2IXT4gMXvsG1zXnEYw== X-Received: by 2002:a17:902:d483:b0:199:16c6:8a24 with SMTP id c3-20020a170902d48300b0019916c68a24mr4796582plg.61.1675802675820; Tue, 07 Feb 2023 12:44:35 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id jk24-20020a170903331800b00194ab9a4febsm4725562plb.74.2023.02.07.12.44.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Feb 2023 12:44:35 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , jiayu.hu@intel.com, Mark Kavanagh , Konstantin Ananyev Subject: [RFC 02/13] gso: remove logtype Date: Tue, 7 Feb 2023 12:41:40 -0800 Message-Id: <20230207204151.1503491-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230207204151.1503491-1-stephen@networkplumber.org> References: <20230207204151.1503491-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 and pass it through. This is incorrect behaviour on many levels: - it allows oversize packet to get passed on to NIC driver - no direct return is visible to applications - if it happens once, many more will follow and log will fill. - bonus it is only log message with GSO type. The fix is to just return -EINVAL which is what this library does in many other places when looking at headers. Fixes: 119583797b6a ("gso: support TCP/IPv4 GSO") Cc: jiayu.hu@intel.com Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 2 +- lib/eal/include/rte_log.h | 1 - lib/gso/rte_gso.c | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index bd7b188ceb4a..c369154cb1ea 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -368,7 +368,7 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EFD, "lib.efd"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, - {RTE_LOGTYPE_GSO, "lib.gso"}, + {RTE_LOGTYPE_USER1, "user1"}, {RTE_LOGTYPE_USER2, "user2"}, {RTE_LOGTYPE_USER3, "user3"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 6d2b0856a565..97d6b26a9967 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -46,7 +46,6 @@ extern "C" { #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ #define RTE_LOGTYPE_EFD 18 /**< Log related to EFD. */ #define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */ -#define RTE_LOGTYPE_GSO 20 /**< Log related to GSO. */ /* these log types can be used in an application */ #define RTE_LOGTYPE_USER1 24 /**< User-defined log type 1. */ diff --git a/lib/gso/rte_gso.c b/lib/gso/rte_gso.c index 4b59217c16ee..19c351769fcc 100644 --- a/lib/gso/rte_gso.c +++ b/lib/gso/rte_gso.c @@ -81,8 +81,7 @@ rte_gso_segment(struct rte_mbuf *pkt, indirect_pool, pkts_out, nb_pkts_out); } else { /* unsupported packet, skip */ - RTE_LOG(DEBUG, GSO, "Unsupported packet type\n"); - ret = 0; + ret = -EINVAL; } if (ret < 0) { -- 2.39.1