[5/6] net/hns3: log fdir configuration

Message ID 1619408092-54050-6-git-send-email-humin29@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series optimization and bugfix for hns3 PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

humin (Q) April 26, 2021, 3:34 a.m. UTC
  From: Chengwen Feng <fengchengwen@huawei.com>

The rte flow interface does not support the API of the capability
set. Therefore, fdir configuration logs are added to facilitate
debugging.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_fdir.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
  

Comments

Ferruh Yigit April 27, 2021, 1:39 p.m. UTC | #1
On 4/26/2021 4:34 AM, Min Hu (Connor) wrote:
> From: Chengwen Feng <fengchengwen@huawei.com>
> 
> The rte flow interface does not support the API of the capability
> set. Therefore, fdir configuration logs are added to facilitate
> debugging.
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  drivers/net/hns3/hns3_fdir.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
> index 87c1aef..8b14219 100644
> --- a/drivers/net/hns3/hns3_fdir.c
> +++ b/drivers/net/hns3/hns3_fdir.c
> @@ -336,6 +336,8 @@ int hns3_init_fd_config(struct hns3_adapter *hns)
>  	    BIT(INNER_IP_PROTO) | BIT(INNER_IP_TOS) |
>  	    BIT(INNER_SRC_IP) | BIT(INNER_DST_IP) |
>  	    BIT(INNER_SRC_PORT) | BIT(INNER_DST_PORT);
> +	hns3_info(hw, "fdir tuple: inner<vlan_tag1 eth_type ip_src ip_dst "
> +		  "ip_proto ip_tos l4_src_port l4_dst_port>");


If the messages are for debugging, what do you think about add them as
'hns3_dbg'? Isn't info level too verbose for debugging?
  
Chengwen Feng April 27, 2021, 2:15 p.m. UTC | #2
From:Ferruh Yigit <ferruh.yigit@intel.com>
To:humin (Q) <humin29@huawei.com>;dev <dev@dpdk.org>
Date:2021-04-27 21:39:45
Subject:Re: [dpdk-dev] [PATCH 5/6] net/hns3: log fdir configuration

On 4/26/2021 4:34 AM, Min Hu (Connor) wrote:
> From: Chengwen Feng < fengchengwen@huawei.com<mailto:fengchengwen@huawei.com>>
>
> The rte flow interface does not support the API of the capability
> set. Therefore, fdir configuration logs are added to facilitate
> debugging.
>
> Signed-off-by: Chengwen Feng < fengchengwen@huawei.com<mailto:fengchengwen@huawei.com>>
> Signed-off-by: Min Hu (Connor) < humin29@huawei.com<mailto:humin29@huawei.com>>
> ---
> drivers/net/hns3/hns3_fdir.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
> index 87c1aef..8b14219 100644
> --- a/drivers/net/hns3/hns3_fdir.c
> +++ b/drivers/net/hns3/hns3_fdir.c
> @@ -336,6 +336,8 @@ int hns3_init_fd_config(struct hns3_adapter *hns)
>            BIT(INNER_IP_PROTO) | BIT(INNER_IP_TOS) |
>            BIT(INNER_SRC_IP) | BIT(INNER_DST_IP) |
>            BIT(INNER_SRC_PORT) | BIT(INNER_DST_PORT);
> +     hns3_info(hw, "fdir tuple: inner<vlan_tag1 eth_type ip_src ip_dst "
> +               "ip_proto ip_tos l4_src_port l4_dst_port>");


If the messages are for debugging, what do you think about add them as
'hns3_dbg'? Isn't info level too verbose for debugging?

yes, it was used for debugging and log analyzing, we use hns3_info because the default level may not debug in product scenario.
we use verbose readable log because it's useful for reading.

thanks

BTW: sorry for this reply format because using phone.
  
Ferruh Yigit April 27, 2021, 2:25 p.m. UTC | #3
On 4/27/2021 3:15 PM, Fengchengwen wrote:
> 
> 
> 
> 
> 
> *From:*Ferruh Yigit <ferruh.yigit@intel.com>
> *To:*humin (Q) <humin29@huawei.com>;dev <dev@dpdk.org>
> *Date:*2021-04-27 21:39:45
> *Subject:*Re: [dpdk-dev] [PATCH 5/6] net/hns3: log fdir configuration
> 
> On 4/26/2021 4:34 AM, Min Hu (Connor) wrote:
>> From: Chengwen Feng < fengchengwen@huawei.com <mailto:fengchengwen@huawei.com>>
>> 
>> The rte flow interface does not support the API of the capability 
>> set. Therefore, fdir configuration logs are added to facilitate 
>> debugging. 
>> 
>> Signed-off-by: Chengwen Feng < fengchengwen@huawei.com <mailto:fengchengwen@huawei.com>>
>> Signed-off-by: Min Hu (Connor) < humin29@huawei.com <mailto:humin29@huawei.com>>
>> --- 
>> drivers/net/hns3/hns3_fdir.c | 13 +++++++++++++ 
>> 1 file changed, 13 insertions(+) 
>> 
>> diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c 
>> index 87c1aef..8b14219 100644 
>> --- a/drivers/net/hns3/hns3_fdir.c 
>> +++ b/drivers/net/hns3/hns3_fdir.c 
>> @@ -336,6 +336,8 @@ int hns3_init_fd_config(struct hns3_adapter *hns) 
>>            BIT(INNER_IP_PROTO) | BIT(INNER_IP_TOS) | 
>>            BIT(INNER_SRC_IP) | BIT(INNER_DST_IP) | 
>>            BIT(INNER_SRC_PORT) | BIT(INNER_DST_PORT); 
>> +     hns3_info(hw, "fdir tuple: inner<vlan_tag1 eth_type ip_src ip_dst " 
>> +               "ip_proto ip_tos l4_src_port l4_dst_port>"); 
> 
> 
> If the messages are for debugging, what do you think about add them as
> 'hns3_dbg'? Isn't info level too verbose for debugging?
> 
> yes, it was used for debugging and log analyzing, we use hns3_info because the
> default level may not debug in product scenario.
> we use verbose readable log because it's useful for reading.
> 

It is possible to dynamically change the log level and get debug logs when
needed, I think this is better than enable it by default.

> thanks
> 
> BTW: sorry for this reply format because using phone.
>
  
Chengwen Feng April 27, 2021, 2:29 p.m. UTC | #4
From:Ferruh Yigit <ferruh.yigit@intel.com>
To:Fengchengwen <fengchengwen@huawei.com>;humin (Q) <humin29@huawei.com>;dev <dev@dpdk.org>
Date:2021-04-27 22:26:09
Subject:Re: [dpdk-dev] [PATCH 5/6] net/hns3: log fdir configuration

On 4/27/2021 3:15 PM, Fengchengwen wrote:
>
>
>
>
>
> *From:*Ferruh Yigit < ferruh.yigit@intel.com<mailto:ferruh.yigit@intel.com>>
> *To:*humin (Q) < humin29@huawei.com<mailto:humin29@huawei.com>>;dev < dev@dpdk.org<mailto:dev@dpdk.org>>
> *Date:*2021-04-27 21:39:45
> *Subject:*Re: [dpdk-dev] [PATCH 5/6] net/hns3: log fdir configuration
>
> On 4/26/2021 4:34 AM, Min Hu (Connor) wrote:
>> From: Chengwen Feng < fengchengwen@huawei.com<mailto:fengchengwen@huawei.com> < mailto:fengchengwen@huawei.com>>
>>
>> The rte flow interface does not support the API of the capability
>> set. Therefore, fdir configuration logs are added to facilitate
>> debugging.
>>
>> Signed-off-by: Chengwen Feng < fengchengwen@huawei.com<mailto:fengchengwen@huawei.com> < mailto:fengchengwen@huawei.com>>
>> Signed-off-by: Min Hu (Connor) < humin29@huawei.com<mailto:humin29@huawei.com> < mailto:humin29@huawei.com>>
>> ---
>> drivers/net/hns3/hns3_fdir.c | 13 +++++++++++++
>> 1 file changed, 13 insertions(+)
>>
>> diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
>> index 87c1aef..8b14219 100644
>> --- a/drivers/net/hns3/hns3_fdir.c
>> +++ b/drivers/net/hns3/hns3_fdir.c
>> @@ -336,6 +336,8 @@ int hns3_init_fd_config(struct hns3_adapter *hns)
>>            BIT(INNER_IP_PROTO) | BIT(INNER_IP_TOS) |
>>            BIT(INNER_SRC_IP) | BIT(INNER_DST_IP) |
>>            BIT(INNER_SRC_PORT) | BIT(INNER_DST_PORT);
>> +     hns3_info(hw, "fdir tuple: inner<vlan_tag1 eth_type ip_src ip_dst "
>> +               "ip_proto ip_tos l4_src_port l4_dst_port>");
>
>
> If the messages are for debugging, what do you think about add them as
> 'hns3_dbg'? Isn't info level too verbose for debugging?
>
> yes, it was used for debugging and log analyzing, we use hns3_info because the
> default level may not debug in product scenario.
> we use verbose readable log because it's useful for reading.
>

It is possible to dynamically change the log level and get debug logs when
needed, I think this is better than enable it by default.

OK, will fix in v2, thanks

> thanks
>
> BTW: sorry for this reply format because using phone.
>
  

Patch

diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c
index 87c1aef..8b14219 100644
--- a/drivers/net/hns3/hns3_fdir.c
+++ b/drivers/net/hns3/hns3_fdir.c
@@ -336,6 +336,8 @@  int hns3_init_fd_config(struct hns3_adapter *hns)
 	    BIT(INNER_IP_PROTO) | BIT(INNER_IP_TOS) |
 	    BIT(INNER_SRC_IP) | BIT(INNER_DST_IP) |
 	    BIT(INNER_SRC_PORT) | BIT(INNER_DST_PORT);
+	hns3_info(hw, "fdir tuple: inner<vlan_tag1 eth_type ip_src ip_dst "
+		  "ip_proto ip_tos l4_src_port l4_dst_port>");
 
 	/* If use max 400bit key, we can support tuples for ether type */
 	if (pf->fdir.fd_cfg.max_key_length == MAX_KEY_LENGTH) {
@@ -345,6 +347,9 @@  int hns3_init_fd_config(struct hns3_adapter *hns)
 		    BIT(OUTER_DST_PORT) | BIT(INNER_VLAN_TAG2) |
 		    BIT(OUTER_TUN_VNI) | BIT(OUTER_TUN_FLOW_ID) |
 		    BIT(OUTER_ETH_TYPE) | BIT(OUTER_IP_PROTO);
+		hns3_info(hw, "fdir tuple more: inner<dst_mac src_mac "
+			  "vlan_tag2 sctp_tag> outer<eth_type ip_proto "
+			  "l4_src_port l4_dst_port tun_vni tun_flow_id>");
 	}
 
 	/* roce_type is used to filter roce frames
@@ -352,6 +357,7 @@  int hns3_init_fd_config(struct hns3_adapter *hns)
 	 */
 	key_cfg->meta_data_active = BIT(DST_VPORT) | BIT(TUNNEL_PACKET) |
 	    BIT(VLAN_NUMBER);
+	hns3_info(hw, "fdir meta data: dst_vport tunnel_packet vlan_number");
 
 	ret = hns3_get_fd_allocation(hw,
 				     &pf->fdir.fd_cfg.rule_num[HNS3_FD_STAGE_1],
@@ -361,6 +367,13 @@  int hns3_init_fd_config(struct hns3_adapter *hns)
 	if (ret)
 		return ret;
 
+	hns3_info(hw, "fdir: stage1<rules-%u counters-%u> stage2<rules-%u "
+		  "counters=%u>",
+		  pf->fdir.fd_cfg.rule_num[HNS3_FD_STAGE_1],
+		  pf->fdir.fd_cfg.cnt_num[HNS3_FD_STAGE_1],
+		  pf->fdir.fd_cfg.rule_num[HNS3_FD_STAGE_2],
+		  pf->fdir.fd_cfg.cnt_num[HNS3_FD_STAGE_2]);
+
 	return hns3_set_fd_key_config(hns);
 }