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_glue.h"
74 #include "mlx4_rxtx.h"
75 #include "mlx4_utils.h"
78 * Get interface name from private structure.
81 * Pointer to private structure.
83 * Interface name output buffer.
86 * 0 on success, negative errno value otherwise and rte_errno is set.
89 mlx4_get_ifname(const struct priv *priv, char (*ifname)[IF_NAMESIZE])
93 unsigned int dev_type = 0;
94 unsigned int dev_port_prev = ~0u;
95 char match[IF_NAMESIZE] = "";
98 MKSTR(path, "%s/device/net", priv->ctx->device->ibdev_path);
106 while ((dent = readdir(dir)) != NULL) {
107 char *name = dent->d_name;
109 unsigned int dev_port;
112 if ((name[0] == '.') &&
113 ((name[1] == '\0') ||
114 ((name[1] == '.') && (name[2] == '\0'))))
117 MKSTR(path, "%s/device/net/%s/%s",
118 priv->ctx->device->ibdev_path, name,
119 (dev_type ? "dev_id" : "dev_port"));
121 file = fopen(path, "rb");
126 * Switch to dev_id when dev_port does not exist as
127 * is the case with Linux kernel versions < 3.15.
138 r = fscanf(file, (dev_type ? "%x" : "%u"), &dev_port);
143 * Switch to dev_id when dev_port returns the same value for
144 * all ports. May happen when using a MOFED release older than
145 * 3.0 with a Linux kernel >= 3.15.
147 if (dev_port == dev_port_prev)
149 dev_port_prev = dev_port;
150 if (dev_port == (priv->port - 1u))
151 snprintf(match, sizeof(match), "%s", name);
154 if (match[0] == '\0') {
158 strncpy(*ifname, match, sizeof(*ifname));
163 * Read from sysfs entry.
166 * Pointer to private structure.
168 * Entry name relative to sysfs path.
170 * Data output buffer.
175 * Number of bytes read on success, negative errno value otherwise and
179 mlx4_sysfs_read(const struct priv *priv, const char *entry,
180 char *buf, size_t size)
182 char ifname[IF_NAMESIZE];
186 ret = mlx4_get_ifname(priv, &ifname);
190 MKSTR(path, "%s/device/net/%s/%s", priv->ctx->device->ibdev_path,
193 file = fopen(path, "rb");
198 ret = fread(buf, 1, size, file);
199 if ((size_t)ret < size && ferror(file)) {
210 * Write to sysfs entry.
213 * Pointer to private structure.
215 * Entry name relative to sysfs path.
222 * Number of bytes written on success, negative errno value otherwise and
226 mlx4_sysfs_write(const struct priv *priv, const char *entry,
227 char *buf, size_t size)
229 char ifname[IF_NAMESIZE];
233 ret = mlx4_get_ifname(priv, &ifname);
237 MKSTR(path, "%s/device/net/%s/%s", priv->ctx->device->ibdev_path,
240 file = fopen(path, "wb");
245 ret = fwrite(buf, 1, size, file);
246 if ((size_t)ret < size || ferror(file)) {
257 * Get unsigned long sysfs property.
260 * Pointer to private structure.
262 * Entry name relative to sysfs path.
264 * Value output buffer.
267 * 0 on success, negative errno value otherwise and rte_errno is set.
270 mlx4_get_sysfs_ulong(struct priv *priv, const char *name, unsigned long *value)
273 unsigned long value_ret;
276 ret = mlx4_sysfs_read(priv, name, value_str, (sizeof(value_str) - 1));
278 DEBUG("cannot read %s value from sysfs: %s",
279 name, strerror(rte_errno));
282 value_str[ret] = '\0';
284 value_ret = strtoul(value_str, NULL, 0);
287 DEBUG("invalid %s value `%s': %s", name, value_str,
288 strerror(rte_errno));
296 * Set unsigned long sysfs property.
299 * Pointer to private structure.
301 * Entry name relative to sysfs path.
306 * 0 on success, negative errno value otherwise and rte_errno is set.
309 mlx4_set_sysfs_ulong(struct priv *priv, const char *name, unsigned long value)
312 MKSTR(value_str, "%lu", value);
314 ret = mlx4_sysfs_write(priv, name, value_str, (sizeof(value_str) - 1));
316 DEBUG("cannot write %s `%s' (%lu) to sysfs: %s",
317 name, value_str, value, strerror(rte_errno));
324 * Perform ifreq ioctl() on associated Ethernet device.
327 * Pointer to private structure.
329 * Request number to pass to ioctl().
331 * Interface request structure output buffer.
334 * 0 on success, negative errno value otherwise and rte_errno is set.
337 mlx4_ifreq(const struct priv *priv, int req, struct ifreq *ifr)
339 int sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
346 ret = mlx4_get_ifname(priv, &ifr->ifr_name);
347 if (!ret && ioctl(sock, req, ifr) == -1) {
356 * Get MAC address by querying netdevice.
359 * Pointer to private structure.
361 * MAC address output buffer.
364 * 0 on success, negative errno value otherwise and rte_errno is set.
367 mlx4_get_mac(struct priv *priv, uint8_t (*mac)[ETHER_ADDR_LEN])
369 struct ifreq request;
370 int ret = mlx4_ifreq(priv, SIOCGIFHWADDR, &request);
374 memcpy(mac, request.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
382 * Pointer to private structure.
384 * MTU value output buffer.
387 * 0 on success, negative errno value otherwise and rte_errno is set.
390 mlx4_mtu_get(struct priv *priv, uint16_t *mtu)
392 unsigned long ulong_mtu = 0;
393 int ret = mlx4_get_sysfs_ulong(priv, "mtu", &ulong_mtu);
402 * DPDK callback to change the MTU.
405 * Pointer to Ethernet device structure.
410 * 0 on success, negative errno value otherwise and rte_errno is set.
413 mlx4_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
415 struct priv *priv = dev->data->dev_private;
417 int ret = mlx4_set_sysfs_ulong(priv, "mtu", mtu);
421 ret = mlx4_mtu_get(priv, &new_mtu);
424 if (new_mtu == mtu) {
436 * Pointer to private structure.
438 * Bitmask for flags that must remain untouched.
440 * Bitmask for flags to modify.
443 * 0 on success, negative errno value otherwise and rte_errno is set.
446 mlx4_set_flags(struct priv *priv, unsigned int keep, unsigned int flags)
448 unsigned long tmp = 0;
449 int ret = mlx4_get_sysfs_ulong(priv, "flags", &tmp);
454 tmp |= (flags & (~keep));
455 return mlx4_set_sysfs_ulong(priv, "flags", tmp);
459 * Change the link state (UP / DOWN).
462 * Pointer to Ethernet device private data.
464 * Nonzero for link up, otherwise link down.
467 * 0 on success, negative errno value otherwise and rte_errno is set.
470 mlx4_dev_set_link(struct priv *priv, int up)
475 err = mlx4_set_flags(priv, ~IFF_UP, IFF_UP);
479 err = mlx4_set_flags(priv, ~IFF_UP, ~IFF_UP);
487 * DPDK callback to bring the link DOWN.
490 * Pointer to Ethernet device structure.
493 * 0 on success, negative errno value otherwise and rte_errno is set.
496 mlx4_dev_set_link_down(struct rte_eth_dev *dev)
498 struct priv *priv = dev->data->dev_private;
500 return mlx4_dev_set_link(priv, 0);
504 * DPDK callback to bring the link UP.
507 * Pointer to Ethernet device structure.
510 * 0 on success, negative errno value otherwise and rte_errno is set.
513 mlx4_dev_set_link_up(struct rte_eth_dev *dev)
515 struct priv *priv = dev->data->dev_private;
517 return mlx4_dev_set_link(priv, 1);
521 * Supported Rx mode toggles.
523 * Even and odd values respectively stand for off and on.
526 RXMODE_TOGGLE_PROMISC_OFF,
527 RXMODE_TOGGLE_PROMISC_ON,
528 RXMODE_TOGGLE_ALLMULTI_OFF,
529 RXMODE_TOGGLE_ALLMULTI_ON,
533 * Helper function to toggle promiscuous and all multicast modes.
536 * Pointer to Ethernet device structure.
541 mlx4_rxmode_toggle(struct rte_eth_dev *dev, enum rxmode_toggle toggle)
543 struct priv *priv = dev->data->dev_private;
545 struct rte_flow_error error;
548 case RXMODE_TOGGLE_PROMISC_OFF:
549 case RXMODE_TOGGLE_PROMISC_ON:
550 mode = "promiscuous";
551 dev->data->promiscuous = toggle & 1;
553 case RXMODE_TOGGLE_ALLMULTI_OFF:
554 case RXMODE_TOGGLE_ALLMULTI_ON:
555 mode = "all multicast";
556 dev->data->all_multicast = toggle & 1;
559 if (!mlx4_flow_sync(priv, &error))
561 ERROR("cannot toggle %s mode (code %d, \"%s\"),"
562 " flow error type %d, cause %p, message: %s",
563 mode, rte_errno, strerror(rte_errno), error.type, error.cause,
564 error.message ? error.message : "(unspecified)");
568 * DPDK callback to enable promiscuous mode.
571 * Pointer to Ethernet device structure.
574 mlx4_promiscuous_enable(struct rte_eth_dev *dev)
576 mlx4_rxmode_toggle(dev, RXMODE_TOGGLE_PROMISC_ON);
580 * DPDK callback to disable promiscuous mode.
583 * Pointer to Ethernet device structure.
586 mlx4_promiscuous_disable(struct rte_eth_dev *dev)
588 mlx4_rxmode_toggle(dev, RXMODE_TOGGLE_PROMISC_OFF);
592 * DPDK callback to enable all multicast mode.
595 * Pointer to Ethernet device structure.
598 mlx4_allmulticast_enable(struct rte_eth_dev *dev)
600 mlx4_rxmode_toggle(dev, RXMODE_TOGGLE_ALLMULTI_ON);
604 * DPDK callback to disable all multicast mode.
607 * Pointer to Ethernet device structure.
610 mlx4_allmulticast_disable(struct rte_eth_dev *dev)
612 mlx4_rxmode_toggle(dev, RXMODE_TOGGLE_ALLMULTI_OFF);
616 * DPDK callback to remove a MAC address.
619 * Pointer to Ethernet device structure.
624 mlx4_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
626 struct priv *priv = dev->data->dev_private;
627 struct rte_flow_error error;
629 if (index >= RTE_DIM(priv->mac)) {
633 memset(&priv->mac[index], 0, sizeof(priv->mac[index]));
634 if (!mlx4_flow_sync(priv, &error))
636 ERROR("failed to synchronize flow rules after removing MAC address"
637 " at index %d (code %d, \"%s\"),"
638 " flow error type %d, cause %p, message: %s",
639 index, rte_errno, strerror(rte_errno), error.type, error.cause,
640 error.message ? error.message : "(unspecified)");
644 * DPDK callback to add a MAC address.
647 * Pointer to Ethernet device structure.
649 * MAC address to register.
653 * VMDq pool index to associate address with (ignored).
656 * 0 on success, negative errno value otherwise and rte_errno is set.
659 mlx4_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
660 uint32_t index, uint32_t vmdq)
662 struct priv *priv = dev->data->dev_private;
663 struct rte_flow_error error;
667 if (index >= RTE_DIM(priv->mac)) {
671 memcpy(&priv->mac[index], mac_addr, sizeof(priv->mac[index]));
672 ret = mlx4_flow_sync(priv, &error);
675 ERROR("failed to synchronize flow rules after adding MAC address"
676 " at index %d (code %d, \"%s\"),"
677 " flow error type %d, cause %p, message: %s",
678 index, rte_errno, strerror(rte_errno), error.type, error.cause,
679 error.message ? error.message : "(unspecified)");
684 * DPDK callback to configure a VLAN filter.
687 * Pointer to Ethernet device structure.
694 * 0 on success, negative errno value otherwise and rte_errno is set.
697 mlx4_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
699 struct priv *priv = dev->data->dev_private;
700 struct rte_flow_error error;
701 unsigned int vidx = vlan_id / 64;
702 unsigned int vbit = vlan_id % 64;
706 if (vidx >= RTE_DIM(dev->data->vlan_filter_conf.ids)) {
710 v = &dev->data->vlan_filter_conf.ids[vidx];
711 *v &= ~(UINT64_C(1) << vbit);
712 *v |= (uint64_t)!!on << vbit;
713 ret = mlx4_flow_sync(priv, &error);
716 ERROR("failed to synchronize flow rules after %s VLAN filter on ID %u"
717 " (code %d, \"%s\"), "
718 " flow error type %d, cause %p, message: %s",
719 on ? "enabling" : "disabling", vlan_id,
720 rte_errno, strerror(rte_errno), error.type, error.cause,
721 error.message ? error.message : "(unspecified)");
726 * DPDK callback to set the primary MAC address.
729 * Pointer to Ethernet device structure.
731 * MAC address to register.
734 mlx4_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
736 mlx4_mac_addr_add(dev, mac_addr, 0, 0);
740 * DPDK callback to get information about the device.
743 * Pointer to Ethernet device structure.
745 * Info structure output buffer.
748 mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
750 struct priv *priv = dev->data->dev_private;
752 char ifname[IF_NAMESIZE];
754 info->pci_dev = RTE_ETH_DEV_TO_PCI(dev);
755 /* FIXME: we should ask the device for these values. */
756 info->min_rx_bufsize = 32;
757 info->max_rx_pktlen = 65536;
759 * Since we need one CQ per QP, the limit is the minimum number
760 * between the two values.
762 max = ((priv->device_attr.max_cq > priv->device_attr.max_qp) ?
763 priv->device_attr.max_qp : priv->device_attr.max_cq);
764 /* If max >= 65535 then max = 0, max_rx_queues is uint16_t. */
767 info->max_rx_queues = max;
768 info->max_tx_queues = max;
769 info->max_mac_addrs = RTE_DIM(priv->mac);
770 info->tx_offload_capa = mlx4_get_tx_port_offloads(priv);
771 info->rx_queue_offload_capa = mlx4_get_rx_queue_offloads(priv);
772 info->rx_offload_capa = (mlx4_get_rx_port_offloads(priv) |
773 info->rx_queue_offload_capa);
774 if (mlx4_get_ifname(priv, &ifname) == 0)
775 info->if_index = if_nametoindex(ifname);
776 info->hash_key_size = MLX4_RSS_HASH_KEY_SIZE;
786 * DPDK callback to get device statistics.
789 * Pointer to Ethernet device structure.
791 * Stats structure output buffer.
794 mlx4_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
796 struct rte_eth_stats tmp;
800 memset(&tmp, 0, sizeof(tmp));
801 /* Add software counters. */
802 for (i = 0; i != dev->data->nb_rx_queues; ++i) {
803 struct rxq *rxq = dev->data->rx_queues[i];
807 idx = rxq->stats.idx;
808 if (idx < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
809 tmp.q_ipackets[idx] += rxq->stats.ipackets;
810 tmp.q_ibytes[idx] += rxq->stats.ibytes;
811 tmp.q_errors[idx] += (rxq->stats.idropped +
812 rxq->stats.rx_nombuf);
814 tmp.ipackets += rxq->stats.ipackets;
815 tmp.ibytes += rxq->stats.ibytes;
816 tmp.ierrors += rxq->stats.idropped;
817 tmp.rx_nombuf += rxq->stats.rx_nombuf;
819 for (i = 0; i != dev->data->nb_tx_queues; ++i) {
820 struct txq *txq = dev->data->tx_queues[i];
824 idx = txq->stats.idx;
825 if (idx < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
826 tmp.q_opackets[idx] += txq->stats.opackets;
827 tmp.q_obytes[idx] += txq->stats.obytes;
828 tmp.q_errors[idx] += txq->stats.odropped;
830 tmp.opackets += txq->stats.opackets;
831 tmp.obytes += txq->stats.obytes;
832 tmp.oerrors += txq->stats.odropped;
839 * DPDK callback to clear device statistics.
842 * Pointer to Ethernet device structure.
845 mlx4_stats_reset(struct rte_eth_dev *dev)
849 for (i = 0; i != dev->data->nb_rx_queues; ++i) {
850 struct rxq *rxq = dev->data->rx_queues[i];
853 rxq->stats = (struct mlx4_rxq_stats){
854 .idx = rxq->stats.idx,
857 for (i = 0; i != dev->data->nb_tx_queues; ++i) {
858 struct txq *txq = dev->data->tx_queues[i];
861 txq->stats = (struct mlx4_txq_stats){
862 .idx = txq->stats.idx,
868 * DPDK callback to retrieve physical link information.
871 * Pointer to Ethernet device structure.
872 * @param wait_to_complete
873 * Wait for request completion (ignored).
876 * 0 on success, negative errno value otherwise and rte_errno is set.
879 mlx4_link_update(struct rte_eth_dev *dev, int wait_to_complete)
881 const struct priv *priv = dev->data->dev_private;
882 struct ethtool_cmd edata = {
886 struct rte_eth_link dev_link;
893 (void)wait_to_complete;
894 if (mlx4_ifreq(priv, SIOCGIFFLAGS, &ifr)) {
895 WARN("ioctl(SIOCGIFFLAGS) failed: %s", strerror(rte_errno));
898 memset(&dev_link, 0, sizeof(dev_link));
899 dev_link.link_status = ((ifr.ifr_flags & IFF_UP) &&
900 (ifr.ifr_flags & IFF_RUNNING));
901 ifr.ifr_data = (void *)&edata;
902 if (mlx4_ifreq(priv, SIOCETHTOOL, &ifr)) {
903 WARN("ioctl(SIOCETHTOOL, ETHTOOL_GSET) failed: %s",
904 strerror(rte_errno));
907 link_speed = ethtool_cmd_speed(&edata);
908 if (link_speed == -1)
909 dev_link.link_speed = 0;
911 dev_link.link_speed = link_speed;
912 dev_link.link_duplex = ((edata.duplex == DUPLEX_HALF) ?
913 ETH_LINK_HALF_DUPLEX : ETH_LINK_FULL_DUPLEX);
914 dev_link.link_autoneg = !(dev->data->dev_conf.link_speeds &
915 ETH_LINK_SPEED_FIXED);
916 dev->data->dev_link = dev_link;
921 * DPDK callback to get flow control status.
924 * Pointer to Ethernet device structure.
925 * @param[out] fc_conf
926 * Flow control output buffer.
929 * 0 on success, negative errno value otherwise and rte_errno is set.
932 mlx4_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
934 struct priv *priv = dev->data->dev_private;
936 struct ethtool_pauseparam ethpause = {
937 .cmd = ETHTOOL_GPAUSEPARAM,
941 ifr.ifr_data = (void *)ðpause;
942 if (mlx4_ifreq(priv, SIOCETHTOOL, &ifr)) {
944 WARN("ioctl(SIOCETHTOOL, ETHTOOL_GPAUSEPARAM)"
946 strerror(rte_errno));
949 fc_conf->autoneg = ethpause.autoneg;
950 if (ethpause.rx_pause && ethpause.tx_pause)
951 fc_conf->mode = RTE_FC_FULL;
952 else if (ethpause.rx_pause)
953 fc_conf->mode = RTE_FC_RX_PAUSE;
954 else if (ethpause.tx_pause)
955 fc_conf->mode = RTE_FC_TX_PAUSE;
957 fc_conf->mode = RTE_FC_NONE;
965 * DPDK callback to modify flow control parameters.
968 * Pointer to Ethernet device structure.
970 * Flow control parameters.
973 * 0 on success, negative errno value otherwise and rte_errno is set.
976 mlx4_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
978 struct priv *priv = dev->data->dev_private;
980 struct ethtool_pauseparam ethpause = {
981 .cmd = ETHTOOL_SPAUSEPARAM,
985 ifr.ifr_data = (void *)ðpause;
986 ethpause.autoneg = fc_conf->autoneg;
987 if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
988 (fc_conf->mode & RTE_FC_RX_PAUSE))
989 ethpause.rx_pause = 1;
991 ethpause.rx_pause = 0;
992 if (((fc_conf->mode & RTE_FC_FULL) == RTE_FC_FULL) ||
993 (fc_conf->mode & RTE_FC_TX_PAUSE))
994 ethpause.tx_pause = 1;
996 ethpause.tx_pause = 0;
997 if (mlx4_ifreq(priv, SIOCETHTOOL, &ifr)) {
999 WARN("ioctl(SIOCETHTOOL, ETHTOOL_SPAUSEPARAM)"
1001 strerror(rte_errno));
1011 * DPDK callback to retrieve the received packet types that are recognized
1015 * Pointer to Ethernet device structure.
1018 * Pointer to an array of recognized packet types if in Rx burst mode,
1022 mlx4_dev_supported_ptypes_get(struct rte_eth_dev *dev)
1024 static const uint32_t ptypes[] = {
1025 /* refers to rxq_cq_to_pkt_type() */
1027 RTE_PTYPE_L3_IPV4_EXT_UNKNOWN,
1028 RTE_PTYPE_L3_IPV6_EXT_UNKNOWN,
1034 static const uint32_t ptypes_l2tun[] = {
1035 /* refers to rxq_cq_to_pkt_type() */
1037 RTE_PTYPE_L3_IPV4_EXT_UNKNOWN,
1038 RTE_PTYPE_L3_IPV6_EXT_UNKNOWN,
1042 RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN,
1043 RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN,
1046 struct priv *priv = dev->data->dev_private;
1048 if (dev->rx_pkt_burst == mlx4_rx_burst) {
1049 if (priv->hw_csum_l2tun)
1050 return ptypes_l2tun;
1058 * Check if mlx4 device was removed.
1061 * Pointer to Ethernet device structure.
1064 * 1 when device is removed, otherwise 0.
1067 mlx4_is_removed(struct rte_eth_dev *dev)
1069 struct ibv_device_attr device_attr;
1070 struct priv *priv = dev->data->dev_private;
1072 if (mlx4_glue->query_device(priv->ctx, &device_attr) == EIO)