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 48FABA0C4D; Fri, 13 Aug 2021 17:36:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A92B4069C; Fri, 13 Aug 2021 17:36:08 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id BC85440140 for ; Fri, 13 Aug 2021 17:36:07 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d17so12404751plr.12 for ; Fri, 13 Aug 2021 08:36:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xBTvgBQM0wwArR/ccce7oiaO5zatkFQOccZVi43vpOg=; b=LuPziUsqzNFEk1qbhOluaiX6IWYD3q22FoSwTNHzPc0JErjydGulabIDiaXpWKeAHz 6WHxAKYrZ9fi6tTNfOUFov1UuvFdpWi5Cb3G40zIpu2xzOyAIJIdtyQPQXLtcrqsZd2j nDiJsg5q4iQmJ5AZPVGPblxyTGnBWCgPzFz0nQFAeGyIJPkJdq4u+36jSbx8CtRiHdcF gnYX4XQyphJAiVUXXaCWMXHmllrvVZJUsYR7MUXU+Ro/rLgFyEVy+1osFEeg1ZYwLT7Y 532Calsn0Hy5BcJjTviv5lgP4BE76yParsdjZADiU4U0lcKe95D4dWZ+cVi/FbB3gLOF XF8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xBTvgBQM0wwArR/ccce7oiaO5zatkFQOccZVi43vpOg=; b=nAQCzASLg8c6a3+33f5dYh/sVYtGUX6Ivr9dUh33s+fEayLWrX/4R8BMvfxRNLATtw D4rQC5/gdUAPXjZaIUSofc1fSCWGOc19dunl9cvcHtNCYyg/2YQmVn3npCHbL5F1QxJR f1UrUA0eWBtkQtgMhhmvzAEin50jkD5OFhG+Z8zTSRIUFo55ER2l/XEHgBxIT0t//HjV 56jMG0fzcykALy+Y4dHRk6wxf2G0Hyfr+82tTZUp3k/5FfXvnRsebA6j3PICdN/ffd0w nEQlMSbw0z6h6cnvWQxnZ5vjvVBb4NDEskjEhCMB7fDI6MST+zFgxl00oFhsyPviryHE 9ESg== X-Gm-Message-State: AOAM5334Fou8WgUKyG6WS3roIN5t0Mde5PeDOfUfTu7zSvbRvVmxSaqv LuUFUf4QPTo0f3Nqj7ehr7Ea3Q== X-Google-Smtp-Source: ABdhPJziupqXMPD2f9eDGHMVDZ5Ep1gV+jI336AKAiDFrNIIL8jVJ04h0/AWoZwVXJn0rBk/0lIDXg== X-Received: by 2002:a17:90b:2505:: with SMTP id ns5mr3150124pjb.75.1628868966891; Fri, 13 Aug 2021 08:36:06 -0700 (PDT) Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123]) by smtp.gmail.com with ESMTPSA id g10sm2768915pfh.120.2021.08.13.08.36.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 08:36:06 -0700 (PDT) Date: Fri, 13 Aug 2021 08:36:04 -0700 From: Stephen Hemminger To: Vijay Srivastava Cc: , , , , Vijay Kumar Srivastava Message-ID: <20210813083604.0153a56a@hermes.local> In-Reply-To: <20210706164418.32615-2-vsrivast@xilinx.com> References: <20210706164418.32615-1-vsrivast@xilinx.com> <20210706164418.32615-2-vsrivast@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 01/10] vdpa/sfc: introduce Xilinx vDPA driver 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 Sender: "dev" On Tue, 6 Jul 2021 22:14:09 +0530 Vijay Srivastava wrote: > +uint32_t > +sfc_vdpa_register_logtype(const struct rte_pci_addr *pci_addr, > + const char *lt_prefix_str, uint32_t ll_default) > +{ > + size_t lt_prefix_str_size = strlen(lt_prefix_str); > + size_t lt_str_size_max; > + char *lt_str = NULL; > + int ret; > + > + if (SIZE_MAX - PCI_PRI_STR_SIZE - 1 > lt_prefix_str_size) { > + ++lt_prefix_str_size; /* Reserve space for prefix separator */ > + lt_str_size_max = lt_prefix_str_size + PCI_PRI_STR_SIZE + 1; > + } else { > + return RTE_LOGTYPE_PMD; > + } > + > + lt_str = rte_zmalloc("logtype_str", lt_str_size_max, 0); > + if (lt_str == NULL) > + return RTE_LOGTYPE_PMD; > + > + strncpy(lt_str, lt_prefix_str, lt_prefix_str_size); > + lt_str[lt_prefix_str_size - 1] = '.'; > + rte_pci_device_name(pci_addr, lt_str + lt_prefix_str_size, > + lt_str_size_max - lt_prefix_str_size); > + lt_str[lt_str_size_max - 1] = '\0'; > + > + ret = rte_log_register_type_and_pick_level(lt_str, ll_default); > + rte_free(lt_str); > + > + return (ret < 0) ? RTE_LOGTYPE_PMD : ret; > +} This seems like overkill doing per-device log level. Other drivers aren't doing this. Once again my advice to DPDK driver developers is "don't be a snowflake" your driver is not special.