X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_ip_frag%2Fip_frag_internal.c;h=b679ff43ad90309d591b984c34a0169542ff5a7f;hb=83fef46a22b2c6a321b7fd92c1acd5f6e48ce489;hp=6203740a378dbd89b74e7fd4d0507cfff12b5506;hpb=d451d46c698786da7b3217f0d8d874cd881b7f17;p=dpdk.git diff --git a/lib/librte_ip_frag/ip_frag_internal.c b/lib/librte_ip_frag/ip_frag_internal.c index 6203740a37..b679ff43ad 100644 --- a/lib/librte_ip_frag/ip_frag_internal.c +++ b/lib/librte_ip_frag/ip_frag_internal.c @@ -200,7 +200,7 @@ ip_frag_process(struct ip_frag_pkt *fp, struct rte_ip_frag_death_row *dr, ip_frag_key_invalidate(&fp->key); IP_FRAG_MBUF2DR(dr, mb); - return (NULL); + return NULL; } fp->frags[idx].ofs = ofs; @@ -211,7 +211,7 @@ ip_frag_process(struct ip_frag_pkt *fp, struct rte_ip_frag_death_row *dr, /* not all fragments are collected yet. */ if (likely (fp->frag_size < fp->total_size)) { - return (mb); + return mb; /* if we collected all fragments, then try to reassemble. */ } else if (fp->frag_size == fp->total_size && @@ -259,7 +259,7 @@ ip_frag_process(struct ip_frag_pkt *fp, struct rte_ip_frag_death_row *dr, /* we are done with that entry, invalidate it. */ ip_frag_key_invalidate(&fp->key); - return (mb); + return mb; } @@ -327,7 +327,7 @@ ip_frag_find(struct rte_ip_frag_tbl *tbl, struct rte_ip_frag_death_row *dr, IP_FRAG_TBL_STAT_UPDATE(&tbl->stat, fail_total, (pkt == NULL)); tbl->last = pkt; - return (pkt); + return pkt; } struct ip_frag_pkt * @@ -346,8 +346,8 @@ ip_frag_lookup(struct rte_ip_frag_tbl *tbl, max_cycles = tbl->max_cycles; assoc = tbl->bucket_entries; - if (tbl->last != NULL && ip_frag_key_cmp(&tbl->last->key, key) == 0) - return (tbl->last); + if (tbl->last != NULL && ip_frag_key_cmp(key, &tbl->last->key) == 0) + return tbl->last; /* different hashing methods for IPv4 and IPv6 */ if (key->key_len == IPV4_KEYLEN) @@ -378,8 +378,8 @@ ip_frag_lookup(struct rte_ip_frag_tbl *tbl, p1, i, assoc, IPv6_KEY_BYTES(p1[i].key.src_dst), p1[i].key.id, p1[i].start); - if (ip_frag_key_cmp(&p1[i].key, key) == 0) - return (p1 + i); + if (ip_frag_key_cmp(key, &p1[i].key) == 0) + return p1 + i; else if (ip_frag_key_is_empty(&p1[i].key)) empty = (empty == NULL) ? (p1 + i) : empty; else if (max_cycles + p1[i].start < tms) @@ -404,8 +404,8 @@ ip_frag_lookup(struct rte_ip_frag_tbl *tbl, p2, i, assoc, IPv6_KEY_BYTES(p2[i].key.src_dst), p2[i].key.id, p2[i].start); - if (ip_frag_key_cmp(&p2[i].key, key) == 0) - return (p2 + i); + if (ip_frag_key_cmp(key, &p2[i].key) == 0) + return p2 + i; else if (ip_frag_key_is_empty(&p2[i].key)) empty = (empty == NULL) ?( p2 + i) : empty; else if (max_cycles + p2[i].start < tms) @@ -414,5 +414,5 @@ ip_frag_lookup(struct rte_ip_frag_tbl *tbl, *free = empty; *stale = old; - return (NULL); + return NULL; }