Skip to content

Commit

Permalink
tests: net: arp: Increase network buffer counts
Browse files Browse the repository at this point in the history
In some hw like Atmel SAM-E70, the original amount of network
buffers is too small so increasing it slightly.
Also generate proper error if this happens in the test so it
is easier to figure out.

Fixes #8866

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
  • Loading branch information
jukkar authored and nashif committed Jul 13, 2018
1 parent 247ca67 commit 9ad36e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
8 changes: 4 additions & 4 deletions tests/net/arp/prj.conf
Expand Up @@ -5,10 +5,10 @@ CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_IPV4=y
CONFIG_NET_BUF=y
CONFIG_ZTEST_STACKSIZE=2048
CONFIG_NET_PKT_RX_COUNT=5
CONFIG_NET_PKT_TX_COUNT=5
CONFIG_NET_BUF_RX_COUNT=5
CONFIG_NET_BUF_TX_COUNT=5
CONFIG_NET_PKT_RX_COUNT=10
CONFIG_NET_PKT_TX_COUNT=10
CONFIG_NET_BUF_RX_COUNT=20
CONFIG_NET_BUF_TX_COUNT=20
CONFIG_NET_LOG=y
CONFIG_SYS_LOG_SHOW_COLOR=y
CONFIG_ENTROPY_GENERATOR=y
Expand Down
14 changes: 4 additions & 10 deletions tests/net/arp/src/main.c
Expand Up @@ -561,19 +561,13 @@ void test_arp(void)
/* The arp request packet is now verified, create an arp reply.
* The previous value of pkt is stored in arp table and is not lost.
*/
pkt = net_pkt_get_reserve_rx(sizeof(struct net_eth_hdr), K_FOREVER);

zassert_not_null(pkt,
"Out of mem RX reply");
pkt = net_pkt_get_reserve_rx(sizeof(struct net_eth_hdr), K_SECONDS(1));

printk("%d pkt %p\n", __LINE__, pkt);
zassert_not_null(pkt, "Out of mem RX reply");

frag = net_pkt_get_frag(pkt, K_FOREVER);

zassert_not_null(frag,
"Out of mem DATA reply");
frag = net_pkt_get_frag(pkt, K_SECONDS(1));

printk("%d frag %p\n", __LINE__, frag);
zassert_not_null(frag, "Out of mem DATA reply");

net_pkt_frag_add(pkt, frag);

Expand Down

0 comments on commit 9ad36e7

Please sign in to comment.