net/mlx4: restore Rx offloads
[dpdk.git] / drivers / net / mlx4 / mlx4_ethdev.c
index 01fb195..ca2170e 100644 (file)
@@ -467,20 +467,16 @@ mlx4_set_flags(struct priv *priv, unsigned int keep, unsigned int flags)
 static int
 mlx4_dev_set_link(struct priv *priv, int up)
 {
-       struct rte_eth_dev *dev = priv->dev;
        int err;
 
        if (up) {
                err = mlx4_set_flags(priv, ~IFF_UP, IFF_UP);
                if (err)
                        return err;
-               dev->rx_pkt_burst = mlx4_rx_burst;
        } else {
                err = mlx4_set_flags(priv, ~IFF_UP, ~IFF_UP);
                if (err)
                        return err;
-               dev->rx_pkt_burst = mlx4_rx_burst_removed;
-               dev->tx_pkt_burst = mlx4_tx_burst_removed;
        }
        return 0;
 }
@@ -754,8 +750,6 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
        char ifname[IF_NAMESIZE];
 
        info->pci_dev = RTE_ETH_DEV_TO_PCI(dev);
-       if (priv == NULL)
-               return;
        /* FIXME: we should ask the device for these values. */
        info->min_rx_bufsize = 32;
        info->max_rx_pktlen = 65536;
@@ -773,8 +767,19 @@ mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
        info->max_mac_addrs = RTE_DIM(priv->mac);
        info->rx_offload_capa = 0;
        info->tx_offload_capa = 0;
+       if (priv->hw_csum) {
+               info->tx_offload_capa |= (DEV_TX_OFFLOAD_IPV4_CKSUM |
+                                         DEV_TX_OFFLOAD_UDP_CKSUM |
+                                         DEV_TX_OFFLOAD_TCP_CKSUM);
+               info->rx_offload_capa |= (DEV_RX_OFFLOAD_IPV4_CKSUM |
+                                         DEV_RX_OFFLOAD_UDP_CKSUM |
+                                         DEV_RX_OFFLOAD_TCP_CKSUM);
+       }
+       if (priv->hw_csum_l2tun)
+               info->tx_offload_capa |= DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM;
        if (mlx4_get_ifname(priv, &ifname) == 0)
                info->if_index = if_nametoindex(ifname);
+       info->hash_key_size = MLX4_RSS_HASH_KEY_SIZE;
        info->speed_capa =
                        ETH_LINK_SPEED_1G |
                        ETH_LINK_SPEED_10G |