[PATCH v1 09/14] net/zxdh: implement tables initialization

Stephen Hemminger stephen at networkplumber.org
Mon Feb 10 18:43:50 CET 2025


On Mon, 10 Feb 2025 09:50:12 +0800
Bingbin Chen <chen.bingbin at zte.com.cn> wrote:

> +static uint32_t
> +zxdh_np_sdt_mgr_sdt_item_add(uint32_t dev_id, uint32_t sdt_no,
> +		uint32_t sdt_hig32, uint32_t sdt_low32)
> +{
> +	ZXDH_SDT_SOFT_TABLE_T *p_sdt_soft_tbl = NULL;
> +	ZXDH_SDT_ITEM_T *p_sdt_item = NULL;
> +
> +	p_sdt_soft_tbl = ZXDH_SDT_SOFT_TBL_GET(dev_id);
> +
> +	if (p_sdt_soft_tbl == NULL) {
> +		PMD_DRV_LOG(ERR, "Error: %s soft sdt table not Init!", __func__);
> +		RTE_ASSERT(0);
> +		return ZXDH_RC_TABLE_SDT_MGR_INVALID;
> +	}
> +
> +	if (dev_id != p_sdt_soft_tbl->device_id) {
> +		PMD_DRV_LOG(ERR,
> +		"Error: %s soft sdt table Item Invalid!", __func__);
> +		RTE_ASSERT(0);
> +		return ZXDH_RC_TABLE_PARA_INVALID;
> +	}
> +
> +	p_sdt_item = &p_sdt_soft_tbl->sdt_array[sdt_no];
> +	p_sdt_item->valid = ZXDH_SDT_VALID;
> +	p_sdt_item->table_cfg[0] = sdt_hig32;
> +	p_sdt_item->table_cfg[1] = sdt_low32;
> +
> +	PMD_DRV_LOG(DEBUG, "%s 0x%08x 0x%08x", __func__,
> +		p_sdt_item->table_cfg[0], p_sdt_item->table_cfg[1]);

Duplication here.

define PMD_DRV_LOG(level, ...) \
	RTE_LOG_LINE_PREFIX(level, ZXDH_DRIVER, "%s(): ", __func__, __VA_ARGS__)


More information about the dev mailing list