net/tap: fix icc build
[dpdk.git] / drivers / net / tap / rte_eth_tap.c
index b18efd8..ef33aac 100644 (file)
@@ -526,8 +526,8 @@ pmd_tx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
                 */
                char *buff_data = rte_pktmbuf_mtod(seg, void *);
                j = (*buff_data & 0xf0);
-               if (j & (0x40 | 0x60))
-                       pi.proto = (j == 0x40) ? 0x0008 : 0xdd86;
+               pi.proto = (j == 0x40) ? 0x0008 :
+                               (j == 0x60) ? 0xdd86 : 0x00;
 
                iovecs[0].iov_base = π
                iovecs[0].iov_len = sizeof(pi);
@@ -621,7 +621,9 @@ apply:
        case SIOCSIFMTU:
                break;
        default:
-               RTE_ASSERT(!"unsupported request type: must not happen");
+               RTE_LOG(WARNING, PMD, "%s: ioctl() called with wrong arg\n",
+                       pmd->name);
+               return -EINVAL;
        }
        if (ioctl(pmd->ioctl_sock, request, ifr) < 0)
                goto error;
@@ -1721,6 +1723,7 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)
        char tap_name[RTE_ETH_NAME_MAX_LEN];
        char remote_iface[RTE_ETH_NAME_MAX_LEN];
        struct ether_addr user_mac = { .addr_bytes = {0} };
+       struct rte_eth_dev *eth_dev;
 
        tap_type = 1;
        strcpy(tuntap_name, "TAP");
@@ -1728,6 +1731,18 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)
        name = rte_vdev_device_name(dev);
        params = rte_vdev_device_args(dev);
 
+       if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
+           strlen(params) == 0) {
+               eth_dev = rte_eth_dev_attach_secondary(name);
+               if (!eth_dev) {
+                       RTE_LOG(ERR, PMD, "Failed to probe %s\n", name);
+                       return -1;
+               }
+               /* TODO: request info from primary to set up Rx and Tx */
+               eth_dev->dev_ops = &ops;
+               return 0;
+       }
+
        speed = ETH_SPEED_NUM_10G;
        snprintf(tap_name, sizeof(tap_name), "%s%d",
                 DEFAULT_TAP_NAME, tap_unit++);