3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 17:59:25 +01:00

hwsim: remove unconditional packet delay

This was initially put in to solve an issue that was specific to
mac80211_hwsim where the connect callback would get queued and
delayed until after the connect event. This caused IWD to get very
confused.

Later it was found that "real" drivers can sometimes do this so
some code was added to IWD core to handle it.

Now there isn't much point to delay all frames unless a rule specifies
so change the behavior back to sending out frames immediately.
This commit is contained in:
James Prestwood 2021-08-18 15:09:29 -07:00 committed by Denis Kenzior
parent a4ee9c8152
commit 382bbf1861

View File

@ -1436,9 +1436,11 @@ static void frame_delay_callback(struct l_timeout *timeout, void *user_data)
else else
send_frame_destroy(send_info); send_frame_destroy(send_info);
l_timeout_remove(timeout); if (timeout)
l_timeout_remove(timeout);
} }
/* /*
* Process frames in a similar way to how the kernel built-in hwsim medium * Process frames in a similar way to how the kernel built-in hwsim medium
* does this, with an additional optimization for unicast frames and * does this, with an additional optimization for unicast frames and
@ -1457,7 +1459,7 @@ static void process_frame(struct hwsim_frame *frame)
struct radio_info_rec *radio = entry->data; struct radio_info_rec *radio = entry->data;
struct send_frame_info *send_info; struct send_frame_info *send_info;
bool drop = drop_mcast; bool drop = drop_mcast;
uint32_t delay = HWSIM_DELAY_MIN_MS; uint32_t delay = 0;
if (radio == frame->src_radio) if (radio == frame->src_radio)
continue; continue;
@ -1499,11 +1501,16 @@ static void process_frame(struct hwsim_frame *frame)
send_info->radio = radio; send_info->radio = radio;
send_info->frame = hwsim_frame_ref(frame); send_info->frame = hwsim_frame_ref(frame);
if (!l_timeout_create_ms(delay, frame_delay_callback, if (delay) {
send_info, NULL)) { if (!l_timeout_create_ms(delay, frame_delay_callback,
l_error("Error delaying frame, frame will be dropped"); send_info, NULL)) {
send_frame_destroy(send_info); l_error("Error delaying frame %ums, "
} "frame will be dropped", delay);
send_frame_destroy(send_info);
}
} else
frame_delay_callback(NULL, send_info);
} }
hwsim_frame_unref(frame); hwsim_frame_unref(frame);
@ -1999,7 +2006,7 @@ static struct l_dbus_message *rule_add(struct l_dbus *dbus,
rule->id = next_rule_id++; rule->id = next_rule_id++;
rule->source_any = true; rule->source_any = true;
rule->destination_any = true; rule->destination_any = true;
rule->delay = HWSIM_DELAY_MIN_MS; rule->delay = 0;
rule->enabled = false; rule->enabled = false;
if (!rules) if (!rules)