X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_gso%2Fgso_udp4.c;h=5d0186aa240b777d3d122c0549de3d5f2bbace94;hb=3127f99274b679124658afdbfc49210730c50617;hp=21fea0927368aa8b15529a6d74fa5c42ae76281e;hpb=a7c528e5d71ff3f569898d268f9de129fdfc152b;p=dpdk.git diff --git a/lib/librte_gso/gso_udp4.c b/lib/librte_gso/gso_udp4.c index 21fea09273..5d0186aa24 100644 --- a/lib/librte_gso/gso_udp4.c +++ b/lib/librte_gso/gso_udp4.c @@ -52,8 +52,7 @@ gso_udp4_segment(struct rte_mbuf *pkt, pkt->l2_len); frag_off = rte_be_to_cpu_16(ipv4_hdr->fragment_offset); if (unlikely(IS_FRAGMENTED(frag_off))) { - pkts_out[0] = pkt; - return 1; + return 0; } /* @@ -65,11 +64,13 @@ gso_udp4_segment(struct rte_mbuf *pkt, /* Don't process the packet without data. */ if (unlikely(hdr_offset + pkt->l4_len >= pkt->pkt_len)) { - pkts_out[0] = pkt; - return 1; + return 0; } - pyld_unit_size = gso_size - hdr_offset; + /* pyld_unit_size must be a multiple of 8 because frag_off + * uses 8 bytes as unit. + */ + pyld_unit_size = (gso_size - hdr_offset) & ~7U; /* Segment the payload */ ret = gso_do_segment(pkt, hdr_offset, pyld_unit_size, direct_pool,