Author: vmaffione
Date: Fri Dec 21 11:32:55 2018
New Revision: 342299
URL: https://svnweb.freebsd.org/changeset/base/342299

Log:
  netmap: pipes: make sure both ends use the same number of slots

Modified:
  head/sys/dev/netmap/netmap_pipe.c

Modified: head/sys/dev/netmap/netmap_pipe.c
==============================================================================
--- head/sys/dev/netmap/netmap_pipe.c   Fri Dec 21 10:41:45 2018        
(r342298)
+++ head/sys/dev/netmap/netmap_pipe.c   Fri Dec 21 11:32:55 2018        
(r342299)
@@ -782,9 +782,11 @@ netmap_get_pipe_na(struct nmreq_header *hdr, struct ne
        /* 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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to