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 469C941C58; Fri, 10 Feb 2023 02:08:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 312D9410D0; Fri, 10 Feb 2023 02:08:05 +0100 (CET) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id E683940EDB for ; Fri, 10 Feb 2023 02:08:03 +0100 (CET) Received: by mail-pl1-f177.google.com with SMTP id u9so4909581plf.3 for ; Thu, 09 Feb 2023 17:08:03 -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=50XX/QySJTKolTOu8WsFFMZtvwvzAwYjVKuibp6A/fKeGEqOvLSzjFarPMh3zrToq3 zJo2f1rTcwo4kd4uPuCFtkhxuPZilA6sdRRJfosXhejULUYQJFtSw9OHympLZnCnd2g9 ejplc9KXaO2yVfuam/ZEH4v4WD9bKkyk9cTAbaP8aIeiYpyydQMKo9fI6C/5PqSG7jNN YXDVggxG32kTfDZVwIUDoeyUWaJnvaf2ppRGgXYrIQRpEP5eCh6ooSMscm9EGAf53EIV qkT6JUi6qk0+SFjHrhD7YNkkw2pjvCcYc+khuOzlpws6ythnh6nj5uyAFHA73F6Q7AW7 Nahg== 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=wgemMnvzqwC0dbdR9sqiwyD8X64x3QwUZi4wwqSoI3spHdRk0J+z9Oi6HSUOu7MeR9 +TgB+SzaI7dzl5xUa83IOZelYfJYJ9oWmDQ+s3YqHBUifOH6nKcQjsHufqmu7pt8SI9u zWInyqLrEVPqhkqnny1loTY6QIsxU/HvI0KHQY+ldnIjzl5cEgF6NR76Quus83/NabeO 7qOYu5AA8zge+dVmIwUhqYHxy3NOvTFYsozI9vs/V4PJSkWtWrfUeQl6iUDrhgWCNZCc 9scVrzpvcVBftdSAkYu7Ra0wS2x/Uhzq6iDy2BB3RYfPeTu3gscgbCUU1++alE9bsfsF /g/w== X-Gm-Message-State: AO0yUKXMd4tW67cbNJ3QzrsfKSFXIRVYgtqjRLaA2k7zLmkP9yDWBzAF U+Sxw36iKFlbsZrc6rcBHANOjE55i2gWyBIJ1QI= X-Google-Smtp-Source: AK7set+CpXzmpOxTxPUved+y8nTuTBDb53etkuZ7bIbVNp/RfDpNhlx1Js2dljkLRkxGOmuFw58niA== X-Received: by 2002:a17:902:f20b:b0:199:aae:7569 with SMTP id m11-20020a170902f20b00b001990aae7569mr10019916plc.28.1675991282901; Thu, 09 Feb 2023 17:08:02 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id jd9-20020a170903260900b0019625428cefsm2103023plb.281.2023.02.09.17.08.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 17:08:02 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , jiayu.hu@intel.com, Konstantin Ananyev , Mark Kavanagh Subject: [PATCH v3 01/16] gso: remove logtype Date: Thu, 9 Feb 2023 17:07:09 -0800 Message-Id: <20230210010724.890413-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230210010724.890413-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230210010724.890413-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