* [net-next PATCH 0/2] Minor macvlan source mode cleanups
@ 2017-10-13 20:40 Alexander Duyck
2017-10-13 20:40 ` [net-next PATCH 1/2] macvlan: Only deliver one copy of the frame to the macvlan interface Alexander Duyck
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Alexander Duyck @ 2017-10-13 20:40 UTC (permalink / raw)
To: netdev, davem
So this patch series is just a few minor cleanups for macvlan source mode.
The first patch addresses double receives when a packet is being routed to
the macvlan destination address, and the other addresses the pkt_type being
updated in cases where it most likely should not be.
---
Alexander Duyck (2):
macvlan: Only deliver one copy of the frame to the macvlan interface
macvlan: Only update pkt_type if destination MAC address matches
drivers/net/macvlan.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [net-next PATCH 1/2] macvlan: Only deliver one copy of the frame to the macvlan interface
2017-10-13 20:40 [net-next PATCH 0/2] Minor macvlan source mode cleanups Alexander Duyck
@ 2017-10-13 20:40 ` Alexander Duyck
2017-10-13 20:40 ` [net-next PATCH 2/2] macvlan: Only update pkt_type if destination MAC address matches Alexander Duyck
2017-10-15 1:46 ` [net-next PATCH 0/2] Minor macvlan source mode cleanups David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Alexander Duyck @ 2017-10-13 20:40 UTC (permalink / raw)
To: netdev, davem
From: Alexander Duyck <alexander.h.duyck@intel.com>
This patch intoduces a slight adjustment for macvlan to address the fact
that in source mode I was seeing two copies of any packet addressed to the
macvlan interface being delivered where there should have been only one.
The issue appears to be that one copy was delivered based on the source MAC
address and then the second copy was being delivered based on the
destination MAC address. To fix it I am just treating a unicast address
match as though it is not a match since source based macvlan isn't supposed
to be matching based on the destination MAC anyway.
Fixes: 79cf79abce71 ("macvlan: add source mode")
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---
drivers/net/macvlan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index d2aea961e0f4..fb1c9e095d0c 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -480,7 +480,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
struct macvlan_dev, list);
else
vlan = macvlan_hash_lookup(port, eth->h_dest);
- if (vlan == NULL)
+ if (!vlan || vlan->mode == MACVLAN_MODE_SOURCE)
return RX_HANDLER_PASS;
dev = vlan->dev;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [net-next PATCH 2/2] macvlan: Only update pkt_type if destination MAC address matches
2017-10-13 20:40 [net-next PATCH 0/2] Minor macvlan source mode cleanups Alexander Duyck
2017-10-13 20:40 ` [net-next PATCH 1/2] macvlan: Only deliver one copy of the frame to the macvlan interface Alexander Duyck
@ 2017-10-13 20:40 ` Alexander Duyck
2017-10-15 1:46 ` [net-next PATCH 0/2] Minor macvlan source mode cleanups David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Alexander Duyck @ 2017-10-13 20:40 UTC (permalink / raw)
To: netdev, davem
From: Alexander Duyck <alexander.h.duyck@intel.com>
This patch updates the pkt_type to PACKET_HOST only if the destination MAC
address matches on the on the source based macvlan. It didn't make sense to
be updating broadcast, multicast, and non-local destined frames with
PACKET_HOST.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---
drivers/net/macvlan.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index fb1c9e095d0c..b0cd866915d7 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -413,7 +413,9 @@ static void macvlan_forward_source_one(struct sk_buff *skb,
len = nskb->len + ETH_HLEN;
nskb->dev = dev;
- nskb->pkt_type = PACKET_HOST;
+
+ if (ether_addr_equal_64bits(eth_hdr(skb)->h_dest, dev->dev_addr))
+ nskb->pkt_type = PACKET_HOST;
ret = netif_rx(nskb);
macvlan_count_rx(vlan, len, ret == NET_RX_SUCCESS, false);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net-next PATCH 0/2] Minor macvlan source mode cleanups
2017-10-13 20:40 [net-next PATCH 0/2] Minor macvlan source mode cleanups Alexander Duyck
2017-10-13 20:40 ` [net-next PATCH 1/2] macvlan: Only deliver one copy of the frame to the macvlan interface Alexander Duyck
2017-10-13 20:40 ` [net-next PATCH 2/2] macvlan: Only update pkt_type if destination MAC address matches Alexander Duyck
@ 2017-10-15 1:46 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-10-15 1:46 UTC (permalink / raw)
To: alexander.duyck; +Cc: netdev
From: Alexander Duyck <alexander.duyck@gmail.com>
Date: Fri, 13 Oct 2017 13:40:18 -0700
> So this patch series is just a few minor cleanups for macvlan source mode.
> The first patch addresses double receives when a packet is being routed to
> the macvlan destination address, and the other addresses the pkt_type being
> updated in cases where it most likely should not be.
Series applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-15 1:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-13 20:40 [net-next PATCH 0/2] Minor macvlan source mode cleanups Alexander Duyck
2017-10-13 20:40 ` [net-next PATCH 1/2] macvlan: Only deliver one copy of the frame to the macvlan interface Alexander Duyck
2017-10-13 20:40 ` [net-next PATCH 2/2] macvlan: Only update pkt_type if destination MAC address matches Alexander Duyck
2017-10-15 1:46 ` [net-next PATCH 0/2] Minor macvlan source mode cleanups David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).