From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <arybchenko@solarflare.com>
Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com
 [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 5BE6A3256
 for <dev@dpdk.org>; Tue,  8 May 2018 09:37:07 +0200 (CEST)
X-Virus-Scanned: Proofpoint Essentials engine
Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id
 2533E980062; Tue,  8 May 2018 07:37:05 +0000 (UTC)
Received: from [192.168.38.17] (84.52.114.114) by ukex01.SolarFlarecom.com
 (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Tue, 8 May
 2018 08:37:01 +0100
To: Andy Green <andy@warmcat.com>, <dev@dpdk.org>
References: <152575364588.56689.3300796065057551728.stgit@localhost.localdomain>
 <152575382842.56689.4589071928538784307.stgit@localhost.localdomain>
From: Andrew Rybchenko <arybchenko@solarflare.com>
Message-ID: <e2e3bb52-6880-6611-21d8-6be805dfac7b@solarflare.com>
Date: Tue, 8 May 2018 10:36:57 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.7.0
MIME-Version: 1.0
In-Reply-To: <152575382842.56689.4589071928538784307.stgit@localhost.localdomain>
Content-Language: en-GB
X-Originating-IP: [84.52.114.114]
X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To
 ukex01.SolarFlarecom.com (10.17.10.4)
X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.100.1062-23830.003
X-TM-AS-Result: No--12.767400-0.000000-31
X-TM-AS-User-Approved-Sender: Yes
X-TM-AS-User-Blocked-Sender: No
X-MDID: 1525765026-5zJwzrnp9iod
Content-Type: text/plain; charset="utf-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Subject: Re: [dpdk-dev] [PATCH 12/18] drivers: net: sfc: fix another strncpy
 size and NUL
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 08 May 2018 07:37:07 -0000

Many thanks. I guess the most of below notes are applicable to many other
patches in the series.

Signed-off-by: ,  Fixes: and Cc: stable@dpdk.org tags are missing. See [1].

Changeset summary should start from "net/sfc: "
I.e. something like:
net/sfc: fix strncpy size and NUL

(it looks like "another" is useless in the original subject)

In general all patches should pass ./devtools/check-git-log.sh and 
./devtools/checkpatches.sh
(which requires path to Linux kernel checkpatches.pl).

Andrew.

[1] 
http://dpdk.org/doc/guides/contributing/patches.html#commit-messages-subject-line

On 05/08/2018 07:30 AM, Andy Green wrote:
> ---
>   drivers/net/sfc/sfc_ethdev.c |    7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
> index e9bb283e0..bd5f17f33 100644
> --- a/drivers/net/sfc/sfc_ethdev.c
> +++ b/drivers/net/sfc/sfc_ethdev.c
> @@ -662,10 +662,13 @@ sfc_xstats_get_names(struct rte_eth_dev *dev,
>   
>   	for (i = 0; i < EFX_MAC_NSTATS; ++i) {
>   		if (EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, i)) {
> -			if (xstats_names != NULL && nstats < xstats_count)
> +			if (xstats_names != NULL && nstats < xstats_count) {
>   				strncpy(xstats_names[nstats].name,
>   					efx_mac_stat_name(sa->nic, i),
> -					sizeof(xstats_names[0].name));
> +					sizeof(xstats_names[0].name) - 1);
> +				xstats_names[0].name[
> +					sizeof(xstats_names[0].name) - 1] = '\0';
> +			}

In fact strlcpy() should be used.

>   			nstats++;
>   		}
>   	}
>