diff mbox series

[ovs-dev] xlate: don't add dummy eth header when doing recirc

Message ID HE1PR07MB308299926C7581890F3704178A0D0@HE1PR07MB3082.eurprd07.prod.outlook.com
State Changes Requested
Headers show
Series [ovs-dev] xlate: don't add dummy eth header when doing recirc | expand

Commit Message

Zoltan Balogh Dec. 21, 2017, 2:24 p.m. UTC
In xlate_actions(), when packet comes from a L3 port and its packet_type
is not Ethernet, then a dummy Ethernet header is added to the packet by
setting flow->packet_type to Ethernet and zero out flow->dl_src and
flow->dl_dst. This process should be avoided if packet is recirculated,
i.e. xin->frozen_state is set properly.

Signed-off-by: Zoltan Balogh <zoltan.balogh@ericsson.com>
CC: Jan Scheurich <jan.scheurich@ericsson.com>
---
 ofproto/ofproto-dpif-xlate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ben Pfaff Jan. 4, 2018, 11:12 p.m. UTC | #1
On Thu, Dec 21, 2017 at 02:24:08PM +0000, Zoltán Balogh wrote:
> In xlate_actions(), when packet comes from a L3 port and its packet_type
> is not Ethernet, then a dummy Ethernet header is added to the packet by
> setting flow->packet_type to Ethernet and zero out flow->dl_src and
> flow->dl_dst. This process should be avoided if packet is recirculated,
> i.e. xin->frozen_state is set properly.
> 
> Signed-off-by: Zoltan Balogh <zoltan.balogh@ericsson.com>
> CC: Jan Scheurich <jan.scheurich@ericsson.com>

Thanks for fixing bugs.

Please add something to the commit message to explain why this is
unnecessary when the packet is recirculated.

Thanks,

Ben.
diff mbox series

Patch

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 9b3a2f28a..d85441cb4 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -7041,7 +7041,7 @@  xlate_actions(struct xlate_in *xin, struct xlate_out *xout)
     struct xport *in_port = get_ofp_port(xbridge,
                                          ctx.base_flow.in_port.ofp_port);
 
-    if (flow->packet_type != htonl(PT_ETH) && in_port &&
+    if (!xin->frozen_state && flow->packet_type != htonl(PT_ETH) && in_port &&
         in_port->pt_mode == NETDEV_PT_LEGACY_L3 && ctx.table_id == 0) {
         /* Add dummy Ethernet header to non-L2 packet if it's coming from a
          * L3 port. So all packets will be L2 packets for lookup.