From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 76C6EA04DB; Wed, 9 Dec 2020 20:28:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 16DFBC8F8; Wed, 9 Dec 2020 20:26:23 +0100 (CET) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 904AABE79 for ; Wed, 9 Dec 2020 20:26:20 +0100 (CET) Received: by mail-pg1-f195.google.com with SMTP id v29so1813920pgk.12 for ; Wed, 09 Dec 2020 11:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=//+B5hWo6uHS0yp8YW1/gCfTE+cWVkEuxjpErgIX+sw=; b=sAPRBEIJ0xYFlfiSGYRjzyAUCjHj9Vd+0I3bTv7Q40YMvdtV6eg/jNj7bMxVkhdjb0 DBoZEfof9HwzYskpvqsth2tBol78Gzm1osUatHhN7fXKTFR0etqhbvjyDPQGEmDUJSHJ 3B79RB+kwouPLLY1uvwqhT/hE/mKGQeTH9POu7pOg2k2uN1db5+gA8z1jsPOSXpwGI1l qUrGzI7i6iL78vMqdiact+aV+vrxO7Yik3TyIvso9E3CD1gAH6FUTVz8lMCBdWPgzmVt JZv3Q4ME0mU61SyQCGDk4Vb8ldK1zzmPNQLdK4UImhj1sEuz0NVphZfESoeCAd9vkZxX p6Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=//+B5hWo6uHS0yp8YW1/gCfTE+cWVkEuxjpErgIX+sw=; b=W4pMQuFQ60AsG18JU7wG5Tae/A8fZzXguR5mI6yp0wWg+hcaJsW/J/6OGVqVO5tsFj HcVoeN/QMm3zGb1uvsFo5xDmlSSz9ENmXh+dNlCpQzwMB3jDq7zDH7Sj81fhRZG+fDAh 4FZ+IKDdj6xRJrH2c8x3065QDw6KbsQsEK0MI98Of3yPhg75OlWqO5wnwU2VTpoJ6Oq6 fc4NMiwA1jSbSEp4aa8kQ2BpaNPSc27oo3GQrVmFZOEuqbPxp8vvRGH/u4M+viclFCmP XCrcUdYRks5YarJtT6dpvbDNGoQcSefd6QD9JtSUxV9q+YNhP6ubloukAYuJT7qLOxXt oU5Q== X-Gm-Message-State: AOAM531BrMTgTLheI/u7U8q68BQ6Dw/MDi10WBbVh8kO3wXVC5LB6bwm due5TpxUyamucSd1kB7YHXEJPA== X-Google-Smtp-Source: ABdhPJzuAYGywncybPmlNfKFROhDe3Ipkixg1aSMz5qAXn0wY2/5QGMSEtl7WIrZa4r3cZ4MWX3bAQ== X-Received: by 2002:a63:5a52:: with SMTP id k18mr3338258pgm.407.1607541979841; Wed, 09 Dec 2020 11:26:19 -0800 (PST) Received: from ?IPv6:2600:1700:6b0:fde0:38f6:904:9f94:4f03? ([2600:1700:6b0:fde0:38f6:904:9f94:4f03]) by smtp.gmail.com with ESMTPSA id w2sm3046267pjb.22.2020.12.09.11.26.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 11:26:19 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) From: Andrew Boyer In-Reply-To: <79aebafa-6b07-c546-0356-97b56f28241a@intel.com> Date: Wed, 9 Dec 2020 14:26:17 -0500 Cc: dev@dpdk.org, Alfredo Cardigliano Content-Transfer-Encoding: quoted-printable Message-Id: <3571A75C-4268-469F-BEE9-6AE086182E60@pensando.io> References: <20201203203418.15064-1-aboyer@pensando.io> <20201204201646.51746-10-aboyer@pensando.io> <5febeda3-f733-303c-0a13-6e9f1dfe4306@intel.com> <79aebafa-6b07-c546-0356-97b56f28241a@intel.com> To: Ferruh Yigit X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: Re: [dpdk-dev] [PATCH v3 9/9] net/ionic: minor logging fixups X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > On Dec 9, 2020, at 10:42 AM, Ferruh Yigit = wrote: >=20 > On 12/9/2020 2:45 PM, Andrew Boyer wrote: >>> On Dec 9, 2020, at 8:47 AM, Ferruh Yigit > wrote: >>>=20 >>> On 12/4/2020 8:16 PM, Andrew Boyer wrote: >>>> Expose ionic_opcode_to_str() so it can be used for dev cmds, too. >>>> Store the device name in struct adapter. >>>> Switch to memcpy() to work around gcc false positives. >>>> Signed-off-by: Andrew Boyer > >>>> --- >>>> drivers/net/ionic/ionic.h | 1 + >>>> drivers/net/ionic/ionic_dev.c | 5 +++ >>>> drivers/net/ionic/ionic_dev.h | 2 + >>>> drivers/net/ionic/ionic_ethdev.c | 4 +- >>>> drivers/net/ionic/ionic_lif.c | 68 = ++++++++++++++++--------------- >>>> drivers/net/ionic/ionic_mac_api.c | 4 +- >>>> drivers/net/ionic/ionic_main.c | 32 ++++++++------- >>>> drivers/net/ionic/ionic_rxtx.c | 41 ++++++++----------- >>>> 8 files changed, 84 insertions(+), 73 deletions(-) >>>=20 >>> <...> >>>=20 >>>> @@ -1217,12 +1221,11 @@ ionic_lif_notifyq_init(struct ionic_lif = *lif) >>>> } >>>> }; >>>> -IONIC_PRINT(DEBUG, "notifyq_init.index %d", >>>> -ctx.cmd.q_init.index); >>>> -IONIC_PRINT(DEBUG, "notifyq_init.ring_base 0x%" PRIx64 "", >>>> -ctx.cmd.q_init.ring_base); >>>> +IONIC_PRINT(DEBUG, "notifyq_init.index %d", q->index); >>>> +IONIC_PRINT(DEBUG, "notifyq_init.ring_base %#jx", q->base_pa); >>>=20 >>> There are lots of similar PRIx64 -> %j change in this patch, >>> '%j' specifier is for 'intmax_t' and which seems 64bit storage, so = this should work with 64 bit variable 'q->base_pa', >>> but the variable is explicitly uint64_t why replacing 'PRIx64' usage = which is correct and more common usage in the DPDK? Why ionic is want to = do this in its own way, I am not clear of the motivation of these = changes really, can you please clarify? >> As best I know, I am following the (two different) contribute = guidelines pages, both of which direct submitters to run checkpatch. One = of things checkpatch flags is lines over 80 columns. Many of these lines = were over 80 columns or oddly broken to meet the 80 column limit. >> %j is used in many other places in this PMD - as originally written = by Alfredo, one of your core contributors. If we are allowed to use %j, = I want to, since I much prefer it to the hideous PRIx64. >=20 > %j is accepted, that is not an issue. But you are making an active = effort to convert PRIx64 -> %j, which is very unnecessary in my opinion. Ferruh, I made these changes months ago. Changing them back now is going = to take at least a few hours - many other changes are layered on top. > 80 column limit is not for log strings, but even if you are fixing = them that is different thing from the PRIx64 -> %j conversion, you can = keep PRIx64 and stay in 80 columns, and indeed lots of the cases the = column limit seems not an issue at all. >=20 > Andrew, this is a driver currently marked as 'UNMAINTAINED', I kindly = suggest focusing your 70+ functional changes instead of this PRIx64 -> = %j syntax changes, but it is all up to you of course. Apparently it is not up to me, though, is it? I would very much = appreciate if you would respond to my request for a meeting, at any time = you find convenient. When I add new log messages in the future (including adding to these = lists of FW values and response codes), should I use PRIx64 or %jx? Should I expect your objection to a mix of PRIx64 and %jx in the same = paragraph? Am I allowed to change from PRIx64 to %jx if I am also modifying the = text or the value logged? This is going to involve respinning all of those functional patches, and = since I am not a mind-reader it seems likely that this is going to take = years. >>> <...> >>>=20 >>>> @@ -1448,8 +1450,9 @@ ionic_lif_set_name(struct ionic_lif *lif) >>>> }, >>>> }; >>>> -snprintf(ctx.cmd.lif_setattr.name, = sizeof(ctx.cmd.lif_setattr.name), >>>> -"%d", lif->port_id); >>>> +/* FW is responsible for NULL terminating this field */ >>>> +memcpy(ctx.cmd.lif_setattr.name, lif->name, >>>> +sizeof(ctx.cmd.lif_setattr.name)); >>>=20 >>> Even though FW may be guaranting the string will be null terminated, = won't it be nice to provide input as null terminated if this is the = expectation? >> No, that is not the expectation. We prefer it to be this way. >=20 > It is know that FW will add NULL terminate the string but you "prefer" = to provide 'name' without NULL termination. Why? > "we prefer it to be this way" is not a good justification, please = either change or explain in a logical way. I will set the last character to NULL if that is what you want. I do not = see how it serves any purpose. -Andrew=