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 B800441DBC; Fri, 3 Mar 2023 03:16:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54632427EE; Fri, 3 Mar 2023 03:16:47 +0100 (CET) Received: from DM6FTOPR00CU001-vft-obe.outbound.protection.outlook.com (mail-cusazon11020020.outbound.protection.outlook.com [52.101.61.20]) by mails.dpdk.org (Postfix) with ESMTP id DCD7340687; Fri, 3 Mar 2023 03:16:45 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OzdUbZt5Ri/XeAy02RYNCKdE+2NT3cmUZAd99tT5mjq3WQ7V0yca1vEUnt+Gc+HzPOn25bPK6OX0YvMfH+C6v1sVC5glegQx0kzUe2/PxfSlbvALR5ZJySz8Rc9ywneI25mrYD5571b5xb0B0ahqdc1IUI1XmIe2/T8mpz808E0/lyNjei3QKcowWu0697iJloadXKyaypxT2yMenuU1/1IjfkH3NSRNazKeQKnHQLxjS4CToQR9oHCHSoXaukez7apOxKsQMOmp0osKPQzybEY0P+IB6TrQis5iiyPTASW0Q7Z7mRsp8iIzh3eNXfcG00FtwYRWGEEnBPcDqY09xw== 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=H9COA1ktZZvFhV6r+QazxbTeI4n1IEGl0F7elHsI0X0=; b=Cibq+PGsakgPba8aRwCiIRg+bnGuc1tEopXFGnvuX0gWn598LFopiZ9g9IS75ukzJtzhmZvHaQbBeIsRnFkJW1gKoHGTW51HdhR3VPIqjxju2K4SpDmSLzw1wMElZaf1DtRHAAqezeDHiog5lgbOpQmlPpI865X8y5HTznfMHpLYW8m+KMGCE5mQtSfZpqmdZ+WWU2jG5SPasonNFm5PbQB0I/xNuupe1XFSg+RXhJxqfP01hVvnINgt4epb395Cl1yoPzmQUJvnM5h53ZMbklB6genfvHn9tV5zVYnUltYEDLfY9aUHP85p5Ro9yZV7XAqdQkA6FXH2kj+0TlBjUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H9COA1ktZZvFhV6r+QazxbTeI4n1IEGl0F7elHsI0X0=; b=VXDZSgm3zvq+BZfH/qjDEXcOUVcoeSXHj3HmcLsoUGoLcrCV4Z2n/K9lSEhCUROOxRkJR3akm1NOqVap/y9pvGs7OlEaNxnmzDq4FCbKUoCDaXxbtz51qxst8pepFBexNynPpK8nHtX9ih9AdnJPBuzjDmN04BjnrqSSFDQ9134= Received: from PH7PR21MB3263.namprd21.prod.outlook.com (2603:10b6:510:1db::16) by BL1PR21MB3043.namprd21.prod.outlook.com (2603:10b6:208:387::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.7; Fri, 3 Mar 2023 02:16:42 +0000 Received: from PH7PR21MB3263.namprd21.prod.outlook.com ([fe80::98e3:81df:cbed:886d]) by PH7PR21MB3263.namprd21.prod.outlook.com ([fe80::98e3:81df:cbed:886d%4]) with mapi id 15.20.6178.006; Fri, 3 Mar 2023 02:16:42 +0000 From: Long Li To: Stephen Hemminger , Ferruh Yigit CC: "longli@linuxonhyperv.com" , Thomas Monjalon , Andrew Rybchenko , Jerin Jacob Kollanukkaran , David Marchand , "dev@dpdk.org" , Ajay Sharma , "stable@dpdk.org" , Luca Boccassi , Qi Z Zhang , Ajit Khaparde , Bruce Richardson , Konstantin Ananyev , Olivier Matz , Honnappa Nagarahalli Subject: RE: [PATCH] net/mana: use RTE_LOG_DP for logs on datapath Thread-Topic: [PATCH] net/mana: use RTE_LOG_DP for logs on datapath Thread-Index: AQHZRjUFXhaisXbQZkOQdNjmWQDEma7ck+WAgABDk4CAAY1RAIAJ+raQ Date: Fri, 3 Mar 2023 02:16:42 +0000 Message-ID: References: <1677012145-3559-1-git-send-email-longli@linuxonhyperv.com> <20230223100917.282f191c@hermes.local> <20230224095120.32c25481@hermes.local> In-Reply-To: <20230224095120.32c25481@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=8c3b8fda-0b11-4c2f-8780-294d9976e7ba; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-03-03T02:15:00Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR21MB3263:EE_|BL1PR21MB3043:EE_ x-ms-office365-filtering-correlation-id: 47c71fba-841f-496c-3f35-08db1b8d545d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gzKW2oBbJAT5itSIkVtB7++FIxPQUs94r/ushqCpyoAqk0jchazyJnyUsBRDMwrSLpkPn30Rh+9CHtEAxIooiuM6pR73m9EXrrqZcQjWI0cnl3s8D7iJdRsEEWPaRwTXggFpJ5ckElirSj2Y9z/68GEYf691DlSMvbGBzi07dpj0kf3fXBO3xJk4Lg+cnEI+v0Yuw1fxb4nu48eC4Wl3tctszbwPk7MdHE3pzXUZya/occAlUghXY6Pij8msPvvHYMEm62eLGBjQbRTQhoTiJrKKP44/EbG392cSNLYLX8Kf6OAlF0j70mX7KZYDiAJuxsgvREIfv25mYf76AvjsZgx0s/Vrzor5vEgorOj6A2wjaEwYwAH0gTF6oVeW75lJvCL5WcyfBQnUFJygB0OJB6BK4X/3cERGW+NLu+WLEzL0nkx5NZq+Zkugt4xCgVxU444Qcur+2OhBbPYq6eRBUywPSsHFyznBj6t7i4SghwLVLrP0VZL8rv5ebOibLFCTM5IwoXMLBMar89kCjWO9g+wLQD2tDkhPMILrpkSnpQ6tL9iaOYuMp1VjiwH28d2DBL5YtcvtAaVZK876IFuGFd2+8EpsdP+fvYDHBJO0XzuwZDnT/x0kyfToIOjEmJj3/4CBdA2PDA4NG7yePEFBlYAqUxnMUo/j23xmO4w/h1YfAWbUpDWQbfsGSpY/SzJqMizs2ZDNrcfI6QBrHC4u+rGJWdXXQBFRyphqqF5/JsYvKsIPcwl1c9p/6W2LXFVp x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR21MB3263.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(39860400002)(396003)(366004)(136003)(346002)(451199018)(9686003)(82950400001)(7416002)(82960400001)(26005)(186003)(52536014)(30864003)(2906002)(66946007)(76116006)(122000001)(33656002)(10290500003)(71200400001)(8990500004)(478600001)(41300700001)(8936002)(38070700005)(38100700002)(5660300002)(6506007)(7696005)(86362001)(4326008)(66556008)(66476007)(8676002)(66446008)(55016003)(110136005)(83380400001)(64756008)(54906003)(316002)(579004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?vDvjlPIrg0Tf7lc2bzfPPmxVuomypDvZfN9Z5HGoitjADV4wsx5Y1+a7NnW0?= =?us-ascii?Q?9VF9i3+TaDrvk7bvsEFAinM+U12wpxmW7LfKeKx9/Il5Eaocom5W81waJC3f?= =?us-ascii?Q?K5tUEd6pdouCiBSYSc7vOum7gxsEEtzr92wnaA8CG6V8Ik01fJdN9C1KHePP?= =?us-ascii?Q?KrHsPMnMaLfThCCuY4LMc/0URi1qX20NctsrpWAgofEUTLN86Z0dQ4cem3qK?= =?us-ascii?Q?eKeG0wfu9jS+7LIKMK+G3pRyDtPvchbpo9eEXaVS8cxCQ9PIxxkD5ZKr0V47?= =?us-ascii?Q?vEBmQ9qDkQhC26it5uduf+cjWNyOorcDeCCwCBAw0sn2hh9/eM2WR5YByxjD?= =?us-ascii?Q?0NTzQ/rpd6K+mrwa19dbHi1kr20TpcEq7GqZ+elanzuDd8l2nDAubOymFt0u?= =?us-ascii?Q?hqnl9JNjpuPiyi+FZR02UDreY/Sqdl0EdTDjpVeKx1kwXpRXHwedOkfeDESh?= =?us-ascii?Q?9KkHF+0NfkSgFqWor/D01kqKOGQ2sUKUIo2J2imevn5BS3D34mr6aXZBSZq7?= =?us-ascii?Q?CpvMfuvX6RMI2GmuQo13aqrFnVjTQ8E29UBcewcBlPbamMll8x7FqRNkt42a?= =?us-ascii?Q?TDiAfvZqyM2SLaa42qG8+rvSkDYXWp4UxcgC4Idi3qytD9gk6dlXaFo2BL63?= =?us-ascii?Q?Dm+V4ztlxnElmjiaWDU0WSiMXtgl63YL08HDXSyxtf56mPS2NiFS3PIrylQ9?= =?us-ascii?Q?/0WROLHwQm/BBU3apkCNKuta3ALvA88l+BEsXEViDuSDzOwWSx/istm1drac?= =?us-ascii?Q?qf7zpq/WWzQUJQCHs5bYzS3d0uwc5kOSiA+5EzLVQVbMb8CrbX7U1vocBizh?= =?us-ascii?Q?GUZv5glaW5ofvF8MTCHt+edgYEZ6wVW0P26zwFaQ9o6ZC6dzCOvVaBjyjUG5?= =?us-ascii?Q?RFdxQ/dN9YVdaw4T/L0c91ifS1j5MiljLaWRbxYnLOVsDygwaZoCYJGz69Xs?= =?us-ascii?Q?kCi7vv5K7EVsFvZdZZR+dLoW5W1RIDGF0xqB8B1/alGKhAUP0tFcWj/+FC8c?= =?us-ascii?Q?dsU8zcyzhKlEBdUJEqafa798r655RfrGHeIOwSsRQHwAoROW7WOVEZdEvzbE?= =?us-ascii?Q?Hx72cEAZg7lWo46vcNpk5ulH/uWMrnLTvhsoiohEjQnWl8Spop/DbbJdZT5v?= =?us-ascii?Q?hhZyj3Wwsx5iS708b3Cqz5M412PdYTQKXJqVpV6M0esHcyd+TJlZmZLTobPG?= =?us-ascii?Q?r0Hq+THVXlyqw5iFBtCc+eiOw3Q5FxpCxa6l1EEMNP705Fo8xtjrdFb64aSH?= =?us-ascii?Q?RnoqEgoTV9JJPKKnG4TeIYnDCXJUtHorm1+X6H8GxLyCqX0jEza97lYBAS1n?= =?us-ascii?Q?YMKikfYj4Q1fWpiCXqSzRw1SlGRM0OZ5oCXE/jiupNAmmVz8umJjieiFrV5B?= =?us-ascii?Q?0GsHvyGPri+PGnHlsV0CSI86o0v44DZ0kLt45IGIw5jWZ5DxGdMzqzrCLRSC?= =?us-ascii?Q?kgVatpPvukmgqP3G5PN2bPP0qZsu5ZSMQ653bU3OrUL0Le4KY0ulrgsrQPuV?= =?us-ascii?Q?x84o1NJFvmcFke+QtZkkYBsPRtSfoTLCcQ+0+G/2W4mn1lJlOFmdlQwCCbPK?= =?us-ascii?Q?qKDwgwGBiVjulx3nJKOew+szlM1rpuIhVlYh4maK?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR21MB3263.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47c71fba-841f-496c-3f35-08db1b8d545d X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2023 02:16:42.2324 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: YANjw9cSpl0VXfHC8NGr5aSk16Lid8t5giBZkYs+8EhB7pTI+Dno1G18zCm7VdUYX6o00pFruhAuY3cbFTVhFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR21MB3043 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 > Subject: Re: [PATCH] net/mana: use RTE_LOG_DP for logs on datapath >=20 > On Thu, 23 Feb 2023 10:09:17 -0800 > Stephen Hemminger wrote: >=20 > > On Thu, 23 Feb 2023 14:07:25 +0000 > > Ferruh Yigit wrote: > > > > > Overall I am not sure if anyone is interested in driver datapath > > > logs other than driver developers themselves. > > > > > > For datapath logging I think there are two concerns, > > > 1) It should not eat *any* cycles unless explicitly enabled > > > 2) Capability of enable/disable them because of massive amount of > > > log it can generate > > > > > > > > > Currently there are two existing approaches for driver datapath loggi= ng: > > > i) Controlled by 'RTE_ETHDEV_DEBUG_RX/TX' compile time flag, > > > when enabled 'rte_log()' is used with Rx/Tx specific log type. > > > ii) 'RTE_LOG_DP' ', compile time control per logtype via > > > 'RTE_LOG_DP_LEVEL', > > > when enabled 'rte_log()' is used with PMD logtype. > > > > > > > > > In (ii), need to re-compile code when you need to increase the log > > > verbosity, and it leaks to production code as mentioned above. > > > > > > For (i), developer compiles once enabling debug, later can fine > > > grain log level dynamically. This is more DPDK developer focused appr= oach. > > > > > > > > > [1] > > > According above, what do you think to retire 'RTE_LOG_DP', (at least > > > within ethdev datapath), and chose (i) as preferred datapath logging? > > > > I agree, the current tx/rx logging is a mess. > > Each driver is different, each driver has to have something to enable > > it; and it really isn't useful beyond the driver developer. > > > > Using tracing seems like a much better option. Could we agree on a > > common set of trace points for drivers and fix all drivers to use the s= ame > thing. > > Probably will cause some upset among driver developers: > > "where did my nice printf's go, now I have to learn tracing" > > but DPDK has a good facility here, lets use it. > > > > My proposal would be: > > - agree on common set of trace points > > - apply to all drivers > > - remove RTE_LOG_DP() > > - remove per driver RX/TX options > > - side effect, more uses of RTE_LOGTYPE_PMD go away. >=20 > Here is an example of using tracepoints instead. > Compile tested for example only. >=20 > Note: using tracepoints it is possible to keep some of the tracepoints ev= en if > fastpath is not enabled. Things like running out of Tx or Mbuf is not so= mething > that is perf critical; but would be good for application to see. Thank you for the example. I sent another patch converting data path logs (mana) to trace points. Long >=20 >=20 > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 7 -- > drivers/net/ixgbe/ixgbe_logs.h | 18 ----- > drivers/net/ixgbe/ixgbe_rxtx.c | 95 +++++++------------------- > drivers/net/ixgbe/ixgbe_trace.h | 110 > +++++++++++++++++++++++++++++++ > 4 files changed, 133 insertions(+), 97 deletions(-) create mode 100644 > drivers/net/ixgbe/ixgbe_trace.h >=20 > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c > b/drivers/net/ixgbe/ixgbe_ethdev.c > index 88118bc30560..07f8ccdd97cb 100644 > --- a/drivers/net/ixgbe/ixgbe_ethdev.c > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c > @@ -8317,10 +8317,3 @@ > RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe_vf, >=20 > RTE_LOG_REGISTER_SUFFIX(ixgbe_logtype_init, init, NOTICE); > RTE_LOG_REGISTER_SUFFIX(ixgbe_logtype_driver, driver, NOTICE); > - > -#ifdef RTE_ETHDEV_DEBUG_RX > -RTE_LOG_REGISTER_SUFFIX(ixgbe_logtype_rx, rx, DEBUG); -#endif -#ifdef > RTE_ETHDEV_DEBUG_TX -RTE_LOG_REGISTER_SUFFIX(ixgbe_logtype_tx, tx, > DEBUG); -#endif diff --git a/drivers/net/ixgbe/ixgbe_logs.h > b/drivers/net/ixgbe/ixgbe_logs.h index 00ef797ca103..f70fa1fd4afd 100644 > --- a/drivers/net/ixgbe/ixgbe_logs.h > +++ b/drivers/net/ixgbe/ixgbe_logs.h > @@ -12,24 +12,6 @@ extern int ixgbe_logtype_init; >=20 > #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>") >=20 > -#ifdef RTE_ETHDEV_DEBUG_RX > -extern int ixgbe_logtype_rx; > -#define PMD_RX_LOG(level, fmt, args...) \ > - rte_log(RTE_LOG_ ## level, ixgbe_logtype_rx, \ > - "%s(): " fmt "\n", __func__, ## args) > -#else > -#define PMD_RX_LOG(level, fmt, args...) do { } while (0) -#endif > - > -#ifdef RTE_ETHDEV_DEBUG_TX > -extern int ixgbe_logtype_tx; > -#define PMD_TX_LOG(level, fmt, args...) \ > - rte_log(RTE_LOG_ ## level, ixgbe_logtype_tx, \ > - "%s(): " fmt "\n", __func__, ## args) > -#else > -#define PMD_TX_LOG(level, fmt, args...) do { } while (0) -#endif > - > extern int ixgbe_logtype_driver; > #define PMD_DRV_LOG_RAW(level, fmt, args...) \ > rte_log(RTE_LOG_ ## level, ixgbe_logtype_driver, "%s(): " fmt, \ diff -= - > git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c ind= ex > c9d6ca9efea4..f9f0ffebee8e 100644 > --- a/drivers/net/ixgbe/ixgbe_rxtx.c > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c > @@ -46,6 +46,7 @@ > #include >=20 > #include "ixgbe_logs.h" > +#include "ixgbe_trace.h" > #include "base/ixgbe_api.h" > #include "base/ixgbe_vf.h" > #include "ixgbe_ethdev.h" > @@ -581,11 +582,8 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq) > desc_to_clean_to =3D sw_ring[desc_to_clean_to].last_id; > status =3D txr[desc_to_clean_to].wb.status; > if (!(status & rte_cpu_to_le_32(IXGBE_TXD_STAT_DD))) { > - PMD_TX_LOG(DEBUG, > - "TX descriptor %4u is not done" > - "(port=3D%d queue=3D%d)", > - desc_to_clean_to, > - txq->port_id, txq->queue_id); > + ixgbe_trace_tx_not_done(txq->port_id, txq->queue_id, > +desc_to_clean_to); > + > /* Failed to clean any descriptors, better luck next time */ > return -(1); > } > @@ -598,11 +596,8 @@ ixgbe_xmit_cleanup(struct ixgbe_tx_queue *txq) > nb_tx_to_clean =3D (uint16_t)(desc_to_clean_to - > last_desc_cleaned); >=20 > - PMD_TX_LOG(DEBUG, > - "Cleaning %4u TX descriptors: %4u to %4u " > - "(port=3D%d queue=3D%d)", > - nb_tx_to_clean, last_desc_cleaned, desc_to_clean_to, > - txq->port_id, txq->queue_id); > + ixgbe_trace_tx_done(txq->port_id, txq->queue_id, > + nb_tx_to_clean, last_desc_cleaned, > desc_to_clean_to); >=20 > /* > * The last descriptor to clean is done, so that means all the @@ - > 734,26 +729,14 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf > **tx_pkts, > if (tx_last >=3D txq->nb_tx_desc) > tx_last =3D (uint16_t) (tx_last - txq->nb_tx_desc); >=20 > - PMD_TX_LOG(DEBUG, "port_id=3D%u queue_id=3D%u pktlen=3D%u" > - " tx_first=3D%u tx_last=3D%u", > - (unsigned) txq->port_id, > - (unsigned) txq->queue_id, > - (unsigned) pkt_len, > - (unsigned) tx_id, > - (unsigned) tx_last); > - > + ixgbe_trace_tx(txq->port_id, txq->queue_id, pkt_len, tx_id, > tx_last); > /* > * Make sure there are enough TX descriptors available to > * transmit the entire packet. > * nb_used better be less than or equal to txq->tx_rs_thresh > */ > if (nb_used > txq->nb_tx_free) { > - PMD_TX_LOG(DEBUG, > - "Not enough free TX descriptors " > - "nb_used=3D%4u nb_free=3D%4u " > - "(port=3D%d queue=3D%d)", > - nb_used, txq->nb_tx_free, > - txq->port_id, txq->queue_id); > + ixgbe_trace_tx_full(txq->port_id, txq->queue_id, > nb_used, > +txq->nb_tx_free); >=20 > if (ixgbe_xmit_cleanup(txq) !=3D 0) { > /* Could not clean any descriptors */ @@ - > 764,17 +747,8 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf > **tx_pkts, >=20 > /* nb_used better be <=3D txq->tx_rs_thresh */ > if (unlikely(nb_used > txq->tx_rs_thresh)) { > - PMD_TX_LOG(DEBUG, > - "The number of descriptors needed > to " > - "transmit the packet exceeds the " > - "RS bit threshold. This will impact " > - "performance." > - "nb_used=3D%4u nb_free=3D%4u " > - "tx_rs_thresh=3D%4u. " > - "(port=3D%d queue=3D%d)", > - nb_used, txq->nb_tx_free, > - txq->tx_rs_thresh, > - txq->port_id, txq->queue_id); > + ixgbe_trace_tx_thresh(txq->port_id, txq- > >queue_id, > + nb_used, txq->nb_tx_free, > txq->tx_rs_thresh); > /* > * Loop here until there are enough TX > * descriptors or until the ring cannot be @@ - > 918,10 +892,7 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf > **tx_pkts, >=20 > /* Set RS bit only on threshold packets' last descriptor */ > if (txq->nb_tx_used >=3D txq->tx_rs_thresh) { > - PMD_TX_LOG(DEBUG, > - "Setting RS bit on TXD id=3D" > - "%4u (port=3D%d queue=3D%d)", > - tx_last, txq->port_id, txq->queue_id); > + ixgbe_trace_tx_rs(txq->port_id, txq->queue_id, > tx_last); >=20 > cmd_type_len |=3D IXGBE_TXD_CMD_RS; >=20 > @@ -944,9 +915,7 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf > **tx_pkts, > /* > * Set the Transmit Descriptor Tail (TDT) > */ > - PMD_TX_LOG(DEBUG, "port_id=3D%u queue_id=3D%u tx_tail=3D%u > nb_tx=3D%u", > - (unsigned) txq->port_id, (unsigned) txq->queue_id, > - (unsigned) tx_id, (unsigned) nb_tx); > + ixgbe_trace_tx_tail(txq->port_id, txq->queue_id, tx_id, nb_tx); > IXGBE_PCI_REG_WC_WRITE_RELAXED(txq->tdt_reg_addr, tx_id); > txq->tx_tail =3D tx_id; >=20 > @@ -1717,9 +1686,7 @@ rx_recv_pkts(void *rx_queue, struct rte_mbuf > **rx_pkts, > if (ixgbe_rx_alloc_bufs(rxq, true) !=3D 0) { > int i, j; >=20 > - PMD_RX_LOG(DEBUG, "RX mbuf alloc failed > port_id=3D%u " > - "queue_id=3D%u", (unsigned) rxq->port_id, > - (unsigned) rxq->queue_id); > + ixgbe_trace_rx_mbuf_alloc_failed(rxq->port_id, rxq- > >queue_id); >=20 > rte_eth_devices[rxq->port_id].data- > >rx_mbuf_alloc_failed +=3D > rxq->rx_free_thresh; > @@ -1851,17 +1818,12 @@ ixgbe_recv_pkts(void *rx_queue, struct > rte_mbuf **rx_pkts, > * to happen by sending specific "back-pressure" flow control > * frames to its peer(s). > */ > - PMD_RX_LOG(DEBUG, "port_id=3D%u queue_id=3D%u rx_id=3D%u " > - "ext_err_stat=3D0x%08x pkt_len=3D%u", > - (unsigned) rxq->port_id, (unsigned) rxq->queue_id, > - (unsigned) rx_id, (unsigned) staterr, > - (unsigned) rte_le_to_cpu_16(rxd.wb.upper.length)); > + ixgbe_trace_rx(rxq->port_id, rxq->queue_id, rx_id, > + staterr, rte_le_to_cpu_16(rxd.wb.upper.length)); >=20 > nmb =3D rte_mbuf_raw_alloc(rxq->mb_pool); > if (nmb =3D=3D NULL) { > - PMD_RX_LOG(DEBUG, "RX mbuf alloc failed > port_id=3D%u " > - "queue_id=3D%u", (unsigned) rxq->port_id, > - (unsigned) rxq->queue_id); > + ixgbe_trace_rx_mbuf_alloc_failed(rxq->port_id, rxq- > >queue_id); > rte_eth_devices[rxq->port_id].data- > >rx_mbuf_alloc_failed++; > break; > } > @@ -1959,11 +1921,9 @@ ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf > **rx_pkts, > */ > nb_hold =3D (uint16_t) (nb_hold + rxq->nb_rx_hold); > if (nb_hold > rxq->rx_free_thresh) { > - PMD_RX_LOG(DEBUG, "port_id=3D%u queue_id=3D%u rx_tail=3D%u > " > - "nb_hold=3D%u nb_rx=3D%u", > - (unsigned) rxq->port_id, (unsigned) rxq->queue_id, > - (unsigned) rx_id, (unsigned) nb_hold, > - (unsigned) nb_rx); > + ixgbe_trace_rx_post(rxq->port_id, rxq->queue_id, > + rx_id, nb_hold, nb_rx); > + > rx_id =3D (uint16_t) ((rx_id =3D=3D 0) ? > (rxq->nb_rx_desc - 1) : (rx_id - 1)); > IXGBE_PCI_REG_WC_WRITE(rxq->rdt_reg_addr, rx_id); @@ - > 2124,17 +2084,13 @@ ixgbe_recv_pkts_lro(void *rx_queue, struct rte_mbuf > **rx_pkts, uint16_t nb_pkts, >=20 > rxd =3D *rxdp; >=20 > - PMD_RX_LOG(DEBUG, "port_id=3D%u queue_id=3D%u rx_id=3D%u " > - "staterr=3D0x%x data_len=3D%u", > - rxq->port_id, rxq->queue_id, rx_id, staterr, > - rte_le_to_cpu_16(rxd.wb.upper.length)); > + ixgbe_trace_rx(rxq->port_id, rxq->queue_id, rx_id, staterr, > + rte_le_to_cpu_16(rxd.wb.upper.length)); >=20 > if (!bulk_alloc) { > nmb =3D rte_mbuf_raw_alloc(rxq->mb_pool); > if (nmb =3D=3D NULL) { > - PMD_RX_LOG(DEBUG, "RX mbuf alloc failed " > - "port_id=3D%u queue_id=3D%u", > - rxq->port_id, rxq->queue_id); > + ixgbe_trace_rx_mbuf_alloc_failed(rxq- > >port_id, rxq->queue_id); >=20 > rte_eth_devices[rxq->port_id].data-> >=20 > rx_mbuf_alloc_failed++; > @@ -2150,10 +2106,7 @@ ixgbe_recv_pkts_lro(void *rx_queue, struct > rte_mbuf **rx_pkts, uint16_t nb_pkts, > next_rdt); > nb_hold -=3D rxq->rx_free_thresh; > } else { > - PMD_RX_LOG(DEBUG, "RX bulk alloc failed " > - "port_id=3D%u queue_id=3D%u", > - rxq->port_id, rxq->queue_id); > - > + ixgbe_trace_rx_mbuf_alloc_failed(rxq- > >port_id, rxq->queue_id); > rte_eth_devices[rxq->port_id].data-> >=20 > rx_mbuf_alloc_failed++; > break; > @@ -2307,9 +2260,7 @@ ixgbe_recv_pkts_lro(void *rx_queue, struct > rte_mbuf **rx_pkts, uint16_t nb_pkts, > * hardware point of view... > */ > if (!bulk_alloc && nb_hold > rxq->rx_free_thresh) { > - PMD_RX_LOG(DEBUG, "port_id=3D%u queue_id=3D%u rx_tail=3D%u > " > - "nb_hold=3D%u nb_rx=3D%u", > - rxq->port_id, rxq->queue_id, rx_id, nb_hold, nb_rx); > + ixgbe_trace_rx_post(rxq->port_id, rxq->queue_id, rx_id, > nb_hold, > +nb_rx); >=20 > rte_wmb(); > IXGBE_PCI_REG_WC_WRITE_RELAXED(rxq->rdt_reg_addr, > prev_id); diff --git a/drivers/net/ixgbe/ixgbe_trace.h > b/drivers/net/ixgbe/ixgbe_trace.h new file mode 100644 index > 000000000000..f260edd6fe3a > --- /dev/null > +++ b/drivers/net/ixgbe/ixgbe_trace.h > @@ -0,0 +1,110 @@ > +/* SPDX-License-Identifier: BSD-3-Clause */ > + > +#ifndef _IXGBE_TRACE_H_ > +#define _IXGBE_TRACE_H_ > + > +#include > + > +RTE_TRACE_POINT( > + ixgbe_trace_rx_mbuf_alloc_failed, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(rx_queue_id); > +); > + > +RTE_TRACE_POINT_FP( > + ixgbe_trace_rx, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, > + uint16_t rx_id, uint32_t staterr, uint16_t len), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(rx_queue_id); > + rte_trace_point_emit_u16(rx_id); > + rte_trace_point_emit_u32(staterr); > + rte_trace_point_emit_u16(len); > +); > + > +RTE_TRACE_POINT_FP( > + ixgbe_trace_rx_post, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t rx_queue_id, > + uint16_t rx_id, uint16_t nb_hold, uint16_t nb_rx), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(rx_queue_id); > + rte_trace_point_emit_u16(rx_id); > + rte_trace_point_emit_u16(nb_hold); > + rte_trace_point_emit_u16(nb_rx); > +); > + > +RTE_TRACE_POINT_FP( > + ixgbe_trace_tx_done, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, > + uint16_t nb_to_clean, uint16_t last_desc_cleaned, > + uint16_t desc_to_clean), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(tx_queue_id); > + rte_trace_point_emit_u16(nb_to_clean); > + rte_trace_point_emit_u16(last_desc_cleaned); > + rte_trace_point_emit_u16(desc_to_clean); > +); > + > +RTE_TRACE_POINT_FP( > + ixgbe_trace_tx_not_done, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, > + uint16_t desc_to_clean), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(tx_queue_id); > + rte_trace_point_emit_u16(desc_to_clean); > +); > + > +RTE_TRACE_POINT_FP( > + ixgbe_trace_tx, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, > + uint16_t pktlen, uint16_t tx_first, uint16_t tx_last), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(tx_queue_id); > + rte_trace_point_emit_u16(pktlen); > + rte_trace_point_emit_u16(tx_first); > + rte_trace_point_emit_u16(tx_last); > +); > + > +RTE_TRACE_POINT( > + ixgbe_trace_tx_full, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, > + uint16_t nb_used, uint16_t nb_free), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(tx_queue_id); > + rte_trace_point_emit_u16(nb_used); > + rte_trace_point_emit_u16(nb_free); > +); > + > +RTE_TRACE_POINT( > + ixgbe_trace_tx_thresh, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, > + uint16_t nb_used, uint16_t nb_free, > + uint16_t tx_rs_thresh), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(tx_queue_id); > + rte_trace_point_emit_u16(nb_used); > + rte_trace_point_emit_u16(nb_free); > + rte_trace_point_emit_u16(tx_rs_thresh); > +); > + > +RTE_TRACE_POINT_FP( > + ixgbe_trace_tx_rs, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, > + uint16_t txd_id), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(tx_queue_id); > + rte_trace_point_emit_u16(txd_id); > +); > + > +RTE_TRACE_POINT_FP( > + ixgbe_trace_tx_tail, > + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint16_t tx_queue_id, > + uint16_t tx_tail, uint16_t nb_tx), > + rte_trace_point_emit_u16(port_id); > + rte_trace_point_emit_u16(tx_queue_id); > + rte_trace_point_emit_u16(tx_tail); > + rte_trace_point_emit_u16(nb_tx); > +); > + > +#endif /* _IXGBE_LOGS_H_ */ > -- > 2.39.1 >=20 >=20