Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10d8e907 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller
Browse files

igb: setup vlan tag replication stripping in igb_vmm_control



This update adds vlan tag stripping for inter-vf communications to the
igb_vmm_control configuration function.

Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d4960307
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -203,6 +203,15 @@ struct e1000_adv_tx_context_desc {
#define E1000_IOVCTL 0x05BBC
#define E1000_IOVCTL 0x05BBC
#define E1000_IOVCTL_REUSE_VFQ 0x00000001
#define E1000_IOVCTL_REUSE_VFQ 0x00000001


#define E1000_RPLOLR_STRVLAN   0x40000000
#define E1000_RPLOLR_STRCRC    0x80000000

#define E1000_DTXCTL_8023LL     0x0004
#define E1000_DTXCTL_VLAN_ADDED 0x0008
#define E1000_DTXCTL_OOS_ENABLE 0x0010
#define E1000_DTXCTL_MDP_EN     0x0020
#define E1000_DTXCTL_SPOOF_INT  0x0040

#define ALL_QUEUES   0xFFFF
#define ALL_QUEUES   0xFFFF


void igb_vmdq_set_loopback_pf(struct e1000_hw *, bool);
void igb_vmdq_set_loopback_pf(struct e1000_hw *, bool);
+11 −0
Original line number Original line Diff line number Diff line
@@ -5799,11 +5799,22 @@ static int igb_set_vf_mac(struct igb_adapter *adapter,
static void igb_vmm_control(struct igb_adapter *adapter)
static void igb_vmm_control(struct igb_adapter *adapter)
{
{
	struct e1000_hw *hw = &adapter->hw;
	struct e1000_hw *hw = &adapter->hw;
	u32 reg;


	/* replication is not supported for 82575 */
	/* replication is not supported for 82575 */
	if (hw->mac.type == e1000_82575)
	if (hw->mac.type == e1000_82575)
		return;
		return;


	/* enable replication vlan tag stripping */
	reg = rd32(E1000_RPLOLR);
	reg |= E1000_RPLOLR_STRVLAN;
	wr32(E1000_RPLOLR, reg);

	/* notify HW that the MAC is adding vlan tags */
	reg = rd32(E1000_DTXCTL);
	reg |= E1000_DTXCTL_VLAN_ADDED;
	wr32(E1000_DTXCTL, reg);

	if (adapter->vfs_allocated_count) {
	if (adapter->vfs_allocated_count) {
		igb_vmdq_set_loopback_pf(hw, true);
		igb_vmdq_set_loopback_pf(hw, true);
		igb_vmdq_set_replication_pf(hw, true);
		igb_vmdq_set_replication_pf(hw, true);