[ovs-dev] [patch v2 2/5] conntrack: Minor performance enhancement.
Darrell Ball
dlu998 at gmail.com
Thu Sep 21 07:12:06 UTC 2017
Add an OVS_UNLIKELY and reorder a few variable condition
checks.
Signed-off-by: Darrell Ball <dlu998 at gmail.com>
---
lib/conntrack.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/conntrack.c b/lib/conntrack.c
index 59d3c4e..c94bc27 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -1104,7 +1104,7 @@ process_one(struct conntrack *ct, struct dp_packet *pkt,
bool tftp_ctl = is_tftp_ctl(pkt);
struct conn conn_for_expectation;
- if (conn && (ftp_ctl || tftp_ctl)) {
+ if (OVS_UNLIKELY((ftp_ctl || tftp_ctl) && conn)) {
conn_for_expectation = *conn;
}
@@ -1115,10 +1115,10 @@ process_one(struct conntrack *ct, struct dp_packet *pkt,
}
/* FTP control packet handling with expectation creation. */
- if (OVS_UNLIKELY(conn && ftp_ctl)) {
+ if (OVS_UNLIKELY(ftp_ctl && conn)) {
handle_ftp_ctl(ct, ctx, pkt, &conn_for_expectation,
now, CT_FTP_CTL_INTEREST, !!nat_action_info);
- } else if (OVS_UNLIKELY(conn && tftp_ctl)) {
+ } else if (OVS_UNLIKELY(tftp_ctl && conn)) {
handle_tftp_ctl(ct, &conn_for_expectation, now);
}
}
--
1.9.1
More information about the dev
mailing list