Пример #1
0
/* not a policy according to specs */
static int rcv_nack_ctl(struct dtcp * dtcp,
                        struct pdu *  pdu)
{
        struct rtxq *    q;
        struct dtcp_ps * ps;
        seq_num_t        seq_num;
        struct pci *     pci;

        pci     = pdu_pci_get_rw(pdu);
        seq_num = pci_control_ack_seq_num(pci);

        rcu_read_lock();
        ps = container_of(rcu_dereference(dtcp->base.ps),
                          struct dtcp_ps, base);

        if (ps->rtx_ctrl) {
                q = dt_rtxq(dtcp->parent);
                if (!q) {
                        rcu_read_unlock();
                        LOG_ERR("Couldn't find the Retransmission queue");
                        return -1;
                }
                rtxq_nack(q, seq_num, dt_sv_tr(dtcp->parent));
		if (ps->rtt_estimator)
                	ps->rtt_estimator(ps, pci_control_ack_seq_num(pci));
        }
        rcu_read_unlock();

        LOG_DBG("DTCP received NACK (CPU: %d)", smp_processor_id());
        dump_we(dtcp, pci);

        pdu_destroy(pdu);
        return 0;
}
Пример #2
0
static int rcv_ack(struct dtcp * dtcp,
                   struct pdu *  pdu)
{
        struct dtcp_ps * ps;
        seq_num_t        seq;
        int              ret;
        struct pci *     pci;

        ASSERT(dtcp);
        ASSERT(pdu);

        pci = pdu_pci_get_rw(pdu);
        ASSERT(pci);

        seq = pci_control_ack_seq_num(pci);

        rcu_read_lock();
        ps = container_of(rcu_dereference(dtcp->base.ps),
                          struct dtcp_ps, base);
        ret = ps->sender_ack(ps, seq);
	if (ps->rtt_estimator)
        	ps->rtt_estimator(ps, pci_control_ack_seq_num(pci));
        rcu_read_unlock();

        LOG_DBG("DTCP received ACK (CPU: %d)", smp_processor_id());
        dump_we(dtcp, pci);

        pdu_destroy(pdu);
        return ret;
}
Пример #3
0
static int rcv_ack_and_flow_ctl(struct dtcp * dtcp,
                                struct pdu *  pdu)
{
        struct dtcp_ps * ps;
        seq_num_t        seq;
        struct pci *     pci;

        ASSERT(dtcp);

        pci = pdu_pci_get_rw(pdu);
        ASSERT(pci);

        LOG_DBG("Updating Window Edges for DTCP: %pK", dtcp);

        seq = pci_control_ack_seq_num(pci);

        rcu_read_lock();
        ps = container_of(rcu_dereference(dtcp->base.ps),
                          struct dtcp_ps, base);
        /* This updates sender LWE */
        if (ps->sender_ack(ps, seq))
                LOG_ERR("Could not update RTXQ and LWE");
	if (ps->rtx_ctrl && ps->rtt_estimator)
        	ps->rtt_estimator(ps, pci_control_ack_seq_num(pci));
        rcu_read_unlock();

        snd_rt_wind_edge_set(dtcp, pci_control_new_rt_wind_edge(pci));
        LOG_DBG("Right Window Edge: %u", snd_rt_wind_edge(dtcp));

        LOG_DBG("Calling CWQ_deliver for DTCP: %pK", dtcp);
        push_pdus_rmt(dtcp);

        /* FIXME: Verify values for the receiver side */
        LOG_DBG("DTCP received ACK-FC (CPU: %d)", smp_processor_id());
        dump_we(dtcp, pci);

        pdu_destroy(pdu);
        return 0;
}
Пример #4
0
static int serialize_ack_pci(const struct serdes * instance,
                             char *                data,
                             const struct pci *    pci,
                             int                   offset)
{
        seq_num_t        ack_seq;
        struct dt_cons * dt_cons;

        ASSERT(instance);
        ASSERT(data);
        ASSERT(pci);
        ASSERT(offset);

        dt_cons = instance->dt_cons;
        ASSERT(dt_cons);

        ack_seq = pci_control_ack_seq_num(pci);
        memcpy(data + offset, &ack_seq, dt_cons->seq_num_length);

        return 0;
}
Пример #5
0
void dump_we(struct dtcp * dtcp, struct pci *  pci)
{
        struct dtp * dtp;
        seq_num_t    snd_rt_we;
        seq_num_t    snd_lf_we;
        seq_num_t    rcv_rt_we;
        seq_num_t    rcv_lf_we;
        seq_num_t    new_rt_we;
        seq_num_t    new_lf_we;
        seq_num_t    pci_seqn;
        seq_num_t    my_rt_we;
        seq_num_t    my_lf_we;
        seq_num_t    ack;

        ASSERT(dtcp);
        ASSERT(pci);

        dtp = dt_dtp(dtcp->parent);
        ASSERT(dtp);

        snd_rt_we = snd_rt_wind_edge(dtcp);
        snd_lf_we = dtcp_snd_lf_win(dtcp);
        rcv_rt_we = rcvr_rt_wind_edge(dtcp);
        rcv_lf_we = dt_sv_rcv_lft_win(dtcp->parent);
        new_rt_we = pci_control_new_rt_wind_edge(pci);
        new_lf_we = pci_control_new_left_wind_edge(pci);
        my_lf_we  = pci_control_my_left_wind_edge(pci);
        my_rt_we  = pci_control_my_rt_wind_edge(pci);
        pci_seqn  = pci_sequence_number_get(pci);
        ack       = pci_control_ack_seq_num(pci);

        LOG_DBG("SEQN: %u N/Ack: %u SndRWE: %u SndLWE: %u "
                "RcvRWE: %u RcvLWE: %u "
                "newRWE: %u newLWE: %u "
                "myRWE: %u myLWE: %u",
                pci_seqn, ack, snd_rt_we, snd_lf_we, rcv_rt_we, rcv_lf_we,
                new_rt_we, new_lf_we, my_rt_we, my_lf_we);
}