mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 05:47:55 +00:00
dpif-netdev: Read recirc depth and flow api enabled once per batch.
The call to recirc_depth_get involves accessing a TLS value. So read that once, and store it on the stack for re-use while processing the batch. The same goes for reading netdev_is_flow_api_enabled(), a non-inlined function. Signed-off-by: Balazs Nemeth <bnemeth@redhat.com> Acked-by: Gaetan Rivet <grive@u256.net> Acked-by: Paolo Valerio <pvalerio@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
parent
e6ad4d8d9c
commit
aa4359cb9f
@ -7151,6 +7151,8 @@ dfc_processing(struct dp_netdev_pmd_thread *pmd,
|
||||
struct dp_packet *packet;
|
||||
const size_t cnt = dp_packet_batch_size(packets_);
|
||||
uint32_t cur_min = pmd->ctx.emc_insert_min;
|
||||
const uint32_t recirc_depth = *recirc_depth_get();
|
||||
const bool netdev_flow_api = netdev_is_flow_api_enabled();
|
||||
int i;
|
||||
uint16_t tcp_flags;
|
||||
bool smc_enable_db;
|
||||
@ -7182,7 +7184,7 @@ dfc_processing(struct dp_netdev_pmd_thread *pmd,
|
||||
pkt_metadata_init(&packet->md, port_no);
|
||||
}
|
||||
|
||||
if (netdev_is_flow_api_enabled() && *recirc_depth_get() == 0) {
|
||||
if (netdev_flow_api && recirc_depth == 0) {
|
||||
if (OVS_UNLIKELY(dp_netdev_hw_flow(pmd, port_no, packet, &flow))) {
|
||||
/* Packet restoration failed and it was dropped, do not
|
||||
* continue processing.
|
||||
|
Loading…
x
Reference in New Issue
Block a user