Forum Discussion
Altera_Forum
Honored Contributor
14 years agoIgor,
--- Quote Start --- I agree that your defaults are consistent, but it is not obvious for the user that changing TCP_MSS also affects maximum allowable Ethernet frame size. --- Quote End --- There is unfortunately a good bit of lwIP and lwipopts that is not obvious. --- Quote Start --- More dangerous and hard-to-debug flaw is rx buffer overflow which may occur for small MAC core if PBUF_POOL_BUFSIZE < 1520. I see that setting TSEMAC_FRM_LENGTH to (PBUF_POOL_BUFSIZE+ETH_PAD_SIZE) in tse_mac_init() supposed to do the job, but this doesn’t work because “This maximum frame length is fixed to 1518 in 10/100 and 1000 Small MAC core variations.” So, it would be good for the driver to either ensure PBUF_POOL_BUFSIZE > 1520 in compile time, or to check that PBUF_POOL_BUFSIZE > TSEMAC_FRM_LENGTH in runtime and fail hard if this confition is not meat. --- Quote End --- Then I agree it's too easy to break things with MSS changes and it shouldn't be left as-is. alteraTseEthernetif.c should include a# define with the right (calculated) size to be used in the pbug_allocs. I typically code that way when I know there are constraints. Bill