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 7173745AD6; Mon, 7 Oct 2024 17:25:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 476F64026C; Mon, 7 Oct 2024 17:25:23 +0200 (CEST) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id AC6C14021E for ; Mon, 7 Oct 2024 17:25:21 +0200 (CEST) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-20b49ee353cso42870595ad.2 for ; Mon, 07 Oct 2024 08:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728314721; x=1728919521; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=YpaOZF1tc7ZOlipfe/tizPEMKKxrigylpNoSu0tG8Wk=; b=LHwOHVutCxN1SiPVNkScojIQiudN3/BWWWAJSJjRgDkPtRTcJF5hNuziiIhHFw7Ddc Dv3F+gTaX6U3GxUcfqiPbAsvaVMm6aVRYbT+K0rABkHWDtOgKouwp5eLXACpb+8bpVLV upmoeARTVeivjSDjCvCaVq7GZFCjBfrCdXyawy+NULNz96Scfd2EQo22DAUiACFQu1Lg LPNAzx3fniOxbXM63bqKK/C+LKPJ2QgLnDSzEx5mXmq7Si5uXuInwYm+ZG6YycmJq5+a kCh5r/eK2tuRIg+zEcDINNE6CWlUlEZdIIga4ue5NXi1N0YUCeD3qet0s8MmBwNE9aFo ua/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728314721; x=1728919521; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YpaOZF1tc7ZOlipfe/tizPEMKKxrigylpNoSu0tG8Wk=; b=hutHLNiyTCLWrheKPVZz05Y+ZxyNcayhPClwj3EBYu2XRk2BHt02YruIf+xfwoGU73 JPS0vkWJIUlvfAiYfVDrx1tUHe3hFbTTabTDZWCE8qxZlKv4ifjBw1KfUH2HjhIZR6ks EeXOzVBiUUlSho7qQ8NayVhB91EX4WnNOfI9W8YjPQdPcPGzbLK4D8Fnz77CGS9WPgm7 Qw4nJTolr9RsAAKwVwKhH25MMNKiJ3VsozpoC6o6pXZmlvg1JDZvbl4qY4YAYkXxEsqf 8t0MUu2y3xNDOoJc8TU+t8drb/YA2vp5SjUBMfaX1ulm1RBH8qDyPFcpjjojf7G0Ony6 2ACg== X-Gm-Message-State: AOJu0Yzu5/EWMzCVoQvqnOg+a715mO1Jz0Kgf8QK4vx5E3HiicQUEHlR /j5ODGQxzQEtyH1NGkAblQTnQcPlTdWQnJf0RAlWGL2v5cGTBEK/NMf2UCgd6mg= X-Google-Smtp-Source: AGHT+IEDj6olUNDM+nsziG2h3woPuEQ2o5rsIJA/uDa48Mb24bJbUgA3kgf+BBTVvYG6iZ+lPNSquA== X-Received: by 2002:a17:903:182:b0:20b:bd8d:4297 with SMTP id d9443c01a7336-20bfee34556mr173021345ad.49.1728314720872; Mon, 07 Oct 2024 08:25:20 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c1396d995sm40974605ad.230.2024.10.07.08.25.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 08:25:20 -0700 (PDT) Date: Mon, 7 Oct 2024 08:25:19 -0700 From: Stephen Hemminger To: Gagandeep Singh Cc: dev@dpdk.org, gakhil@marvell.com, david.marchand@redhat.com, Jun Yang Subject: Re: [PATCH] crypto/dpaa2_sec: rework debug code Message-ID: <20241007082519.0d59a74a@hermes.local> In-Reply-To: <20241007084354.852733-1-g.singh@nxp.com> References: <20241007084354.852733-1-g.singh@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Mon, 7 Oct 2024 14:13:54 +0530 Gagandeep Singh wrote: > +#if (RTE_LOG_DEBUG <= RTE_LOG_DP_LEVEL) > + offset = sprintf(debug_str, > + "CIPHER SG: fdaddr =%" PRIx64 ", from %s pool ", > DPAA2_GET_FD_ADDR(fd), > - DPAA2_GET_FD_BPID(fd), > - rte_dpaa2_bpid_info[bpid].meta_data_size, > - DPAA2_GET_FD_OFFSET(fd), > - DPAA2_GET_FD_LEN(fd)); > + bpid < MAX_BPID ? "SW" : "BMAN"); > + if (bpid < MAX_BPID) { > + offset += sprintf(&debug_str[offset], > + "bpid = %d ", bpid); > + } > + offset += sprintf(&debug_str[offset], > + "private size = %d ", > + mbuf->pool->private_data_size); > + offset += sprintf(&debug_str[offset], > + "off =%d, len =%d", > + DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_LEN(fd)); > + DPAA2_SEC_DP_DEBUG("%s", debug_str); > +#else > + RTE_SET_USED(bpid); > +#endif > + Since this code is repeated, and not in hot path why not make it a function, then the #ifdef mess would be less as well