From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1DB03A0544; Sat, 28 May 2022 03:47:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B717540DF6; Sat, 28 May 2022 03:47:07 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 25CD340DDB for ; Sat, 28 May 2022 03:47:05 +0200 (CEST) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L94Hs2j6dzgY8Z; Sat, 28 May 2022 09:45:29 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 28 May 2022 09:47:03 +0800 Subject: Re: [PATCH 3/4] net/hns3: support Rx/Tx bd dump To: Stephen Hemminger CC: , Yisen Zhuang , Lijun Ou References: <20220527023351.40577-1-humin29@huawei.com> <20220527023351.40577-4-humin29@huawei.com> <20220527083603.367c5490@hermes.local> From: "Min Hu (Connor)" Message-ID: <0cc62cf5-2108-5f49-8a14-03215c59bad7@huawei.com> Date: Sat, 28 May 2022 09:47:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20220527083603.367c5490@hermes.local> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi, Stephen, ÔÚ 2022/5/27 23:36, Stephen Hemminger дµÀ: > On Fri, 27 May 2022 10:33:50 +0800 > "Min Hu (Connor)" 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. > . >