: History access is redundant when sending feedback
PATCH 2/5 : History access is redundant when sending feedback
[CCID 3]: History access is redundant when sending feedback
When receiving a new packet, the receiver needs to access the RX history twice:
* first to create / add a new entry
* to send feedback, that selfsame entry must then be `found' via history lookup.
Meaning that, for the same information, it first needs an exclusive write-access and then a (shared) read access. Without locking in between these calls, the history information may have already changed.
This patch
1. removes redundant use of packet history for sending feedback
(data packet is no longer `found', just referenced);
2. which obsoletes function dccp_rx_hist_find_data_packet - removed;
3. removes an irrelevant state `TERM' (feedback is then not sent);
4. removes redundant variable last_ack' (duplicates last_feedback');
5. converts rx_send_feedback() to use the newer timeofday interface;
6. simplify the computation of p/p_inv (see note below).
Note regarding (3): The use of the feedback variable becomes clear later
regarding (6): p will be updated by a separate function later in this changeset
--- net/dccp/ccids/ccid3.c | 67 ++++++++++++++++-------------------- net/dccp/ccids/ccid3.h | 6 +-- net/dccp/ccids/lib/packet_history.c | 16 -------- net/dccp/ccids/lib/packet_history.h | 2 - 4 files changed, 32 insertions(+), 59 deletions(-)
net/dccp/ccids/lib/packet_history.h +0 -2
@@ -145,8 +145,6 @@ static inline struct dccp_rx_hist_entryextern int dccp_rx_hist_find_entry (const struct list_head *list,const u64 seq,u8 *ccval); -extern struct dccp_rx_hist_entry * -dccp_rx_hist_find_data_packet (const struct list_head *list); extern void dccp_rx_hist_add_packet(struct dccp_rx_hist *hist, struct list_head *rx_list,
net/dccp/ccids/lib/packet_history.c +0 -16
@@ -212,22 +212,6 @@ int dccp_rx_hist_find_entry(const struct }EXPORT_SYMBOL_GPL (dccp_rx_hist_find_entry); -struct dccp_rx_hist_entry * -dccp_rx_hist_find_data_packet (const struct list_head *list) -{ -struct dccp_rx_hist_entry *entry, *packet =NULL ; - -list_for_each_entry (entry, list, dccphrx_node) -if (entry->dccphrx_type =DCCP_PKT_DATA || - entry->dccphrx_type =DCCP_PKT_DATAACK ) { - packet = entry; -break ; - } - -return packet; -} - -EXPORT_SYMBOL_GPL (dccp_rx_hist_find_data_packet); void dccp_rx_hist_add_packet(struct dccp_rx_hist *hist, struct list_head *rx_list,
net/dccp/ccids/ccid3.c +29 -36
124 lines not on this page · raw message
net/dccp/ccids/ccid3.h +2 -4
@@ -133,8 +133,7 @@ enum ccid3_hc_rx_states {* @ccid3hcrx_ccval_last_counter - Tracks window counter (RFC 4342, 8.1) * @ccid3hcrx_state - receiver state, one of %ccid3_hc_rx_states * @ccid3hcrx_bytes_recv - Total sum of DCCP payload bytes -* @ccid3hcrx_tstamp_last_feedback - Time at which last feedback was sent -* @ccid3hcrx_tstamp_last_ack - Time at which last feedback was sent +* @ccid3hcrx_last_feedback - Time at which last feedback was sent * @ccid3hcrx_hist - Packet history * @ccid3hcrx_li_hist - Loss Interval History * @ccid3hcrx_s - Received packet size in bytes
@@ -150,8 +149,7 @@ struct ccid3_hc_rx_sock { ccid3hcrx_ccval_last_counter:4 ; enum ccid3_hc_rx_states ccid3hcrx_state:8;u32 ccid3hcrx_bytes_recv; -struct timeval ccid3hcrx_tstamp_last_feedback; -struct timeval ccid3hcrx_tstamp_last_ack; +ktime_t ccid3hcrx_last_feedback;struct list_head ccid3hcrx_hist;struct list_head ccid3hcrx_li_hist;u16 ccid3hcrx_s;
Quoted 12 lines · Gerrit Renker
[CCID 3]: History access is redundant when sending feedback
This patch
1. removes redundant use of packet history for sending feedback(data packet is no longer `found', just referenced);2. which obsoletes function
dccp_rx_hist_find_data_packet- removed;
3. removes an irrelevant state `TERM' (feedback is then not sent);
4. removes redundant variablelast_ack' (duplicateslast_feedback');
5. convertsrx_send_feedback()to use the newer timeofday interface;
6. simplify the computation of p/p_inv (see note below).
Great - making code much simpler - makes it easier for people like me to understand!
Quoted 1 line
Signed-off-by Gerrit Renker <[email protected]>
Signature · 3 lines
Web: http://wand.net.nz/~iam4/ Blog: http://iansblog.jandi.co.nz WAND Network Research Group
Quoting Ian McDonald:
| > This patch | > 1. removes redundant use of packet history for sending feedback | > (data packet is no longer `found', just referenced); | > 2. which obsoletes function dccp_rx_hist_find_data_packet - removed; | > 3. removes an irrelevant state `TERM' (feedback is then not sent); | > 4. removes redundant variable `last_ack' (duplicates `last_feedback'); | > 5. converts rx_send_feedback() to use the newer timeofday interface; | > 6. simplify the computation of p/p_inv (see note below). | > | Great - making code much simpler - makes it easier for people like me | to understand!
... and people like me too. I think it is good to keep code as simple as possible, to better see the interactions. Thank you for really going through the patches individually, I'd especially appreciate input for further simplifications. After talking to Arnaldo recently, there is at least one further patch to further reduce
- removing redundant initialisations with `0' in tx_init/rx_init.