[PATCH 3/4] net/hns3: support Rx/Tx bd dump

Min Hu (Connor) humin29 at huawei.com
Sat May 28 03:47:02 CEST 2022


Hi, Stephen,

在 2022/5/27 23:36, Stephen Hemminger 写道:
> On Fri, 27 May 2022 10:33:50 +0800
> "Min Hu (Connor)" <humin29 at huawei.com> wrote:
> 
>> +	for (i = 0; i < HNS3_BD_DW_NUM; i++) {
>> +		/*
>> +		 * For the sake of security, first 8 bytes of BD which stands
>> +		 * for physical address of packet should not be shown.
>> +		 */
>> +		if (i < HNS3_BD_ADDRESS_LAST_DW) {
>> +			fprintf(file, "TX BD WORD[%d]:0x%08x\n", i, 0);
>> +			continue;
>> +		}
>> +
>> +		fprintf(file, "Tx BD WORD[%d]:0x%08x\n", i, *(bd_data + i));
> 
> Use hex dump that exists?
I redefine the dump style because it'd better be consistent with the
layout of decription for HW buffer. Like this :
### NIC descriptor for port 0 ###
Rx queue id:0 BD id:1
RX BD WORD[0]:0x00000000
RX BD WORD[1]:0x00000000
RX BD WORD[2]:0x00000000
RX BD WORD[3]:0x00000000
RX BD WORD[4]:0x00000000
RX BD WORD[5]:0x00000000
RX BD WORD[6]:0x00000000
RX BD WORD[7]:0x00000000

The style is more readable.


> Also this is not the kernel so leaking physical address values is not a real
> security concern.
This address is physical address of packet. It will be used illegal like
tamper with packets. This is unsafe to do so.

> .
> 


More information about the dev mailing list