Changeset efdfebc in mainline for uspace/srv/net/tcp/tqueue.c


Ignore:
Timestamp:
2012-11-06T21:03:44Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
338810f
Parents:
de73242 (diff), 94795812 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tcp/tqueue.c

    rde73242 refdfebc  
    8888        tcp_segment_t *seg;
    8989
    90         log_msg(LVL_DEBUG, "tcp_tqueue_ctrl_seg(%p, %u)", conn, ctrl);
     90        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_tqueue_ctrl_seg(%p, %u)", conn, ctrl);
    9191
    9292        seg = tcp_segment_make_ctrl(ctrl);
     
    9999        tcp_tqueue_entry_t *tqe;
    100100
    101         log_msg(LVL_DEBUG, "%s: tcp_tqueue_seg(%p, %p)", conn->name, conn,
     101        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_tqueue_seg(%p, %p)", conn->name, conn,
    102102            seg);
    103103
     
    109109                rt_seg = tcp_segment_dup(seg);
    110110                if (rt_seg == NULL) {
    111                         log_msg(LVL_ERROR, "Memory allocation failed.");
     111                        log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed.");
    112112                        /* XXX Handle properly */
    113113                        return;
     
    116116                tqe = calloc(1, sizeof(tcp_tqueue_entry_t));
    117117                if (tqe == NULL) {
    118                         log_msg(LVL_ERROR, "Memory allocation failed.");
     118                        log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed.");
    119119                        /* XXX Handle properly */
    120120                        return;
     
    165165        tcp_segment_t *seg;
    166166
    167         log_msg(LVL_DEBUG, "%s: tcp_tqueue_new_data()", conn->name);
     167        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_tqueue_new_data()", conn->name);
    168168
    169169        /* Number of free sequence numbers in send window */
     
    172172
    173173        xfer_seqlen = min(snd_buf_seqlen, avail_wnd);
    174         log_msg(LVL_DEBUG, "%s: snd_buf_seqlen = %zu, SND.WND = %zu, "
     174        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: snd_buf_seqlen = %zu, SND.WND = %" PRIu32 ", "
    175175            "xfer_seqlen = %zu", conn->name, snd_buf_seqlen, conn->snd_wnd,
    176176            xfer_seqlen);
     
    185185
    186186        if (send_fin) {
    187                 log_msg(LVL_DEBUG, "%s: Sending out FIN.", conn->name);
     187                log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: Sending out FIN.", conn->name);
    188188                /* We are sending out FIN */
    189189                ctrl = CTL_FIN;
     
    194194        seg = tcp_segment_make_data(ctrl, conn->snd_buf, data_size);
    195195        if (seg == NULL) {
    196                 log_msg(LVL_ERROR, "Memory allocation failure.");
     196                log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failure.");
    197197                return;
    198198        }
     
    223223        link_t *cur, *next;
    224224
    225         log_msg(LVL_DEBUG, "%s: tcp_tqueue_ack_received(%p)", conn->name,
     225        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_tqueue_ack_received(%p)", conn->name,
    226226            conn);
    227227
     
    239239
    240240                        if ((tqe->seg->ctrl & CTL_FIN) != 0) {
    241                                 log_msg(LVL_DEBUG, "Fin has been acked");
    242                                 log_msg(LVL_DEBUG, "SND.UNA=%" PRIu32
     241                                log_msg(LOG_DEFAULT, LVL_DEBUG, "Fin has been acked");
     242                                log_msg(LOG_DEFAULT, LVL_DEBUG, "SND.UNA=%" PRIu32
    243243                                    " SEG.SEQ=%" PRIu32 " SEG.LEN=%" PRIu32,
    244244                                    conn->snd_una, tqe->seg->seq, tqe->seg->len);
     
    267267void tcp_conn_transmit_segment(tcp_conn_t *conn, tcp_segment_t *seg)
    268268{
    269         log_msg(LVL_DEBUG, "%s: tcp_conn_transmit_segment(%p, %p)",
     269        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_conn_transmit_segment(%p, %p)",
    270270            conn->name, conn, seg);
    271271
     
    282282void tcp_transmit_segment(tcp_sockpair_t *sp, tcp_segment_t *seg)
    283283{
    284         log_msg(LVL_DEBUG, "tcp_transmit_segment(f:(%x,%u),l:(%x,%u), %p)",
     284        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_transmit_segment(f:(%x,%u),l:(%x,%u), %p)",
    285285            sp->foreign.addr.ipv4, sp->foreign.port,
    286286            sp->local.addr.ipv4, sp->local.port, seg);
    287287
    288         log_msg(LVL_DEBUG, "SEG.SEQ=%" PRIu32 ", SEG.WND=%" PRIu32,
     288        log_msg(LOG_DEFAULT, LVL_DEBUG, "SEG.SEQ=%" PRIu32 ", SEG.WND=%" PRIu32,
    289289            seg->seq, seg->wnd);
    290290
     
    300300
    301301        if (tcp_pdu_encode(sp, seg, &pdu) != EOK) {
    302                 log_msg(LVL_WARN, "Not enough memory. Segment dropped.");
     302                log_msg(LOG_DEFAULT, LVL_WARN, "Not enough memory. Segment dropped.");
    303303                return;
    304304        }
     
    315315        link_t *link;
    316316
    317         log_msg(LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn);
     317        log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmit_timeout_func(%p)", conn->name, conn);
    318318
    319319        fibril_mutex_lock(&conn->lock);
    320320
    321321        if (conn->cstate == st_closed) {
    322                 log_msg(LVL_DEBUG, "Connection already closed.");
     322                log_msg(LOG_DEFAULT, LVL_DEBUG, "Connection already closed.");
    323323                fibril_mutex_unlock(&conn->lock);
    324324                tcp_conn_delref(conn);
     
    328328        link = list_first(&conn->retransmit.list);
    329329        if (link == NULL) {
    330                 log_msg(LVL_DEBUG, "Nothing to retransmit");
     330                log_msg(LOG_DEFAULT, LVL_DEBUG, "Nothing to retransmit");
    331331                fibril_mutex_unlock(&conn->lock);
    332332                tcp_conn_delref(conn);
     
    338338        rt_seg = tcp_segment_dup(tqe->seg);
    339339        if (rt_seg == NULL) {
    340                 log_msg(LVL_ERROR, "Memory allocation failed.");
     340                log_msg(LOG_DEFAULT, LVL_ERROR, "Memory allocation failed.");
    341341                fibril_mutex_unlock(&conn->lock);
    342342                tcp_conn_delref(conn);
     
    345345        }
    346346
    347         log_msg(LVL_DEBUG, "### %s: retransmitting segment", conn->name);
     347        log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: retransmitting segment", conn->name);
    348348        tcp_conn_transmit_segment(tqe->conn, rt_seg);
    349349
     
    358358static void tcp_tqueue_timer_set(tcp_conn_t *conn)
    359359{
    360         log_msg(LVL_DEBUG, "### %s: tcp_tqueue_timer_set()", conn->name);
     360        log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_set()", conn->name);
    361361
    362362        /* Clear first to make sure we update refcnt correctly */
     
    371371static void tcp_tqueue_timer_clear(tcp_conn_t *conn)
    372372{
    373         log_msg(LVL_DEBUG, "### %s: tcp_tqueue_timer_clear()", conn->name);
     373        log_msg(LOG_DEFAULT, LVL_DEBUG, "### %s: tcp_tqueue_timer_clear()", conn->name);
    374374
    375375        if (fibril_timer_clear(conn->retransmit.timer) == fts_active)
Note: See TracChangeset for help on using the changeset viewer.