src/dpdk/drivers/net/txgbe/base/txgbe_hw.c
s32 txgbe_update_mc_addr_list(struct txgbe_hw *hw, u8 *mc_addr_list,
				      u32 mc_addr_count, txgbe_mc_addr_itr next,
				      bool clear)
{
	u32 i;
	u32 vmdq;

	DEBUGFUNC("txgbe_update_mc_addr_list");

	/*
	 * Set the new number of MC addresses that we are being requested to
	 * use.
	 */
	hw->addr_ctrl.num_mc_addrs = mc_addr_count;
	hw->addr_ctrl.mta_in_use = 0;

	/* Clear mta_shadow */
	if (clear) {
		DEBUGOUT(" Clearing MTA\n");
		memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow));
	}

	/* Update mta_shadow */
	for (i = 0; i < mc_addr_count; i++) {
		DEBUGOUT(" Adding the multicast addresses:\n");
		txgbe_set_mta(hw, next(hw, &mc_addr_list, &vmdq));
	}

	/* Enable mta */
	for (i = 0; i < hw->mac.mcft_size; i++)
		wr32a(hw, TXGBE_MCADDRTBL(0), i,
				      hw->mac.mta_shadow[i]);

	if (hw->addr_ctrl.mta_in_use > 0) {
		u32 psrctl = rd32(hw, TXGBE_PSRCTL);
		psrctl &= ~(TXGBE_PSRCTL_ADHF12_MASK | TXGBE_PSRCTL_MCHFENA);
		psrctl |= TXGBE_PSRCTL_MCHFENA |
			 TXGBE_PSRCTL_ADHF12(hw->mac.mc_filter_type);
		wr32(hw, TXGBE_PSRCTL, psrctl);
	}

	DEBUGOUT("txgbe update mc addr list complete\n");
	return 0;
}
/**
 *  txgbe_update_mc_addr_list - Updates MAC list of multicast addresses
 *  @hw: pointer to hardware structure
 *  @mc_addr_list: the list of new multicast addresses
 *  @mc_addr_count: number of addresses
 *  @next: iterator function to walk the multicast address list
 *  @clear: flag, when set clears the table beforehand
 *
 *  When the clear flag is set, the given list replaces any existing list.
 *  Hashes the given addresses into the multicast table.
 **/


When the clear flag is set, the given list replaces any existing list.
Hashes the given addresses into the multicast table.
When the clear flag is set the given list replaces any existing list . Hashes the given addresses into the multicast table .
s32 txgbe_update_mc_addr_list(struct txgbe_hw *hw, u8 *mc_addr_list,
				      u32 mc_addr_count, txgbe_mc_addr_itr next,
				      bool clear)
{
	u32 i;
	u32 vmdq;
	DEBUGFUNC("txgbe_update_mc_addr_list");
	hw->addr_ctrl.num_mc_addrs = mc_addr_count;
	hw->addr_ctrl.mta_in_use = 0;
	if (clear) {
		DEBUGOUT(" Clearing MTA\n");
		memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow));
	}
	for (i = 0; i < mc_addr_count; i++) {
		DEBUGOUT(" Adding the multicast addresses:\n");
		txgbe_set_mta(hw, next(hw, &mc_addr_list, &vmdq));
	}
	for (i = 0; i < hw->mac.mcft_size; i++)
		wr32a(hw, TXGBE_MCADDRTBL(0), i,
				      hw->mac.mta_shadow[i]);
	if (hw->addr_ctrl.mta_in_use > 0) {
		u32 psrctl = rd32(hw, TXGBE_PSRCTL);
		psrctl &= ~(TXGBE_PSRCTL_ADHF12_MASK | TXGBE_PSRCTL_MCHFENA);
		psrctl |= TXGBE_PSRCTL_MCHFENA |
			 TXGBE_PSRCTL_ADHF12(hw->mac.mc_filter_type);
		wr32(hw, TXGBE_PSRCTL, psrctl);
	}
	DEBUGOUT("txgbe update mc addr list complete\n");
	return 0;
}
s32 txgbe_update_mc_addr_list ( struct txgbe_hw * hw , u8 * mc_addr_list , u32 mc_addr_count , txgbe_mc_addr_itr next , bool clear ) { u32 i ; u32 vmdq ; DEBUGFUNC ( " " ) ; hw -> addr_ctrl . num_mc_addrs = mc_addr_count ; hw -> addr_ctrl . mta_in_use = 0 ; if ( clear ) { DEBUGOUT ( " \n " ) ; memset ( & hw -> mac . mta_shadow , 0 , sizeof ( hw -> mac . mta_shadow ) ) ; } for ( i = 0 ; i < mc_addr_count ; i ++ ) { DEBUGOUT ( " \n " ) ; txgbe_set_mta ( hw , next ( hw , & mc_addr_list , & vmdq ) ) ; } for ( i = 0 ; i < hw -> mac . mcft_size ; i ++ ) wr32a ( hw , TXGBE_MCADDRTBL ( 0 ) , i , hw -> mac . mta_shadow [ i ] ) ; if ( hw -> addr_ctrl . mta_in_use > 0 ) { u32 psrctl = rd32 ( hw , TXGBE_PSRCTL ) ; psrctl &= ~ ( TXGBE_PSRCTL_ADHF12_MASK | TXGBE_PSRCTL_MCHFENA ) ; psrctl |= TXGBE_PSRCTL_MCHFENA | TXGBE_PSRCTL_ADHF12 ( hw -> mac . mc_filter_type ) ; wr32 ( hw , TXGBE_PSRCTL , psrctl ) ; } DEBUGOUT ( " \n " ) ; return 0 ; }
txgbe_update_mc_addr_list - Updates MAC list of multicast addresses
  @hw: pointer to hardware structure
  @mc_addr_list: the list of new multicast addresses
  @mc_addr_count: number of addresses
  @next: iterator function to walk the multicast address list
  @clear: flag, when set clears the table beforehand
txgbe_update_mc_addr_list - Updates MAC list of multicast addresses @hw : pointer to hardware structure @mc_addr_list : the list of new multicast addresses @mc_addr_count : number of addresses @next : iterator function to walk the multicast address list @clear : flag when set clears the table beforehand
/*
	 * Set the new number of MC addresses that we are being requested to
	 * use.
	 */ /* Clear mta_shadow */ /* Update mta_shadow */ /* Enable mta */