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 720D041C34; Wed, 8 Feb 2023 00:05:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D443942D29; Wed, 8 Feb 2023 00:05:11 +0100 (CET) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id 2406E42D29 for ; Wed, 8 Feb 2023 00:05:11 +0100 (CET) Received: by mail-pl1-f170.google.com with SMTP id w5so7288753plg.8 for ; Tue, 07 Feb 2023 15:05:11 -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=YCFc74BF/HyjUP3BKVtIehS72NMimPlfPy0qt7hznt9SKoAR2nWcrgAT1EG4SuvSXY +TzZUtFhxdHPWaqgsR90CiyRxNPqDO6k6FT2zpxlLTIQqYYbtujxIAgL0fMYpzetNYNu fWm3ORFHyHif1ulvuL/qSIkMq0qRQVrmbQ/isKuV3VgTb+om1v0IlCzdYuj9XGK6NWlK BISb1oMXdm/rSs/ZFLbP1QQiCsuv4a81RGrJya83us93lQMjtz07WYMBvNhQ5uOCtiOC WHwSsCLeAhEDfnxzSB1pP8S23oVb3R4vsTY1oyzL3QJfbslPjJTdXtX8OwSPN3OUdWHl V2yg== 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=rARxXTH5vKyDbyfcN2ZKkWhS7KLY97Kwb2gxIEqNBO5zQETbkhuo88GfEec7uyKP49 tSXZWwKd0T8Z1ouBM46ilORZdArySy83N0qdcZN7P3YNQIthfsy+kAw7NGC4jw46nj1g BcWc1mD2o3mduhYGC0vZ1H2kA9ihY9UMISeJNFe24hYyuiPEyrLBf+rgddCz7SepVZe5 nnCg/5DvhN909sTnBcgL6OK6Mg8xIpx9+KYeBLv96TPlGozXwXj0fsaObbRIZ7v9ztyg bj/TZxkng5muTofSDwtV88ddPIpRGgFLFm9Z9vTCabFAlx7boUvgPa9lP6GMOZuud9zz Aj1g== X-Gm-Message-State: AO0yUKU+as+s67pEMwef7JZ59FgNA/+BPyifpXal+DH48zM0fb5usq4J 0WNAmp0czSw0igU09ZAuexFwkoWvebjbnMpRnfI= X-Google-Smtp-Source: AK7set82fPvAeZzfvYjjU079BqEzY8r6N1htQxyDDJzTPONYYcNDga99BrYxctSbwieZusP2OtnGFQ== X-Received: by 2002:a17:90b:1bca:b0:22c:79bf:bee1 with SMTP id oa10-20020a17090b1bca00b0022c79bfbee1mr6186097pjb.10.1675811110104; Tue, 07 Feb 2023 15:05:10 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id gq17-20020a17090b105100b0020dc318a43esm71189pjb.25.2023.02.07.15.05.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Feb 2023 15:05:09 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , jiayu.hu@intel.com, Konstantin Ananyev , Mark Kavanagh Subject: [RFC v2 05/17] gso: remove logtype Date: Tue, 7 Feb 2023 15:04:26 -0800 Message-Id: <20230207230438.1617331-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230207230438.1617331-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230207230438.1617331-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