X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_ip_frag%2Fip_frag_internal.c;h=b436a4c9313b3c654ceb839df220148fe2acbbac;hb=453b9593a3cfe62ce1f64c65382090ec8adb3ec0;hp=2560c77139b44798f1eac8650166dcbac8e12b4d;hpb=3375e7f28649881fc53d83ee91772d97c8b1eb9b;p=dpdk.git diff --git a/lib/librte_ip_frag/ip_frag_internal.c b/lib/librte_ip_frag/ip_frag_internal.c index 2560c77139..b436a4c931 100644 --- a/lib/librte_ip_frag/ip_frag_internal.c +++ b/lib/librte_ip_frag/ip_frag_internal.c @@ -14,24 +14,6 @@ #define IP_FRAG_TBL_POS(tbl, sig) \ ((tbl)->pkt + ((sig) & (tbl)->entry_mask)) -#ifdef RTE_LIBRTE_IP_FRAG_TBL_STAT -#define IP_FRAG_TBL_STAT_UPDATE(s, f, v) ((s)->f += (v)) -#else -#define IP_FRAG_TBL_STAT_UPDATE(s, f, v) do {} while (0) -#endif /* IP_FRAG_TBL_STAT */ - -/* local frag table helper functions */ -static inline void -ip_frag_tbl_del(struct rte_ip_frag_tbl *tbl, struct rte_ip_frag_death_row *dr, - struct ip_frag_pkt *fp) -{ - ip_frag_free(fp, dr); - ip_frag_key_invalidate(&fp->key); - TAILQ_REMOVE(&tbl->lru, fp, lru); - tbl->use_entries--; - IP_FRAG_TBL_STAT_UPDATE(&tbl->stat, del_num, 1); -} - static inline void ip_frag_tbl_add(struct rte_ip_frag_tbl *tbl, struct ip_frag_pkt *fp, const struct ip_frag_key *key, uint64_t tms) @@ -125,8 +107,7 @@ ip_frag_process(struct ip_frag_pkt *fp, struct rte_ip_frag_death_row *dr, IP_LAST_FRAG_IDX : UINT32_MAX; /* this is the intermediate fragment. */ - } else if ((idx = fp->last_idx) < - sizeof (fp->frags) / sizeof (fp->frags[0])) { + } else if ((idx = fp->last_idx) < RTE_DIM(fp->frags)) { fp->last_idx++; } @@ -134,7 +115,7 @@ ip_frag_process(struct ip_frag_pkt *fp, struct rte_ip_frag_death_row *dr, * erroneous packet: either exceed max allowed number of fragments, * or duplicate first/last fragment encountered. */ - if (idx >= sizeof (fp->frags) / sizeof (fp->frags[0])) { + if (idx >= RTE_DIM(fp->frags)) { /* report an error. */ if (fp->key.key_len == IPV4_KEYLEN)