From c52382bd401caf8f63320308c909e42e319e5254 Mon Sep 17 00:00:00 2001 From: Vincenzo Maffione Date: Fri, 21 Dec 2018 11:32:55 +0000 Subject: netmap: pipes: make sure both ends use the same number of slots --- sys/dev/netmap/netmap_pipe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/dev/netmap/netmap_pipe.c') diff --git a/sys/dev/netmap/netmap_pipe.c b/sys/dev/netmap/netmap_pipe.c index e9a2b275974c..999b45f4c371 100644 --- a/sys/dev/netmap/netmap_pipe.c +++ b/sys/dev/netmap/netmap_pipe.c @@ -782,9 +782,11 @@ netmap_get_pipe_na(struct nmreq_header *hdr, struct netmap_adapter **na, /* most fields are the same, copy from master and then fix */ *sna = *mna; sna->up.nm_mem = netmap_mem_get(mna->up.nm_mem); - /* swap the number of tx/rx rings */ + /* swap the number of tx/rx rings and slots */ sna->up.num_tx_rings = mna->up.num_rx_rings; + sna->up.num_tx_desc = mna->up.num_rx_desc; sna->up.num_rx_rings = mna->up.num_tx_rings; + sna->up.num_rx_desc = mna->up.num_tx_desc; snprintf(sna->up.name, sizeof(sna->up.name), "%s}%s", pna->name, pipe_id); sna->role = NM_PIPE_ROLE_SLAVE; error = netmap_attach_common(&sna->up); -- cgit v1.3