4 * Copyright 2017 6WIND S.A.
5 * Copyright 2017 Mellanox
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of 6WIND S.A. nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 * Miscellaneous control operations for mlx4 driver.
42 #include <linux/ethtool.h>
43 #include <linux/sockios.h>
45 #include <netinet/ip.h>
51 #include <sys/ioctl.h>
52 #include <sys/socket.h>
55 /* Verbs headers do not support -pedantic. */
57 #pragma GCC diagnostic ignored "-Wpedantic"
59 #include <infiniband/verbs.h>
61 #pragma GCC diagnostic error "-Wpedantic"
64 #include <rte_bus_pci.h>
65 #include <rte_errno.h>
66 #include <rte_ethdev_driver.h>
67 #include <rte_ether.h>
72 #include "mlx4_flow.h"
73 #include "mlx4_rxtx.h"
74 #include "mlx4_utils.h"
77 * Get interface name from private structure.
80 * Pointer to private structure.
82 * Interface name output buffer.
85 * 0 on success, negative errno value otherwise and rte_errno is set.
88 mlx4_get_ifname(const struct priv *priv, char (*ifname)[IF_NAMESIZE])
92 unsigned int dev_type = 0;
93 unsigned int dev_port_prev = ~0u;
94 char match[IF_NAMESIZE] = "";
97 MKSTR(path, "%s/device/net", priv->ctx->device->ibdev_path);
105 while ((dent = readdir(dir)) != NULL) {
106 char *name = dent->d_name;
108 unsigned int dev_port;
111 if ((name[0] == '.') &&
112 ((name[1] == '\0') ||
113 ((name[1] == '.') && (name[2] == '\0'))))
116 MKSTR(path, "%s/device/net/%s/%s",
117 priv->ctx->device->ibdev_path, name,
118 (dev_type ? "dev_id" : "dev_port"));
120 file = fopen(path, "rb");
125 * Switch to dev_id when dev_port does not exist as
126 * is the case with Linux kernel versions < 3.15.
137 r = fscanf(file, (dev_type ? "%x" : "%u"), &dev_port);
142 * Switch to dev_id when dev_port returns the same value for
143 * all ports. May happen when using a MOFED release older than
144 * 3.0 with a Linux kernel >= 3.15.
146 if (dev_port == dev_port_prev)
148 dev_port_prev = dev_port;
149 if (dev_port == (priv->port - 1u))
150 snprintf(match, sizeof(match), "%s", name);
153 if (match[0] == '\0') {
157 strncpy(*ifname, match, sizeof(*ifname));
162 * Read from sysfs entry.
165 * Pointer to private structure.
167 * Entry name relative to sysfs path.
169 * Data output buffer.
174 * Number of bytes read on success, negative errno value otherwise and
178 mlx4_sysfs_read(const struct priv *priv, const char *entry,
179 char *buf, size_t size)
181 char ifname[IF_NAMESIZE];
185 ret = mlx4_get_ifname(priv, &ifname);
189 MKSTR(path, "%s/device/net/%s/%s", priv->ctx->device->ibdev_path,
192 file = fopen(path, "rb");
197 ret = fread(buf, 1, size, file);
198 if ((size_t)ret < size && ferror(file)) {
209 * Write to sysfs entry.
212 * Pointer to private structure.
214 * Entry name relative to sysfs path.
221 * Number of bytes written on success, negative errno value otherwise and
225 mlx4_sysfs_write(const struct priv *priv, const char *entry,
226 char *buf, size_t size)
228 char ifname[IF_NAMESIZE];
232 ret = mlx4_get_ifname(priv, &ifname);
236 MKSTR(path, "%s/device/net/%s/%s", priv->ctx->device->ibdev_path,
239 file = fopen(path, "wb");
244 ret = fwrite(buf, 1, size, file);
245 if ((size_t)ret < size || ferror(file)) {
256 * Get unsigned long sysfs property.
259 * Pointer to private structure.
261 * Entry name relative to sysfs path.
263 * Value output buffer.
266 * 0 on success, negative errno value otherwise and rte_errno is set.
269 mlx4_get_sysfs_ulong(struct priv *priv, const char *name, unsigned long *value)
272 unsigned long value_ret;
275 ret = mlx4_sysfs_read(priv, name, value_str, (sizeof(value_str) - 1));
277 DEBUG("cannot read %s value from sysfs: %s",
278 name, strerror(rte_errno));
281 value_str[ret] = '\0';
283 value_ret = strtoul(value_str, NULL, 0);
286 DEBUG("invalid %s value `%s': %s", name, value_str,
287 strerror(rte_errno));
295 * Set unsigned long sysfs property.
298 * Pointer to private structure.
300 * Entry name relative to sysfs path.
305 * 0 on success, negative errno value otherwise and rte_errno is set.
308 mlx4_set_sysfs_ulong(struct priv *priv, const char *name, unsigned long value)
311 MKSTR(value_str, "%lu", value);
313 ret = mlx4_sysfs_write(priv, name, value_str, (sizeof(value_str) - 1));
315 DEBUG("cannot write %s `%s' (%lu) to sysfs: %s",
316 name, value_str, value, strerror(rte_errno));
323 * Perform ifreq ioctl() on associated Ethernet device.
326 * Pointer to private structure.
328 * Request number to pass to ioctl().
330 * Interface request structure output buffer.
333 * 0 on success, negative errno value otherwise and rte_errno is set.
336 mlx4_ifreq(const struct priv *priv, int req, struct ifreq *ifr)
338 int sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
345 ret = mlx4_get_ifname(priv, &ifr->ifr_name);
346 if (!ret && ioctl(sock, req, ifr) == -1) {
355 * Get MAC address by querying netdevice.
358 * Pointer to private structure.
360 * MAC address output buffer.
363 * 0 on success, negative errno value otherwise and rte_errno is set.
366 mlx4_get_mac(struct priv *priv, uint8_t (*mac)[ETHER_ADDR_LEN])
368 struct ifreq request;
369 int ret = mlx4_ifreq(priv, SIOCGIFHWADDR, &request);
373 memcpy(mac, request.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
381 * Pointer to private structure.
383 * MTU value output buffer.
386 * 0 on success, negative errno value otherwise and rte_errno is set.
389 mlx4_mtu_get(struct priv *priv, uint16_t *mtu)
391 unsigned long ulong_mtu = 0;
392 int ret = mlx4_get_sysfs_ulong(priv, "mtu", &ulong_mtu);
401 * DPDK callback to change the MTU.
404 * Pointer to Ethernet device structure.
409 * 0 on success, negative errno value otherwise and rte_errno is set.
412 mlx4_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
414 struct priv *priv = dev->data->dev_private;
416 int ret = mlx4_set_sysfs_ulong(priv, "mtu", mtu);
420 ret = mlx4_mtu_get(priv, &new_mtu);
423 if (new_mtu == mtu) {
435 * Pointer to private structure.
437 * Bitmask for flags that must remain untouched.
439 * Bitmask for flags to modify.
442 * 0 on success, negative errno value otherwise and rte_errno is set.
445 mlx4_set_flags(struct priv *priv, unsigned int keep, unsigned int flags)
447 unsigned long tmp = 0;
448 int ret = mlx4_get_sysfs_ulong(priv, "flags", &tmp);
453 tmp |= (flags & (~keep));
454 return mlx4_set_sysfs_ulong(priv, "flags", tmp);
458 * Change the link state (UP / DOWN).
461 * Pointer to Ethernet device private data.
463 * Nonzero for link up, otherwise link down.
466 * 0 on success, negative errno value otherwise and rte_errno is set.
469 mlx4_dev_set_link(struct priv *priv, int up)
474 err = mlx4_set_flags(priv, ~IFF_UP, IFF_UP);
478 err = mlx4_set_flags(priv, ~IFF_UP, ~IFF_UP);
486 * DPDK callback to bring the link DOWN.
489 * Pointer to Ethernet device structure.
492 * 0 on success, negative errno value otherwise and rte_errno is set.
495 mlx4_dev_set_link_down(struct rte_eth_dev *dev)
497 struct priv *priv = dev->data->dev_private;
499 return mlx4_dev_set_link(priv, 0);
503 * DPDK callback to bring the link UP.
506 * Pointer to Ethernet device structure.
509 * 0 on success, negative errno value otherwise and rte_errno is set.
512 mlx4_dev_set_link_up(struct rte_eth_dev *dev)
514 struct priv *priv = dev->data->dev_private;
516 return mlx4_dev_set_link(priv, 1);
520 * Supported Rx mode toggles.
522 * Even and odd values respectively stand for off and on.
525 RXMODE_TOGGLE_PROMISC_OFF,
526 RXMODE_TOGGLE_PROMISC_ON,
527 RXMODE_TOGGLE_ALLMULTI_OFF,
528 RXMODE_TOGGLE_ALLMULTI_ON,
532 * Helper function to toggle promiscuous and all multicast modes.
535 * Pointer to Ethernet device structure.
540 mlx4_rxmode_toggle(struct rte_eth_dev *dev, enum rxmode_toggle toggle)
542 struct priv *priv = dev->data->dev_private;
544 struct rte_flow_error error;
547 case RXMODE_TOGGLE_PROMISC_OFF:
548 case RXMODE_TOGGLE_PROMISC_ON:
549 mode = "promiscuous";
550 dev->data->promiscuous = toggle & 1;
552 case RXMODE_TOGGLE_ALLMULTI_OFF:
553 case RXMODE_TOGGLE_ALLMULTI_ON:
554 mode = "all multicast";
555 dev->data->all_multicast = toggle & 1;
558 if (!mlx4_flow_sync(priv, &error))
560 ERROR("cannot toggle %s mode (code %d, \"%s\"),"
561 " flow error type %d, cause %p, message: %s",
562 mode, rte_errno, strerror(rte_errno), error.type, error.cause,
563 error.message ? error.message : "(unspecified)");
567 * DPDK callback to enable promiscuous mode.
570 * Pointer to Ethernet device structure.
573 mlx4_promiscuous_enable(struct rte_eth_dev *dev)
575 mlx4_rxmode_toggle(dev, RXMODE_TOGGLE_PROMISC_ON);
579 * DPDK callback to disable promiscuous mode.
582 * Pointer to Ethernet device structure.
585 mlx4_promiscuous_disable(struct rte_eth_dev *dev)
587 mlx4_rxmode_toggle(dev, RXMODE_TOGGLE_PROMISC_OFF);
591 * DPDK callback to enable all multicast mode.
594 * Pointer to Ethernet device structure.
597 mlx4_allmulticast_enable(struct rte_eth_dev *dev)
599 mlx4_rxmode_toggle(dev, RXMODE_TOGGLE_ALLMULTI_ON);
603 * DPDK callback to disable all multicast mode.
606 * Pointer to Ethernet device structure.
609 mlx4_allmulticast_disable(struct rte_eth_dev *dev)
611 mlx4_rxmode_toggle(dev, RXMODE_TOGGLE_ALLMULTI_OFF);
615 * DPDK callback to remove a MAC address.
618 * Pointer to Ethernet device structure.
623 mlx4_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
625 struct priv *priv = dev->data->dev_private;
626 struct rte_flow_error error;
628 if (index >= RTE_DIM(priv->mac)) {
632 memset(&priv->mac[index], 0, sizeof(priv->mac[index]));
633 if (!mlx4_flow_sync(priv, &error))
635 ERROR("failed to synchronize flow rules after removing MAC address"
636 " at index %d (code %d, \"%s\"),"
637 " flow error type %d, cause %p, message: %s",
638 index, rte_errno, strerror(rte_errno), error.type, error.cause,
639 error.message ? error.message : "(unspecified)");
643 * DPDK callback to add a MAC address.
646 * Pointer to Ethernet device structure.
648 * MAC address to register.
652 * VMDq pool index to associate address with (ignored).
655 * 0 on success, negative errno value otherwise and rte_errno is set.
658 mlx4_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
659 uint32_t index, uint32_t vmdq)
661 struct priv *priv = dev->data->dev_private;
662 struct rte_flow_error error;
666 if (index >= RTE_DIM(priv->mac)) {
670 memcpy(&priv->mac[index], mac_addr, sizeof(priv->mac[index]));
671 ret = mlx4_flow_sync(priv, &error);
674 ERROR("failed to synchronize flow rules after adding MAC address"
675 " at index %d (code %d, \"%s\"),"
676 " flow error type %d, cause %p, message: %s",
677 index, rte_errno, strerror(rte_errno), error.type, error.cause,
678 error.message ? error.message : "(unspecified)");
683 * DPDK callback to configure a VLAN filter.
686 * Pointer to Ethernet device structure.
693 * 0 on success, negative errno value otherwise and rte_errno is set.
696 mlx4_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
698 struct priv *priv = dev->data->dev_private;
699 struct rte_flow_error error;
700 unsigned int vidx = vlan_id / 64;
701 unsigned int vbit = vlan_id % 64;
705 if (vidx >= RTE_DIM(dev->data->vlan_filter_conf.ids)) {
709 v = &dev->data->vlan_filter_conf.ids[vidx];
710 *v &= ~(UINT64_C(1) << vbit);
711 *v |= (uint64_t)!!on << vbit;
712 ret = mlx4_flow_sync(priv, &error);
715 ERROR("failed to synchronize flow rules after %s VLAN filter on ID %u"
716 " (code %d, \"%s\"), "
717 " flow error type %d, cause %p, message: %s",
718 on ? "enabling" : "disabling", vlan_id,
719 rte_errno, strerror(rte_errno), error.type, error.cause,
720 error.message ? error.message : "(unspecified)");
725 * DPDK callback to set the primary MAC address.
728 * Pointer to Ethernet device structure.
730 * MAC address to register.
733 mlx4_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
735 mlx4_mac_addr_add(dev, mac_addr, 0, 0);
739 * DPDK callback to get information about the device.
742 * Pointer to Ethernet device structure.
744 * Info structure output buffer.
747 mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
749 struct priv *priv = dev->data->dev_private;
751 char ifname[IF_NAMESIZE];
753 info->pci_dev = RTE_ETH_DEV_TO_PCI(dev);
754 /* FIXME: we should ask the device for these values. */
755 info->min_rx_bufsize = 32;
756 info->max_rx_pktlen = 65536;
758 * Since we need one CQ per QP, the limit is the minimum number
759 * between the two values.
761 max = ((priv->device_attr.max_cq > priv->device_attr.max_qp) ?
762 priv->device_attr.max_qp : priv->device_attr.max_cq);
763 /* If max >= 65535 then max = 0, max_rx_queues is uint16_t. */
766 info->max_rx_queues = max;
767 info->max_tx_queues = max;
768 info->max_mac_addrs = RTE_DIM(priv->mac);
769 info->tx_offload_capa = mlx4_get_tx_port_offloads(priv);
770 info->rx_queue_offload_capa = mlx4_get_rx_queue_offloads(priv);
771 info->rx_offload_capa = (mlx4_get_rx_port_offloads(priv) |
772 info->rx_queue_offload_capa);
773 if (mlx4_get_ifname(priv, &ifname) == 0)
774 info->if_index = if_nametoindex(ifname);
775 info->hash_key_size = MLX4_RSS_HASH_KEY_SIZE;
785 * DPDK callback to get device statistics.
788 * Pointer to Ethernet device structure.
790 * Stats structure output buffer.
793 mlx4_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
795 struct rte_eth_stats tmp;
799 memset(&tmp, 0, sizeof(tmp));
800 /* Add software counters. */
801 for (i = 0; i != dev->data->nb_rx_queues; ++i) {
802 struct rxq *rxq = dev->data->rx_queues[i];
806 idx = rxq->stats.idx;
807 if (idx < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
808 tmp.q_ipackets[idx] += rxq->stats.ipackets;
809 tmp.q_ibytes[idx] += rxq->stats.ibytes;
810 tmp.q_errors[idx] += (rxq->stats.idropped +
811 rxq->stats.rx_nombuf);
813 tmp.ipackets += rxq->stats.ipackets;
814 tmp.ibytes += rxq->stats.ibytes;
815 tmp.ierrors += rxq->stats.idropped;
816 tmp.rx_nombuf += rxq->stats.rx_nombuf;
818 for (i = 0; i != dev->data->nb_tx_queues; ++i) {
819 struct txq *txq = dev->data->tx_queues[i];
823 idx = txq->stats.idx;
824 if (idx < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
825 tmp.q_opackets[idx] += txq->stats.opackets;
826 tmp.q_obytes[idx] += txq->stats.obytes;
827 tmp.q_errors[idx] += txq->stats.odropped;
829 tmp.opackets += txq->stats.opackets;
830 tmp.obytes += txq->stats.obytes;
831 tmp.oerrors += txq->stats.odropped;
838 * DPDK callback to clear device statistics.
841 * Pointer to Ethernet device structure.
844 mlx4_stats_reset(struct rte_eth_dev *dev)
848 for (i = 0; i != dev->data->nb_rx_queues; ++i) {
849 struct rxq *rxq = dev->data->rx_queues[i];
852 rxq->stats = (struct mlx4_rxq_stats){
853 .idx = rxq->stats.idx,
856 for (i = 0; i != dev->data->nb_tx_queues; ++i) {
857 struct txq *txq = dev->data->tx_queues[i];
860 txq->stats = (struct mlx4_txq_stats){
861 .idx = txq->stats.idx,
867 * DPDK callback to retrieve physical link information.
870 * Pointer to Ethernet device structure.
871 * @param wait_to_complete
872 * Wait for request completion (ignored).
875 * 0 on success, negative errno value otherwise and rte_errno is set.
878 mlx4_link_update(struct rte_eth_dev *dev, int wait_to_complete)
880 const struct priv *priv = dev->data->dev_private;
881 struct ethtool_cmd edata = {
885 struct rte_eth_link dev_link;
892 (void)wait_to_complete;
893 if (mlx4_ifreq(priv, SIOCGIFFLAGS, &ifr)) {
894 WARN("ioctl(SIOCGIFFLAGS) failed: %s", strerror(rte_errno));
897 memset(&dev_link, 0, sizeof(dev_link));
898 dev_link.link_status = ((ifr.ifr_flags & IFF_UP) &&
899 (ifr.ifr_flags & IFF_RUNNING));
900 ifr.ifr_data = (void *)&edata;
901 if (mlx4_ifreq(priv, SIOCETHTOOL, &ifr)) {
902 WARN("ioctl(SIOCETHTOOL, ETHTOOL_GSET) failed: %s",
903 strerror(rte_errno));
906 link_speed = ethtool_cmd_speed(&edata);
907 if (link_speed == -1)
908 dev_link.link_speed = 0;
910 dev_link.link_speed = link_speed;
911 dev_link.link_duplex = ((edata.duplex == DUPLEX_HALF) ?
912 ETH_LINK_HALF_DUPLEX : ETH_LINK_FULL_DUPLEX);
913 dev_link.link_autoneg = !(dev->data->dev_conf.link_speeds &
914 ETH_LINK_SPEED_FIXED);
915 dev->data->dev_link = dev_link;
920 * DPDK callback to get flow control status.
923 * Pointer to Ethernet device structure.
924 * @param[out] fc_conf
925 * Flow control output buffer.
928 * 0 on success, negative errno value otherwise and rte_errno is set.
931 mlx4_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
933 struct priv *priv = dev->data->dev_private;
935 struct ethtool_pauseparam ethpause = {
936 .cmd = ETHTOOL_GPAUSEPARAM,
940 ifr.ifr_data = (void *)ðpause;
941 if (mlx4_ifreq(priv, SIOCETHTOOL, &ifr)) {
943 WARN("ioctl(SIOCETHTOOL, ETHTOOL_GPAUSEPARAM)"
945 strerror(rte_errno));
948 fc_conf->autoneg = ethpause.autoneg;
949 if (ethpause.rx_pause && ethpause.tx_pause)
950 fc_conf->mode = RTE_FC_FULL;
951 else if (ethpause.rx_pause)
952 fc_conf->mode = RTE_FC_RX_PAUSE;
953 else if (ethpause.tx_pause)
954 fc_conf->mode = RTE_FC_TX_PAUSE;
956 fc_conf->mode = RTE_FC_NONE;
964 * DPDK callback to modify flow control parameters.
967 * Pointer to Ethernet device structure.
969 * Flow control parameters.
972 * 0 on success, negative errno value otherwise and rte_errno is set.
975 mlx4_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
977 struct priv *priv = dev->data->dev_private;
979 struct ethtool_pauseparam ethpause = {
980 .cmd = ETHTOOL_SPAUSEPARAM,
984 ifr.ifr_data = (void *)ðpause;
985 ethpause.autoneg = fc_conf->autoneg;
986 if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
987 (fc_conf->mode & RTE_FC_RX_PAUSE))
988 ethpause.rx_pause = 1;
990 ethpause.rx_pause = 0;
991 if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
992 (fc_conf->mode & RTE_FC_TX_PAUSE))
993 ethpause.tx_pause = 1;
995 ethpause.tx_pause = 0;
996 if (mlx4_ifreq(priv, SIOCETHTOOL, &ifr)) {
998 WARN("ioctl(SIOCETHTOOL, ETHTOOL_SPAUSEPARAM)"
1000 strerror(rte_errno));
1010 * DPDK callback to retrieve the received packet types that are recognized
1014 * Pointer to Ethernet device structure.
1017 * Pointer to an array of recognized packet types if in Rx burst mode,
1021 mlx4_dev_supported_ptypes_get(struct rte_eth_dev *dev)
1023 static const uint32_t ptypes[] = {
1024 /* refers to rxq_cq_to_pkt_type() */
1026 RTE_PTYPE_L3_IPV4_EXT_UNKNOWN,
1027 RTE_PTYPE_L3_IPV6_EXT_UNKNOWN,
1033 static const uint32_t ptypes_l2tun[] = {
1034 /* refers to rxq_cq_to_pkt_type() */
1036 RTE_PTYPE_L3_IPV4_EXT_UNKNOWN,
1037 RTE_PTYPE_L3_IPV6_EXT_UNKNOWN,
1041 RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN,
1042 RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN,
1045 struct priv *priv = dev->data->dev_private;
1047 if (dev->rx_pkt_burst == mlx4_rx_burst) {
1048 if (priv->hw_csum_l2tun)
1049 return ptypes_l2tun;
1057 * Check if mlx4 device was removed.
1060 * Pointer to Ethernet device structure.
1063 * 1 when device is removed, otherwise 0.
1066 mlx4_is_removed(struct rte_eth_dev *dev)
1068 struct ibv_device_attr device_attr;
1069 struct priv *priv = dev->data->dev_private;
1071 if (ibv_query_device(priv->ctx, &device_attr) == EIO)