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 422E145AAE; Fri, 4 Oct 2024 15:37:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D813940E34; Fri, 4 Oct 2024 15:37:09 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id F2C8F4066D for ; Fri, 4 Oct 2024 15:37:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728049027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Uwy8aThd0ReoJphcv5h05wbClU1l7Nm8FkYaiHMGY8=; b=AsZw45U5qJKStQGdzRv3/sVXGrVuhN7pnZCeG6zTETNTxg1drh9K8ZmjjlTq9WUt5MeKss E93uVr9eHUKyApgEFQ1YEI6do6gfqoplQ0yA31uGFgNjUM4YNER7DDVkLmQFtFwSCTJZtt Bl7h+vk1OL8nZ6h3i6Q71vNoTk+rrCk= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-271-C4yeyL5IOveh4wYWYf2Z3w-1; Fri, 04 Oct 2024 09:37:06 -0400 X-MC-Unique: C4yeyL5IOveh4wYWYf2Z3w-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2fabf9789a2so15933591fa.2 for ; Fri, 04 Oct 2024 06:37:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728049025; x=1728653825; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+Uwy8aThd0ReoJphcv5h05wbClU1l7Nm8FkYaiHMGY8=; b=LEy+yXJtQ//5ypMRB2RuUMGK+pnXRCqPosVVMrcYTQkFHXI01bk6kXpXGGBGnpFAs/ Mz1v4lCS0Cwevk8x87BAlwBi60lXCJ3XQPTnbVevrqD5fn6GTD3ngfiRsEx34k8XIWAx P8qWXT1EXOYzeaN1gYnxm7ZMiLZwTs+++aaG3WuOG25pl8cWaF592FPHaC9iA0NRTomP uxHi0HStDeB230dXTx5OOCHOZET1qn3a8fmJKaYSEsq0509mOiWgiWC8DpqrqZbb5Pwx MUHQOh32gTIpgDbS+ug47RqfjPLY6M0brP1PuWBVOQ7SRwJHYVbRe/RE5FB2q1PMI1Z5 /tmQ== X-Gm-Message-State: AOJu0Yy91V9Zl6zTwfaJqd7cl2hPbVVCPM3JnN9PBlOn1MdQ7FG644TL 1f5gI2dhXYtVV7C1UjRVEkJKzrXVyBhE71k/GD3zKcfUMgX78g45EnlEisi4Jt4QoOYzbwefacE zwE7ymRN+/7gnZDI/pX6xlZSViMOOTe+Lxc5b5yFak6op3+31BKORimdUL+L9h/YHA651GcMLeu pWeQUYMU01y0zgCW4= X-Received: by 2002:a05:651c:154b:b0:2f7:51e3:fe2f with SMTP id 38308e7fff4ca-2faf3c1cac3mr15932691fa.13.1728049024859; Fri, 04 Oct 2024 06:37:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTjBjpRF3x1vodti38/+8tqIfB/ICzBcOA019VFRAq7aLmWe2m2UvezcsWeY0GfmG2B4GXHRqMIf7uTSr9AXQ= X-Received: by 2002:a05:651c:154b:b0:2f7:51e3:fe2f with SMTP id 38308e7fff4ca-2faf3c1cac3mr15932481fa.13.1728049024331; Fri, 04 Oct 2024 06:37:04 -0700 (PDT) MIME-Version: 1.0 References: <20240806084136.3212615-1-g.singh@nxp.com> <20240806102732.3225536-1-g.singh@nxp.com> <20240806102732.3225536-8-g.singh@nxp.com> In-Reply-To: <20240806102732.3225536-8-g.singh@nxp.com> From: David Marchand Date: Fri, 4 Oct 2024 15:36:53 +0200 Message-ID: Subject: Re: [v2 7/7] crypto/dpaa2_sec: rework debug code To: Gagandeep Singh Cc: dev@dpdk.org, Hemant Agrawal , Jun Yang , Akhil Goyal , Thomas Monjalon X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hello guys, On Tue, Aug 6, 2024 at 12:28=E2=80=AFPM Gagandeep Singh w= rote: > > From: Jun Yang > > Output debug information according to various modes. > > Signed-off-by: Jun Yang > --- > drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 87 +++++++++++++++------ > 1 file changed, 63 insertions(+), 24 deletions(-) > > diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto= /dpaa2_sec/dpaa2_sec_dpseci.c > index 1e28c71b53..a293a21881 100644 > --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > @@ -1095,7 +1095,7 @@ build_auth_fd(dpaa2_sec_session *sess, struct rte_c= rypto_op *op, > > static int > build_cipher_sg_fd(dpaa2_sec_session *sess, struct rte_crypto_op *op, > - struct qbman_fd *fd, __rte_unused uint16_t bpid) > + struct qbman_fd *fd, uint16_t bpid) > { > struct rte_crypto_sym_op *sym_op =3D op->sym; > struct qbman_fle *ip_fle, *op_fle, *sge, *fle; > @@ -1105,6 +1105,10 @@ build_cipher_sg_fd(dpaa2_sec_session *sess, struct= rte_crypto_op *op, > struct rte_mbuf *mbuf; > uint8_t *iv_ptr =3D rte_crypto_op_ctod_offset(op, uint8_t *, > sess->iv.offset); > +#if (RTE_LOG_DEBUG <=3D RTE_LOG_DP_LEVEL) > + char debug_str[1024]; > + int offset; > +#endif > > data_len =3D sym_op->cipher.data.length; > data_offset =3D sym_op->cipher.data.offset; > @@ -1210,14 +1214,26 @@ build_cipher_sg_fd(dpaa2_sec_session *sess, struc= t rte_crypto_op *op, > DPAA2_SET_FD_COMPOUND_FMT(fd); > DPAA2_SET_FD_FLC(fd, DPAA2_VADDR_TO_IOVA(flc)); > > - DPAA2_SEC_DP_DEBUG( > - "CIPHER SG: fdaddr =3D%" PRIx64 " bpid =3D%d meta =3D%d" > - " off =3D%d, len =3D%d\n", > +#if (RTE_LOG_DEBUG <=3D RTE_LOG_DP_LEVEL) > + offset =3D sprintf(debug_str, > + "CIPHER SG: fdaddr =3D%" 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 +=3D sprintf(&debug_str[offset], > + "bpid =3D %d ", bpid); > + } > + offset +=3D sprintf(&debug_str[offset], > + "private size =3D %d ", > + mbuf->pool->private_data_size); > + offset +=3D sprintf(&debug_str[offset], > + "off =3D%d, len =3D%d\n", DPAA2_SEC_DP_DEBUG already appends a \n, don't add a new one. > + DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_LEN(fd)); > + DPAA2_SEC_DP_DEBUG("%s", debug_str); Indentation is wrong. > +#else > + RTE_SET_USED(bpid); > +#endif > + > return 0; > } > > @@ -1233,6 +1249,10 @@ build_cipher_fd(dpaa2_sec_session *sess, struct rt= e_crypto_op *op, > uint8_t *iv_ptr =3D rte_crypto_op_ctod_offset(op, uint8_t *, > sess->iv.offset); > struct rte_mbuf *dst; > +#if (RTE_LOG_DEBUG <=3D RTE_LOG_DP_LEVEL) > + char debug_str[1024]; > + int offset; > +#endif > > data_len =3D sym_op->cipher.data.length; > data_offset =3D sym_op->cipher.data.offset; > @@ -1324,14 +1344,23 @@ build_cipher_fd(dpaa2_sec_session *sess, struct r= te_crypto_op *op, > DPAA2_SET_FLE_FIN(sge); > DPAA2_SET_FLE_FIN(fle); > > - DPAA2_SEC_DP_DEBUG( > - "CIPHER: fdaddr =3D%" PRIx64 " bpid =3D%d meta =3D%d" > - " off =3D%d, len =3D%d\n", > +#if (RTE_LOG_DEBUG <=3D RTE_LOG_DP_LEVEL) > + offset =3D sprintf(debug_str, > + "CIPHER: fdaddr =3D%" 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 +=3D sprintf(&debug_str[offset], > + "bpid =3D %d ", bpid); > + } > + offset +=3D sprintf(&debug_str[offset], > + "private size =3D %d ", > + dst->pool->private_data_size); > + offset +=3D sprintf(&debug_str[offset], > + "off =3D%d, len =3D%d\n", Idem. > + DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_LEN(fd)); > + DPAA2_SEC_DP_DEBUG("%s", debug_str); > +#endif > > return 0; > } > @@ -1564,6 +1593,10 @@ sec_fd_to_mbuf(const struct qbman_fd *fd, struct d= paa2_sec_qp *qp) > struct qbman_fle *fle; > struct rte_crypto_op *op; > struct rte_mbuf *dst, *src; > +#if (RTE_LOG_DEBUG <=3D RTE_LOG_DP_LEVEL) > + char debug_str[1024]; > + int offset; > +#endif > > if (DPAA2_FD_GET_FORMAT(fd) =3D=3D qbman_fd_single) > return sec_simple_fd_to_mbuf(fd); > @@ -1602,15 +1635,21 @@ sec_fd_to_mbuf(const struct qbman_fd *fd, struct = dpaa2_sec_qp *qp) > dst->data_len =3D len; > } > > - DPAA2_SEC_DP_DEBUG("mbuf %p BMAN buf addr %p," > - " fdaddr =3D%" PRIx64 " bpid =3D%d meta =3D%d off =3D%d, = len =3D%d\n", > - (void *)dst, > - dst->buf_addr, > - DPAA2_GET_FD_ADDR(fd), > - DPAA2_GET_FD_BPID(fd), > - rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size= , > - DPAA2_GET_FD_OFFSET(fd), > - DPAA2_GET_FD_LEN(fd)); > +#if (RTE_LOG_DEBUG <=3D RTE_LOG_DP_LEVEL) > + offset =3D sprintf(debug_str, "Mbuf %p from %s pool ", > + dst, DPAA2_GET_FD_IVP(fd) ? "SW" : "BMAN"); > + if (!DPAA2_GET_FD_IVP(fd)) { > + offset +=3D sprintf(&debug_str[offset], "bpid =3D %d ", > + DPAA2_GET_FD_BPID(fd)); > + } > + offset +=3D sprintf(&debug_str[offset], > + "private size =3D %d ", dst->pool->private_data_s= ize); > + offset +=3D sprintf(&debug_str[offset], > + "addr %p, fdaddr =3D%" PRIx64 ", off =3D%d, len = =3D%d\n", Idem. > + dst->buf_addr, DPAA2_GET_FD_ADDR(fd), > + DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_LEN(fd)); > + DPAA2_SEC_DP_DEBUG("%s", debug_str); > +#endif > > /* free the fle memory */ > if (likely(rte_pktmbuf_is_contiguous(src))) { I see this patch is already merged in next-crypto. Please, can this be fixed before reaching main? Thanks. --=20 David Marchand