A non-transitory machine readable medium storing a program for optimizing network processing in a system comprising a physical host and a set of physical network interface controllers (PNICs), the physical host comprising a forwarding element, the program executable by at least one processing unit, the program comprising sets of instructions for:
- determining that a set of conditions is satisfied to bypass the forwarding element for exchanging packets between a particular data compute node (DCN) and a particular PNIC, the set of conditions comprising the particular DCN being the only DCN connected to the forwarding element and the particular PNIC being the only PNIC connected to the forwarding element;
- exchanging packets between the particular DCN and the particular PNIC bypassing the forwarding element when the set of conditions are satisfied;
- determining that at least one condition in said set of conditions is not satisfied, the at least one condition comprising the particular DCN being the only DCN connected to the forwarding element and the particular PNIC being the only PNIC connected to the forwarding element;
- and
- utilizing the forwarding element to exchange packets between the particular DCN and the particular PNIC when the at least one condition in said set of conditions is not satisfied.