net/iavf: fix default RSS configuration
[dpdk.git] / drivers / net / netvsc / hn_rxtx.c
index 674520c..0f4ef01 100644 (file)
@@ -570,7 +570,7 @@ static void hn_rxpkt(struct hn_rx_queue *rxq, struct hn_rx_bufinfo *rxb,
         * For large packets, avoid copy if possible but need to keep
         * some space available in receive area for later packets.
         */
-       if (dlen > hv->rx_copybreak &&
+       if (hv->rx_extmbuf_enable && dlen > hv->rx_copybreak &&
            (uint32_t)rte_atomic32_read(&rxq->rxbuf_outstanding) <
                        hv->rxbuf_section_cnt / 2) {
                struct rte_mbuf_ext_shared_info *shinfo;
@@ -1492,16 +1492,20 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
                hn_process_events(hv, txq->queue_id, 0);
 
        /* Transmit over VF if present and up */
-       rte_rwlock_read_lock(&hv->vf_lock);
-       vf_dev = hn_get_vf_dev(hv);
-       if (vf_dev && vf_dev->data->dev_started) {
-               void *sub_q = vf_dev->data->tx_queues[queue_id];
-
-               nb_tx = (*vf_dev->tx_pkt_burst)(sub_q, tx_pkts, nb_pkts);
+       if (hv->vf_ctx.vf_vsc_switched) {
+               rte_rwlock_read_lock(&hv->vf_lock);
+               vf_dev = hn_get_vf_dev(hv);
+               if (hv->vf_ctx.vf_vsc_switched && vf_dev &&
+                   vf_dev->data->dev_started) {
+                       void *sub_q = vf_dev->data->tx_queues[queue_id];
+
+                       nb_tx = (*vf_dev->tx_pkt_burst)
+                                       (sub_q, tx_pkts, nb_pkts);
+                       rte_rwlock_read_unlock(&hv->vf_lock);
+                       return nb_tx;
+               }
                rte_rwlock_read_unlock(&hv->vf_lock);
-               return nb_tx;
        }
-       rte_rwlock_read_unlock(&hv->vf_lock);
 
        for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
                struct rte_mbuf *m = tx_pkts[nb_tx];
@@ -1614,13 +1618,17 @@ hn_recv_pkts(void *prxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
                                           (void **)rx_pkts, nb_pkts, NULL);
 
        /* If VF is available, check that as well */
-       rte_rwlock_read_lock(&hv->vf_lock);
-       vf_dev = hn_get_vf_dev(hv);
-       if (vf_dev && vf_dev->data->dev_started)
-               nb_rcv += hn_recv_vf(vf_dev->data->port_id, rxq,
-                                    rx_pkts + nb_rcv, nb_pkts - nb_rcv);
+       if (hv->vf_ctx.vf_vsc_switched) {
+               rte_rwlock_read_lock(&hv->vf_lock);
+               vf_dev = hn_get_vf_dev(hv);
+               if (hv->vf_ctx.vf_vsc_switched && vf_dev &&
+                   vf_dev->data->dev_started)
+                       nb_rcv += hn_recv_vf(vf_dev->data->port_id, rxq,
+                                            rx_pkts + nb_rcv,
+                                            nb_pkts - nb_rcv);
 
-       rte_rwlock_read_unlock(&hv->vf_lock);
+               rte_rwlock_read_unlock(&hv->vf_lock);
+       }
        return nb_rcv;
 }