[dpdk-dev] [PATCH 9/9] net/hns3: remove PF/VF duplicate code

Ferruh Yigit ferruh.yigit at intel.com
Thu Nov 4 15:55:48 CET 2021


On 11/2/2021 3:17 AM, Min Hu (Connor) wrote:
> From: Chengwen Feng <fengchengwen at huawei.com>
> 
> This patch remove PF/VF duplicate code of:
> 1. get firmware version.
> 2. get device info.
> 3. rx interrupt related functions.
> 
> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>

<...>

> +int
> +hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)
> +{
> +	struct hns3_adapter *hns = eth_dev->data->dev_private;
> +	struct hns3_hw *hw = &hns->hw;
> +	uint16_t queue_num = hw->tqps_num;
> +
> +	/*
> +	 * In interrupt mode, 'max_rx_queues' is set based on the number of
> +	 * MSI-X interrupt resources of the hardware.
> +	 */
> +	if (hw->data->dev_conf.intr_conf.rxq == 1)
> +		queue_num = hw->intr_tqps_num;
> +
> +	info->max_rx_queues = queue_num;
> +	info->max_tx_queues = hw->tqps_num;
> +	info->max_rx_pktlen = HNS3_MAX_FRAME_LEN; /* CRC included */
> +	info->min_rx_bufsize = HNS3_MIN_BD_BUF_SIZE;
> +	info->max_mtu = info->max_rx_pktlen - HNS3_ETH_OVERHEAD;
> +	info->max_lro_pkt_size = HNS3_MAX_LRO_SIZE;
> +	info->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM |
> +				 DEV_RX_OFFLOAD_TCP_CKSUM |
> +				 DEV_RX_OFFLOAD_UDP_CKSUM |
> +				 DEV_RX_OFFLOAD_SCTP_CKSUM |
> +				 DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
> +				 DEV_RX_OFFLOAD_OUTER_UDP_CKSUM |
> +				 DEV_RX_OFFLOAD_SCATTER |
> +				 DEV_RX_OFFLOAD_VLAN_STRIP |
> +				 DEV_RX_OFFLOAD_VLAN_FILTER |
> +				 DEV_RX_OFFLOAD_RSS_HASH |
> +				 DEV_RX_OFFLOAD_TCP_LRO);
> +	info->tx_offload_capa = (DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
> +				 DEV_TX_OFFLOAD_IPV4_CKSUM |
> +				 DEV_TX_OFFLOAD_TCP_CKSUM |
> +				 DEV_TX_OFFLOAD_UDP_CKSUM |
> +				 DEV_TX_OFFLOAD_SCTP_CKSUM |
> +				 DEV_TX_OFFLOAD_MULTI_SEGS |
> +				 DEV_TX_OFFLOAD_TCP_TSO |
> +				 DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
> +				 DEV_TX_OFFLOAD_GRE_TNL_TSO |
> +				 DEV_TX_OFFLOAD_GENEVE_TNL_TSO |
> +				 DEV_TX_OFFLOAD_MBUF_FAST_FREE |
> +				 DEV_TX_OFFLOAD_VLAN_INSERT);

The function changed while moving, please be aware renamed macros in upsteram.
Can you please rebase your patch on top of latest next-net?



More information about the dev mailing list