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 CBC50A0524 for ; Fri, 5 Feb 2021 12:23:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC6AD4067B; Fri, 5 Feb 2021 12:23:49 +0100 (CET) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mails.dpdk.org (Postfix) with ESMTP id B0AB21606BA for ; Fri, 5 Feb 2021 12:23:42 +0100 (CET) Received: by mail-wm1-f41.google.com with SMTP id t142so3557327wmt.1 for ; Fri, 05 Feb 2021 03:23:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uwkJbfnx3NLuAWx6NLNKPJ2/htolQz+7VGh86RR8dR4=; b=SE5S4ZtQg1HVDZT3fjMUHyd92Qj77kgPxtxeodOLX12co555YR0qFhdu4ECO+7xdZl M0qasl86WOJ/5OWnMbdVVE5gpOsbDvyQeK0WDIUVUP8W06H/ZkEP0EdQGDwocD4Svk1E jDU/+dUj0KijdkqF8N7Ht29EObj9xVorq8bVH32O8vU9l0SCPrfE9PWu7lRaHt3CjUrx l2g7Zgng9+X3baEK2YSpNTSecgb3AzljG/kLD069TVBRnscZH4EdTbkd1S7GOzPpM4u8 GV9qqS9jgiTOZM+jJ7j1nCP0cQ2vzQLX3JRL04Hex9Arq9cNyhrc2pLvhS/17rhbgVo5 j6fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uwkJbfnx3NLuAWx6NLNKPJ2/htolQz+7VGh86RR8dR4=; b=P9eaFeWTQA+5n8NqyB6rfukbNIvmWLgy5ZS6dTAVqTkQfO6rn8JynLkiCIUq2lhEeb J6LsliOUOtCLcFZC0e84snLEdU9fbfi9ySfFTTZcl4qfPhe8OqDjcTlYyw7cE+Aa5O+A ci4e3KCpM8NxtzZVnzg8o7FYXPVzEVTO3YbasBLFjj7H6GJZHNv8nwkZvozFK5SaTqD9 sS3Gsjv2L9QIT446apsddCNW3BoluBeu3KTl84Z6uH2x8JkClqlCCmjil1Y/eSeEo2en 6jgdEMMows+ZoEUvdNKjsuHl/xZKgc2wRTWFDUtf28MzOcjWijTZimx3/DOvf8Q4pYn1 r1OA== X-Gm-Message-State: AOAM532pAtCPiM5wDnLjRYn6H0hzSl/rrSoz93RwDkrMcqsilI9DynCc fEG768mVC1dhy8CNonyIem8= X-Google-Smtp-Source: ABdhPJwOSFv414gg1vqihrUf5q42pdfF3ueDueJ0Bxxq43LbM3H3KL31xEzkOvRd6l0UE9yW3p2Ycg== X-Received: by 2002:a05:600c:1988:: with SMTP id t8mr3314954wmq.48.1612524222399; Fri, 05 Feb 2021 03:23:42 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id u6sm12692770wro.75.2021.02.05.03.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:23:41 -0800 (PST) From: luca.boccassi@gmail.com To: Ophir Munk Cc: Matan Azrad , dpdk stable Date: Fri, 5 Feb 2021 11:16:06 +0000 Message-Id: <20210205111920.1272063-80-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: unify operations for all OS' has been queued to stable release 20.11.1 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/07/21. 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/d8277bf9f26d0fdfbcd9a05fb45f15ea02bbd67a Thanks. Luca Boccassi --- >From d8277bf9f26d0fdfbcd9a05fb45f15ea02bbd67a Mon Sep 17 00:00:00 2001 From: Ophir Munk Date: Mon, 28 Dec 2020 14:32:56 +0200 Subject: [PATCH] net/mlx5: unify operations for all OS [ upstream commit b012b4ce72d7168c886ec00b1346c0f768541ad7 ] There are three types of eth_dev_ops: primary, secondary and isolate represented in three callback tables per OS. In this commit the OS specific eth dev tables are unified into shared tables in file mlx5.c. Starting from this commit all operating systems must implement the same eth dev APIs. In case an OS does not support an API - it can return in its implementation an error ENOTSUP. Fixes: 042f5c94fd3a ("net/mlx5: refactor device operations for Linux") Signed-off-by: Ophir Munk Acked-by: Matan Azrad --- drivers/net/mlx5/linux/mlx5_os.c | 154 +------------------------------ drivers/net/mlx5/mlx5.c | 150 ++++++++++++++++++++++++++++++ drivers/net/mlx5/mlx5.h | 6 +- drivers/net/mlx5/mlx5_flow.c | 4 +- 4 files changed, 157 insertions(+), 157 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 9062191dd1..750ca7557f 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -751,7 +751,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, rte_eth_devices[priv->sh->bond_dev].device; else eth_dev->device = dpdk_dev; - eth_dev->dev_ops = &mlx5_os_dev_sec_ops; + eth_dev->dev_ops = &mlx5_dev_sec_ops; eth_dev->rx_descriptor_status = mlx5_rx_descriptor_status; eth_dev->tx_descriptor_status = mlx5_tx_descriptor_status; err = mlx5_proc_priv_init(eth_dev); @@ -1426,7 +1426,7 @@ err_secondary: /* Initialize burst functions to prevent crashes before link-up. */ eth_dev->rx_pkt_burst = removed_rx_burst; eth_dev->tx_pkt_burst = removed_tx_burst; - eth_dev->dev_ops = &mlx5_os_dev_ops; + eth_dev->dev_ops = &mlx5_dev_ops; eth_dev->rx_descriptor_status = mlx5_rx_descriptor_status; eth_dev->tx_descriptor_status = mlx5_tx_descriptor_status; eth_dev->rx_queue_count = mlx5_rx_queue_count; @@ -2605,153 +2605,3 @@ mlx5_os_mac_addr_flush(struct rte_eth_dev *dev) dev->data->mac_addrs, MLX5_MAX_MAC_ADDRESSES, priv->mac_own); } - -const struct eth_dev_ops mlx5_os_dev_ops = { - .dev_configure = mlx5_dev_configure, - .dev_start = mlx5_dev_start, - .dev_stop = mlx5_dev_stop, - .dev_set_link_down = mlx5_set_link_down, - .dev_set_link_up = mlx5_set_link_up, - .dev_close = mlx5_dev_close, - .promiscuous_enable = mlx5_promiscuous_enable, - .promiscuous_disable = mlx5_promiscuous_disable, - .allmulticast_enable = mlx5_allmulticast_enable, - .allmulticast_disable = mlx5_allmulticast_disable, - .link_update = mlx5_link_update, - .stats_get = mlx5_stats_get, - .stats_reset = mlx5_stats_reset, - .xstats_get = mlx5_xstats_get, - .xstats_reset = mlx5_xstats_reset, - .xstats_get_names = mlx5_xstats_get_names, - .fw_version_get = mlx5_fw_version_get, - .dev_infos_get = mlx5_dev_infos_get, - .read_clock = mlx5_txpp_read_clock, - .dev_supported_ptypes_get = mlx5_dev_supported_ptypes_get, - .vlan_filter_set = mlx5_vlan_filter_set, - .rx_queue_setup = mlx5_rx_queue_setup, - .rx_hairpin_queue_setup = mlx5_rx_hairpin_queue_setup, - .tx_queue_setup = mlx5_tx_queue_setup, - .tx_hairpin_queue_setup = mlx5_tx_hairpin_queue_setup, - .rx_queue_release = mlx5_rx_queue_release, - .tx_queue_release = mlx5_tx_queue_release, - .rx_queue_start = mlx5_rx_queue_start, - .rx_queue_stop = mlx5_rx_queue_stop, - .tx_queue_start = mlx5_tx_queue_start, - .tx_queue_stop = mlx5_tx_queue_stop, - .flow_ctrl_get = mlx5_dev_get_flow_ctrl, - .flow_ctrl_set = mlx5_dev_set_flow_ctrl, - .mac_addr_remove = mlx5_mac_addr_remove, - .mac_addr_add = mlx5_mac_addr_add, - .mac_addr_set = mlx5_mac_addr_set, - .set_mc_addr_list = mlx5_set_mc_addr_list, - .mtu_set = mlx5_dev_set_mtu, - .vlan_strip_queue_set = mlx5_vlan_strip_queue_set, - .vlan_offload_set = mlx5_vlan_offload_set, - .reta_update = mlx5_dev_rss_reta_update, - .reta_query = mlx5_dev_rss_reta_query, - .rss_hash_update = mlx5_rss_hash_update, - .rss_hash_conf_get = mlx5_rss_hash_conf_get, - .filter_ctrl = mlx5_dev_filter_ctrl, - .rxq_info_get = mlx5_rxq_info_get, - .txq_info_get = mlx5_txq_info_get, - .rx_burst_mode_get = mlx5_rx_burst_mode_get, - .tx_burst_mode_get = mlx5_tx_burst_mode_get, - .rx_queue_intr_enable = mlx5_rx_intr_enable, - .rx_queue_intr_disable = mlx5_rx_intr_disable, - .is_removed = mlx5_is_removed, - .udp_tunnel_port_add = mlx5_udp_tunnel_port_add, - .get_module_info = mlx5_get_module_info, - .get_module_eeprom = mlx5_get_module_eeprom, - .hairpin_cap_get = mlx5_hairpin_cap_get, - .mtr_ops_get = mlx5_flow_meter_ops_get, - .hairpin_bind = mlx5_hairpin_bind, - .hairpin_unbind = mlx5_hairpin_unbind, - .hairpin_get_peer_ports = mlx5_hairpin_get_peer_ports, - .hairpin_queue_peer_update = mlx5_hairpin_queue_peer_update, - .hairpin_queue_peer_bind = mlx5_hairpin_queue_peer_bind, - .hairpin_queue_peer_unbind = mlx5_hairpin_queue_peer_unbind, -}; - -/* Available operations from secondary process. */ -const struct eth_dev_ops mlx5_os_dev_sec_ops = { - .stats_get = mlx5_stats_get, - .stats_reset = mlx5_stats_reset, - .xstats_get = mlx5_xstats_get, - .xstats_reset = mlx5_xstats_reset, - .xstats_get_names = mlx5_xstats_get_names, - .fw_version_get = mlx5_fw_version_get, - .dev_infos_get = mlx5_dev_infos_get, - .read_clock = mlx5_txpp_read_clock, - .rx_queue_start = mlx5_rx_queue_start, - .rx_queue_stop = mlx5_rx_queue_stop, - .tx_queue_start = mlx5_tx_queue_start, - .tx_queue_stop = mlx5_tx_queue_stop, - .rxq_info_get = mlx5_rxq_info_get, - .txq_info_get = mlx5_txq_info_get, - .rx_burst_mode_get = mlx5_rx_burst_mode_get, - .tx_burst_mode_get = mlx5_tx_burst_mode_get, - .get_module_info = mlx5_get_module_info, - .get_module_eeprom = mlx5_get_module_eeprom, -}; - -/* Available operations in flow isolated mode. */ -const struct eth_dev_ops mlx5_os_dev_ops_isolate = { - .dev_configure = mlx5_dev_configure, - .dev_start = mlx5_dev_start, - .dev_stop = mlx5_dev_stop, - .dev_set_link_down = mlx5_set_link_down, - .dev_set_link_up = mlx5_set_link_up, - .dev_close = mlx5_dev_close, - .promiscuous_enable = mlx5_promiscuous_enable, - .promiscuous_disable = mlx5_promiscuous_disable, - .allmulticast_enable = mlx5_allmulticast_enable, - .allmulticast_disable = mlx5_allmulticast_disable, - .link_update = mlx5_link_update, - .stats_get = mlx5_stats_get, - .stats_reset = mlx5_stats_reset, - .xstats_get = mlx5_xstats_get, - .xstats_reset = mlx5_xstats_reset, - .xstats_get_names = mlx5_xstats_get_names, - .fw_version_get = mlx5_fw_version_get, - .dev_infos_get = mlx5_dev_infos_get, - .read_clock = mlx5_txpp_read_clock, - .dev_supported_ptypes_get = mlx5_dev_supported_ptypes_get, - .vlan_filter_set = mlx5_vlan_filter_set, - .rx_queue_setup = mlx5_rx_queue_setup, - .rx_hairpin_queue_setup = mlx5_rx_hairpin_queue_setup, - .tx_queue_setup = mlx5_tx_queue_setup, - .tx_hairpin_queue_setup = mlx5_tx_hairpin_queue_setup, - .rx_queue_release = mlx5_rx_queue_release, - .tx_queue_release = mlx5_tx_queue_release, - .rx_queue_start = mlx5_rx_queue_start, - .rx_queue_stop = mlx5_rx_queue_stop, - .tx_queue_start = mlx5_tx_queue_start, - .tx_queue_stop = mlx5_tx_queue_stop, - .flow_ctrl_get = mlx5_dev_get_flow_ctrl, - .flow_ctrl_set = mlx5_dev_set_flow_ctrl, - .mac_addr_remove = mlx5_mac_addr_remove, - .mac_addr_add = mlx5_mac_addr_add, - .mac_addr_set = mlx5_mac_addr_set, - .set_mc_addr_list = mlx5_set_mc_addr_list, - .mtu_set = mlx5_dev_set_mtu, - .vlan_strip_queue_set = mlx5_vlan_strip_queue_set, - .vlan_offload_set = mlx5_vlan_offload_set, - .filter_ctrl = mlx5_dev_filter_ctrl, - .rxq_info_get = mlx5_rxq_info_get, - .txq_info_get = mlx5_txq_info_get, - .rx_burst_mode_get = mlx5_rx_burst_mode_get, - .tx_burst_mode_get = mlx5_tx_burst_mode_get, - .rx_queue_intr_enable = mlx5_rx_intr_enable, - .rx_queue_intr_disable = mlx5_rx_intr_disable, - .is_removed = mlx5_is_removed, - .get_module_info = mlx5_get_module_info, - .get_module_eeprom = mlx5_get_module_eeprom, - .hairpin_cap_get = mlx5_hairpin_cap_get, - .mtr_ops_get = mlx5_flow_meter_ops_get, - .hairpin_bind = mlx5_hairpin_bind, - .hairpin_unbind = mlx5_hairpin_unbind, - .hairpin_get_peer_ports = mlx5_hairpin_get_peer_ports, - .hairpin_queue_peer_update = mlx5_hairpin_queue_peer_update, - .hairpin_queue_peer_bind = mlx5_hairpin_queue_peer_bind, - .hairpin_queue_peer_unbind = mlx5_hairpin_queue_peer_unbind, -}; diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 591750a3ff..ebad6a0709 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1427,6 +1427,156 @@ mlx5_dev_close(struct rte_eth_dev *dev) return 0; } +const struct eth_dev_ops mlx5_dev_ops = { + .dev_configure = mlx5_dev_configure, + .dev_start = mlx5_dev_start, + .dev_stop = mlx5_dev_stop, + .dev_set_link_down = mlx5_set_link_down, + .dev_set_link_up = mlx5_set_link_up, + .dev_close = mlx5_dev_close, + .promiscuous_enable = mlx5_promiscuous_enable, + .promiscuous_disable = mlx5_promiscuous_disable, + .allmulticast_enable = mlx5_allmulticast_enable, + .allmulticast_disable = mlx5_allmulticast_disable, + .link_update = mlx5_link_update, + .stats_get = mlx5_stats_get, + .stats_reset = mlx5_stats_reset, + .xstats_get = mlx5_xstats_get, + .xstats_reset = mlx5_xstats_reset, + .xstats_get_names = mlx5_xstats_get_names, + .fw_version_get = mlx5_fw_version_get, + .dev_infos_get = mlx5_dev_infos_get, + .read_clock = mlx5_txpp_read_clock, + .dev_supported_ptypes_get = mlx5_dev_supported_ptypes_get, + .vlan_filter_set = mlx5_vlan_filter_set, + .rx_queue_setup = mlx5_rx_queue_setup, + .rx_hairpin_queue_setup = mlx5_rx_hairpin_queue_setup, + .tx_queue_setup = mlx5_tx_queue_setup, + .tx_hairpin_queue_setup = mlx5_tx_hairpin_queue_setup, + .rx_queue_release = mlx5_rx_queue_release, + .tx_queue_release = mlx5_tx_queue_release, + .rx_queue_start = mlx5_rx_queue_start, + .rx_queue_stop = mlx5_rx_queue_stop, + .tx_queue_start = mlx5_tx_queue_start, + .tx_queue_stop = mlx5_tx_queue_stop, + .flow_ctrl_get = mlx5_dev_get_flow_ctrl, + .flow_ctrl_set = mlx5_dev_set_flow_ctrl, + .mac_addr_remove = mlx5_mac_addr_remove, + .mac_addr_add = mlx5_mac_addr_add, + .mac_addr_set = mlx5_mac_addr_set, + .set_mc_addr_list = mlx5_set_mc_addr_list, + .mtu_set = mlx5_dev_set_mtu, + .vlan_strip_queue_set = mlx5_vlan_strip_queue_set, + .vlan_offload_set = mlx5_vlan_offload_set, + .reta_update = mlx5_dev_rss_reta_update, + .reta_query = mlx5_dev_rss_reta_query, + .rss_hash_update = mlx5_rss_hash_update, + .rss_hash_conf_get = mlx5_rss_hash_conf_get, + .filter_ctrl = mlx5_dev_filter_ctrl, + .rxq_info_get = mlx5_rxq_info_get, + .txq_info_get = mlx5_txq_info_get, + .rx_burst_mode_get = mlx5_rx_burst_mode_get, + .tx_burst_mode_get = mlx5_tx_burst_mode_get, + .rx_queue_intr_enable = mlx5_rx_intr_enable, + .rx_queue_intr_disable = mlx5_rx_intr_disable, + .is_removed = mlx5_is_removed, + .udp_tunnel_port_add = mlx5_udp_tunnel_port_add, + .get_module_info = mlx5_get_module_info, + .get_module_eeprom = mlx5_get_module_eeprom, + .hairpin_cap_get = mlx5_hairpin_cap_get, + .mtr_ops_get = mlx5_flow_meter_ops_get, + .hairpin_bind = mlx5_hairpin_bind, + .hairpin_unbind = mlx5_hairpin_unbind, + .hairpin_get_peer_ports = mlx5_hairpin_get_peer_ports, + .hairpin_queue_peer_update = mlx5_hairpin_queue_peer_update, + .hairpin_queue_peer_bind = mlx5_hairpin_queue_peer_bind, + .hairpin_queue_peer_unbind = mlx5_hairpin_queue_peer_unbind, +}; + +/* Available operations from secondary process. */ +const struct eth_dev_ops mlx5_dev_sec_ops = { + .stats_get = mlx5_stats_get, + .stats_reset = mlx5_stats_reset, + .xstats_get = mlx5_xstats_get, + .xstats_reset = mlx5_xstats_reset, + .xstats_get_names = mlx5_xstats_get_names, + .fw_version_get = mlx5_fw_version_get, + .dev_infos_get = mlx5_dev_infos_get, + .read_clock = mlx5_txpp_read_clock, + .rx_queue_start = mlx5_rx_queue_start, + .rx_queue_stop = mlx5_rx_queue_stop, + .tx_queue_start = mlx5_tx_queue_start, + .tx_queue_stop = mlx5_tx_queue_stop, + .rxq_info_get = mlx5_rxq_info_get, + .txq_info_get = mlx5_txq_info_get, + .rx_burst_mode_get = mlx5_rx_burst_mode_get, + .tx_burst_mode_get = mlx5_tx_burst_mode_get, + .get_module_info = mlx5_get_module_info, + .get_module_eeprom = mlx5_get_module_eeprom, +}; + +/* Available operations in flow isolated mode. */ +const struct eth_dev_ops mlx5_dev_ops_isolate = { + .dev_configure = mlx5_dev_configure, + .dev_start = mlx5_dev_start, + .dev_stop = mlx5_dev_stop, + .dev_set_link_down = mlx5_set_link_down, + .dev_set_link_up = mlx5_set_link_up, + .dev_close = mlx5_dev_close, + .promiscuous_enable = mlx5_promiscuous_enable, + .promiscuous_disable = mlx5_promiscuous_disable, + .allmulticast_enable = mlx5_allmulticast_enable, + .allmulticast_disable = mlx5_allmulticast_disable, + .link_update = mlx5_link_update, + .stats_get = mlx5_stats_get, + .stats_reset = mlx5_stats_reset, + .xstats_get = mlx5_xstats_get, + .xstats_reset = mlx5_xstats_reset, + .xstats_get_names = mlx5_xstats_get_names, + .fw_version_get = mlx5_fw_version_get, + .dev_infos_get = mlx5_dev_infos_get, + .read_clock = mlx5_txpp_read_clock, + .dev_supported_ptypes_get = mlx5_dev_supported_ptypes_get, + .vlan_filter_set = mlx5_vlan_filter_set, + .rx_queue_setup = mlx5_rx_queue_setup, + .rx_hairpin_queue_setup = mlx5_rx_hairpin_queue_setup, + .tx_queue_setup = mlx5_tx_queue_setup, + .tx_hairpin_queue_setup = mlx5_tx_hairpin_queue_setup, + .rx_queue_release = mlx5_rx_queue_release, + .tx_queue_release = mlx5_tx_queue_release, + .rx_queue_start = mlx5_rx_queue_start, + .rx_queue_stop = mlx5_rx_queue_stop, + .tx_queue_start = mlx5_tx_queue_start, + .tx_queue_stop = mlx5_tx_queue_stop, + .flow_ctrl_get = mlx5_dev_get_flow_ctrl, + .flow_ctrl_set = mlx5_dev_set_flow_ctrl, + .mac_addr_remove = mlx5_mac_addr_remove, + .mac_addr_add = mlx5_mac_addr_add, + .mac_addr_set = mlx5_mac_addr_set, + .set_mc_addr_list = mlx5_set_mc_addr_list, + .mtu_set = mlx5_dev_set_mtu, + .vlan_strip_queue_set = mlx5_vlan_strip_queue_set, + .vlan_offload_set = mlx5_vlan_offload_set, + .filter_ctrl = mlx5_dev_filter_ctrl, + .rxq_info_get = mlx5_rxq_info_get, + .txq_info_get = mlx5_txq_info_get, + .rx_burst_mode_get = mlx5_rx_burst_mode_get, + .tx_burst_mode_get = mlx5_tx_burst_mode_get, + .rx_queue_intr_enable = mlx5_rx_intr_enable, + .rx_queue_intr_disable = mlx5_rx_intr_disable, + .is_removed = mlx5_is_removed, + .get_module_info = mlx5_get_module_info, + .get_module_eeprom = mlx5_get_module_eeprom, + .hairpin_cap_get = mlx5_hairpin_cap_get, + .mtr_ops_get = mlx5_flow_meter_ops_get, + .hairpin_bind = mlx5_hairpin_bind, + .hairpin_unbind = mlx5_hairpin_unbind, + .hairpin_get_peer_ports = mlx5_hairpin_get_peer_ports, + .hairpin_queue_peer_update = mlx5_hairpin_queue_peer_update, + .hairpin_queue_peer_bind = mlx5_hairpin_queue_peer_bind, + .hairpin_queue_peer_unbind = mlx5_hairpin_queue_peer_unbind, +}; + /** * Verify and store value for device argument. * diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 121d726405..df27983ad9 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -135,9 +135,9 @@ struct mlx5_local_data { extern struct mlx5_shared_data *mlx5_shared_data; /* Dev ops structs */ -extern const struct eth_dev_ops mlx5_os_dev_ops; -extern const struct eth_dev_ops mlx5_os_dev_sec_ops; -extern const struct eth_dev_ops mlx5_os_dev_ops_isolate; +extern const struct eth_dev_ops mlx5_dev_ops; +extern const struct eth_dev_ops mlx5_dev_sec_ops; +extern const struct eth_dev_ops mlx5_dev_ops_isolate; struct mlx5_counter_ctrl { /* Name of the counter. */ diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index a4cf63b235..e0c23927eb 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -6125,9 +6125,9 @@ mlx5_flow_isolate(struct rte_eth_dev *dev, } priv->isolated = !!enable; if (enable) - dev->dev_ops = &mlx5_os_dev_ops_isolate; + dev->dev_ops = &mlx5_dev_ops_isolate; else - dev->dev_ops = &mlx5_os_dev_ops; + dev->dev_ops = &mlx5_dev_ops; dev->rx_descriptor_status = mlx5_rx_descriptor_status; dev->tx_descriptor_status = mlx5_tx_descriptor_status; -- 2.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:32.846085548 +0000 +++ 0080-net-mlx5-unify-operations-for-all-OS.patch 2021-02-05 11:18:28.886692635 +0000 @@ -1 +1 @@ -From b012b4ce72d7168c886ec00b1346c0f768541ad7 Mon Sep 17 00:00:00 2001 +From d8277bf9f26d0fdfbcd9a05fb45f15ea02bbd67a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b012b4ce72d7168c886ec00b1346c0f768541ad7 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -19,6 +20,5 @@ - drivers/net/mlx5/linux/mlx5_os.c | 154 +---------------------------- - drivers/net/mlx5/mlx5.c | 150 ++++++++++++++++++++++++++++ - drivers/net/mlx5/mlx5.h | 6 +- - drivers/net/mlx5/mlx5_flow.c | 4 +- - drivers/net/mlx5/windows/mlx5_os.c | 110 +-------------------- - 5 files changed, 158 insertions(+), 266 deletions(-) + drivers/net/mlx5/linux/mlx5_os.c | 154 +------------------------------ + drivers/net/mlx5/mlx5.c | 150 ++++++++++++++++++++++++++++++ + drivers/net/mlx5/mlx5.h | 6 +- + drivers/net/mlx5/mlx5_flow.c | 4 +- + 4 files changed, 157 insertions(+), 157 deletions(-) @@ -27 +27 @@ -index 4f68c74267..8353ac22e0 100644 +index 9062191dd1..750ca7557f 100644 @@ -30 +30 @@ -@@ -757,7 +757,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, +@@ -751,7 +751,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, @@ -39 +39 @@ -@@ -1432,7 +1432,7 @@ err_secondary: +@@ -1426,7 +1426,7 @@ err_secondary: @@ -48 +48 @@ -@@ -2611,153 +2611,3 @@ mlx5_os_mac_addr_flush(struct rte_eth_dev *dev) +@@ -2605,153 +2605,3 @@ mlx5_os_mac_addr_flush(struct rte_eth_dev *dev) @@ -203 +203 @@ -index 05c23aecba..a91c240bcc 100644 +index 591750a3ff..ebad6a0709 100644 @@ -206 +206 @@ -@@ -1430,6 +1430,156 @@ mlx5_dev_close(struct rte_eth_dev *dev) +@@ -1427,6 +1427,156 @@ mlx5_dev_close(struct rte_eth_dev *dev) @@ -364 +364 @@ -index 2fbeb9112d..0cb907c599 100644 +index 121d726405..df27983ad9 100644 @@ -367 +367 @@ -@@ -140,9 +140,9 @@ struct mlx5_local_data { +@@ -135,9 +135,9 @@ struct mlx5_local_data { @@ -381 +381 @@ -index 4035090cbb..b1c061a3f0 100644 +index a4cf63b235..e0c23927eb 100644 @@ -384 +384 @@ -@@ -6135,9 +6135,9 @@ mlx5_flow_isolate(struct rte_eth_dev *dev, +@@ -6125,9 +6125,9 @@ mlx5_flow_isolate(struct rte_eth_dev *dev, @@ -396,125 +395,0 @@ -diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c -index 95e4e1e68a..4fbd8893cf 100644 ---- a/drivers/net/mlx5/windows/mlx5_os.c -+++ b/drivers/net/mlx5/windows/mlx5_os.c -@@ -571,7 +571,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, - /* Initialize burst functions to prevent crashes before link-up. */ - eth_dev->rx_pkt_burst = removed_rx_burst; - eth_dev->tx_pkt_burst = removed_tx_burst; -- eth_dev->dev_ops = &mlx5_os_dev_ops; -+ eth_dev->dev_ops = &mlx5_dev_ops; - eth_dev->rx_descriptor_status = mlx5_rx_descriptor_status; - eth_dev->tx_descriptor_status = mlx5_tx_descriptor_status; - eth_dev->rx_queue_count = mlx5_rx_queue_count; -@@ -1156,111 +1156,3 @@ mlx5_os_get_pdn(void *pd, uint32_t *pdn) - } - - const struct mlx5_flow_driver_ops mlx5_flow_verbs_drv_ops = {0}; -- --const struct eth_dev_ops mlx5_os_dev_ops = { -- .dev_configure = mlx5_dev_configure, -- .dev_start = mlx5_dev_start, -- .dev_stop = mlx5_dev_stop, -- .dev_close = mlx5_dev_close, -- .mtu_set = mlx5_dev_set_mtu, -- .link_update = mlx5_link_update, -- .stats_get = mlx5_stats_get, -- .stats_reset = mlx5_stats_reset, -- .dev_infos_get = mlx5_dev_infos_get, -- .dev_supported_ptypes_get = mlx5_dev_supported_ptypes_get, -- .promiscuous_enable = mlx5_promiscuous_enable, -- .promiscuous_disable = mlx5_promiscuous_disable, -- .allmulticast_enable = mlx5_allmulticast_enable, -- .allmulticast_disable = mlx5_allmulticast_disable, -- .xstats_get = mlx5_xstats_get, -- .xstats_reset = mlx5_xstats_reset, -- .xstats_get_names = mlx5_xstats_get_names, -- .fw_version_get = mlx5_fw_version_get, -- .read_clock = mlx5_read_clock, -- .vlan_filter_set = mlx5_vlan_filter_set, -- .rx_queue_setup = mlx5_rx_queue_setup, -- .rx_hairpin_queue_setup = mlx5_rx_hairpin_queue_setup, -- .tx_queue_setup = mlx5_tx_queue_setup, -- .tx_hairpin_queue_setup = mlx5_tx_hairpin_queue_setup, -- .rx_queue_release = mlx5_rx_queue_release, -- .tx_queue_release = mlx5_tx_queue_release, -- .flow_ctrl_get = mlx5_dev_get_flow_ctrl, -- .flow_ctrl_set = mlx5_dev_set_flow_ctrl, -- .mac_addr_remove = mlx5_mac_addr_remove, -- .mac_addr_add = mlx5_mac_addr_add, -- .mac_addr_set = mlx5_mac_addr_set, -- .set_mc_addr_list = mlx5_set_mc_addr_list, -- .vlan_strip_queue_set = mlx5_vlan_strip_queue_set, -- .vlan_offload_set = mlx5_vlan_offload_set, -- .reta_update = mlx5_dev_rss_reta_update, -- .reta_query = mlx5_dev_rss_reta_query, -- .rss_hash_update = mlx5_rss_hash_update, -- .rss_hash_conf_get = mlx5_rss_hash_conf_get, -- .filter_ctrl = mlx5_dev_filter_ctrl, -- .rxq_info_get = mlx5_rxq_info_get, -- .txq_info_get = mlx5_txq_info_get, -- .rx_burst_mode_get = mlx5_rx_burst_mode_get, -- .tx_burst_mode_get = mlx5_tx_burst_mode_get, -- .rx_queue_intr_enable = mlx5_rx_intr_enable, -- .rx_queue_intr_disable = mlx5_rx_intr_disable, -- .is_removed = mlx5_is_removed, -- .udp_tunnel_port_add = mlx5_udp_tunnel_port_add, -- .get_module_info = mlx5_get_module_info, -- .get_module_eeprom = mlx5_get_module_eeprom, -- .hairpin_cap_get = mlx5_hairpin_cap_get, -- .mtr_ops_get = mlx5_flow_meter_ops_get, --}; -- --/* Available operations from secondary process. */ --const struct eth_dev_ops mlx5_os_dev_sec_ops = {0}; -- --/* Available operations in flow isolated mode. */ --const struct eth_dev_ops mlx5_os_dev_ops_isolate = { -- .dev_configure = mlx5_dev_configure, -- .dev_start = mlx5_dev_start, -- .dev_stop = mlx5_dev_stop, -- .dev_close = mlx5_dev_close, -- .mtu_set = mlx5_dev_set_mtu, -- .link_update = mlx5_link_update, -- .stats_get = mlx5_stats_get, -- .stats_reset = mlx5_stats_reset, -- .dev_infos_get = mlx5_dev_infos_get, -- .dev_set_link_down = mlx5_set_link_down, -- .dev_set_link_up = mlx5_set_link_up, -- .promiscuous_enable = mlx5_promiscuous_enable, -- .promiscuous_disable = mlx5_promiscuous_disable, -- .allmulticast_enable = mlx5_allmulticast_enable, -- .allmulticast_disable = mlx5_allmulticast_disable, -- .xstats_get = mlx5_xstats_get, -- .xstats_reset = mlx5_xstats_reset, -- .xstats_get_names = mlx5_xstats_get_names, -- .fw_version_get = mlx5_fw_version_get, -- .dev_supported_ptypes_get = mlx5_dev_supported_ptypes_get, -- .vlan_filter_set = mlx5_vlan_filter_set, -- .rx_queue_setup = mlx5_rx_queue_setup, -- .rx_hairpin_queue_setup = mlx5_rx_hairpin_queue_setup, -- .tx_queue_setup = mlx5_tx_queue_setup, -- .tx_hairpin_queue_setup = mlx5_tx_hairpin_queue_setup, -- .rx_queue_release = mlx5_rx_queue_release, -- .tx_queue_release = mlx5_tx_queue_release, -- .flow_ctrl_get = mlx5_dev_get_flow_ctrl, -- .flow_ctrl_set = mlx5_dev_set_flow_ctrl, -- .mac_addr_remove = mlx5_mac_addr_remove, -- .mac_addr_add = mlx5_mac_addr_add, -- .mac_addr_set = mlx5_mac_addr_set, -- .set_mc_addr_list = mlx5_set_mc_addr_list, -- .vlan_strip_queue_set = mlx5_vlan_strip_queue_set, -- .vlan_offload_set = mlx5_vlan_offload_set, -- .filter_ctrl = mlx5_dev_filter_ctrl, -- .rxq_info_get = mlx5_rxq_info_get, -- .txq_info_get = mlx5_txq_info_get, -- .rx_burst_mode_get = mlx5_rx_burst_mode_get, -- .tx_burst_mode_get = mlx5_tx_burst_mode_get, -- .rx_queue_intr_enable = mlx5_rx_intr_enable, -- .rx_queue_intr_disable = mlx5_rx_intr_disable, -- .is_removed = mlx5_is_removed, -- .get_module_info = mlx5_get_module_info, -- .get_module_eeprom = mlx5_get_module_eeprom, -- .hairpin_cap_get = mlx5_hairpin_cap_get, -- .mtr_ops_get = mlx5_flow_meter_ops_get, --};