@@ -1730,6 +1730,12 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint16_t ringid, uint32_t flags
17301730 case NR_REG_PIPE_MASTER :
17311731 case NR_REG_PIPE_SLAVE :
17321732 for_rx_tx (t ) {
1733+ if ((t == NR_RX && (flags & NR_TX_RINGS_ONLY )) ||
1734+ (t == NR_TX && (flags & NR_RX_RINGS_ONLY ))) {
1735+ priv -> np_qfirst [t ] = priv -> np_qlast [t ] = 0 ;
1736+ continue ;
1737+ }
1738+
17331739 priv -> np_qfirst [t ] = 0 ;
17341740 priv -> np_qlast [t ] = nma_get_nrings (na , t );
17351741 }
@@ -1743,6 +1749,18 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint16_t ringid, uint32_t flags
17431749 return EINVAL ;
17441750 }
17451751 for_rx_tx (t ) {
1752+ if ((t == NR_RX && (flags & NR_TX_RINGS_ONLY )) ||
1753+ (t == NR_TX && (flags & NR_RX_RINGS_ONLY ))) {
1754+ /*
1755+ * NR_[TX|RX]_RINGS_ONLY affects only hw
1756+ * rings, so keep sw rings on in any
1757+ * case
1758+ */
1759+ priv -> np_qfirst [t ] = nma_get_nrings (na , t );
1760+ priv -> np_qlast [t ] = nma_get_nrings (na , t ) + 1 ;
1761+ continue ;
1762+ }
1763+
17461764 priv -> np_qfirst [t ] = (reg == NR_REG_SW ?
17471765 nma_get_nrings (na , t ) : 0 );
17481766 priv -> np_qlast [t ] = nma_get_nrings (na , t ) + 1 ;
@@ -1756,6 +1774,12 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint16_t ringid, uint32_t flags
17561774 return EINVAL ;
17571775 }
17581776 for_rx_tx (t ) {
1777+ if ((t == NR_RX && (flags & NR_TX_RINGS_ONLY )) ||
1778+ (t == NR_TX && (flags & NR_RX_RINGS_ONLY ))) {
1779+ priv -> np_qfirst [t ] = priv -> np_qlast [t ] = 0 ;
1780+ continue ;
1781+ }
1782+
17591783 /* if not enough rings, use the first one */
17601784 j = i ;
17611785 if (j >= nma_get_nrings (na , t ))
0 commit comments