From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1D1A8489EF for ; Mon, 27 Oct 2025 17:21:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 180394028B; Mon, 27 Oct 2025 17:21:03 +0100 (CET) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mails.dpdk.org (Postfix) with ESMTP id 8DF0540653 for ; Mon, 27 Oct 2025 17:21:01 +0100 (CET) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-471b80b994bso68644955e9.3 for ; Mon, 27 Oct 2025 09:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761582061; x=1762186861; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kz4yMqM7/doFWFSpIn8tkFutC6KmLD87YJs/slKgXfE=; b=EEo1T0pkZSwlQN5MiHHwR2Gr4B9xCAhQA/XrCajmYuva6yrsxxUGzyKYGmzl87krSV I+79y4mwT4RCiw2CENwXi6DD0u5oJjWG40JzGensEFSdQplTOuyw9frEjvi9yJcHP2kW w6YU0vzXaT3dW1+D5zoBbmyh4VlO+0CMBMfNjM9615dSmaYya4bEpQcNZMEzPqz4q4Cp qW1dIF8vNHo2GEjKdJKEZEi4S8yr0mTzKhGAubrqAwG68zqmuKDMYbnkjxSOU4CK8UGc s8cQvEwWNjTUZBgJ8P5JMh/N2FSZR5hKaRidSk5bBWslkDBBQzPJsyQQzxo2gFxeM7fq x0Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761582061; x=1762186861; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kz4yMqM7/doFWFSpIn8tkFutC6KmLD87YJs/slKgXfE=; b=MVkdJ8VLv9MDKbZmSS5O4uzmpiURoPLmhsIbiSr+rkd9I2CLwQt612khpHYUnWEoUe veuTO8JW1ThEPnbkn1QxDObxzEn7a6vlvHPLZfXhxPo/7ZTpIvBHigSigrIQBFr1/P85 hishwc1Yixnq6s4EOgwBYMdzSHwlX0C8C9LVjxi/oR4zpFNfo1DzD3sulws+yHZ6QPnb tlhV6IWb06MTNOj72b8r5PzamoY3gbloAWvIC0uBT09mpqY8axJyNAChdujJZx0tsnK1 14X+GQp8i8W+9lE+xcGybdt2GPhPYiSJv8jhAb0kfU5xHN1DAOE7apZy/287f5xQIxg4 xauw== X-Forwarded-Encrypted: i=1; AJvYcCVaNrdc7+wkXKrxfPpjo8dNWjIFw8zOr+X2MY1fR3MD+dqC079vZ6Ke4k9PzAzohFUH86VHdjQ=@dpdk.org X-Gm-Message-State: AOJu0YxiZP4eeDtdbu/KsmmsUzYzf9QHigL5gRn169kPZZHfdR/CRJyZ zwqtsHBY3RB43cdPm9OtX73hvDmSEwq1V/m3TKb+aSSwVQBnLYdE5UsCfZJQ4Q== X-Gm-Gg: ASbGncsHkjtX1+9T+aLIkHSg46FtvRmKaV2WVDspJuKlhYHJjcuRuzhiq3/HGxPBGKE OXJTc36U1ufiyjnQM9jPM2Rqza2+hGBGDizokxRRrj3b+mrt+b+BqDU9dWo7qsjc7VkpxkUhcWK beVYVlDXpdvKATcAYZe+5imi1AHYuSHyZSic4/r/HPd7tCkpbrXzjOWQ2ViosohHRP2VJa7hDAc hO8rJFJIZslluZ8JPtr3PlTkCacbZf2JRCk9XdhCDlzp5tJlxZf0J9BtrsCNthdoR0Tebub5ilY wJ/zdSKawMwFZTZ0H9xE5Up3lgsW1/YIEZh06nOMKWlxPqoty3gk4dkKSl8F3DPhgJes8mhk5O0 wsBaygC8p1iP0tc6hFGyxdNqVz4igxzel2HlCv2+P9haXS6igL1FU7IiYN8/kp125WBfAIw2nty FiJELJHgqDkqok20QU X-Google-Smtp-Source: AGHT+IGCMswhwUlN3qKL+8X+xUf+N0BYQQUCaj5ucyr5C3P+BOJM7EyL82noCv9uy3+joqrA/ShhnQ== X-Received: by 2002:a05:600c:8b76:b0:465:a51d:d4 with SMTP id 5b1f17b1804b1-47717df7c45mr2786475e9.6.1761582060306; Mon, 27 Oct 2025 09:21:00 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:6fc5:c3bc:147e:832c]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-429952de5f9sm15151006f8f.38.2025.10.27.09.20.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Oct 2025 09:20:59 -0700 (PDT) From: luca.boccassi@gmail.com To: Dariusz Sosnowski Cc: Viacheslav Ovsiienko , dpdk stable Subject: patch 'net/mlx5: fix min and max MTU reporting' has been queued to stable release 22.11.11 Date: Mon, 27 Oct 2025 16:18:55 +0000 Message-ID: <20251027162001.3710450-17-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251027162001.3710450-1-luca.boccassi@gmail.com> References: <20251027162001.3710450-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/29/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/b1be3bbf46a8d9c6a422db5c9359904dafe9048f Thanks. Luca Boccassi --- >From b1be3bbf46a8d9c6a422db5c9359904dafe9048f Mon Sep 17 00:00:00 2001 From: Dariusz Sosnowski Date: Wed, 16 Jul 2025 12:25:45 +0200 Subject: [PATCH] net/mlx5: fix min and max MTU reporting [ upstream commit 44d657109216a32e8718446f20f91272e10575dd ] mlx5 PMD used hardcoded and incorrect values when reporting maximum MTU and maximum Rx packet length through rte_eth_dev_info_get(). This patch adds support for querying OS for minimum and maximum allowed MTU values. Maximum Rx packet length is then calculated based on these values. On Linux, these values are queried through netlink, using IFLA_MIN_MTU and IFLA_MAX_MTU attributes added in Linux 4.18. Windows API unfortunately does not expose minimum and maximum allowed MTU values. In this case, fallback hardcoded values (working on currently supported HW) will be used. Bugzilla ID: 1719 Fixes: e60fbd5b24fc ("mlx5: add device configure/start/stop") Signed-off-by: Dariusz Sosnowski Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/linux/mlx5_nl.c | 108 ++++++++++++++++++++++ drivers/common/mlx5/linux/mlx5_nl.h | 3 + drivers/common/mlx5/version.map | 1 + drivers/net/mlx5/linux/mlx5_ethdev_os.c | 30 ++++++ drivers/net/mlx5/linux/mlx5_os.c | 2 + drivers/net/mlx5/mlx5.h | 13 +++ drivers/net/mlx5/mlx5_ethdev.c | 42 ++++++++- drivers/net/mlx5/windows/mlx5_ethdev_os.c | 28 ++++++ drivers/net/mlx5/windows/mlx5_os.c | 2 + 9 files changed, 228 insertions(+), 1 deletion(-) diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c index 5d04857b38..4fa2410a81 100644 --- a/drivers/common/mlx5/linux/mlx5_nl.c +++ b/drivers/common/mlx5/linux/mlx5_nl.c @@ -1962,3 +1962,111 @@ mlx5_nl_read_events(int nlsk_fd, mlx5_nl_event_cb *cb, void *cb_arg) } return 0; } + +struct mlx5_mtu { + uint32_t min_mtu; + bool min_mtu_set; + uint32_t max_mtu; + bool max_mtu_set; +}; + +static int +mlx5_nl_get_mtu_bounds_cb(struct nlmsghdr *nh, void *arg) +{ + size_t off = NLMSG_LENGTH(sizeof(struct ifinfomsg)); + struct mlx5_mtu *out = arg; + + while (off < nh->nlmsg_len) { + struct rtattr *ra = RTE_PTR_ADD(nh, off); + uint32_t *payload; + + switch (ra->rta_type) { + case IFLA_MIN_MTU: + payload = RTA_DATA(ra); + out->min_mtu = *payload; + out->min_mtu_set = true; + break; + case IFLA_MAX_MTU: + payload = RTA_DATA(ra); + out->max_mtu = *payload; + out->max_mtu_set = true; + break; + default: + /* Nothing to do for other attributes. */ + break; + } + off += RTA_ALIGN(ra->rta_len); + } + + return 0; +} + +/** + * Query minimum and maximum allowed MTU values for given Linux network interface. + * + * This function queries the following interface attributes exposed in netlink since Linux 4.18: + * + * - IFLA_MIN_MTU - minimum allowed MTU + * - IFLA_MAX_MTU - maximum allowed MTU + * + * @param[in] nl + * Netlink socket of the ROUTE kind (NETLINK_ROUTE). + * @param[in] ifindex + * Linux network device index. + * @param[out] min_mtu + * Pointer to minimum allowed MTU. Populated only if both minimum and maximum MTU was queried. + * @param[out] max_mtu + * Pointer to maximum allowed MTU. Populated only if both minimum and maximum MTU was queried. + * + * @return + * 0 on success, negative on error and rte_errno is set. + * + * Known errors: + * + * - (-EINVAL) - either @p min_mtu or @p max_mtu is NULL. + * - (-ENOENT) - either minimum or maximum allowed MTU was not found in interface attributes. + */ +int +mlx5_nl_get_mtu_bounds(int nl, unsigned int ifindex, uint16_t *min_mtu, uint16_t *max_mtu) +{ + struct mlx5_mtu out = { 0 }; + struct { + struct nlmsghdr nh; + struct ifinfomsg info; + } req = { + .nh = { + .nlmsg_len = NLMSG_LENGTH(sizeof(req.info)), + .nlmsg_type = RTM_GETLINK, + .nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK, + }, + .info = { + .ifi_family = AF_UNSPEC, + .ifi_index = ifindex, + }, + }; + uint32_t sn = MLX5_NL_SN_GENERATE; + int ret; + + if (min_mtu == NULL || max_mtu == NULL) { + rte_errno = EINVAL; + return -rte_errno; + } + + ret = mlx5_nl_send(nl, &req.nh, sn); + if (ret < 0) + return ret; + + ret = mlx5_nl_recv(nl, sn, mlx5_nl_get_mtu_bounds_cb, &out); + if (ret < 0) + return ret; + + if (!out.min_mtu_set || !out.max_mtu_set) { + rte_errno = ENOENT; + return -rte_errno; + } + + *min_mtu = out.min_mtu; + *max_mtu = out.max_mtu; + + return ret; +} diff --git a/drivers/common/mlx5/linux/mlx5_nl.h b/drivers/common/mlx5/linux/mlx5_nl.h index db01d7323e..ed3bad213a 100644 --- a/drivers/common/mlx5/linux/mlx5_nl.h +++ b/drivers/common/mlx5/linux/mlx5_nl.h @@ -82,4 +82,7 @@ int mlx5_nl_read_events(int nlsk_fd, mlx5_nl_event_cb *cb, void *cb_arg); __rte_internal int mlx5_nl_parse_link_status_update(struct nlmsghdr *hdr, uint32_t *ifindex); +__rte_internal +int mlx5_nl_get_mtu_bounds(int nl, unsigned int ifindex, uint16_t *min_mtu, uint16_t *max_mtu); + #endif /* RTE_PMD_MLX5_NL_H_ */ diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map index 03c8ce5593..75fed298cd 100644 --- a/drivers/common/mlx5/version.map +++ b/drivers/common/mlx5/version.map @@ -123,6 +123,7 @@ INTERNAL { mlx5_mr_mb2mr_bh; mlx5_nl_allmulti; # WINDOWS_NO_EXPORT + mlx5_nl_get_mtu_bounds; # WINDOWS_NO_EXPORT mlx5_nl_ifindex; # WINDOWS_NO_EXPORT mlx5_nl_init; # WINDOWS_NO_EXPORT mlx5_nl_mac_addr_add; # WINDOWS_NO_EXPORT diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c index 1d999ef66b..4d126751a2 100644 --- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c @@ -242,6 +242,36 @@ mlx5_ifreq(const struct rte_eth_dev *dev, int req, struct ifreq *ifr) return mlx5_ifreq_by_ifname(ifname, req, ifr); } +/** + * Get device minimum and maximum allowed MTU values. + * + * @param dev + * Pointer to Ethernet device. + * @param[out] min_mtu + * Minimum MTU value output buffer. + * @param[out] max_mtu + * Maximum MTU value output buffer. + * + * @return + * 0 on success, a negative errno value otherwise and rte_errno is set. + */ +int +mlx5_os_get_mtu_bounds(struct rte_eth_dev *dev, uint16_t *min_mtu, uint16_t *max_mtu) +{ + struct mlx5_priv *priv = dev->data->dev_private; + int nl_route; + int ret; + + nl_route = mlx5_nl_init(NETLINK_ROUTE, 0); + if (nl_route < 0) + return nl_route; + + ret = mlx5_nl_get_mtu_bounds(nl_route, priv->if_index, min_mtu, max_mtu); + + close(nl_route); + return ret; +} + /** * Get device MTU. * diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 073d81291a..38a774ade7 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1484,6 +1484,8 @@ err_secondary: eth_dev->data->mac_addrs = priv->mac; eth_dev->device = dpdk_dev; eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; + /* Fetch minimum and maximum allowed MTU from the device. */ + mlx5_get_mtu_bounds(eth_dev, &priv->min_mtu, &priv->max_mtu); /* Configure the first MAC address by default. */ if (mlx5_get_mac(eth_dev, &mac.addr_bytes)) { DRV_LOG(ERR, diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 8052d8c426..b82142f2bc 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -65,6 +65,15 @@ /* Maximal number of field/field parts to map into sample registers .*/ #define MLX5_FLEX_ITEM_MAPPING_NUM 32 +/* Number of bytes not included in MTU. */ +#define MLX5_ETH_OVERHEAD (RTE_ETHER_HDR_LEN + RTE_VLAN_HLEN + RTE_ETHER_CRC_LEN) + +/* Minimum allowed MTU to be reported whenever PMD cannot query it from OS. */ +#define MLX5_ETH_MIN_MTU (RTE_ETHER_MIN_MTU) + +/* Maximum allowed MTU to be reported whenever PMD cannot query it from OS. */ +#define MLX5_ETH_MAX_MTU (9978) + enum mlx5_ipool_index { #if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H) MLX5_IPOOL_DECAP_ENCAP = 0, /* Pool for encap/decap resource. */ @@ -1714,6 +1723,8 @@ struct mlx5_priv { unsigned int vlan_filter_n; /* Number of configured VLAN filters. */ /* Device properties. */ uint16_t mtu; /* Configured MTU. */ + uint16_t min_mtu; /* Minimum MTU allowed on the NIC. */ + uint16_t max_mtu; /* Maximum MTU allowed on the NIC. */ unsigned int isolated:1; /* Whether isolated mode is enabled. */ unsigned int representor:1; /* Device is a port representor. */ unsigned int master:1; /* Device is a E-Switch master. */ @@ -1952,6 +1963,7 @@ eth_rx_burst_t mlx5_select_rx_function(struct rte_eth_dev *dev); struct mlx5_priv *mlx5_port_to_eswitch_info(uint16_t port, bool valid); struct mlx5_priv *mlx5_dev_to_eswitch_info(struct rte_eth_dev *dev); int mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev); +void mlx5_get_mtu_bounds(struct rte_eth_dev *dev, uint16_t *min_mtu, uint16_t *max_mtu); /* mlx5_ethdev_os.c */ @@ -1990,6 +2002,7 @@ int mlx5_os_get_stats_n(struct rte_eth_dev *dev, bool bond_master, uint16_t *n_stats, uint16_t *n_stats_sec); void mlx5_os_stats_init(struct rte_eth_dev *dev); int mlx5_get_flag_dropless_rq(struct rte_eth_dev *dev); +int mlx5_os_get_mtu_bounds(struct rte_eth_dev *dev, uint16_t *min_mtu, uint16_t *max_mtu); /* mlx5_mac.c */ diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index b5b5a4f287..8fc62e9d04 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -352,9 +352,11 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) unsigned int max; uint16_t max_wqe; + info->min_mtu = priv->min_mtu; + info->max_mtu = priv->max_mtu; + info->max_rx_pktlen = info->max_mtu + MLX5_ETH_OVERHEAD; /* FIXME: we should ask the device for these values. */ info->min_rx_bufsize = 32; - info->max_rx_pktlen = 65536; info->max_lro_pkt_size = MLX5_MAX_LRO_SIZE; /* * Since we need one CQ per QP, the limit is the minimum number @@ -801,3 +803,41 @@ mlx5_hairpin_cap_get(struct rte_eth_dev *dev, struct rte_eth_hairpin_cap *cap) cap->tx_cap.rte_memory = hca_attr->hairpin_sq_wq_in_host_mem; return 0; } + +/** + * Query minimum and maximum allowed MTU value on the device. + * + * This functions will always return valid MTU bounds. + * In case platform-specific implementation fails or current platform does not support it, + * the fallback default values will be used. + * + * @param[in] dev + * Pointer to Ethernet device + * @param[out] min_mtu + * Minimum MTU value output buffer. + * @param[out] max_mtu + * Maximum MTU value output buffer. + */ +void +mlx5_get_mtu_bounds(struct rte_eth_dev *dev, uint16_t *min_mtu, uint16_t *max_mtu) +{ + int ret; + + MLX5_ASSERT(min_mtu != NULL); + MLX5_ASSERT(max_mtu != NULL); + + ret = mlx5_os_get_mtu_bounds(dev, min_mtu, max_mtu); + if (ret < 0) { + if (ret != -ENOTSUP) + DRV_LOG(INFO, "port %u failed to query MTU bounds, using fallback values", + dev->data->port_id); + *min_mtu = MLX5_ETH_MIN_MTU; + *max_mtu = MLX5_ETH_MAX_MTU; + + /* This function does not fail. Clear rte_errno. */ + rte_errno = 0; + } + + DRV_LOG(INFO, "port %u minimum MTU is %u", dev->data->port_id, *min_mtu); + DRV_LOG(INFO, "port %u maximum MTU is %u", dev->data->port_id, *max_mtu); +} diff --git a/drivers/net/mlx5/windows/mlx5_ethdev_os.c b/drivers/net/mlx5/windows/mlx5_ethdev_os.c index 49f750be68..4f43b95a09 100644 --- a/drivers/net/mlx5/windows/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/windows/mlx5_ethdev_os.c @@ -71,6 +71,34 @@ mlx5_get_ifname(const struct rte_eth_dev *dev, char (*ifname)[MLX5_NAMESIZE]) return 0; } +/** + * Get device minimum and maximum allowed MTU. + * + * Windows API does not expose minimum and maximum allowed MTU. + * In this case, this just returns (-ENOTSUP) to allow platform-independent code + * to fallback to default values. + * + * @param dev + * Pointer to Ethernet device. + * @param[out] min_mtu + * Minimum MTU value output buffer. + * @param[out] max_mtu + * Maximum MTU value output buffer. + * + * @return + * (-ENOTSUP) - not supported on Windows + */ +int +mlx5_os_get_mtu_bounds(struct rte_eth_dev *dev, uint16_t *min_mtu, uint16_t *max_mtu) +{ + RTE_SET_USED(dev); + RTE_SET_USED(min_mtu); + RTE_SET_USED(max_mtu); + + rte_errno = ENOTSUP; + return -rte_errno; +} + /** * Get device MTU. * diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c index d35b949b34..a2c2b37773 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -431,6 +431,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, eth_dev->data->mac_addrs = priv->mac; eth_dev->device = dpdk_dev; eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; + /* Fetch minimum and maximum allowed MTU from the device. */ + mlx5_get_mtu_bounds(eth_dev, &priv->min_mtu, &priv->max_mtu); /* Configure the first MAC address by default. */ if (mlx5_get_mac(eth_dev, &mac.addr_bytes)) { DRV_LOG(ERR, -- 2.47.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-10-27 15:54:35.463064942 +0000 +++ 0017-net-mlx5-fix-min-and-max-MTU-reporting.patch 2025-10-27 15:54:34.743948245 +0000 @@ -1 +1 @@ -From 44d657109216a32e8718446f20f91272e10575dd Mon Sep 17 00:00:00 2001 +From b1be3bbf46a8d9c6a422db5c9359904dafe9048f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 44d657109216a32e8718446f20f91272e10575dd ] + @@ -22 +23,0 @@ -Cc: stable@dpdk.org @@ -27 +28 @@ - drivers/common/mlx5/linux/mlx5_nl.c | 109 ++++++++++++++++++++++ + drivers/common/mlx5/linux/mlx5_nl.c | 108 ++++++++++++++++++++++ @@ -28,0 +30 @@ + drivers/common/mlx5/version.map | 1 + @@ -35 +37 @@ - 8 files changed, 228 insertions(+), 1 deletion(-) + 9 files changed, 228 insertions(+), 1 deletion(-) @@ -38 +40 @@ -index 86166e92d0..dd69e229e3 100644 +index 5d04857b38..4fa2410a81 100644 @@ -41 +43 @@ -@@ -2247,3 +2247,112 @@ mlx5_nl_rdma_monitor_cap_get(int nl, uint8_t *cap) +@@ -1962,3 +1962,111 @@ mlx5_nl_read_events(int nlsk_fd, mlx5_nl_event_cb *cb, void *cb_arg) @@ -109 +110,0 @@ -+RTE_EXPORT_INTERNAL_SYMBOL(mlx5_nl_get_mtu_bounds) @@ -155 +156 @@ -index e32080fa63..26923a88fd 100644 +index db01d7323e..ed3bad213a 100644 @@ -158 +159 @@ -@@ -117,4 +117,7 @@ void mlx5_nl_rdma_monitor_info_get(struct nlmsghdr *hdr, struct mlx5_nl_port_inf +@@ -82,4 +82,7 @@ int mlx5_nl_read_events(int nlsk_fd, mlx5_nl_event_cb *cb, void *cb_arg); @@ -160 +161 @@ - int mlx5_nl_rdma_monitor_cap_get(int nl, uint8_t *cap); + int mlx5_nl_parse_link_status_update(struct nlmsghdr *hdr, uint32_t *ifindex); @@ -165,0 +167,12 @@ +diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map +index 03c8ce5593..75fed298cd 100644 +--- a/drivers/common/mlx5/version.map ++++ b/drivers/common/mlx5/version.map +@@ -123,6 +123,7 @@ INTERNAL { + mlx5_mr_mb2mr_bh; + + mlx5_nl_allmulti; # WINDOWS_NO_EXPORT ++ mlx5_nl_get_mtu_bounds; # WINDOWS_NO_EXPORT + mlx5_nl_ifindex; # WINDOWS_NO_EXPORT + mlx5_nl_init; # WINDOWS_NO_EXPORT + mlx5_nl_mac_addr_add; # WINDOWS_NO_EXPORT @@ -167 +180 @@ -index 9daeda5435..a371c2c747 100644 +index 1d999ef66b..4d126751a2 100644 @@ -170 +183 @@ -@@ -159,6 +159,36 @@ mlx5_ifreq(const struct rte_eth_dev *dev, int req, struct ifreq *ifr) +@@ -242,6 +242,36 @@ mlx5_ifreq(const struct rte_eth_dev *dev, int req, struct ifreq *ifr) @@ -208 +221 @@ -index 696a3e12c7..2bc8ca9284 100644 +index 073d81291a..38a774ade7 100644 @@ -211 +224 @@ -@@ -1562,6 +1562,8 @@ err_secondary: +@@ -1484,6 +1484,8 @@ err_secondary: @@ -221 +234 @@ -index c08894cd03..53f0a27445 100644 +index 8052d8c426..b82142f2bc 100644 @@ -224 +237 @@ -@@ -74,6 +74,15 @@ +@@ -65,6 +65,15 @@ @@ -240 +253 @@ -@@ -1981,6 +1990,8 @@ struct mlx5_priv { +@@ -1714,6 +1723,8 @@ struct mlx5_priv { @@ -249 +262,3 @@ -@@ -2333,6 +2344,7 @@ struct mlx5_priv *mlx5_dev_to_eswitch_info(struct rte_eth_dev *dev); +@@ -1952,6 +1963,7 @@ eth_rx_burst_t mlx5_select_rx_function(struct rte_eth_dev *dev); + struct mlx5_priv *mlx5_port_to_eswitch_info(uint16_t port, bool valid); + struct mlx5_priv *mlx5_dev_to_eswitch_info(struct rte_eth_dev *dev); @@ -251,2 +265,0 @@ - uint64_t mlx5_get_restore_flags(struct rte_eth_dev *dev, - enum rte_eth_dev_operation op); @@ -257 +270 @@ -@@ -2372,6 +2384,7 @@ int mlx5_os_get_stats_n(struct rte_eth_dev *dev, bool bond_master, +@@ -1990,6 +2002,7 @@ int mlx5_os_get_stats_n(struct rte_eth_dev *dev, bool bond_master, @@ -266 +279 @@ -index 68d1c1bfa7..7747b0c869 100644 +index b5b5a4f287..8fc62e9d04 100644 @@ -269 +282 @@ -@@ -360,9 +360,11 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) +@@ -352,9 +352,11 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) @@ -282,2 +295,2 @@ -@@ -863,3 +865,41 @@ mlx5_get_restore_flags(__rte_unused struct rte_eth_dev *dev, - /* mlx5 PMD does not require any configuration restore. */ +@@ -801,3 +803,41 @@ mlx5_hairpin_cap_get(struct rte_eth_dev *dev, struct rte_eth_hairpin_cap *cap) + cap->tx_cap.rte_memory = hca_attr->hairpin_sq_wq_in_host_mem; @@ -364 +377 @@ -index d583730066..c4e3430bdc 100644 +index d35b949b34..a2c2b37773 100644 @@ -367 +380 @@ -@@ -477,6 +477,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, +@@ -431,6 +431,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,