diff options
author | Darrell Ball <dlu998@gmail.com> | 2017-09-25 20:51:46 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-09-26 15:55:01 -0700 |
commit | d3e105fdc70e4b9a905f36cf43188b4f800212b4 (patch) | |
tree | eb309d9cb08a9b4006c11084e25a7321348360cc /lib/conntrack.c | |
parent | 23bea9752a3d8c1626ec7c9526c54089470d04e4 (diff) | |
download | openvswitch-d3e105fdc70e4b9a905f36cf43188b4f800212b4.tar.gz |
conntrack: Minor performance enhancement.
Add an OVS_UNLIKELY and reorder a few variable condition
checks.
Acked-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib/conntrack.c')
-rw-r--r-- | lib/conntrack.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/conntrack.c b/lib/conntrack.c index 4a5116dcb..e555b5501 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -1189,7 +1189,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; } @@ -1200,10 +1200,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); } } |