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 4B21B41C58; Fri, 10 Feb 2023 03:29:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE42840EE6; Fri, 10 Feb 2023 03:29:51 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 33ABD40EE3 for ; Fri, 10 Feb 2023 03:29:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675996189; x=1707532189; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=B7CRrEYxW28MFfIV6Chgo9V6G5noThfX8GIXoadgU6Q=; b=JzPUAPD+aOBbi1e2oH0K1hDNaDP9y55RNoLxOo1+NPKvs6zHmgXcAHCm 9TlgTJ1fOzouN1YeBiD81cvzl3t/m4N/YHlwm61X8VKLY0ylmctGt6GDR dkFug1zPxWpsxZzIdYJHceS+lNuSK5+yMhNNaVpSu2WDMtjAGziQ24MUl 1bwkUiLEKTSaKOpUzHAlmHPe2uSCmhBG7Q6XyxzDmMjVrZqX4b2ssbp7r qxhu6wchCUwplxnBBcIg8L+D0gD9+IRnOcoOsZxHm2Yq5y19hu/5uEl++ 65o9of031crztNemkvg1RjNhuu09KGA0N+eRyTIY6YQQhsN2otQmnCCG6 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10616"; a="332456972" X-IronPort-AV: E=Sophos;i="5.97,285,1669104000"; d="scan'208";a="332456972" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2023 18:29:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10616"; a="617744289" X-IronPort-AV: E=Sophos;i="5.97,285,1669104000"; d="scan'208";a="617744289" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga003.jf.intel.com with ESMTP; 09 Feb 2023 18:29:47 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 9 Feb 2023 18:29:47 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Thu, 9 Feb 2023 18:29:47 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.174) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Thu, 9 Feb 2023 18:29:47 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WT+B6OEv96drILsGwztQTtk4VVI+giGH2t4Bv60kejXgXxPYCegYc4f/rxW7ZX/JpK1nLsY9szx4psllv91RprPX0FFEDsBUFWGURjLSTCraH25/LRzjjwq+gVNlxTDMmF4/Ridb9WjYdiYdwU96Nuo0uTjYYbvvjORxgrxdStm6U7vnej5uUhnUu4wCvi81DFOaNwDJPtWTdOa582xzPx43Q+PiG5zEA8+OfFaG4PwzXKcbPCOFE9yi3AlXE9+AOVlPO7mEaibEAlxjgVzJPAuzVg4BhdcYu546EAodPpbmm2YuOPTI+9e3k98h7xXHLNgsDD3GZ2WpU+xHqOV8Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iU1TXSm5N3rocBmBtm0PVGB+x8jiOT03MTl9etLM+2s=; b=O0cSeP+AVEqZdfFcS5BGkK/qgU4WCJJOj+WMHUHDVsflKK0zhJCtbZ3hHPT+GOb/hkSANV1nKG6m7JX23eiBxUMEaRDs03Zi6J3howpia9H/qvo6ArK+QnpoSfde7KrlnCM+AM3aRiLqY9GZRxCx2FcSbbwfAES9yUMO9Fq44Ae+Con0091aUzg6q177tfyCE3cMSdD2KKa3dPJKpDmmbFHS/jvfeGCFYw/+3EufIowL6xkTmk/Kt3fgdUN8Zv6pxOSqtVLPGO6XOV1irfI5mbnHSTL4FnN0850nKJod/44Aga02jvIS7PqnPziRbi0gEU01TTITglzNk7H+RA50hg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from CY5PR11MB6487.namprd11.prod.outlook.com (2603:10b6:930:31::17) by PH8PR11MB6829.namprd11.prod.outlook.com (2603:10b6:510:22f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Fri, 10 Feb 2023 02:29:45 +0000 Received: from CY5PR11MB6487.namprd11.prod.outlook.com ([fe80::4fba:c63b:6db5:75e4]) by CY5PR11MB6487.namprd11.prod.outlook.com ([fe80::4fba:c63b:6db5:75e4%9]) with mapi id 15.20.6086.017; Fri, 10 Feb 2023 02:29:44 +0000 From: "Hu, Jiayu" To: Stephen Hemminger , "dev@dpdk.org" CC: Konstantin Ananyev , Mark Kavanagh Subject: RE: [PATCH v3 01/16] gso: remove logtype Thread-Topic: [PATCH v3 01/16] gso: remove logtype Thread-Index: AQHZPOwm/6+PfTEYn0y3UXXi2Kqx167Hby2w Date: Fri, 10 Feb 2023 02:29:44 +0000 Message-ID: References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230210010724.890413-1-stephen@networkplumber.org> <20230210010724.890413-2-stephen@networkplumber.org> In-Reply-To: <20230210010724.890413-2-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CY5PR11MB6487:EE_|PH8PR11MB6829:EE_ x-ms-office365-filtering-correlation-id: 9e6ab4f1-71d3-4d6f-89ce-08db0b0eabf2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: O1ewtwQ9+E+mmVef+7wIVcknsuxVNHcHEJrDU74FZsj80MjxcPbfaSn9NgTGIbVYLHrs+B2p9zc6/j8X1K06SRiivQIk7l2953sh7gsWwQDQ4hRUjvl4cVSg/TRdnUZyHuullT2pD3hGkwHR38uYKyba+5xjDQmKgNMjguu9sw1fBgcavHjKtmPFcM7+nV83N5FQT/nFto6DcStUOzM4rnV87F9ntPmcLS3QiLLKl+Xd+N6swTpLmpUcnTUMWXw3KcxNpSGD9W0MwX1NHD9YsvrGdgxIi7aixwbkLPFulQTDIDGHCiN+ObtlupsFg9ghxtNOzvQuKg6PalfoCcdLkIP9EmHCoCT1OdV6qAmFFmpTBiXzUWpWhUqh1/pKjf8DOClEVlZZolQqmu3N2KI+1Fx6gVDLOFRnzc4lFljsfDMQ9cgd4xDKQ89sYtC+rZ9Ek8c1JfvcjurG7fBwfFvlSnRGsRij7JjLqz4oLBbQs97N2arBIv+clc6VfAprbc8Ef1ATuhUYJTA2OvkBVz230EUbReMiaS9eWWa5dLcJphtflAOi28ntlm7zO0+u06OACRsUQKCl3TUwggzfZTYIIrF7OVea6nKP6fLeSWMDDIsSI2C4CmcB7/zD7Q4ab6Jed1NyVrnbalPzoDKtJRJjLnoQnflbcT9brgfjE0Lo9DuI564OsWkCR88dNBQlQRKp4jX+dJ3Cz5mf146ushcuAw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY5PR11MB6487.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(136003)(396003)(39860400002)(346002)(376002)(366004)(451199018)(86362001)(6506007)(53546011)(186003)(5660300002)(9686003)(26005)(66556008)(107886003)(8936002)(82960400001)(2906002)(66946007)(38070700005)(66446008)(4326008)(66476007)(76116006)(38100700002)(8676002)(122000001)(41300700001)(64756008)(316002)(55016003)(52536014)(478600001)(71200400001)(7696005)(33656002)(54906003)(83380400001)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?O4d0XYpvyPOSeOx4Z9Tp87diBcuRRgXJ4D3QeERy5mXCBBqfTPeDZpm+kfrA?= =?us-ascii?Q?7aY1GeZb+neFUTNxPYlXGoh4OocEB8UeEsJ+mtNfHakBxjF5ziiIzx8yAgGR?= =?us-ascii?Q?sTbBTEPNf/j0Zyxx6pec9qDO6xZhEnewGN1J75lSnYNpWjcwTbnQsInxqIST?= =?us-ascii?Q?gb9RrG9PrPlcrIxD+ISIaaz6phzsqkvhDtUEV/eGOwihPHe8BEHE979S0pSD?= =?us-ascii?Q?pFCHGTcyolFJZYHJ3l+jzkzR4RxJZdvgqSGxGTIR2WdEdrr+IXraurshgsy5?= =?us-ascii?Q?5NP4pFtQe0ymnHgDbf6GLMCz2mvCMhxEmKCKIjeqt+9VFBGXtFMe74mOIQ+W?= =?us-ascii?Q?kflCTDlfoSYM2vOTVmdl2kd0ByCf8+sxdziUoYsPov0bJkcI9UPncsD+d95U?= =?us-ascii?Q?VpvuRgOwQwBey2T+mw6o2Z5GZgWcyxGanJkxb6lGZgVoF3qT/4qVKK9tX3aK?= =?us-ascii?Q?QteeXFDO49n75l4G4jwjxdtjOC6jeZSX7wxuCB0RzobtqkRj/f5Ic2u8HLS5?= =?us-ascii?Q?du1Isw1HvZCso43RsVy/wwyoZV+flW15XybJY0v5jJtvHOjOXey5vRXKSDmS?= =?us-ascii?Q?gU83bzqiHTvFgEKbncbo6B1bDQbfiXA2bm4PeGihVCjXVKSZx0lollCgNirM?= =?us-ascii?Q?XLODdl/m+VU7QEbrVh5r7N0kwaJm3fGVrkpTjpKLUs96gmGLELqe86ILVkDv?= =?us-ascii?Q?XA9m8vqrY1misdcSmexJS4ptvVGv8WZ2HkNEeA4/19RV9Stn8+6k9HLBlpvf?= =?us-ascii?Q?00yPhvgk8mUGibm/thCc8euIOD09wfawTSq7KiKjfOFvYXKI5lSDUi3gSIqJ?= =?us-ascii?Q?smNGZJnCCQ6Rsy2XAMQDznoeOYEaXNKhT95xclWqwej/diBaBSXfr2dN835e?= =?us-ascii?Q?y53OAbLpAWozl/BgfMOecJTtlsi3Q4ocYRhShWE427Plb89bDxeKNvndF56X?= =?us-ascii?Q?jiq0crSr13RNtjBgqPWXwrak/P0auttbxibeXoolJWOVtKq5Ov4n6OCgA35x?= =?us-ascii?Q?aoSkQ1griyqxW8S7vfhD32oARmE70zmdDraobcZZObbQX+96dXbMiryJGma0?= =?us-ascii?Q?ToNvODcq6BLFm5oz0IcrzelSEk5ooMRvmCmcwGYSuJwGVR4VBLprt4XMsY3f?= =?us-ascii?Q?oqqGjTyXReXcyR9daJBofmA+o0Fxt0rAkxBHBzxbG1261vU6/tr52UYdbM2A?= =?us-ascii?Q?yziGjdpptU0sHo9DvCdgAnaFWwDBNzvkyiRReANFHqWUtxrDlFWV9T2O6MMh?= =?us-ascii?Q?3sFY3bClBFucy5MGU+YpGIRmIdmbvyHt8i2M6y/YqtsNDm5dz6KnerHLtOQR?= =?us-ascii?Q?nhODFayjIn2qCde2jzveTDN4yGfFRagqwRcfXOijiJ0c9FD/9PWKZSX7buFM?= =?us-ascii?Q?Xvl3GE8tvXZioxWzKiSDEC+2cwM7qHMRAL+4L5tLsMdgxATboVOzzFnjxqob?= =?us-ascii?Q?gmtBqZ93v7PmPxb8uNEsi+Pb3zTng7gecXsUsldvs44vKOQvEl0il0+vVoFo?= =?us-ascii?Q?4YcOlgSyrJuNepOa/Hhlu+TCmM0JRrV2b5YeIJmPql1SrV2R5JN4WMW8df2z?= =?us-ascii?Q?3h0Svv1iM1kJLwViNEr0WPJXNSYZ8xBoa7GPf3eI?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY5PR11MB6487.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e6ab4f1-71d3-4d6f-89ce-08db0b0eabf2 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2023 02:29:44.5147 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: O8bh0xJuBmQL22hiJGFYncg3zLk+4jzSi21AnxMCws45CYAGwF/mHRMpZlTrBOoPndlSxMI8JVCd6t6NXcpfdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB6829 X-OriginatorOrg: intel.com 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 Hi Stephen, > -----Original Message----- > From: Stephen Hemminger > Sent: Friday, February 10, 2023 9:07 AM > To: dev@dpdk.org > Cc: Stephen Hemminger ; Hu, Jiayu > ; Konstantin Ananyev > ; Mark Kavanagh > > Subject: [PATCH v3 01/16] gso: remove logtype >=20 > If a large packet is passed into GSO routines of unknown protocol then li= brary > would log a message and pass it through. This is incorrect behaviour on m= any > levels: > - it allows oversize packet to get passed on to NIC driver Applications use SW GSO only if NIC segmentation is not supported. For a burst of packets mixed with different packet types, GSO doesn't process the packet with unsupported types, and the oversize packets go to NIC and get dropped finally. I presume this case frequently happen in real cases. > - 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. >=20 > The fix is to just return -EINVAL which is what this library does in many= other > places when looking at headers. >=20 > 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(-) >=20 > 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[] =3D { > {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. */ >=20 > /* 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 =3D 0; > + ret =3D -EINVAL; If applications want to know that the packet is failed on SW GSO, I think ENOTSUP is better than EINVAL, as it is not invalid input from users. Thanks, Jiayu > } >=20 > if (ret < 0) { > -- > 2.39.1