src/dpdk/drivers/net/txgbe/base/txgbe_hw.c
s32 txgbe_set_vfta(struct txgbe_hw *hw, u32 vlan, u32 vind,
			   bool vlan_on, bool vlvf_bypass)
{
	u32 regidx, vfta_delta, vfta;
	s32 err;

	DEBUGFUNC("txgbe_set_vfta");

	if (vlan > 4095 || vind > 63)
		return TXGBE_ERR_PARAM;

	/*
	 * this is a 2 part operation - first the VFTA, then the
	 * VLVF and VLVFB if VT Mode is set
	 * We don't write the VFTA until we know the VLVF part succeeded.
	 */

	/* Part 1
	 * The VFTA is a bitstring made up of 128 32-bit registers
	 * that enable the particular VLAN id, much like the MTA:
	 *    bits[11-5]: which register
	 *    bits[4-0]:  which bit in the register
	 */
	regidx = vlan / 32;
	vfta_delta = 1 << (vlan % 32);
	vfta = rd32(hw, TXGBE_VLANTBL(regidx));

	/*
	 * vfta_delta represents the difference between the current value
	 * of vfta and the value we want in the register.  Since the diff
	 * is an XOR mask we can just update the vfta using an XOR
	 */
	vfta_delta &= vlan_on ? ~vfta : vfta;
	vfta ^= vfta_delta;

	/* Part 2
	 * Call txgbe_set_vlvf to set VLVFB and VLVF
	 */
	err = txgbe_set_vlvf(hw, vlan, vind, vlan_on, &vfta_delta,
					 vfta, vlvf_bypass);
	if (err != 0) {
		if (vlvf_bypass)
			goto vfta_update;
		return err;
	}

vfta_update:
	/* Update VFTA now that we are ready for traffic */
	if (vfta_delta)
		wr32(hw, TXGBE_VLANTBL(regidx), vfta);

	return 0;
}
/**
 *  txgbe_set_vfta - Set VLAN filter table
 *  @hw: pointer to hardware structure
 *  @vlan: VLAN id to write to VLAN filter
 *  @vind: VMDq output index that maps queue to VLAN id in VLVFB
 *  @vlan_on: boolean flag to turn on/off VLAN
 *  @vlvf_bypass: boolean flag indicating updating default pool is okay
 *
 *  Turn on/off specified VLAN in the VLAN filter table.
 **/


Turn on/off specified VLAN in the VLAN filter table.
Turn on / off specified VLAN in the VLAN filter table .
s32 txgbe_set_vfta(struct txgbe_hw *hw, u32 vlan, u32 vind,
			   bool vlan_on, bool vlvf_bypass)
{
	u32 regidx, vfta_delta, vfta;
	s32 err;
	DEBUGFUNC("txgbe_set_vfta");
	if (vlan > 4095 || vind > 63)
		return TXGBE_ERR_PARAM;
	regidx = vlan / 32;
	vfta_delta = 1 << (vlan % 32);
	vfta = rd32(hw, TXGBE_VLANTBL(regidx));
	vfta_delta &= vlan_on ? ~vfta : vfta;
	vfta ^= vfta_delta;
	err = txgbe_set_vlvf(hw, vlan, vind, vlan_on, &vfta_delta,
					 vfta, vlvf_bypass);
	if (err != 0) {
		if (vlvf_bypass)
			goto vfta_update;
		return err;
	}
vfta_update:
	if (vfta_delta)
		wr32(hw, TXGBE_VLANTBL(regidx), vfta);
	return 0;
}
s32 txgbe_set_vfta ( struct txgbe_hw * hw , u32 vlan , u32 vind , bool vlan_on , bool vlvf_bypass ) { u32 regidx , vfta_delta , vfta ; s32 err ; DEBUGFUNC ( " " ) ; if ( vlan > 4095 || vind > 63 ) return TXGBE_ERR_PARAM ; regidx = vlan / 32 ; vfta_delta = 1 << ( vlan % 32 ) ; vfta = rd32 ( hw , TXGBE_VLANTBL ( regidx ) ) ; vfta_delta &= vlan_on ? ~ vfta : vfta ; vfta ^= vfta_delta ; err = txgbe_set_vlvf ( hw , vlan , vind , vlan_on , & vfta_delta , vfta , vlvf_bypass ) ; if ( err != 0 ) { if ( vlvf_bypass ) goto vfta_update ; return err ; } vfta_update : if ( vfta_delta ) wr32 ( hw , TXGBE_VLANTBL ( regidx ) , vfta ) ; return 0 ; }
txgbe_set_vfta - Set VLAN filter table
  @hw: pointer to hardware structure
  @vlan: VLAN id to write to VLAN filter
  @vind: VMDq output index that maps queue to VLAN id in VLVFB
  @vlan_on: boolean flag to turn on/off VLAN
  @vlvf_bypass: boolean flag indicating updating default pool is okay
txgbe_set_vfta - Set VLAN filter table @hw : pointer to hardware structure @vlan : VLAN id to write to VLAN filter @vind : VMDq output index that maps queue to VLAN id in VLVFB @vlan_on : boolean flag to turn on / off VLAN @vlvf_bypass : boolean flag indicating updating default pool is okay
/*
	 * this is a 2 part operation - first the VFTA, then the
	 * VLVF and VLVFB if VT Mode is set
	 * We don't write the VFTA until we know the VLVF part succeeded.
	 */ /* Part 1
	 * The VFTA is a bitstring made up of 128 32-bit registers
	 * that enable the particular VLAN id, much like the MTA:
	 *    bits[11-5]: which register
	 *    bits[4-0]:  which bit in the register
	 */ /*
	 * vfta_delta represents the difference between the current value
	 * of vfta and the value we want in the register.  Since the diff
	 * is an XOR mask we can just update the vfta using an XOR
	 */ /* Part 2
	 * Call txgbe_set_vlvf to set VLVFB and VLVF
	 */ /* Update VFTA now that we are ready for traffic */