On 3 August 2015 at 22:16, Ivan Khoronzhuk <ivan.khoronz...@linaro.org> wrote:
> Bala, > > ....... > > >> >> what in case of TCP? Incorrect seq num? >> >> Looks like a coding error. TCP should be added using a boolean >> flag. >> >> Incorrect seq num is tested in the ASSERT function after >> receiving the >> packet. >> Seq num is used to check whether the received packet is the same >> which >> was sent. >> >> >> That's not enough. You use the same "fail" function before and after. >> It's not correct when you read it before sending and after sending. >> >> It can be assigned 1 while packet creation. >> Read before sending: ffff >> Read after sending: ffff >> >> No errors - it's the same. >> But assigned 1, in fact that's error. And will not be caught. >> >> >> I understand your point. seq number should be tested for != >> TEST_SEQ_INVALID using a separate assert after receiving the packet. >> > > Smth similar. But I'm not sure if it's needed at all. > > I've better added check like seq_num < 20 to cover all seqnumbers that's > not possible. (Maybe 20 or other num, but it shouldn't be > very big) But seq_num is somthing you generate and add right? So why do u need to check for multiple numbers? we just need to know if the packet is the same which we sent through scheduler/poll queue. Do you return different numbers for different error case or something? Regards, Bala > > > >> >> PS: >> I propose also rename create_packet_tcp() to create_packet(). >> It can create TCP and UDP packets. >> >> >> I wanted to make this change before sending the patch. Looks like I had >> missed and sent the patch before. >> >> Regards, >> Bala >> >> >> >> >> >> + >> + if (data.magic == DATA_MAGIC) >> + return data.seq; >> + } >> + >> + return TEST_SEQ_INVALID; >> +} >> + >> >> >> ....... >> >> -- >> Regards, >> Ivan Khoronzhuk >> >> Regards, >> Bala >> >> >> -- >> Regards, >> Ivan Khoronzhuk >> >> >> > -- > Regards, > Ivan Khoronzhuk >
_______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp