Subject: Re: [PATCH net-next v04 5/5] hinic3: Add netdev register interfaces

From: Simon Horman <[email-masked]>
Date: Wed, 5 Nov 2025 09:16:53 +0000

On Wed, Oct 29, 2025 at 02:16:29PM +0800, Fan Gong wrote:

...

> diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_main.c b/drivers/net/ethernet/huawei/hinic3/hinic3_main.c

...

> @@ -250,7 +319,29 @@ static void netdev_feature_init(struct net_device *netdev)
>  	if (hinic3_test_support(nic_dev, HINIC3_NIC_F_TSO))
>  		tso_fts |= NETIF_F_TSO | NETIF_F_TSO6;
>  
> -	netdev->features |= dft_fts | cso_fts | tso_fts;
> +	if (hinic3_test_support(nic_dev, HINIC3_NIC_F_RX_VLAN_STRIP |
> +				HINIC3_NIC_F_TX_VLAN_INSERT))
> +		vlan_fts |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
> +
> +	if (hinic3_test_support(nic_dev, HINIC3_NIC_F_RX_VLAN_FILTER))
> +		vlan_fts |= NETIF_F_HW_VLAN_CTAG_FILTER;
> +
> +	if (hinic3_test_support(nic_dev, HINIC3_NIC_F_VXLAN_OFFLOAD))
> +		tso_fts |= NETIF_F_GSO_UDP_TUNNEL | NETIF_F_GSO_UDP_TUNNEL_CSUM;
> +
> +	/* LRO is disabled by default, only set hw features */
> +	if (hinic3_test_support(nic_dev, HINIC3_NIC_F_LRO))
> +		hw_features |= NETIF_F_LRO;
> +
> +	netdev->features |= dft_fts | cso_fts | tso_fts | vlan_fts;
> +	netdev->vlan_features |= dft_fts | cso_fts | tso_fts;
> +		hw_features |= netdev->hw_features | netdev->features;

nit: The line above seems to be indented too much.

> +	netdev->hw_features = hw_features;
> +	netdev->priv_flags |= IFF_UNICAST_FLT;
> +
> +	netdev->hw_enc_features |= dft_fts;
> +	if (hinic3_test_support(nic_dev, HINIC3_NIC_F_VXLAN_OFFLOAD))
> +		netdev->hw_enc_features |= cso_fts | tso_fts | NETIF_F_TSO_ECN;
>  }
>  
>  static int hinic3_set_default_hw_feature(struct net_device *netdev)

...