DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@xilinx.com>
To: Jin Liu <jin.liu@corigine.com>, <dev@dpdk.org>
Cc: <niklas.soderlund@corigine.com>, Chaoyong He <chaoyong.he@corigine.com>
Subject: Re: [PATCH 01/14] net/nfp: change the coding style
Date: Thu, 2 Jun 2022 23:52:22 +0100	[thread overview]
Message-ID: <ef62e5be-1594-423a-1023-3daacce5cf95@xilinx.com> (raw)
In-Reply-To: <20220602015304.710197-2-jin.liu@corigine.com>

On 6/2/2022 2:52 AM, Jin Liu wrote:
> From: Chaoyong He <chaoyong.he@corigine.com>
> 
> Change the coding style of some logics, to make it more
> compatible with the DPDK coding style.
> 
> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> Signed-off-by: Jin Liu <jin.liu@corigine.com>
> Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>

<...>

> @@ -404,9 +403,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
>   
>   	/* NFP can not handle DMA addresses requiring more than 40 bits */
>   	if (rte_mem_check_dma_mask(40)) {
> -		RTE_LOG(ERR, PMD, "device %s can not be used:",
> -				   pci_dev->device.name);
> -		RTE_LOG(ERR, PMD, "\trestricted dma mask to 40 bits!\n");
> +		RTE_LOG(ERR, PMD, "device %s can not be used: restricted dma "
> +			"mask to 40 bits!\n", pci_dev->device.name);

Since you are updating this part, it may be better to not break the 
string, like:
RTE_LOG(ERR, PMD,
	"device %s can not be used: restricted dma mask to 40 bits!\n",
	pci_dev->device.name);

<...>

> -static int nfp_init_phyports(struct nfp_pf_dev *pf_dev)
> +static int
> +nfp_init_phyports(struct nfp_pf_dev *pf_dev)
>   {
> +	int i;
> +	int ret = 0;
>   	struct nfp_net_hw *hw;
>   	struct rte_eth_dev *eth_dev;
> -	struct nfp_eth_table *nfp_eth_table = NULL;
> -	int ret = 0;
> -	int i;
> +	struct nfp_eth_table *nfp_eth_table;
> +	char port_name[RTE_ETH_NAME_MAX_LEN];
>   
>   	nfp_eth_table = nfp_eth_read_ports(pf_dev->cpp);
> -	if (!nfp_eth_table) {
> +	if (nfp_eth_table == NULL) {
>   		PMD_INIT_LOG(ERR, "Error reading NFP ethernet table");
> -		ret = -EIO;
> -		goto error;
> +		return -EIO;
>   	}
>   
>   	/* Loop through all physical ports on PF */
>   	for (i = 0; i < pf_dev->total_phyports; i++) {
>   		const unsigned int numa_node = rte_socket_id();
> -		char port_name[RTE_ETH_NAME_MAX_LEN];
>   

No need to increase the scope of the variable 'port_name', above is 
valid for the coding convention.

<...>

> @@ -989,13 +984,11 @@ static int nfp_pf_secondary_init(struct rte_pci_device *pci_dev)
>   		snprintf(port_name, sizeof(port_name), "%s_port%d",
>   			 pci_dev->device.name, i);
>   
> -		PMD_DRV_LOG(DEBUG, "Secondary attaching to port %s",
> -		    port_name);
> +		PMD_DRV_LOG(DEBUG, "Secondary attaching to port %s", port_name);
>   		eth_dev = rte_eth_dev_attach_secondary(port_name);
> -		if (!eth_dev) {
> -			RTE_LOG(ERR, EAL,
> -			"secondary process attach failed, "
> -			"ethdev doesn't exist");
> +		if (eth_dev == NULL) {
> +			RTE_LOG(ERR, EAL, "secondary process attach failed, "
> +				"ethdev doesn't exist");

Same here.

<...>

> @@ -296,9 +296,8 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
>   
>   	/* NFP can not handle DMA addresses requiring more than 40 bits */
>   	if (rte_mem_check_dma_mask(40)) {
> -		RTE_LOG(ERR, PMD, "device %s can not be used:",
> -				   pci_dev->device.name);
> -		RTE_LOG(ERR, PMD, "\trestricted dma mask to 40 bits!\n");
> +		RTE_LOG(ERR, PMD, "device %s can not be used: restricted dma "
> +			"mask to 40 bits!\n", pci_dev->device.name);

ditto

  reply	other threads:[~2022-06-02 22:52 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02  1:52 [PATCH 00/14] Add support of NFP3800 chip and firmware with NFDk Jin Liu
2022-06-02  1:52 ` [PATCH 01/14] net/nfp: change the coding style Jin Liu
2022-06-02 22:52   ` Ferruh Yigit [this message]
2022-06-14  8:50     ` Kevin Liu
2022-06-02  1:52 ` [PATCH 02/14] net/nfp: remove unnecessary forward function declaration Jin Liu
2022-06-02  1:52 ` [PATCH 03/14] net/nfp: remove pessimistic limit Jin Liu
2022-06-02  1:52 ` [PATCH 04/14] net/nfp: rename set MAC function Jin Liu
2022-06-02  1:52 ` [PATCH 05/14] net/nfp: rename function and struct Jin Liu
2022-06-02  1:52 ` [PATCH 06/14] net/nfp: support NFP3800 card Jin Liu
2022-06-02 22:52   ` Ferruh Yigit
2022-06-14  8:50     ` Kevin Liu
2022-06-02  1:52 ` [PATCH 07/14] net/nfp: support NFDK firmware Jin Liu
2022-06-02 22:53   ` Ferruh Yigit
2022-06-14  8:49     ` Kevin Liu
2022-06-14  9:21       ` Ferruh Yigit
2022-06-14  9:30         ` Kevin Liu
2022-06-02  1:52 ` [PATCH 08/14] net/nfp: structure adjustment Jin Liu
2022-06-02 22:54   ` Ferruh Yigit
2022-06-14  8:49     ` Kevin Liu
2022-06-02  1:52 ` [PATCH 09/14] net/nfp: nfdk netdev option and queue function Jin Liu
2022-06-02  1:53 ` [PATCH 10/14] net/nfp: add queue stop and close helper function Jin Liu
2022-06-02  1:53 ` [PATCH 11/14] net/nfp: nfdk stop and close function Jin Liu
2022-06-02  1:53 ` [PATCH 12/14] net/nfp: move macro from C file to head file Jin Liu
2022-06-02  1:53 ` [PATCH 13/14] net/nfp: nfdk packet xmit function Jin Liu
2022-06-02  1:53 ` [PATCH 14/14] net/nfp: modify RSS logic Jin Liu
2022-06-02 22:56   ` Ferruh Yigit
2022-06-14  8:50     ` Kevin Liu
2022-06-02 22:51 ` [PATCH 00/14] Add support of NFP3800 chip and firmware with NFDk Ferruh Yigit
2022-06-14  8:48   ` Kevin Liu
2022-06-16  2:39 ` [PATCH v2 00/15] " Jin Liu
2022-06-16  2:39   ` [PATCH v2 01/15] doc: update release note Jin Liu
2022-06-16 15:04     ` Ferruh Yigit
2022-06-16  2:39   ` [PATCH v2 02/15] doc: update nfp documentation Jin Liu
2022-06-16 15:04     ` Ferruh Yigit
2022-06-16  2:39   ` [PATCH v2 03/15] net/nfp: change the coding style Jin Liu
2022-06-16  2:39   ` [PATCH v2 04/15] net/nfp: remove unnecessary forward function declaration Jin Liu
2022-06-16  2:39   ` [PATCH v2 05/15] net/nfp: remove pessimistic limit Jin Liu
2022-06-16  2:39   ` [PATCH v2 06/15] net/nfp: rename set MAC function Jin Liu
2022-06-16  2:39   ` [PATCH v2 07/15] net/nfp: rename function and struct Jin Liu
2022-06-16  2:39   ` [PATCH v2 08/15] net/nfp: support NFP3800 card Jin Liu
2022-06-16 15:04     ` Ferruh Yigit
2022-06-16  2:39   ` [PATCH v2 09/15] net/nfp: support firmware with NFDk Jin Liu
2022-06-16  2:39   ` [PATCH v2 10/15] net/nfp: structure adjustment Jin Liu
2022-06-16  2:39   ` [PATCH v2 11/15] net/nfp: nfdk netdev option and queue function Jin Liu
2022-06-16  2:39   ` [PATCH v2 12/15] net/nfp: add queue stop and close helper function Jin Liu
2022-06-16  2:39   ` [PATCH v2 13/15] net/nfp: move macro from C file to head file Jin Liu
2022-06-16  2:39   ` [PATCH v2 14/15] net/nfp: nfdk packet xmit function Jin Liu
2022-06-16  2:39   ` [PATCH v2 15/15] net/nfp: modify RSS logic Jin Liu
2022-06-16 15:06   ` [PATCH v2 00/15] Add support of NFP3800 chip and firmware with NFDk Ferruh Yigit
2022-06-17  9:34   ` [PATCH v3 00/13] " Jin Liu
2022-06-17  9:34     ` [PATCH v3 01/13] net/nfp: change the coding style Jin Liu
2022-06-17  9:34     ` [PATCH v3 02/13] net/nfp: remove unnecessary forward function declaration Jin Liu
2022-06-17  9:34     ` [PATCH v3 03/13] net/nfp: remove pessimistic limit Jin Liu
2022-06-17  9:34     ` [PATCH v3 04/13] net/nfp: rename set MAC function Jin Liu
2022-06-17  9:34     ` [PATCH v3 05/13] net/nfp: rename function and struct Jin Liu
2022-06-17  9:34     ` [PATCH v3 06/13] net/nfp: support NFP3800 card Jin Liu
2022-06-17  9:34     ` [PATCH v3 07/13] net/nfp: support firmware with NFDk Jin Liu
2022-06-17  9:34     ` [PATCH v3 08/13] net/nfp: structure adjustment Jin Liu
2022-06-17  9:34     ` [PATCH v3 09/13] net/nfp: nfdk netdev option and queue function Jin Liu
2022-06-17  9:34     ` [PATCH v3 10/13] net/nfp: add queue stop and close helper function Jin Liu
2022-06-17  9:34     ` [PATCH v3 11/13] net/nfp: move macro from C file to head file Jin Liu
2022-06-17  9:34     ` [PATCH v3 12/13] net/nfp: nfdk packet xmit function Jin Liu
2022-06-22 16:03       ` Thomas Monjalon
2022-06-22 16:29         ` Ferruh Yigit
2022-06-17  9:34     ` [PATCH v3 13/13] net/nfp: modify RSS logic Jin Liu
2022-06-17 13:33     ` [PATCH v3 00/13] Add support of NFP3800 chip and firmware with NFDk Ferruh Yigit
2022-06-23  2:26     ` [PATCH v4 " Jin Liu
2022-06-23  2:26       ` [PATCH v4 01/13] net/nfp: change the coding style Jin Liu
2022-06-23  2:26       ` [PATCH v4 02/13] net/nfp: remove unnecessary forward function declaration Jin Liu
2022-06-23  2:26       ` [PATCH v4 03/13] net/nfp: remove pessimistic limit Jin Liu
2022-06-23  2:26       ` [PATCH v4 04/13] net/nfp: rename set MAC function Jin Liu
2022-06-23  2:26       ` [PATCH v4 05/13] net/nfp: rename function and struct Jin Liu
2022-06-23  2:26       ` [PATCH v4 06/13] net/nfp: support NFP3800 card Jin Liu
2022-06-23  2:26       ` [PATCH v4 07/13] net/nfp: support firmware with NFDk Jin Liu
2022-06-23  2:26       ` [PATCH v4 08/13] net/nfp: structure adjustment Jin Liu
2022-06-23  2:26       ` [PATCH v4 09/13] net/nfp: nfdk netdev option and queue function Jin Liu
2022-06-23  2:26       ` [PATCH v4 10/13] net/nfp: add queue stop and close helper function Jin Liu
2022-06-23  2:26       ` [PATCH v4 11/13] net/nfp: move macro from C file to head file Jin Liu
2022-06-23  2:26       ` [PATCH v4 12/13] net/nfp: nfdk packet xmit function Jin Liu
2022-06-23  2:26       ` [PATCH v4 13/13] net/nfp: modify RSS logic Jin Liu
2022-06-23  9:11       ` [PATCH v4 00/13] Add support of NFP3800 chip and firmware with NFDk Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef62e5be-1594-423a-1023-3daacce5cf95@xilinx.com \
    --to=ferruh.yigit@xilinx.com \
    --cc=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=jin.liu@corigine.com \
    --cc=niklas.soderlund@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).