Thread (1 message) 1 message, 1 author, 2014-08-25
DORMANTno replies REVIEWED: 2 (0M)

2 review trailers.

[PATCH 2/5] e1000: config VMDQ offload register to receive multicast packet

From: Ouyang Changchun <hidden>
Date: 2014-08-25 02:09:29
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

This patch set VM offload register according to VMDQ config for e1000
PMD to support multicast and broadcast packets.

Signed-off-by: Changchun Ouyang <redacted>
Acked-by: Huawei Xie <redacted>
Acked-by: Cunming Liang <redacted>

---
 lib/librte_pmd_e1000/igb_rxtx.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
diff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c
index 977c4a2..51b1206 100644
--- a/lib/librte_pmd_e1000/igb_rxtx.c
+++ b/lib/librte_pmd_e1000/igb_rxtx.c
@@ -1768,6 +1768,26 @@ igb_vmdq_rx_hw_configure(struct rte_eth_dev *dev)
 	vt_ctl |= E1000_VT_CTL_IGNORE_MAC;
 	E1000_WRITE_REG(hw, E1000_VT_CTL, vt_ctl);
 
+	for (i = 0; i < E1000_VMOLR_SIZE; i++) {
+		vmolr = E1000_READ_REG(hw, E1000_VMOLR(i));
+		vmolr &= ~(E1000_VMOLR_AUPE | E1000_VMOLR_ROMPE |
+			E1000_VMOLR_ROPE | E1000_VMOLR_BAM |
+			E1000_VMOLR_MPME);
+
+		if (cfg->rx_mode & ETH_VMDQ_ACCEPT_UNTAG)
+			vmolr |= E1000_VMOLR_AUPE;
+		if (cfg->rx_mode & ETH_VMDQ_ACCEPT_HASH_MC)
+			vmolr |= E1000_VMOLR_ROMPE;
+		if (cfg->rx_mode & ETH_VMDQ_ACCEPT_HASH_UC)
+			vmolr |= E1000_VMOLR_ROPE;
+		if (cfg->rx_mode & ETH_VMDQ_ACCEPT_BROADCAST)
+			vmolr |= E1000_VMOLR_BAM;
+		if (cfg->rx_mode & ETH_VMDQ_ACCEPT_MULTICAST)
+			vmolr |= E1000_VMOLR_MPME;
+
+		E1000_WRITE_REG(hw, E1000_VMOLR(i), vmolr);
+	}
+
 	/*
 	 * VMOLR: set STRVLAN as 1 if IGMAC in VTCTL is set as 1
 	 * Both 82576 and 82580 support it
-- 
1.8.4.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help