ethdev: get rid of device type
[dpdk.git] / drivers / net / cxgbe / cxgbe_main.c
index 316b87d..922155b 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2014-2015 Chelsio Communications.
+ *   Copyright(c) 2014-2016 Chelsio Communications.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -200,7 +200,7 @@ int cxgb4_set_rspq_intr_params(struct sge_rspq *q, unsigned int us,
 
 static inline bool is_x_1g_port(const struct link_config *lc)
 {
-       return ((lc->supported & FW_PORT_CAP_SPEED_1G) != 0);
+       return (lc->supported & FW_PORT_CAP_SPEED_1G) != 0;
 }
 
 static inline bool is_x_10g_port(const struct link_config *lc)
@@ -355,7 +355,7 @@ static int init_rss(struct adapter *adap)
        for_each_port(adap, i) {
                struct port_info *pi = adap2pinfo(adap, i);
 
-               pi->rss = rte_zmalloc(NULL, pi->rss_size, 0);
+               pi->rss = rte_zmalloc(NULL, pi->rss_size * sizeof(u16), 0);
                if (!pi->rss)
                        return -ENOMEM;
        }
@@ -855,12 +855,16 @@ int link_start(struct port_info *pi)
 {
        struct adapter *adapter = pi->adapter;
        int ret;
+       unsigned int mtu;
+
+       mtu = pi->eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
+             (ETHER_HDR_LEN + ETHER_CRC_LEN);
 
        /*
         * We do not set address filters and promiscuity here, the stack does
         * that step explicitly.
         */
-       ret = t4_set_rxmode(adapter, adapter->mbox, pi->viid, 1500, -1, -1,
+       ret = t4_set_rxmode(adapter, adapter->mbox, pi->viid, mtu, -1, -1,
                            -1, 1, true);
        if (ret == 0) {
                ret = t4_change_mac(adapter, adapter->mbox, pi->viid,
@@ -1146,7 +1150,7 @@ int cxgbe_probe(struct adapter *adapter)
                 */
 
                /* reserve an ethdev entry */
-               pi->eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_PCI);
+               pi->eth_dev = rte_eth_dev_allocate(name);
                if (!pi->eth_dev)
                        goto out_free;
 
@@ -1165,6 +1169,9 @@ allocate_mac:
                pi->eth_dev->dev_ops = adapter->eth_dev->dev_ops;
                pi->eth_dev->tx_pkt_burst = adapter->eth_dev->tx_pkt_burst;
                pi->eth_dev->rx_pkt_burst = adapter->eth_dev->rx_pkt_burst;
+
+               rte_eth_copy_pci_info(pi->eth_dev, pi->eth_dev->pci_dev);
+
                TAILQ_INIT(&pi->eth_dev->link_intr_cbs);
 
                pi->eth_dev->data->mac_addrs = rte_zmalloc(name,