src/dpdk/drivers/net/txgbe/base/txgbe_hw.c
s32 txgbe_clear_vmdq(struct txgbe_hw *hw, u32 rar, u32 vmdq)
{
	u32 mpsar_lo, mpsar_hi;
	u32 rar_entries = hw->mac.num_rar_entries;

	DEBUGFUNC("txgbe_clear_vmdq");

	/* Make sure we are using a valid rar index range */
	if (rar >= rar_entries) {
		DEBUGOUT("RAR index %d is out of range.\n", rar);
		return TXGBE_ERR_INVALID_ARGUMENT;
	}

	wr32(hw, TXGBE_ETHADDRIDX, rar);
	mpsar_lo = rd32(hw, TXGBE_ETHADDRASSL);
	mpsar_hi = rd32(hw, TXGBE_ETHADDRASSH);

	if (TXGBE_REMOVED(hw->hw_addr))
		goto done;

	if (!mpsar_lo && !mpsar_hi)
		goto done;

	if (vmdq == BIT_MASK32) {
		if (mpsar_lo) {
			wr32(hw, TXGBE_ETHADDRASSL, 0);
			mpsar_lo = 0;
		}
		if (mpsar_hi) {
			wr32(hw, TXGBE_ETHADDRASSH, 0);
			mpsar_hi = 0;
		}
	} else if (vmdq < 32) {
		mpsar_lo &= ~(1 << vmdq);
		wr32(hw, TXGBE_ETHADDRASSL, mpsar_lo);
	} else {
		mpsar_hi &= ~(1 << (vmdq - 32));
		wr32(hw, TXGBE_ETHADDRASSH, mpsar_hi);
	}

	/* was that the last pool using this rar? */
	if (mpsar_lo == 0 && mpsar_hi == 0 &&
	    rar != 0 && rar != hw->mac.san_mac_rar_index)
		hw->mac.clear_rar(hw, rar);
done:
	return 0;
}
/**
 *  txgbe_clear_vmdq - Disassociate a VMDq pool index from a rx address
 *  @hw: pointer to hardware struct
 *  @rar: receive address register index to disassociate
 *  @vmdq: VMDq pool index to remove from the rar
 **/
Disassociate a VMDq pool index from a rx address
@hw: pointer to hardware struct
@rar: receive address register index to disassociate
@vmdq: VMDq pool index to remove from the rar
Disassociate a VMDq pool index from a rx address @hw : pointer to hardware struct @rar : receive address register index to disassociate @vmdq : VMDq pool index to remove from the rar
s32 txgbe_clear_vmdq(struct txgbe_hw *hw, u32 rar, u32 vmdq)
{
	u32 mpsar_lo, mpsar_hi;
	u32 rar_entries = hw->mac.num_rar_entries;
	DEBUGFUNC("txgbe_clear_vmdq");
	if (rar >= rar_entries) {
		DEBUGOUT("RAR index %d is out of range.\n", rar);
		return TXGBE_ERR_INVALID_ARGUMENT;
	}
	wr32(hw, TXGBE_ETHADDRIDX, rar);
	mpsar_lo = rd32(hw, TXGBE_ETHADDRASSL);
	mpsar_hi = rd32(hw, TXGBE_ETHADDRASSH);
	if (TXGBE_REMOVED(hw->hw_addr))
		goto done;
	if (!mpsar_lo && !mpsar_hi)
		goto done;
	if (vmdq == BIT_MASK32) {
		if (mpsar_lo) {
			wr32(hw, TXGBE_ETHADDRASSL, 0);
			mpsar_lo = 0;
		}
		if (mpsar_hi) {
			wr32(hw, TXGBE_ETHADDRASSH, 0);
			mpsar_hi = 0;
		}
	} else if (vmdq < 32) {
		mpsar_lo &= ~(1 << vmdq);
		wr32(hw, TXGBE_ETHADDRASSL, mpsar_lo);
	} else {
		mpsar_hi &= ~(1 << (vmdq - 32));
		wr32(hw, TXGBE_ETHADDRASSH, mpsar_hi);
	}
	if (mpsar_lo == 0 && mpsar_hi == 0 &&
	    rar != 0 && rar != hw->mac.san_mac_rar_index)
		hw->mac.clear_rar(hw, rar);
done:
	return 0;
}
s32 txgbe_clear_vmdq ( struct txgbe_hw * hw , u32 rar , u32 vmdq ) { u32 mpsar_lo , mpsar_hi ; u32 rar_entries = hw -> mac . num_rar_entries ; DEBUGFUNC ( " " ) ; if ( rar >= rar_entries ) { DEBUGOUT ( " \n " , rar ) ; return TXGBE_ERR_INVALID_ARGUMENT ; } wr32 ( hw , TXGBE_ETHADDRIDX , rar ) ; mpsar_lo = rd32 ( hw , TXGBE_ETHADDRASSL ) ; mpsar_hi = rd32 ( hw , TXGBE_ETHADDRASSH ) ; if ( TXGBE_REMOVED ( hw -> hw_addr ) ) goto done ; if ( ! mpsar_lo && ! mpsar_hi ) goto done ; if ( vmdq == BIT_MASK32 ) { if ( mpsar_lo ) { wr32 ( hw , TXGBE_ETHADDRASSL , 0 ) ; mpsar_lo = 0 ; } if ( mpsar_hi ) { wr32 ( hw , TXGBE_ETHADDRASSH , 0 ) ; mpsar_hi = 0 ; } } else if ( vmdq < 32 ) { mpsar_lo &= ~ ( 1 << vmdq ) ; wr32 ( hw , TXGBE_ETHADDRASSL , mpsar_lo ) ; } else { mpsar_hi &= ~ ( 1 << ( vmdq - 32 ) ) ; wr32 ( hw , TXGBE_ETHADDRASSH , mpsar_hi ) ; } if ( mpsar_lo == 0 && mpsar_hi == 0 && rar != 0 && rar != hw -> mac . san_mac_rar_index ) hw -> mac . clear_rar ( hw , rar ) ; done : return 0 ; }
txgbe_clear_vmdq - Disassociate a VMDq pool index from a rx address
  @hw: pointer to hardware struct
  @rar: receive address register index to disassociate
  @vmdq: VMDq pool index to remove from the rar
txgbe_clear_vmdq - Disassociate a VMDq pool index from a rx address @hw : pointer to hardware struct @rar : receive address register index to disassociate @vmdq : VMDq pool index to remove from the rar
/* Make sure we are using a valid rar index range */ /* was that the last pool using this rar? */