examples/ip_frag: fix use of ethdev internal device array
[dpdk.git] / drivers / net / tap / rte_eth_tap.c
index 896aae5..3841842 100644 (file)
@@ -565,9 +565,9 @@ tap_write_mbufs(struct tx_queue *txq, uint16_t num_mbufs,
                        char *buff_data = rte_pktmbuf_mtod(seg, void *);
                        proto = (*buff_data & 0xf0);
                        pi.proto = (proto == 0x40) ?
-                               rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4) :
+                               rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4) :
                                ((proto == 0x60) ?
-                                       rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6) :
+                                       rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6) :
                                        0x00);
                }
 
@@ -970,10 +970,9 @@ tap_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *tap_stats)
 
        for (i = 0; i < imax; i++) {
                tap_stats->q_opackets[i] = pmd->txq[i].stats.opackets;
-               tap_stats->q_errors[i] = pmd->txq[i].stats.errs;
                tap_stats->q_obytes[i] = pmd->txq[i].stats.obytes;
                tx_total += tap_stats->q_opackets[i];
-               tx_err_total += tap_stats->q_errors[i];
+               tx_err_total += pmd->txq[i].stats.errs;
                tx_bytes_total += tap_stats->q_obytes[i];
        }
 
@@ -2287,7 +2286,7 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)
        /* Register IPC feed callback */
        if (!tap_devices_count) {
                ret = rte_mp_action_register(TAP_MP_KEY, tap_mp_sync_queues);
-               if (ret < 0) {
+               if (ret < 0 && rte_errno != ENOTSUP) {
                        TAP_LOG(ERR, "tap: Failed to register IPC callback: %s",
                                strerror(rte_errno));
                        goto leave;