Thread (11 messages) flat view 11 messages, 5 authors, 2013-01-22

Re: [PATCH net-next 2/2] net/mlx4_en: Add support for destination MAC in steering rules

From: Brian Haley <hidden>
Date: 2012-12-11 15:38:48

On 12/11/2012 07:03 AM, Amir Vadai wrote:
quoted hunk ↗ jump to hunk
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -619,7 +619,13 @@ static int mlx4_en_validate_flow(struct net_device *dev,
 	if (cmd->fs.location >= MAX_NUM_OF_FS_RULES)
 		return -EINVAL;
 
-	switch (cmd->fs.flow_type & ~FLOW_EXT) {
+	if (cmd->fs.flow_type & FLOW_MAC_EXT) {
+		/* dest mac mask must be ff:ff:ff:ff:ff:ff */
+		if (memcmp(cmd->fs.m_ext.h_dest, &full_mac, ETH_ALEN))
+			return -EINVAL;
+	}
etherdevice.h has is_broadcast_ether_addr() and is_zero_ether_addr() if you want
to get rid of full_mac and zero_mac in this function.

-Brian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help