• Min Si's avatar
    Bug-fix: trigger OnFinal at end when receiving multiple segments. · ea444c34
    Min Si authored
    
    
    There are two request handlers used when receiving data:
    (1) OnDataAvail, which is triggered when data is arrived;
    (2) OnFinal, which is triggered when receiving data is finished;
    
    In progress engine, only OnDataAvail is triggered when a request is
    completed. The upper ch3 layer should change OnDataAvail to OnFinal when
    the coming receiving data will complete the request.
    
    However, in the original implementation, when receiving multiple
    segments for a large receive data, the OnDataAvail was reset to 0
    at the last segment hence the final action was lost. This patch fixed
    this bug.
    
    In RMA target put/acc/gacc packet handlers, OnDataAvail was reset to
    OnFinal function if OnDataAvail is 0 due to this bug. This patch also
    rewrites this part so that packet handlers only sets proper OnFinal
    handler at beginning and let the receiving data function change
    OnDataAvail to OnFinal at the last segment.
    
    Signed-off-by: default avatarXin Zhao <xinzhao3@illinois.edu>
    ea444c34