Commit 119c1a33 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'hns3-cleanups'



Guangbin Huang says:

====================
net: hns3: some cleanups for -next

To improve code readability and simplicity, this series add some cleanup
patches for the HNS3 ethernet driver.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 0109841f 184da9dc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1083,7 +1083,7 @@ static void hns3_dump_page_pool_info(struct hns3_enet_ring *ring,
	sprintf(result[j++], "%u", index);
	sprintf(result[j++], "%u",
		READ_ONCE(ring->page_pool->pages_state_hold_cnt));
	sprintf(result[j++], "%u",
	sprintf(result[j++], "%d",
		atomic_read(&ring->page_pool->pages_state_release_cnt));
	sprintf(result[j++], "%u", ring->page_pool->p.pool_size);
	sprintf(result[j++], "%u", ring->page_pool->p.order);
+2 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@
#ifndef __HNS3_DEBUGFS_H
#define __HNS3_DEBUGFS_H

#include "hnae3.h"

#define HNS3_DBG_READ_LEN	65536
#define HNS3_DBG_READ_LEN_128KB	0x20000
#define HNS3_DBG_READ_LEN_1MB	0x100000
+3 −0
Original line number Diff line number Diff line
@@ -10,6 +10,9 @@

#include "hnae3.h"

struct iphdr;
struct ipv6hdr;

enum hns3_nic_state {
	HNS3_NIC_STATE_TESTING,
	HNS3_NIC_STATE_RESETTING,
+8 −5
Original line number Diff line number Diff line
@@ -77,6 +77,10 @@ static const struct hclge_dbg_reg_type_info hclge_dbg_reg_info[] = {
		       .cmd = HCLGE_OPC_DFX_TQP_REG } },
};

/* make sure: len(name) + interval >= maxlen(item data) + 2,
 * for example, name = "pkt_num"(len: 7), the prototype of item data is u32,
 * and print as "%u"(maxlen: 10), so the interval should be at least 5.
 */
static void hclge_dbg_fill_content(char *content, u16 len,
				   const struct hclge_dbg_item *items,
				   const char **result, u16 size)
@@ -99,7 +103,7 @@ static void hclge_dbg_fill_content(char *content, u16 len,
static char *hclge_dbg_get_func_id_str(char *buf, u8 id)
{
	if (id)
		sprintf(buf, "vf%u", id - 1);
		sprintf(buf, "vf%u", id - 1U);
	else
		sprintf(buf, "pf");

@@ -778,7 +782,6 @@ static int hclge_dbg_dump_tm_pg(struct hclge_dev *hdev, char *buf, int len)

	data_str = kcalloc(ARRAY_SIZE(tm_pg_items),
			   HCLGE_DBG_DATA_STR_LEN, GFP_KERNEL);

	if (!data_str)
		return -ENOMEM;

@@ -1764,7 +1767,7 @@ hclge_dbg_get_imp_stats_info(struct hclge_dev *hdev, char *buf, int len)
#define HCLGE_MAX_NCL_CONFIG_LENGTH	16384

static void hclge_ncl_config_data_print(struct hclge_desc *desc, int *index,
					char *buf, int *len, int *pos)
					char *buf, int len, int *pos)
{
#define HCLGE_CMD_DATA_NUM		6

@@ -1776,7 +1779,7 @@ static void hclge_ncl_config_data_print(struct hclge_desc *desc, int *index,
			if (i == 0 && j == 0)
				continue;

			*pos += scnprintf(buf + *pos, *len - *pos,
			*pos += scnprintf(buf + *pos, len - *pos,
					  "0x%04x | 0x%08x\n", offset,
					  le32_to_cpu(desc[i].data[j]));

@@ -1814,7 +1817,7 @@ hclge_dbg_dump_ncl_config(struct hclge_dev *hdev, char *buf, int len)
		if (ret)
			return ret;

		hclge_ncl_config_data_print(desc, &index, buf, &len, &pos);
		hclge_ncl_config_data_print(desc, &index, buf, len, &pos);
	}

	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ int hclge_devlink_init(struct hclge_dev *hdev)
	hdev->devlink = devlink;

	devlink_set_features(devlink, DEVLINK_F_RELOAD);
	devlink_register(devlink);
	(void)devlink_register(devlink);
	return 0;
}

Loading