[ovs-dev] [PATCH] packets: Fix using outdated RSS hash after MPLS decapsulation.

Nitin Katiyar nitin.katiyar at ericsson.com
Fri Aug 16 18:54:33 UTC 2019

When a packet is received, the RSS hash is calculated if it is not
already available. The Exact Match Cache (EMC) entry is then looked up
using this RSS hash.

When a MPLS encapsulated packet is received, the MPLS header is popped
and the packet is recirculated. Since the RSS hash has not been
invalidated here, the EMC lookup will hit the same entry as that before
recirculation. This degrades performance severely.

This patch invalidates RSS hash (by resetting offload flags) after MPLS
header is popped.

Signed-off-by: Nitin Katiyar <nitin.katiyar at ericsson.com>
 lib/packets.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/packets.c b/lib/packets.c
index ab0b1a3..db3f6d0 100644
--- a/lib/packets.c
+++ b/lib/packets.c
@@ -404,6 +404,10 @@ pop_mpls(struct dp_packet *packet, ovs_be16 ethtype)
         struct mpls_hdr *mh = dp_packet_l2_5(packet);
         size_t len = packet->l2_5_ofs;
+        /* Invalidate offload flags as they are not valid after
+         * decapsulation of MPLS header. */
+        dp_packet_reset_offload(packet);
         set_ethertype(packet, ethtype);
         if (get_16aligned_be32(&mh->mpls_lse) & htonl(MPLS_BOS_MASK)) {
             dp_packet_set_l2_5(packet, NULL);

More information about the dev mailing list