[dpdk-dev] [PATCH v4 3/5] drivers/net/i40e: add Port Representor functionality

Xing, Beilei beilei.xing at intel.com
Wed Jan 10 13:37:51 CET 2018


> -----Original Message-----
> From: Awal, Mohammad Abdul
> Sent: Wednesday, January 10, 2018 6:11 PM
> To: Xing, Beilei <beilei.xing at intel.com>; Horton, Remy
> <remy.horton at intel.com>; dev at dpdk.org
> Cc: Mcnamara, John <john.mcnamara at intel.com>; Lu, Wenzhuo
> <wenzhuo.lu at intel.com>; Wu, Jingjing <jingjing.wu at intel.com>; Doherty,
> Declan <declan.doherty at intel.com>
> Subject: Re: [dpdk-dev] [PATCH v4 3/5] drivers/net/i40e: add Port
> Representor functionality
> 
> 
> 
> On 10/01/2018 07:56, Xing, Beilei wrote:
> >
> >> -----Original Message-----
> >> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Remy Horton
> >> +	dev_info->rx_offload_capa =
> >> +		DEV_RX_OFFLOAD_VLAN_STRIP |
> >> +		DEV_RX_OFFLOAD_QINQ_STRIP |
> >> +		DEV_RX_OFFLOAD_IPV4_CKSUM |
> >> +		DEV_RX_OFFLOAD_UDP_CKSUM |
> >> +		DEV_RX_OFFLOAD_TCP_CKSUM;
> >> +	dev_info->tx_offload_capa =
> >> +		DEV_TX_OFFLOAD_VLAN_INSERT |
> >> +		DEV_TX_OFFLOAD_QINQ_INSERT |
> >> +		DEV_TX_OFFLOAD_IPV4_CKSUM |
> >> +		DEV_TX_OFFLOAD_UDP_CKSUM |
> >> +		DEV_TX_OFFLOAD_TCP_CKSUM |
> >> +		DEV_TX_OFFLOAD_SCTP_CKSUM;
> > Tunnel TSO and outer IP checksum are also supported.
> Correct. Fixed.
> >
> > <...>
> >
> >> +static const struct ether_addr null_mac_addr;
> >> +
> >> +int
> >> +rte_pmd_i40e_remove_vf_mac_addr(uint8_t port, uint16_t vf_id,
> >> +	struct ether_addr *mac_addr)
> >> +{
> >> +	struct rte_eth_dev *dev;
> >> +	struct i40e_pf_vf *vf;
> >> +	struct i40e_vsi *vsi;
> >> +	struct i40e_pf *pf;
> >> +
> >> +	if (i40e_validate_mac_addr((u8 *)mac_addr) != I40E_SUCCESS)
> >> +		return -EINVAL;
> >> +
> >> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
> >> +
> >> +	dev = &rte_eth_devices[port];
> >> +
> >> +	if (!is_i40e_supported(dev))
> >> +		return -ENOTSUP;
> >> +
> >> +	pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> >> +
> >> +	if (vf_id >= pf->vf_num || !pf->vfs)
> >> +		return -EINVAL;
> >> +
> >> +	vf = &pf->vfs[vf_id];
> >> +	vsi = vf->vsi;
> >> +	if (!vsi) {
> >> +		PMD_DRV_LOG(ERR, "Invalid VSI.");
> >> +		return -EINVAL;
> >> +	}
> >> +
> >> +	if (!is_same_ether_addr(mac_addr, &vf->mac_addr)) {
> >> +		PMD_DRV_LOG(ERR, "Mac address does not match.");
> >> +		return -EINVAL;
> >> +	}
> > Not very understand why only vf->mac_addr can be moved?
> It it checks if the mac address we want to delete, similar to the function
> rte_pmd_i40e_set_vf_mac_addr where we set the mac address of a VF.

But in this way, seems we can't delete the mac address added by rte_pmd_i40e_add_vf_mac_addr.
set_vf_mac_addr should be used for setting default mac address, right?

> > I think any mac address in vsi->mac_list can be removed.
> Yes, it is removed from the vsi->mac_list in the next line if the mac address is
> matched in the previous checking.
> 
> >> +
> >> +	/* reset the mac with null mac */
> >> +	ether_addr_copy(&null_mac_addr, &vf->mac_addr);
> Here we reset the mac address of a VF with null address, reverting the
> operation of function rte_pmd_i40e_set_vf_mac_addr where we set the
> mac address of a VF.
> >> +
> >> +	/* Remove the mac */
> >> +	i40e_vsi_delete_mac(vsi, mac_addr);
> >> +
> >> +	return 0;
> >> +}
> >> +



More information about the dev mailing list