src/dpdk/drivers/net/e1000/base/e1000_82575.c
void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable)
{
	u32 dtxswc;

	switch (hw->mac.type) {
	case e1000_82576:
		dtxswc = E1000_READ_REG(hw, E1000_DTXSWC);
		if (enable)
			dtxswc |= E1000_DTXSWC_VMDQ_LOOPBACK_EN;
		else
			dtxswc &= ~E1000_DTXSWC_VMDQ_LOOPBACK_EN;
		E1000_WRITE_REG(hw, E1000_DTXSWC, dtxswc);
		break;
	case e1000_i350:
	case e1000_i354:
		dtxswc = E1000_READ_REG(hw, E1000_TXSWC);
		if (enable)
			dtxswc |= E1000_DTXSWC_VMDQ_LOOPBACK_EN;
		else
			dtxswc &= ~E1000_DTXSWC_VMDQ_LOOPBACK_EN;
		E1000_WRITE_REG(hw, E1000_TXSWC, dtxswc);
		break;
	default:
		/* Currently no other hardware supports loopback */
		break;
	}


}
/**
 *  e1000_vmdq_set_loopback_pf - enable or disable vmdq loopback
 *  @hw: pointer to the hardware struct
 *  @enable: state to enter, either enabled or disabled
 *
 *  enables/disables L2 switch loopback functionality.
 **/
enable or disable vmdq loopback
@hw: pointer to the hardware struct
@enable: state to enter, either enabled or disabled

enables/disables L2 switch loopback functionality.
enable or disable vmdq loopback @hw : pointer to the hardware struct @enable : state to enter either enabled or disabled enables / disables L2 switch loopback functionality .
void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable)
{
	u32 dtxswc;
	switch (hw->mac.type) {
	case e1000_82576:
		dtxswc = E1000_READ_REG(hw, E1000_DTXSWC);
		if (enable)
			dtxswc |= E1000_DTXSWC_VMDQ_LOOPBACK_EN;
		else
			dtxswc &= ~E1000_DTXSWC_VMDQ_LOOPBACK_EN;
		E1000_WRITE_REG(hw, E1000_DTXSWC, dtxswc);
		break;
	case e1000_i350:
	case e1000_i354:
		dtxswc = E1000_READ_REG(hw, E1000_TXSWC);
		if (enable)
			dtxswc |= E1000_DTXSWC_VMDQ_LOOPBACK_EN;
		else
			dtxswc &= ~E1000_DTXSWC_VMDQ_LOOPBACK_EN;
		E1000_WRITE_REG(hw, E1000_TXSWC, dtxswc);
		break;
	default:
		break;
	}
}
void e1000_vmdq_set_loopback_pf ( struct e1000_hw * hw , bool enable ) { u32 dtxswc ; switch ( hw -> mac . type ) { case e1000_82576 : dtxswc = E1000_READ_REG ( hw , E1000_DTXSWC ) ; if ( enable ) dtxswc |= E1000_DTXSWC_VMDQ_LOOPBACK_EN ; else dtxswc &= ~ E1000_DTXSWC_VMDQ_LOOPBACK_EN ; E1000_WRITE_REG ( hw , E1000_DTXSWC , dtxswc ) ; break ; case e1000_i350 : case e1000_i354 : dtxswc = E1000_READ_REG ( hw , E1000_TXSWC ) ; if ( enable ) dtxswc |= E1000_DTXSWC_VMDQ_LOOPBACK_EN ; else dtxswc &= ~ E1000_DTXSWC_VMDQ_LOOPBACK_EN ; E1000_WRITE_REG ( hw , E1000_TXSWC , dtxswc ) ; break ; default : break ; } }
e1000_vmdq_set_loopback_pf - enable or disable vmdq loopback
  @hw: pointer to the hardware struct
  @enable: state to enter, either enabled or disabled
e1000_vmdq_set_loopback_pf - enable or disable vmdq loopback @hw : pointer to the hardware struct @enable : state to enter either enabled or disabled
/* Currently no other hardware supports loopback */