From 3f22d03c75cef6b809648b0d968a99da00c621fe Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Wed, 22 Jul 2020 09:25:25 -0400 Subject: [PATCH] import kmod-redhat-ionic-4.18.0.210_dup8.2-2.el8_2 --- .gitignore | 1 + .kmod-redhat-ionic.metadata | 1 + ...c_only_Remove_inclusion_of_vermagic_.patch | 55 + ..._debugfs_create_bool__to_export_bool.patch | 43 + ...002-ionic_support_longer_tx_sg_lists.patch | 626 ++++++ ..._updates_to_ionic_FW_api_description.patch | 1889 +++++++++++++++++ ...ionic_protect_vf_calls_from_fw_reset.patch | 120 ++ ...onic_add_support_for_more_xcvr_types.patch | 45 + ...0006-ionic_shorter_dev_cmd_wait_time.patch | 39 + .../0007-ionic_reset_device_at_probe.patch | 36 + ...nic_ionic_intr_free_parameter_change.patch | 69 + .../0009-ionic_more_ionic_name_tweaks.patch | 133 ++ .../0010-ionic_add_more_ethtool_stats.patch | 400 ++++ ...it_on_queue_start_until_after_IFF_UP.patch | 59 + ...ionic_remove_support_for_mgmt_device.patch | 134 ++ ...nic_export_features_for_vlans_to_use.patch | 37 + ...no_link_check_while_resetting_queues.patch | 41 + ...015-ionic_add_pcie_print_link_status.patch | 36 + ..._tame_the_watchdog_timer_on_reconfig.patch | 79 + ...ionic-update-the-queue-count-on-open.patch | 40 + SOURCES/9000-Makefile-CONFIG_IONIC.patch | 14 + .../9001-add-ionic_backport_compat-h.patch | 23 + SOURCES/9002-SFF8024-enum.patch | 66 + SOURCES/9003-add-dynamic_hex_dump.patch | 29 + ...ss-the-stuck-queue-to-the-timeout-ha.patch | 401 ++++ SOURCES/9005-add-devlink-constants.patch | 18 + ...-core-reject-the-unsupported-coalesc.patch | 80 + ...-use-new-helper-tcp_v6_gso_csum_prep.patch | 45 + SOURCES/9008-module-version.patch | 12 + SPECS/kmod-redhat-ionic.spec | 355 ++++ 30 files changed, 4926 insertions(+) create mode 100644 .gitignore create mode 100644 .kmod-redhat-ionic.metadata create mode 100644 SOURCES/0000-drivers_ionic_only_Remove_inclusion_of_vermagic_.patch create mode 100644 SOURCES/0001-ionic_Use_debugfs_create_bool__to_export_bool.patch create mode 100644 SOURCES/0002-ionic_support_longer_tx_sg_lists.patch create mode 100644 SOURCES/0003-ionic_updates_to_ionic_FW_api_description.patch create mode 100644 SOURCES/0004-ionic_protect_vf_calls_from_fw_reset.patch create mode 100644 SOURCES/0005-ionic_add_support_for_more_xcvr_types.patch create mode 100644 SOURCES/0006-ionic_shorter_dev_cmd_wait_time.patch create mode 100644 SOURCES/0007-ionic_reset_device_at_probe.patch create mode 100644 SOURCES/0008-ionic_ionic_intr_free_parameter_change.patch create mode 100644 SOURCES/0009-ionic_more_ionic_name_tweaks.patch create mode 100644 SOURCES/0010-ionic_add_more_ethtool_stats.patch create mode 100644 SOURCES/0011-ionic_wait_on_queue_start_until_after_IFF_UP.patch create mode 100644 SOURCES/0012-ionic_remove_support_for_mgmt_device.patch create mode 100644 SOURCES/0013-ionic_export_features_for_vlans_to_use.patch create mode 100644 SOURCES/0014-ionic_no_link_check_while_resetting_queues.patch create mode 100644 SOURCES/0015-ionic_add_pcie_print_link_status.patch create mode 100644 SOURCES/0016-ionic_tame_the_watchdog_timer_on_reconfig.patch create mode 100644 SOURCES/0017-ionic-update-the-queue-count-on-open.patch create mode 100644 SOURCES/9000-Makefile-CONFIG_IONIC.patch create mode 100644 SOURCES/9001-add-ionic_backport_compat-h.patch create mode 100644 SOURCES/9002-SFF8024-enum.patch create mode 100644 SOURCES/9003-add-dynamic_hex_dump.patch create mode 100644 SOURCES/9004-Revert-netdrv-netdev-pass-the-stuck-queue-to-the-timeout-ha.patch create mode 100644 SOURCES/9005-add-devlink-constants.patch create mode 100644 SOURCES/9006-Revert-netdrv-ionic-let-core-reject-the-unsupported-coalesc.patch create mode 100644 SOURCES/9007-Revert-netdrv-ionic-use-new-helper-tcp_v6_gso_csum_prep.patch create mode 100644 SOURCES/9008-module-version.patch create mode 100644 SPECS/kmod-redhat-ionic.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e81d83 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/ionic-redhat-4.18.0.210_dup8.2.tar.bz2 diff --git a/.kmod-redhat-ionic.metadata b/.kmod-redhat-ionic.metadata new file mode 100644 index 0000000..631b06b --- /dev/null +++ b/.kmod-redhat-ionic.metadata @@ -0,0 +1 @@ +e5f2bbd14de72bf5220e4f328f2b7201c6b19c59 SOURCES/ionic-redhat-4.18.0.210_dup8.2.tar.bz2 diff --git a/SOURCES/0000-drivers_ionic_only_Remove_inclusion_of_vermagic_.patch b/SOURCES/0000-drivers_ionic_only_Remove_inclusion_of_vermagic_.patch new file mode 100644 index 0000000..54d7a57 --- /dev/null +++ b/SOURCES/0000-drivers_ionic_only_Remove_inclusion_of_vermagic_.patch @@ -0,0 +1,55 @@ +Date: Thu, 18 Jun 2020 19:42:36 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 01/16] drivers: [ionic only] Remove inclusion of + vermagic header + +Get rid of linux/vermagic.h includes, so that MODULE_ARCH_VERMAGIC from +the arch header arch/x86/include/asm/module.h won't be redefined. + + In file included from ./include/linux/module.h:30, + from drivers/net/ethernet/3com/3c515.c:56: + ./arch/x86/include/asm/module.h:73: warning: "MODULE_ARCH_VERMAGIC" +redefined + 73 | # define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY + | + In file included from drivers/net/ethernet/3com/3c515.c:25: + ./include/linux/vermagic.h:28: note: this is the location of the +previous definition + 28 | #define MODULE_ARCH_VERMAGIC "" + | + +Fixes: 6bba2e89a88c ("net/3com: Delete driver and module versions from 3com drivers") +Co-developed-by: Borislav Petkov +Signed-off-by: Borislav Petkov +Acked-by: Shannon Nelson # ionic +Acked-by: Sebastian Reichel # power +Signed-off-by: Leon Romanovsky +Signed-off-by: David S. Miller +(cherry picked from commit 1c79031f8a75c132bbd42e3ef20267af97b67466) +Bugzilla: 1848149 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c +index 3344bc1f7671..15911ee1af32 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_main.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c +@@ -6,7 +6,7 @@ + #include + #include + #include +-#include ++#include + + #include "ionic.h" + #include "ionic_bus.h" +-- +2.16.4 + + diff --git a/SOURCES/0001-ionic_Use_debugfs_create_bool__to_export_bool.patch b/SOURCES/0001-ionic_Use_debugfs_create_bool__to_export_bool.patch new file mode 100644 index 0000000..271262b --- /dev/null +++ b/SOURCES/0001-ionic_Use_debugfs_create_bool__to_export_bool.patch @@ -0,0 +1,43 @@ +Date: Thu, 18 Jun 2020 19:42:37 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 02/16] ionic: Use debugfs_create_bool() to export + bool + +Currently bool ionic_cq.done_color is exported using +debugfs_create_u8(), which requires a cast, preventing further compiler +checks. + +Fix this by switching to debugfs_create_bool(), and dropping the cast. + +Signed-off-by: Geert Uytterhoeven +Acked-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit 0735ccc9d9a4ce09154395feb70b804de7cc6ebf) +Bugzilla: 1848149 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_debugfs.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c +index 5f8fc58d42b3..11621ccc1faf 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c +@@ -170,8 +170,7 @@ void ionic_debugfs_add_qcq(struct ionic_lif *lif, struct ionic_qcq *qcq) + debugfs_create_x64("base_pa", 0400, cq_dentry, &cq->base_pa); + debugfs_create_u32("num_descs", 0400, cq_dentry, &cq->num_descs); + debugfs_create_u32("desc_size", 0400, cq_dentry, &cq->desc_size); +- debugfs_create_u8("done_color", 0400, cq_dentry, +- (u8 *)&cq->done_color); ++ debugfs_create_bool("done_color", 0400, cq_dentry, &cq->done_color); + + debugfs_create_file("tail", 0400, cq_dentry, cq, &cq_tail_fops); + +-- +2.16.4 + + diff --git a/SOURCES/0002-ionic_support_longer_tx_sg_lists.patch b/SOURCES/0002-ionic_support_longer_tx_sg_lists.patch new file mode 100644 index 0000000..27866be --- /dev/null +++ b/SOURCES/0002-ionic_support_longer_tx_sg_lists.patch @@ -0,0 +1,626 @@ +Date: Thu, 18 Jun 2020 19:42:38 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 03/16] ionic: support longer tx sg lists + +The version 1 Tx queues can use longer SG lists than the +original version 0 queues, but we need to check to see if the +firmware supports the v1 Tx queues. This implements the queue +type query for all queue types, and uses the information to +set up for using the longer Tx SG lists. + +Because the Tx SG list can be longer, we need to limit the +max ring length to be sure we stay inside the boundaries of a +DMA allocation max size, so we lower the max Tx ring size. + +The driver sets its highest known version in the Q_IDENTITY +command, and the FW returns the highest version that it knows, +bounded by the driver's version. The negotiated version number +is later used in the Q_INIT commands. + +Signed-off-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit 5b3f3f2a71ed1cecf6fcf9e8c858a89589415449) +Bugzilla: 1848149 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_dev.c | 14 +++ + drivers/net/ethernet/pensando/ionic/ionic_dev.h | 7 +- + .../net/ethernet/pensando/ionic/ionic_ethtool.c | 4 +- + drivers/net/ethernet/pensando/ionic/ionic_if.h | 112 +++++++++++++++++--- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 114 ++++++++++++++++++++- + drivers/net/ethernet/pensando/ionic/ionic_lif.h | 13 +++ + drivers/net/ethernet/pensando/ionic/ionic_main.c | 2 + + drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 27 +++-- + 8 files changed, 263 insertions(+), 30 deletions(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.c b/drivers/net/ethernet/pensando/ionic/ionic_dev.c +index f4ae40ae1e53..d83eff0ae0ac 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_dev.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.c +@@ -388,6 +388,19 @@ int ionic_set_vf_config(struct ionic *ionic, int vf, u8 attr, u8 *data) + } + + /* LIF commands */ ++void ionic_dev_cmd_queue_identify(struct ionic_dev *idev, ++ u16 lif_type, u8 qtype, u8 qver) ++{ ++ union ionic_dev_cmd cmd = { ++ .q_identify.opcode = IONIC_CMD_Q_IDENTIFY, ++ .q_identify.lif_type = lif_type, ++ .q_identify.type = qtype, ++ .q_identify.ver = qver, ++ }; ++ ++ ionic_dev_cmd_go(idev, &cmd); ++} ++ + void ionic_dev_cmd_lif_identify(struct ionic_dev *idev, u8 type, u8 ver) + { + union ionic_dev_cmd cmd = { +@@ -431,6 +444,7 @@ void ionic_dev_cmd_adminq_init(struct ionic_dev *idev, struct ionic_qcq *qcq, + .q_init.opcode = IONIC_CMD_Q_INIT, + .q_init.lif_index = cpu_to_le16(lif_index), + .q_init.type = q->type, ++ .q_init.ver = qcq->q.lif->qtype_info[q->type].version, + .q_init.index = cpu_to_le32(q->index), + .q_init.flags = cpu_to_le16(IONIC_QINIT_F_IRQ | + IONIC_QINIT_F_ENA), +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h +index 587398b01997..33519a8765eb 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h ++++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h +@@ -12,7 +12,8 @@ + + #define IONIC_MIN_MTU ETH_MIN_MTU + #define IONIC_MAX_MTU 9194 +-#define IONIC_MAX_TXRX_DESC 16384 ++#define IONIC_MAX_TX_DESC 8192 ++#define IONIC_MAX_RX_DESC 16384 + #define IONIC_MIN_TXRX_DESC 16 + #define IONIC_DEF_TXRX_DESC 4096 + #define IONIC_LIFS_MAX 1024 +@@ -83,6 +84,8 @@ static_assert(sizeof(struct ionic_q_init_cmd) == 64); + static_assert(sizeof(struct ionic_q_init_comp) == 16); + static_assert(sizeof(struct ionic_q_control_cmd) == 64); + static_assert(sizeof(ionic_q_control_comp) == 16); ++static_assert(sizeof(struct ionic_q_identify_cmd) == 64); ++static_assert(sizeof(struct ionic_q_identify_comp) == 16); + + static_assert(sizeof(struct ionic_rx_mode_set_cmd) == 64); + static_assert(sizeof(ionic_rx_mode_set_comp) == 16); +@@ -283,6 +286,8 @@ void ionic_dev_cmd_port_fec(struct ionic_dev *idev, u8 fec_type); + void ionic_dev_cmd_port_pause(struct ionic_dev *idev, u8 pause_type); + + int ionic_set_vf_config(struct ionic *ionic, int vf, u8 attr, u8 *data); ++void ionic_dev_cmd_queue_identify(struct ionic_dev *idev, ++ u16 lif_type, u8 qtype, u8 qver); + void ionic_dev_cmd_lif_identify(struct ionic_dev *idev, u8 type, u8 ver); + void ionic_dev_cmd_lif_init(struct ionic_dev *idev, u16 lif_index, + dma_addr_t addr); +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +index 6996229facfd..3f9a73aaef61 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +@@ -458,9 +458,9 @@ static void ionic_get_ringparam(struct net_device *netdev, + { + struct ionic_lif *lif = netdev_priv(netdev); + +- ring->tx_max_pending = IONIC_MAX_TXRX_DESC; ++ ring->tx_max_pending = IONIC_MAX_TX_DESC; + ring->tx_pending = lif->ntxq_descs; +- ring->rx_max_pending = IONIC_MAX_TXRX_DESC; ++ ring->rx_max_pending = IONIC_MAX_RX_DESC; + ring->rx_pending = lif->nrxq_descs; + } + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h +index 2804a24a9d73..7b9ec07db363 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_if.h ++++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h +@@ -40,6 +40,7 @@ enum ionic_cmd_opcode { + IONIC_CMD_RX_FILTER_DEL = 32, + + /* Queue commands */ ++ IONIC_CMD_Q_IDENTIFY = 39, + IONIC_CMD_Q_INIT = 40, + IONIC_CMD_Q_CONTROL = 41, + +@@ -469,6 +470,66 @@ struct ionic_lif_init_comp { + u8 rsvd2[12]; + }; + ++ /** ++ * struct ionic_q_identify_cmd - queue identify command ++ * @opcode: opcode ++ * @lif_type: LIF type (enum ionic_lif_type) ++ * @type: Logical queue type (enum ionic_logical_qtype) ++ * @ver: Highest queue type version that the driver supports ++ */ ++struct ionic_q_identify_cmd { ++ u8 opcode; ++ u8 rsvd; ++ __le16 lif_type; ++ u8 type; ++ u8 ver; ++ u8 rsvd2[58]; ++}; ++ ++/** ++ * struct ionic_q_identify_comp - queue identify command completion ++ * @status: Status of the command (enum ionic_status_code) ++ * @comp_index: Index in the descriptor ring for which this is the completion ++ * @ver: Queue type version that can be used with FW ++ */ ++struct ionic_q_identify_comp { ++ u8 status; ++ u8 rsvd; ++ __le16 comp_index; ++ u8 ver; ++ u8 rsvd2[11]; ++}; ++ ++/** ++ * union ionic_q_identity - queue identity information ++ * @version: Queue type version that can be used with FW ++ * @supported: Bitfield of queue versions, first bit = ver 0 ++ * @features: Queue features ++ * @desc_sz: Descriptor size ++ * @comp_sz: Completion descriptor size ++ * @sg_desc_sz: Scatter/Gather descriptor size ++ * @max_sg_elems: Maximum number of Scatter/Gather elements ++ * @sg_desc_stride: Number of Scatter/Gather elements per descriptor ++ */ ++union ionic_q_identity { ++ struct { ++ u8 version; ++ u8 supported; ++ u8 rsvd[6]; ++#define IONIC_QIDENT_F_CQ 0x01 /* queue has completion ring */ ++#define IONIC_QIDENT_F_SG 0x02 /* queue has scatter/gather ring */ ++#define IONIC_QIDENT_F_EQ 0x04 /* queue can use event queue */ ++#define IONIC_QIDENT_F_CMB 0x08 /* queue is in cmb bar */ ++ __le64 features; ++ __le16 desc_sz; ++ __le16 comp_sz; ++ __le16 sg_desc_sz; ++ __le16 max_sg_elems; ++ __le16 sg_desc_stride; ++ }; ++ __le32 words[478]; ++}; ++ + /** + * struct ionic_q_init_cmd - Queue init command + * @opcode: opcode +@@ -733,20 +794,31 @@ static inline void decode_txq_desc_cmd(u64 cmd, u8 *opcode, u8 *flags, + *addr = (cmd >> IONIC_TXQ_DESC_ADDR_SHIFT) & IONIC_TXQ_DESC_ADDR_MASK; + }; + +-#define IONIC_TX_MAX_SG_ELEMS 8 +-#define IONIC_RX_MAX_SG_ELEMS 8 +- + /** +- * struct ionic_txq_sg_desc - Transmit scatter-gather (SG) list ++ * struct ionic_txq_sg_elem - Transmit scatter-gather (SG) descriptor element + * @addr: DMA address of SG element data buffer + * @len: Length of SG element data buffer, in bytes + */ ++struct ionic_txq_sg_elem { ++ __le64 addr; ++ __le16 len; ++ __le16 rsvd[3]; ++}; ++ ++/** ++ * struct ionic_txq_sg_desc - Transmit scatter-gather (SG) list ++ * @elems: Scatter-gather elements ++ */ + struct ionic_txq_sg_desc { +- struct ionic_txq_sg_elem { +- __le64 addr; +- __le16 len; +- __le16 rsvd[3]; +- } elems[IONIC_TX_MAX_SG_ELEMS]; ++#define IONIC_TX_MAX_SG_ELEMS 8 ++#define IONIC_TX_SG_DESC_STRIDE 8 ++ struct ionic_txq_sg_elem elems[IONIC_TX_MAX_SG_ELEMS]; ++}; ++ ++struct ionic_txq_sg_desc_v1 { ++#define IONIC_TX_MAX_SG_ELEMS_V1 15 ++#define IONIC_TX_SG_DESC_STRIDE_V1 16 ++ struct ionic_txq_sg_elem elems[IONIC_TX_SG_DESC_STRIDE_V1]; + }; + + /** +@@ -791,16 +863,24 @@ struct ionic_rxq_desc { + }; + + /** +- * struct ionic_rxq_sg_desc - Receive scatter-gather (SG) list ++ * struct ionic_rxq_sg_desc - Receive scatter-gather (SG) descriptor element + * @addr: DMA address of SG element data buffer + * @len: Length of SG element data buffer, in bytes + */ ++struct ionic_rxq_sg_elem { ++ __le64 addr; ++ __le16 len; ++ __le16 rsvd[3]; ++}; ++ ++/** ++ * struct ionic_rxq_sg_desc - Receive scatter-gather (SG) list ++ * @elems: Scatter-gather elements ++ */ + struct ionic_rxq_sg_desc { +- struct ionic_rxq_sg_elem { +- __le64 addr; +- __le16 len; +- __le16 rsvd[3]; +- } elems[IONIC_RX_MAX_SG_ELEMS]; ++#define IONIC_RX_MAX_SG_ELEMS 8 ++#define IONIC_RX_SG_DESC_STRIDE 8 ++ struct ionic_rxq_sg_elem elems[IONIC_RX_SG_DESC_STRIDE]; + }; + + /** +@@ -2389,6 +2469,7 @@ union ionic_dev_cmd { + struct ionic_qos_init_cmd qos_init; + struct ionic_qos_reset_cmd qos_reset; + ++ struct ionic_q_identify_cmd q_identify; + struct ionic_q_init_cmd q_init; + }; + +@@ -2421,6 +2502,7 @@ union ionic_dev_cmd_comp { + ionic_qos_init_comp qos_init; + ionic_qos_reset_comp qos_reset; + ++ struct ionic_q_identify_comp q_identify; + struct ionic_q_init_comp q_init; + }; + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index f8a9c1bcffc9..d60ef816604a 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -17,6 +17,16 @@ + #include "ionic_ethtool.h" + #include "ionic_debugfs.h" + ++/* queuetype support level */ ++static const u8 ionic_qtype_versions[IONIC_QTYPE_MAX] = { ++ [IONIC_QTYPE_ADMINQ] = 0, /* 0 = Base version with CQ support */ ++ [IONIC_QTYPE_NOTIFYQ] = 0, /* 0 = Base version */ ++ [IONIC_QTYPE_RXQ] = 0, /* 0 = Base version with CQ+SG support */ ++ [IONIC_QTYPE_TXQ] = 1, /* 0 = Base version with CQ+SG support ++ * 1 = ... with Tx SG version 1 ++ */ ++}; ++ + static void ionic_lif_rx_mode(struct ionic_lif *lif, unsigned int rx_mode); + static int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr); + static int ionic_lif_addr_del(struct ionic_lif *lif, const u8 *addr); +@@ -27,6 +37,7 @@ static void ionic_lif_set_netdev_info(struct ionic_lif *lif); + + static int ionic_start_queues(struct ionic_lif *lif); + static void ionic_stop_queues(struct ionic_lif *lif); ++static void ionic_lif_queue_identify(struct ionic_lif *lif); + + static void ionic_lif_deferred_work(struct work_struct *work) + { +@@ -597,6 +608,7 @@ static int ionic_lif_txq_init(struct ionic_lif *lif, struct ionic_qcq *qcq) + .opcode = IONIC_CMD_Q_INIT, + .lif_index = cpu_to_le16(lif->index), + .type = q->type, ++ .ver = lif->qtype_info[q->type].version, + .index = cpu_to_le32(q->index), + .flags = cpu_to_le16(IONIC_QINIT_F_IRQ | + IONIC_QINIT_F_SG), +@@ -614,6 +626,8 @@ static int ionic_lif_txq_init(struct ionic_lif *lif, struct ionic_qcq *qcq) + dev_dbg(dev, "txq_init.index %d\n", ctx.cmd.q_init.index); + dev_dbg(dev, "txq_init.ring_base 0x%llx\n", ctx.cmd.q_init.ring_base); + dev_dbg(dev, "txq_init.ring_size %d\n", ctx.cmd.q_init.ring_size); ++ dev_dbg(dev, "txq_init.flags 0x%x\n", ctx.cmd.q_init.flags); ++ dev_dbg(dev, "txq_init.ver %d\n", ctx.cmd.q_init.ver); + + q->tail = q->info; + q->head = q->tail; +@@ -646,6 +660,7 @@ static int ionic_lif_rxq_init(struct ionic_lif *lif, struct ionic_qcq *qcq) + .opcode = IONIC_CMD_Q_INIT, + .lif_index = cpu_to_le16(lif->index), + .type = q->type, ++ .ver = lif->qtype_info[q->type].version, + .index = cpu_to_le32(q->index), + .flags = cpu_to_le16(IONIC_QINIT_F_IRQ | + IONIC_QINIT_F_SG), +@@ -663,6 +678,8 @@ static int ionic_lif_rxq_init(struct ionic_lif *lif, struct ionic_qcq *qcq) + dev_dbg(dev, "rxq_init.index %d\n", ctx.cmd.q_init.index); + dev_dbg(dev, "rxq_init.ring_base 0x%llx\n", ctx.cmd.q_init.ring_base); + dev_dbg(dev, "rxq_init.ring_size %d\n", ctx.cmd.q_init.ring_size); ++ dev_dbg(dev, "rxq_init.flags 0x%x\n", ctx.cmd.q_init.flags); ++ dev_dbg(dev, "rxq_init.ver %d\n", ctx.cmd.q_init.ver); + + q->tail = q->info; + q->head = q->tail; +@@ -726,7 +743,7 @@ static bool ionic_notifyq_service(struct ionic_cq *cq, + } + break; + default: +- netdev_warn(netdev, "Notifyq unknown event ecode=%d eid=%lld\n", ++ netdev_warn(netdev, "Notifyq event ecode=%d eid=%lld\n", + comp->event.ecode, eid); + break; + } +@@ -1509,17 +1526,25 @@ static void ionic_txrx_free(struct ionic_lif *lif) + + static int ionic_txrx_alloc(struct ionic_lif *lif) + { ++ unsigned int sg_desc_sz; + unsigned int flags; + unsigned int i; + int err = 0; + ++ if (lif->qtype_info[IONIC_QTYPE_TXQ].version >= 1 && ++ lif->qtype_info[IONIC_QTYPE_TXQ].sg_desc_sz == ++ sizeof(struct ionic_txq_sg_desc_v1)) ++ sg_desc_sz = sizeof(struct ionic_txq_sg_desc_v1); ++ else ++ sg_desc_sz = sizeof(struct ionic_txq_sg_desc); ++ + flags = IONIC_QCQ_F_TX_STATS | IONIC_QCQ_F_SG; + for (i = 0; i < lif->nxqs; i++) { + err = ionic_qcq_alloc(lif, IONIC_QTYPE_TXQ, i, "tx", flags, + lif->ntxq_descs, + sizeof(struct ionic_txq_desc), + sizeof(struct ionic_txq_comp), +- sizeof(struct ionic_txq_sg_desc), ++ sg_desc_sz, + lif->kern_pid, &lif->txqcqs[i].qcq); + if (err) + goto err_out; +@@ -2065,9 +2090,17 @@ int ionic_lifs_alloc(struct ionic *ionic) + + /* only build the first lif, others are for later features */ + set_bit(0, ionic->lifbits); ++ + lif = ionic_lif_alloc(ionic, 0); ++ if (IS_ERR_OR_NULL(lif)) { ++ clear_bit(0, ionic->lifbits); ++ return -ENOMEM; ++ } ++ ++ lif->lif_type = IONIC_LIF_TYPE_CLASSIC; ++ ionic_lif_queue_identify(lif); + +- return PTR_ERR_OR_ZERO(lif); ++ return 0; + } + + static void ionic_lif_reset(struct ionic_lif *lif) +@@ -2292,6 +2325,7 @@ static int ionic_lif_notifyq_init(struct ionic_lif *lif) + .opcode = IONIC_CMD_Q_INIT, + .lif_index = cpu_to_le16(lif->index), + .type = q->type, ++ .ver = lif->qtype_info[q->type].version, + .index = cpu_to_le32(q->index), + .flags = cpu_to_le16(IONIC_QINIT_F_IRQ | + IONIC_QINIT_F_ENA), +@@ -2578,6 +2612,80 @@ void ionic_lifs_unregister(struct ionic *ionic) + unregister_netdev(ionic->master_lif->netdev); + } + ++static void ionic_lif_queue_identify(struct ionic_lif *lif) ++{ ++ struct ionic *ionic = lif->ionic; ++ union ionic_q_identity *q_ident; ++ struct ionic_dev *idev; ++ int qtype; ++ int err; ++ ++ idev = &lif->ionic->idev; ++ q_ident = (union ionic_q_identity *)&idev->dev_cmd_regs->data; ++ ++ for (qtype = 0; qtype < ARRAY_SIZE(ionic_qtype_versions); qtype++) { ++ struct ionic_qtype_info *qti = &lif->qtype_info[qtype]; ++ ++ /* filter out the ones we know about */ ++ switch (qtype) { ++ case IONIC_QTYPE_ADMINQ: ++ case IONIC_QTYPE_NOTIFYQ: ++ case IONIC_QTYPE_RXQ: ++ case IONIC_QTYPE_TXQ: ++ break; ++ default: ++ continue; ++ } ++ ++ memset(qti, 0, sizeof(*qti)); ++ ++ mutex_lock(&ionic->dev_cmd_lock); ++ ionic_dev_cmd_queue_identify(idev, lif->lif_type, qtype, ++ ionic_qtype_versions[qtype]); ++ err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); ++ if (!err) { ++ qti->version = q_ident->version; ++ qti->supported = q_ident->supported; ++ qti->features = le64_to_cpu(q_ident->features); ++ qti->desc_sz = le16_to_cpu(q_ident->desc_sz); ++ qti->comp_sz = le16_to_cpu(q_ident->comp_sz); ++ qti->sg_desc_sz = le16_to_cpu(q_ident->sg_desc_sz); ++ qti->max_sg_elems = le16_to_cpu(q_ident->max_sg_elems); ++ qti->sg_desc_stride = le16_to_cpu(q_ident->sg_desc_stride); ++ } ++ mutex_unlock(&ionic->dev_cmd_lock); ++ ++ if (err == -EINVAL) { ++ dev_err(ionic->dev, "qtype %d not supported\n", qtype); ++ continue; ++ } else if (err == -EIO) { ++ dev_err(ionic->dev, "q_ident failed, not supported on older FW\n"); ++ return; ++ } else if (err) { ++ dev_err(ionic->dev, "q_ident failed, qtype %d: %d\n", ++ qtype, err); ++ return; ++ } ++ ++ dev_dbg(ionic->dev, " qtype[%d].version = %d\n", ++ qtype, qti->version); ++ dev_dbg(ionic->dev, " qtype[%d].supported = 0x%02x\n", ++ qtype, qti->supported); ++ dev_dbg(ionic->dev, " qtype[%d].features = 0x%04llx\n", ++ qtype, qti->features); ++ dev_dbg(ionic->dev, " qtype[%d].desc_sz = %d\n", ++ qtype, qti->desc_sz); ++ dev_dbg(ionic->dev, " qtype[%d].comp_sz = %d\n", ++ qtype, qti->comp_sz); ++ dev_dbg(ionic->dev, " qtype[%d].sg_desc_sz = %d\n", ++ qtype, qti->sg_desc_sz); ++ dev_dbg(ionic->dev, " qtype[%d].max_sg_elems = %d\n", ++ qtype, qti->max_sg_elems); ++ dev_dbg(ionic->dev, " qtype[%d].sg_desc_stride = %d\n", ++ qtype, qti->sg_desc_stride); ++ } ++} ++ + int ionic_lif_identify(struct ionic *ionic, u8 lif_type, + union ionic_lif_identity *lid) + { +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h +index 5d4ffda5c05f..1a30f0fb20b9 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h +@@ -133,6 +133,17 @@ enum ionic_lif_state_flags { + IONIC_LIF_F_STATE_SIZE + }; + ++struct ionic_qtype_info { ++ u8 version; ++ u8 supported; ++ u64 features; ++ u16 desc_sz; ++ u16 comp_sz; ++ u16 sg_desc_sz; ++ u16 max_sg_elems; ++ u16 sg_desc_stride; ++}; ++ + #define IONIC_LIF_NAME_MAX_SZ 32 + struct ionic_lif { + char name[IONIC_LIF_NAME_MAX_SZ]; +@@ -161,11 +172,13 @@ struct ionic_lif { + bool mc_overflow; + unsigned int nmcast; + bool uc_overflow; ++ u16 lif_type; + unsigned int nucast; + + struct ionic_lif_info *info; + dma_addr_t info_pa; + u32 info_sz; ++ struct ionic_qtype_info qtype_info[IONIC_QTYPE_MAX]; + + u16 rss_types; + u8 rss_hash_key[IONIC_RSS_HASH_KEY_SIZE]; +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c +index 15911ee1af32..34ccb8f53cda 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_main.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c +@@ -152,6 +152,8 @@ static const char *ionic_opcode_to_str(enum ionic_cmd_opcode opcode) + return "IONIC_CMD_RX_FILTER_ADD"; + case IONIC_CMD_RX_FILTER_DEL: + return "IONIC_CMD_RX_FILTER_DEL"; ++ case IONIC_CMD_Q_IDENTIFY: ++ return "IONIC_CMD_Q_IDENTIFY"; + case IONIC_CMD_Q_INIT: + return "IONIC_CMD_Q_INIT"; + case IONIC_CMD_Q_CONTROL: +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +index d233b6e77b1e..6b14e55a6780 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +@@ -10,8 +10,10 @@ + #include "ionic_lif.h" + #include "ionic_txrx.h" + +-static void ionic_rx_clean(struct ionic_queue *q, struct ionic_desc_info *desc_info, +- struct ionic_cq_info *cq_info, void *cb_arg); ++static void ionic_rx_clean(struct ionic_queue *q, ++ struct ionic_desc_info *desc_info, ++ struct ionic_cq_info *cq_info, ++ void *cb_arg); + + static inline void ionic_txq_post(struct ionic_queue *q, bool ring_dbell, + ionic_desc_cb cb_func, void *cb_arg) +@@ -140,8 +142,10 @@ static struct sk_buff *ionic_rx_copybreak(struct ionic_queue *q, + return skb; + } + +-static void ionic_rx_clean(struct ionic_queue *q, struct ionic_desc_info *desc_info, +- struct ionic_cq_info *cq_info, void *cb_arg) ++static void ionic_rx_clean(struct ionic_queue *q, ++ struct ionic_desc_info *desc_info, ++ struct ionic_cq_info *cq_info, ++ void *cb_arg) + { + struct ionic_rxq_comp *comp = cq_info->cq_desc; + struct ionic_qcq *qcq = q_to_qcq(q); +@@ -475,7 +479,8 @@ int ionic_rx_napi(struct napi_struct *napi, int budget) + return work_done; + } + +-static dma_addr_t ionic_tx_map_single(struct ionic_queue *q, void *data, size_t len) ++static dma_addr_t ionic_tx_map_single(struct ionic_queue *q, ++ void *data, size_t len) + { + struct ionic_tx_stats *stats = q_to_tx_stats(q); + struct device *dev = q->lif->ionic->dev; +@@ -491,7 +496,8 @@ static dma_addr_t ionic_tx_map_single(struct ionic_queue *q, void *data, size_t + return dma_addr; + } + +-static dma_addr_t ionic_tx_map_frag(struct ionic_queue *q, const skb_frag_t *frag, ++static dma_addr_t ionic_tx_map_frag(struct ionic_queue *q, ++ const skb_frag_t *frag, + size_t offset, size_t len) + { + struct ionic_tx_stats *stats = q_to_tx_stats(q); +@@ -507,8 +513,10 @@ static dma_addr_t ionic_tx_map_frag(struct ionic_queue *q, const skb_frag_t *fra + return dma_addr; + } + +-static void ionic_tx_clean(struct ionic_queue *q, struct ionic_desc_info *desc_info, +- struct ionic_cq_info *cq_info, void *cb_arg) ++static void ionic_tx_clean(struct ionic_queue *q, ++ struct ionic_desc_info *desc_info, ++ struct ionic_cq_info *cq_info, ++ void *cb_arg) + { + struct ionic_txq_sg_desc *sg_desc = desc_info->sg_desc; + struct ionic_txq_sg_elem *elem = sg_desc->elems; +@@ -989,6 +997,7 @@ static int ionic_tx(struct ionic_queue *q, struct sk_buff *skb) + + static int ionic_tx_descs_needed(struct ionic_queue *q, struct sk_buff *skb) + { ++ int sg_elems = q->lif->qtype_info[IONIC_QTYPE_TXQ].max_sg_elems; + struct ionic_tx_stats *stats = q_to_tx_stats(q); + int err; + +@@ -997,7 +1006,7 @@ static int ionic_tx_descs_needed(struct ionic_queue *q, struct sk_buff *skb) + return (skb->len / skb_shinfo(skb)->gso_size) + 1; + + /* If non-TSO, just need 1 desc and nr_frags sg elems */ +- if (skb_shinfo(skb)->nr_frags <= IONIC_TX_MAX_SG_ELEMS) ++ if (skb_shinfo(skb)->nr_frags <= sg_elems) + return 1; + + /* Too many frags, so linearize */ +-- +2.16.4 + + diff --git a/SOURCES/0003-ionic_updates_to_ionic_FW_api_description.patch b/SOURCES/0003-ionic_updates_to_ionic_FW_api_description.patch new file mode 100644 index 0000000..9990a6b --- /dev/null +++ b/SOURCES/0003-ionic_updates_to_ionic_FW_api_description.patch @@ -0,0 +1,1889 @@ +Date: Thu, 18 Jun 2020 19:42:39 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 04/16] ionic: updates to ionic FW api description + +Lots of comment cleanup for better documentation, a few new +fields added, and a few minor mistakes fixed up. + +Signed-off-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit c4e7a75a096c02035a102686e2569e7b0341a122) +Bugzilla: 1848149 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_if.h | 979 +++++++++++++++---------- + 1 file changed, 576 insertions(+), 403 deletions(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h +index 7b9ec07db363..20f262913639 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_if.h ++++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h +@@ -1,5 +1,5 @@ + /* SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB) OR BSD-2-Clause */ +-/* Copyright (c) 2017-2019 Pensando Systems, Inc. All rights reserved. */ ++/* Copyright (c) 2017-2020 Pensando Systems, Inc. All rights reserved. */ + + #ifndef _IONIC_IF_H_ + #define _IONIC_IF_H_ +@@ -9,7 +9,7 @@ + #define IONIC_IFNAMSIZ 16 + + /** +- * Commands ++ * enum ionic_cmd_opcode - Device commands + */ + enum ionic_cmd_opcode { + IONIC_CMD_NOP = 0, +@@ -58,6 +58,7 @@ enum ionic_cmd_opcode { + IONIC_CMD_QOS_CLASS_IDENTIFY = 240, + IONIC_CMD_QOS_CLASS_INIT = 241, + IONIC_CMD_QOS_CLASS_RESET = 242, ++ IONIC_CMD_QOS_CLASS_UPDATE = 243, + + /* Firmware commands */ + IONIC_CMD_FW_DOWNLOAD = 254, +@@ -65,7 +66,7 @@ enum ionic_cmd_opcode { + }; + + /** +- * Command Return codes ++ * enum ionic_status_code - Device command return codes + */ + enum ionic_status_code { + IONIC_RC_SUCCESS = 0, /* Success */ +@@ -98,6 +99,7 @@ enum ionic_notifyq_opcode { + IONIC_EVENT_RESET = 2, + IONIC_EVENT_HEARTBEAT = 3, + IONIC_EVENT_LOG = 4, ++ IONIC_EVENT_XCVR = 5, + }; + + /** +@@ -115,12 +117,11 @@ struct ionic_admin_cmd { + + /** + * struct ionic_admin_comp - General admin command completion format +- * @status: The status of the command (enum status_code) +- * @comp_index: The index in the descriptor ring for which this +- * is the completion. +- * @cmd_data: Command-specific bytes. +- * @color: Color bit. (Always 0 for commands issued to the +- * Device Cmd Registers.) ++ * @status: Status of the command (enum ionic_status_code) ++ * @comp_index: Index in the descriptor ring for which this is the completion ++ * @cmd_data: Command-specific bytes ++ * @color: Color bit (Always 0 for commands issued to the ++ * Device Cmd Registers) + */ + struct ionic_admin_comp { + u8 status; +@@ -147,7 +148,7 @@ struct ionic_nop_cmd { + + /** + * struct ionic_nop_comp - NOP command completion +- * @status: The status of the command (enum status_code) ++ * @status: Status of the command (enum ionic_status_code) + */ + struct ionic_nop_comp { + u8 status; +@@ -157,7 +158,7 @@ struct ionic_nop_comp { + /** + * struct ionic_dev_init_cmd - Device init command + * @opcode: opcode +- * @type: device type ++ * @type: Device type + */ + struct ionic_dev_init_cmd { + u8 opcode; +@@ -167,7 +168,7 @@ struct ionic_dev_init_cmd { + + /** + * struct init_comp - Device init command completion +- * @status: The status of the command (enum status_code) ++ * @status: Status of the command (enum ionic_status_code) + */ + struct ionic_dev_init_comp { + u8 status; +@@ -185,7 +186,7 @@ struct ionic_dev_reset_cmd { + + /** + * struct reset_comp - Reset command completion +- * @status: The status of the command (enum status_code) ++ * @status: Status of the command (enum ionic_status_code) + */ + struct ionic_dev_reset_comp { + u8 status; +@@ -206,8 +207,8 @@ struct ionic_dev_identify_cmd { + }; + + /** +- * struct dev_identify_comp - Driver/device identify command completion +- * @status: The status of the command (enum status_code) ++ * struct ionic_dev_identify_comp - Driver/device identify command completion ++ * @status: Status of the command (enum ionic_status_code) + * @ver: Version of identify returned by device + */ + struct ionic_dev_identify_comp { +@@ -226,8 +227,8 @@ enum ionic_os_type { + }; + + /** +- * union drv_identity - driver identity information +- * @os_type: OS type (see enum os_type) ++ * union ionic_drv_identity - driver identity information ++ * @os_type: OS type (see enum ionic_os_type) + * @os_dist: OS distribution, numeric format + * @os_dist_str: OS distribution, string format + * @kernel_ver: Kernel version, numeric format +@@ -243,26 +244,26 @@ union ionic_drv_identity { + char kernel_ver_str[32]; + char driver_ver_str[32]; + }; +- __le32 words[512]; ++ __le32 words[478]; + }; + + /** +- * union dev_identity - device identity information ++ * union ionic_dev_identity - device identity information + * @version: Version of device identify + * @type: Identify type (0 for now) + * @nports: Number of ports provisioned + * @nlifs: Number of LIFs provisioned + * @nintrs: Number of interrupts provisioned + * @ndbpgs_per_lif: Number of doorbell pages per LIF +- * @intr_coal_mult: Interrupt coalescing multiplication factor. ++ * @intr_coal_mult: Interrupt coalescing multiplication factor + * Scale user-supplied interrupt coalescing + * value in usecs to device units using: + * device units = usecs * mult / div +- * @intr_coal_div: Interrupt coalescing division factor. ++ * @intr_coal_div: Interrupt coalescing division factor + * Scale user-supplied interrupt coalescing + * value in usecs to device units using: + * device units = usecs * mult / div +- * ++ * @eq_count: Number of shared event queues + */ + union ionic_dev_identity { + struct { +@@ -276,8 +277,9 @@ union ionic_dev_identity { + __le32 ndbpgs_per_lif; + __le32 intr_coal_mult; + __le32 intr_coal_div; ++ __le32 eq_count; + }; +- __le32 words[512]; ++ __le32 words[478]; + }; + + enum ionic_lif_type { +@@ -287,10 +289,10 @@ enum ionic_lif_type { + }; + + /** +- * struct ionic_lif_identify_cmd - lif identify command ++ * struct ionic_lif_identify_cmd - LIF identify command + * @opcode: opcode +- * @type: lif type (enum lif_type) +- * @ver: version of identify returned by device ++ * @type: LIF type (enum ionic_lif_type) ++ * @ver: Version of identify returned by device + */ + struct ionic_lif_identify_cmd { + u8 opcode; +@@ -300,9 +302,9 @@ struct ionic_lif_identify_cmd { + }; + + /** +- * struct ionic_lif_identify_comp - lif identify command completion +- * @status: status of the command (enum status_code) +- * @ver: version of identify returned by device ++ * struct ionic_lif_identify_comp - LIF identify command completion ++ * @status: Status of the command (enum ionic_status_code) ++ * @ver: Version of identify returned by device + */ + struct ionic_lif_identify_comp { + u8 status; +@@ -310,13 +312,24 @@ struct ionic_lif_identify_comp { + u8 rsvd2[14]; + }; + ++/** ++ * enum ionic_lif_capability - LIF capabilities ++ * @IONIC_LIF_CAP_ETH: LIF supports Ethernet ++ * @IONIC_LIF_CAP_RDMA: LIF support RDMA ++ */ + enum ionic_lif_capability { + IONIC_LIF_CAP_ETH = BIT(0), + IONIC_LIF_CAP_RDMA = BIT(1), + }; + + /** +- * Logical Queue Types ++ * enum ionic_logical_qtype - Logical Queue Types ++ * @IONIC_QTYPE_ADMINQ: Administrative Queue ++ * @IONIC_QTYPE_NOTIFYQ: Notify Queue ++ * @IONIC_QTYPE_RXQ: Receive Queue ++ * @IONIC_QTYPE_TXQ: Transmit Queue ++ * @IONIC_QTYPE_EQ: Event Queue ++ * @IONIC_QTYPE_MAX: Max queue type supported + */ + enum ionic_logical_qtype { + IONIC_QTYPE_ADMINQ = 0, +@@ -328,10 +341,10 @@ enum ionic_logical_qtype { + }; + + /** +- * struct ionic_lif_logical_qtype - Descriptor of logical to hardware queue type. +- * @qtype: Hardware Queue Type. +- * @qid_count: Number of Queue IDs of the logical type. +- * @qid_base: Minimum Queue ID of the logical type. ++ * struct ionic_lif_logical_qtype - Descriptor of logical to HW queue type ++ * @qtype: Hardware Queue Type ++ * @qid_count: Number of Queue IDs of the logical type ++ * @qid_base: Minimum Queue ID of the logical type + */ + struct ionic_lif_logical_qtype { + u8 qtype; +@@ -340,6 +353,12 @@ struct ionic_lif_logical_qtype { + __le32 qid_base; + }; + ++/** ++ * enum ionic_lif_state - LIF state ++ * @IONIC_LIF_DISABLE: LIF disabled ++ * @IONIC_LIF_ENABLE: LIF enabled ++ * @IONIC_LIF_HANG_RESET: LIF hung, being reset ++ */ + enum ionic_lif_state { + IONIC_LIF_DISABLE = 0, + IONIC_LIF_ENABLE = 1, +@@ -347,13 +366,13 @@ enum ionic_lif_state { + }; + + /** +- * LIF configuration +- * @state: lif state (enum lif_state) +- * @name: lif name +- * @mtu: mtu +- * @mac: station mac address +- * @features: features (enum ionic_eth_hw_features) +- * @queue_count: queue counts per queue-type ++ * union ionic_lif_config - LIF configuration ++ * @state: LIF state (enum ionic_lif_state) ++ * @name: LIF name ++ * @mtu: MTU ++ * @mac: Station MAC address ++ * @features: Features (enum ionic_eth_hw_features) ++ * @queue_count: Queue counts per queue-type + */ + union ionic_lif_config { + struct { +@@ -370,37 +389,36 @@ union ionic_lif_config { + }; + + /** +- * struct ionic_lif_identity - lif identity information (type-specific) ++ * struct ionic_lif_identity - LIF identity information (type-specific) + * +- * @capabilities LIF capabilities ++ * @capabilities: LIF capabilities + * +- * Ethernet: +- * @version: Ethernet identify structure version. +- * @features: Ethernet features supported on this lif type. +- * @max_ucast_filters: Number of perfect unicast addresses supported. +- * @max_mcast_filters: Number of perfect multicast addresses supported. +- * @min_frame_size: Minimum size of frames to be sent +- * @max_frame_size: Maximim size of frames to be sent +- * @config: LIF config struct with features, mtu, mac, q counts ++ * @eth: Ethernet identify structure ++ * @version: Ethernet identify structure version ++ * @max_ucast_filters: Number of perfect unicast addresses supported ++ * @max_mcast_filters: Number of perfect multicast addresses supported ++ * @min_frame_size: Minimum size of frames to be sent ++ * @max_frame_size: Maximim size of frames to be sent ++ * @config: LIF config struct with features, mtu, mac, q counts + * +- * RDMA: +- * @version: RDMA version of opcodes and queue descriptors. +- * @qp_opcodes: Number of rdma queue pair opcodes supported. +- * @admin_opcodes: Number of rdma admin opcodes supported. +- * @npts_per_lif: Page table size per lif +- * @nmrs_per_lif: Number of memory regions per lif +- * @nahs_per_lif: Number of address handles per lif +- * @max_stride: Max work request stride. +- * @cl_stride: Cache line stride. +- * @pte_stride: Page table entry stride. +- * @rrq_stride: Remote RQ work request stride. +- * @rsq_stride: Remote SQ work request stride. ++ * @rdma: RDMA identify structure ++ * @version: RDMA version of opcodes and queue descriptors ++ * @qp_opcodes: Number of RDMA queue pair opcodes supported ++ * @admin_opcodes: Number of RDMA admin opcodes supported ++ * @npts_per_lif: Page table size per LIF ++ * @nmrs_per_lif: Number of memory regions per LIF ++ * @nahs_per_lif: Number of address handles per LIF ++ * @max_stride: Max work request stride ++ * @cl_stride: Cache line stride ++ * @pte_stride: Page table entry stride ++ * @rrq_stride: Remote RQ work request stride ++ * @rsq_stride: Remote SQ work request stride + * @dcqcn_profiles: Number of DCQCN profiles +- * @aq_qtype: RDMA Admin Qtype. +- * @sq_qtype: RDMA Send Qtype. +- * @rq_qtype: RDMA Receive Qtype. +- * @cq_qtype: RDMA Completion Qtype. +- * @eq_qtype: RDMA Event Qtype. ++ * @aq_qtype: RDMA Admin Qtype ++ * @sq_qtype: RDMA Send Qtype ++ * @rq_qtype: RDMA Receive Qtype ++ * @cq_qtype: RDMA Completion Qtype ++ * @eq_qtype: RDMA Event Qtype + */ + union ionic_lif_identity { + struct { +@@ -440,15 +458,15 @@ union ionic_lif_identity { + struct ionic_lif_logical_qtype eq_qtype; + } __packed rdma; + } __packed; +- __le32 words[512]; ++ __le32 words[478]; + }; + + /** + * struct ionic_lif_init_cmd - LIF init command +- * @opcode: opcode +- * @type: LIF type (enum lif_type) ++ * @opcode: Opcode ++ * @type: LIF type (enum ionic_lif_type) + * @index: LIF index +- * @info_pa: destination address for lif info (struct ionic_lif_info) ++ * @info_pa: Destination address for LIF info (struct ionic_lif_info) + */ + struct ionic_lif_init_cmd { + u8 opcode; +@@ -461,7 +479,8 @@ struct ionic_lif_init_cmd { + + /** + * struct ionic_lif_init_comp - LIF init command completion +- * @status: The status of the command (enum status_code) ++ * @status: Status of the command (enum ionic_status_code) ++ * @hw_index: Hardware index of the initialized LIF + */ + struct ionic_lif_init_comp { + u8 status; +@@ -534,10 +553,10 @@ union ionic_q_identity { + * struct ionic_q_init_cmd - Queue init command + * @opcode: opcode + * @type: Logical queue type +- * @ver: Queue version (defines opcode/descriptor scope) ++ * @ver: Queue type version + * @lif_index: LIF index +- * @index: (lif, qtype) relative admin queue index +- * @intr_index: Interrupt control register index ++ * @index: (LIF, qtype) relative admin queue index ++ * @intr_index: Interrupt control register index, or Event queue index + * @pid: Process ID + * @flags: + * IRQ: Interrupt requested on completion +@@ -555,12 +574,11 @@ union ionic_q_identity { + * descriptors. Values of ring_size <2 and >16 are + * reserved. + * EQ: Enable the Event Queue +- * @cos: Class of service for this queue. ++ * @cos: Class of service for this queue + * @ring_size: Queue ring size, encoded as a log2(size) + * @ring_base: Queue ring base address + * @cq_ring_base: Completion queue ring base address + * @sg_ring_base: Scatter/Gather ring base address +- * @eq_index: Event queue index + */ + struct ionic_q_init_cmd { + u8 opcode; +@@ -577,29 +595,27 @@ struct ionic_q_init_cmd { + #define IONIC_QINIT_F_ENA 0x02 /* Enable the queue */ + #define IONIC_QINIT_F_SG 0x04 /* Enable scatter/gather on the queue */ + #define IONIC_QINIT_F_EQ 0x08 /* Enable event queue */ +-#define IONIC_QINIT_F_DEBUG 0x80 /* Enable queue debugging */ ++#define IONIC_QINIT_F_CMB 0x10 /* Enable cmb-based queue */ ++#define IONIC_QINIT_F_DEBUG 0x80 /* Enable queue debugging */ + u8 cos; + u8 ring_size; + __le64 ring_base; + __le64 cq_ring_base; + __le64 sg_ring_base; +- __le32 eq_index; +- u8 rsvd2[16]; ++ u8 rsvd2[20]; + } __packed; + + /** + * struct ionic_q_init_comp - Queue init command completion +- * @status: The status of the command (enum status_code) +- * @ver: Queue version (defines opcode/descriptor scope) +- * @comp_index: The index in the descriptor ring for which this +- * is the completion. ++ * @status: Status of the command (enum ionic_status_code) ++ * @comp_index: Index in the descriptor ring for which this is the completion + * @hw_index: Hardware Queue ID + * @hw_type: Hardware Queue type + * @color: Color + */ + struct ionic_q_init_comp { + u8 status; +- u8 ver; ++ u8 rsvd; + __le16 comp_index; + __le32 hw_index; + u8 hw_type; +@@ -620,10 +636,9 @@ enum ionic_txq_desc_opcode { + + /** + * struct ionic_txq_desc - Ethernet Tx queue descriptor format +- * @opcode: Tx operation, see TXQ_DESC_OPCODE_*: ++ * @cmd: Tx operation, see IONIC_TXQ_DESC_OPCODE_*: + * + * IONIC_TXQ_DESC_OPCODE_CSUM_NONE: +- * + * Non-offload send. No segmentation, + * fragmentation or checksum calc/insertion is + * performed by device; packet is prepared +@@ -631,7 +646,6 @@ enum ionic_txq_desc_opcode { + * no further manipulation from device. + * + * IONIC_TXQ_DESC_OPCODE_CSUM_PARTIAL: +- * + * Offload 16-bit L4 checksum + * calculation/insertion. The device will + * calculate the L4 checksum value and +@@ -640,14 +654,16 @@ enum ionic_txq_desc_opcode { + * is calculated starting at @csum_start bytes + * into the packet to the end of the packet. + * The checksum insertion position is given +- * in @csum_offset. This feature is only +- * applicable to protocols such as TCP, UDP +- * and ICMP where a standard (i.e. the +- * 'IP-style' checksum) one's complement +- * 16-bit checksum is used, using an IP +- * pseudo-header to seed the calculation. +- * Software will preload the L4 checksum +- * field with the IP pseudo-header checksum. ++ * in @csum_offset, which is the offset from ++ * @csum_start to the checksum field in the L4 ++ * header. This feature is only applicable to ++ * protocols such as TCP, UDP and ICMP where a ++ * standard (i.e. the 'IP-style' checksum) ++ * one's complement 16-bit checksum is used, ++ * using an IP pseudo-header to seed the ++ * calculation. Software will preload the L4 ++ * checksum field with the IP pseudo-header ++ * checksum. + * + * For tunnel encapsulation, @csum_start and + * @csum_offset refer to the inner L4 +@@ -663,7 +679,6 @@ enum ionic_txq_desc_opcode { + * offloads.txt for more info). + * + * IONIC_TXQ_DESC_OPCODE_CSUM_HW: +- * + * Offload 16-bit checksum computation to hardware. + * If @csum_l3 is set then the packet's L3 checksum is + * updated. Similarly, if @csum_l4 is set the the L4 +@@ -671,7 +686,6 @@ enum ionic_txq_desc_opcode { + * checksums are also updated. + * + * IONIC_TXQ_DESC_OPCODE_TSO: +- * + * Device preforms TCP segmentation offload + * (TSO). @hdr_len is the number of bytes + * to the end of TCP header (the offset to +@@ -698,40 +712,41 @@ enum ionic_txq_desc_opcode { + * clear CWR in remaining segments. + * @flags: + * vlan: +- * Insert an L2 VLAN header using @vlan_tci. ++ * Insert an L2 VLAN header using @vlan_tci + * encap: +- * Calculate encap header checksum. ++ * Calculate encap header checksum + * csum_l3: +- * Compute L3 header checksum. ++ * Compute L3 header checksum + * csum_l4: +- * Compute L4 header checksum. ++ * Compute L4 header checksum + * tso_sot: + * TSO start + * tso_eot: + * TSO end + * @num_sg_elems: Number of scatter-gather elements in SG + * descriptor +- * @addr: First data buffer's DMA address. +- * (Subsequent data buffers are on txq_sg_desc). ++ * @addr: First data buffer's DMA address ++ * (Subsequent data buffers are on txq_sg_desc) + * @len: First data buffer's length, in bytes + * @vlan_tci: VLAN tag to insert in the packet (if requested + * by @V-bit). Includes .1p and .1q tags + * @hdr_len: Length of packet headers, including +- * encapsulating outer header, if applicable. +- * Valid for opcodes TXQ_DESC_OPCODE_CALC_CSUM and +- * TXQ_DESC_OPCODE_TSO. Should be set to zero for ++ * encapsulating outer header, if applicable ++ * Valid for opcodes IONIC_TXQ_DESC_OPCODE_CALC_CSUM and ++ * IONIC_TXQ_DESC_OPCODE_TSO. Should be set to zero for + * all other modes. For +- * TXQ_DESC_OPCODE_CALC_CSUM, @hdr_len is length ++ * IONIC_TXQ_DESC_OPCODE_CALC_CSUM, @hdr_len is length + * of headers up to inner-most L4 header. For +- * TXQ_DESC_OPCODE_TSO, @hdr_len is up to ++ * IONIC_TXQ_DESC_OPCODE_TSO, @hdr_len is up to + * inner-most L4 payload, so inclusive of + * inner-most L4 header. +- * @mss: Desired MSS value for TSO. Only applicable for +- * TXQ_DESC_OPCODE_TSO. +- * @csum_start: Offset into inner-most L3 header of checksum +- * @csum_offset: Offset into inner-most L4 header of checksum ++ * @mss: Desired MSS value for TSO; only applicable for ++ * IONIC_TXQ_DESC_OPCODE_TSO ++ * @csum_start: Offset from packet to first byte checked in L4 checksum ++ * @csum_offset: Offset from csum_start to L4 checksum field + */ +- ++struct ionic_txq_desc { ++ __le64 cmd; + #define IONIC_TXQ_DESC_OPCODE_MASK 0xf + #define IONIC_TXQ_DESC_OPCODE_SHIFT 4 + #define IONIC_TXQ_DESC_FLAGS_MASK 0xf +@@ -753,8 +768,6 @@ enum ionic_txq_desc_opcode { + #define IONIC_TXQ_DESC_FLAG_TSO_SOT 0x4 + #define IONIC_TXQ_DESC_FLAG_TSO_EOT 0x8 + +-struct ionic_txq_desc { +- __le64 cmd; + __le16 len; + union { + __le16 vlan_tci; +@@ -823,10 +836,9 @@ struct ionic_txq_sg_desc_v1 { + + /** + * struct ionic_txq_comp - Ethernet transmit queue completion descriptor +- * @status: The status of the command (enum status_code) +- * @comp_index: The index in the descriptor ring for which this +- * is the completion. +- * @color: Color bit. ++ * @status: Status of the command (enum ionic_status_code) ++ * @comp_index: Index in the descriptor ring for which this is the completion ++ * @color: Color bit + */ + struct ionic_txq_comp { + u8 status; +@@ -843,16 +855,15 @@ enum ionic_rxq_desc_opcode { + + /** + * struct ionic_rxq_desc - Ethernet Rx queue descriptor format +- * @opcode: Rx operation, see RXQ_DESC_OPCODE_*: +- * +- * RXQ_DESC_OPCODE_SIMPLE: ++ * @opcode: Rx operation, see IONIC_RXQ_DESC_OPCODE_*: + * ++ * IONIC_RXQ_DESC_OPCODE_SIMPLE: + * Receive full packet into data buffer + * starting at @addr. Results of + * receive, including actual bytes received, + * are recorded in Rx completion descriptor. + * +- * @len: Data buffer's length, in bytes. ++ * @len: Data buffer's length, in bytes + * @addr: Data buffer's DMA address + */ + struct ionic_rxq_desc { +@@ -863,7 +874,7 @@ struct ionic_rxq_desc { + }; + + /** +- * struct ionic_rxq_sg_desc - Receive scatter-gather (SG) descriptor element ++ * struct ionic_rxq_sg_elem - Receive scatter-gather (SG) descriptor element + * @addr: DMA address of SG element data buffer + * @len: Length of SG element data buffer, in bytes + */ +@@ -885,12 +896,11 @@ struct ionic_rxq_sg_desc { + + /** + * struct ionic_rxq_comp - Ethernet receive queue completion descriptor +- * @status: The status of the command (enum status_code) ++ * @status: Status of the command (enum ionic_status_code) + * @num_sg_elems: Number of SG elements used by this descriptor +- * @comp_index: The index in the descriptor ring for which this +- * is the completion. ++ * @comp_index: Index in the descriptor ring for which this is the completion + * @rss_hash: 32-bit RSS hash +- * @csum: 16-bit sum of the packet's L2 payload. ++ * @csum: 16-bit sum of the packet's L2 payload + * If the packet's L2 payload is odd length, an extra + * zero-value byte is included in the @csum calculation but + * not included in @len. +@@ -898,33 +908,51 @@ struct ionic_rxq_sg_desc { + * set. Includes .1p and .1q tags. + * @len: Received packet length, in bytes. Excludes FCS. + * @csum_calc L2 payload checksum is computed or not +- * @csum_tcp_ok: The TCP checksum calculated by the device +- * matched the checksum in the receive packet's +- * TCP header +- * @csum_tcp_bad: The TCP checksum calculated by the device did +- * not match the checksum in the receive packet's +- * TCP header. +- * @csum_udp_ok: The UDP checksum calculated by the device +- * matched the checksum in the receive packet's +- * UDP header +- * @csum_udp_bad: The UDP checksum calculated by the device did +- * not match the checksum in the receive packet's +- * UDP header. +- * @csum_ip_ok: The IPv4 checksum calculated by the device +- * matched the checksum in the receive packet's +- * first IPv4 header. If the receive packet +- * contains both a tunnel IPv4 header and a +- * transport IPv4 header, the device validates the +- * checksum for the both IPv4 headers. +- * @csum_ip_bad: The IPv4 checksum calculated by the device did +- * not match the checksum in the receive packet's +- * first IPv4 header. If the receive packet +- * contains both a tunnel IPv4 header and a +- * transport IPv4 header, the device validates the +- * checksum for both IP headers. +- * @VLAN: VLAN header was stripped and placed in @vlan_tci. +- * @pkt_type: Packet type +- * @color: Color bit. ++ * @csum_flags: See IONIC_RXQ_COMP_CSUM_F_*: ++ * ++ * IONIC_RXQ_COMP_CSUM_F_TCP_OK: ++ * The TCP checksum calculated by the device ++ * matched the checksum in the receive packet's ++ * TCP header. ++ * ++ * IONIC_RXQ_COMP_CSUM_F_TCP_BAD: ++ * The TCP checksum calculated by the device did ++ * not match the checksum in the receive packet's ++ * TCP header. ++ * ++ * IONIC_RXQ_COMP_CSUM_F_UDP_OK: ++ * The UDP checksum calculated by the device ++ * matched the checksum in the receive packet's ++ * UDP header ++ * ++ * IONIC_RXQ_COMP_CSUM_F_UDP_BAD: ++ * The UDP checksum calculated by the device did ++ * not match the checksum in the receive packet's ++ * UDP header. ++ * ++ * IONIC_RXQ_COMP_CSUM_F_IP_OK: ++ * The IPv4 checksum calculated by the device ++ * matched the checksum in the receive packet's ++ * first IPv4 header. If the receive packet ++ * contains both a tunnel IPv4 header and a ++ * transport IPv4 header, the device validates the ++ * checksum for the both IPv4 headers. ++ * ++ * IONIC_RXQ_COMP_CSUM_F_IP_BAD: ++ * The IPv4 checksum calculated by the device did ++ * not match the checksum in the receive packet's ++ * first IPv4 header. If the receive packet ++ * contains both a tunnel IPv4 header and a ++ * transport IPv4 header, the device validates the ++ * checksum for both IP headers. ++ * ++ * IONIC_RXQ_COMP_CSUM_F_VLAN: ++ * The VLAN header was stripped and placed in @vlan_tci. ++ * ++ * IONIC_RXQ_COMP_CSUM_F_CALC: ++ * The checksum was calculated by the device. ++ * ++ * @pkt_type_color: Packet type and color bit; see IONIC_RXQ_COMP_PKT_TYPE_MASK + */ + struct ionic_rxq_comp { + u8 status; +@@ -971,8 +999,8 @@ enum ionic_eth_hw_features { + IONIC_ETH_HW_TSO_ECN = BIT(10), + IONIC_ETH_HW_TSO_GRE = BIT(11), + IONIC_ETH_HW_TSO_GRE_CSUM = BIT(12), +- IONIC_ETH_HW_TSO_IPXIP4 = BIT(13), +- IONIC_ETH_HW_TSO_IPXIP6 = BIT(14), ++ IONIC_ETH_HW_TSO_IPXIP4 = BIT(13), ++ IONIC_ETH_HW_TSO_IPXIP6 = BIT(14), + IONIC_ETH_HW_TSO_UDP = BIT(15), + IONIC_ETH_HW_TSO_UDP_CSUM = BIT(16), + }; +@@ -1003,7 +1031,10 @@ enum q_control_oper { + }; + + /** +- * Physical connection type ++ * enum ionic_phy_type - Physical connection type ++ * @IONIC_PHY_TYPE_NONE: No PHY installed ++ * @IONIC_PHY_TYPE_COPPER: Copper PHY ++ * @IONIC_PHY_TYPE_FIBER: Fiber PHY + */ + enum ionic_phy_type { + IONIC_PHY_TYPE_NONE = 0, +@@ -1012,18 +1043,23 @@ enum ionic_phy_type { + }; + + /** +- * Transceiver status ++ * enum ionic_xcvr_state - Transceiver status ++ * @IONIC_XCVR_STATE_REMOVED: Transceiver removed ++ * @IONIC_XCVR_STATE_INSERTED: Transceiver inserted ++ * @IONIC_XCVR_STATE_PENDING: Transceiver pending ++ * @IONIC_XCVR_STATE_SPROM_READ: Transceiver data read ++ * @IONIC_XCVR_STATE_SPROM_READ_ERR: Transceiver data read error + */ + enum ionic_xcvr_state { + IONIC_XCVR_STATE_REMOVED = 0, + IONIC_XCVR_STATE_INSERTED = 1, + IONIC_XCVR_STATE_PENDING = 2, + IONIC_XCVR_STATE_SPROM_READ = 3, +- IONIC_XCVR_STATE_SPROM_READ_ERR = 4, ++ IONIC_XCVR_STATE_SPROM_READ_ERR = 4, + }; + + /** +- * Supported link modes ++ * enum ionic_xcvr_pid - Supported link modes + */ + enum ionic_xcvr_pid { + IONIC_XCVR_PID_UNKNOWN = 0, +@@ -1057,64 +1093,83 @@ enum ionic_xcvr_pid { + IONIC_XCVR_PID_SFP_10GBASE_CU = 68, + IONIC_XCVR_PID_QSFP_100G_CWDM4 = 69, + IONIC_XCVR_PID_QSFP_100G_PSM4 = 70, ++ IONIC_XCVR_PID_SFP_25GBASE_ACC = 71, + }; + + /** +- * Port types ++ * enum ionic_port_type - Port types ++ * @IONIC_PORT_TYPE_NONE: Port type not configured ++ * @IONIC_PORT_TYPE_ETH: Port carries ethernet traffic (inband) ++ * @IONIC_PORT_TYPE_MGMT: Port carries mgmt traffic (out-of-band) + */ + enum ionic_port_type { +- IONIC_PORT_TYPE_NONE = 0, /* port type not configured */ +- IONIC_PORT_TYPE_ETH = 1, /* port carries ethernet traffic (inband) */ +- IONIC_PORT_TYPE_MGMT = 2, /* port carries mgmt traffic (out-of-band) */ ++ IONIC_PORT_TYPE_NONE = 0, ++ IONIC_PORT_TYPE_ETH = 1, ++ IONIC_PORT_TYPE_MGMT = 2, + }; + + /** +- * Port config state ++ * enum ionic_port_admin_state - Port config state ++ * @IONIC_PORT_ADMIN_STATE_NONE: Port admin state not configured ++ * @IONIC_PORT_ADMIN_STATE_DOWN: Port admin disabled ++ * @IONIC_PORT_ADMIN_STATE_UP: Port admin enabled + */ + enum ionic_port_admin_state { +- IONIC_PORT_ADMIN_STATE_NONE = 0, /* port admin state not configured */ +- IONIC_PORT_ADMIN_STATE_DOWN = 1, /* port is admin disabled */ +- IONIC_PORT_ADMIN_STATE_UP = 2, /* port is admin enabled */ ++ IONIC_PORT_ADMIN_STATE_NONE = 0, ++ IONIC_PORT_ADMIN_STATE_DOWN = 1, ++ IONIC_PORT_ADMIN_STATE_UP = 2, + }; + + /** +- * Port operational status ++ * enum ionic_port_oper_status - Port operational status ++ * @IONIC_PORT_OPER_STATUS_NONE: Port disabled ++ * @IONIC_PORT_OPER_STATUS_UP: Port link status up ++ * @IONIC_PORT_OPER_STATUS_DOWN: Port link status down + */ + enum ionic_port_oper_status { +- IONIC_PORT_OPER_STATUS_NONE = 0, /* port is disabled */ +- IONIC_PORT_OPER_STATUS_UP = 1, /* port is linked up */ +- IONIC_PORT_OPER_STATUS_DOWN = 2, /* port link status is down */ ++ IONIC_PORT_OPER_STATUS_NONE = 0, ++ IONIC_PORT_OPER_STATUS_UP = 1, ++ IONIC_PORT_OPER_STATUS_DOWN = 2, + }; + + /** +- * Ethernet Forward error correction (fec) modes ++ * enum ionic_port_fec_type - Ethernet Forward error correction (FEC) modes ++ * @IONIC_PORT_FEC_TYPE_NONE: FEC Disabled ++ * @IONIC_PORT_FEC_TYPE_FC: FireCode FEC ++ * @IONIC_PORT_FEC_TYPE_RS: ReedSolomon FEC + */ + enum ionic_port_fec_type { +- IONIC_PORT_FEC_TYPE_NONE = 0, /* Disabled */ +- IONIC_PORT_FEC_TYPE_FC = 1, /* FireCode */ +- IONIC_PORT_FEC_TYPE_RS = 2, /* ReedSolomon */ ++ IONIC_PORT_FEC_TYPE_NONE = 0, ++ IONIC_PORT_FEC_TYPE_FC = 1, ++ IONIC_PORT_FEC_TYPE_RS = 2, + }; + + /** +- * Ethernet pause (flow control) modes ++ * enum ionic_port_pause_type - Ethernet pause (flow control) modes ++ * @IONIC_PORT_PAUSE_TYPE_NONE: Disable Pause ++ * @IONIC_PORT_PAUSE_TYPE_LINK: Link level pause ++ * @IONIC_PORT_PAUSE_TYPE_PFC: Priority-Flow Control + */ + enum ionic_port_pause_type { +- IONIC_PORT_PAUSE_TYPE_NONE = 0, /* Disable Pause */ +- IONIC_PORT_PAUSE_TYPE_LINK = 1, /* Link level pause */ +- IONIC_PORT_PAUSE_TYPE_PFC = 2, /* Priority-Flow control */ ++ IONIC_PORT_PAUSE_TYPE_NONE = 0, ++ IONIC_PORT_PAUSE_TYPE_LINK = 1, ++ IONIC_PORT_PAUSE_TYPE_PFC = 2, + }; + + /** +- * Loopback modes ++ * enum ionic_port_loopback_mode - Loopback modes ++ * @IONIC_PORT_LOOPBACK_MODE_NONE: Disable loopback ++ * @IONIC_PORT_LOOPBACK_MODE_MAC: MAC loopback ++ * @IONIC_PORT_LOOPBACK_MODE_PHY: PHY/SerDes loopback + */ + enum ionic_port_loopback_mode { +- IONIC_PORT_LOOPBACK_MODE_NONE = 0, /* Disable loopback */ +- IONIC_PORT_LOOPBACK_MODE_MAC = 1, /* MAC loopback */ +- IONIC_PORT_LOOPBACK_MODE_PHY = 2, /* PHY/Serdes loopback */ ++ IONIC_PORT_LOOPBACK_MODE_NONE = 0, ++ IONIC_PORT_LOOPBACK_MODE_MAC = 1, ++ IONIC_PORT_LOOPBACK_MODE_PHY = 2, + }; + + /** +- * Transceiver Status information ++ * struct ionic_xcvr_status - Transceiver Status information + * @state: Transceiver status (enum ionic_xcvr_state) + * @phy: Physical connection type (enum ionic_phy_type) + * @pid: Transceiver link mode (enum pid) +@@ -1128,7 +1183,7 @@ struct ionic_xcvr_status { + }; + + /** +- * Port configuration ++ * union ionic_port_config - Port configuration + * @speed: port speed (in Mbps) + * @mtu: mtu + * @state: port admin state (enum port_admin_state) +@@ -1161,17 +1216,21 @@ union ionic_port_config { + }; + + /** +- * Port Status information ++ * struct ionic_port_status - Port Status information + * @status: link status (enum ionic_port_oper_status) + * @id: port id + * @speed: link speed (in Mbps) ++ * @link_down_count: number of times link went from from up to down ++ * @fec_type: fec type (enum ionic_port_fec_type) + * @xcvr: tranceiver status + */ + struct ionic_port_status { + __le32 id; + __le32 speed; + u8 status; +- u8 rsvd[51]; ++ __le16 link_down_count; ++ u8 fec_type; ++ u8 rsvd[48]; + struct ionic_xcvr_status xcvr; + } __packed; + +@@ -1190,7 +1249,7 @@ struct ionic_port_identify_cmd { + + /** + * struct ionic_port_identify_comp - Port identify command completion +- * @status: The status of the command (enum status_code) ++ * @status: Status of the command (enum ionic_status_code) + * @ver: Version of identify returned by device + */ + struct ionic_port_identify_comp { +@@ -1215,7 +1274,7 @@ struct ionic_port_init_cmd { + + /** + * struct ionic_port_init_comp - Port initialization command completion +- * @status: The status of the command (enum status_code) ++ * @status: Status of the command (enum ionic_status_code) + */ + struct ionic_port_init_comp { + u8 status; +@@ -1235,7 +1294,7 @@ struct ionic_port_reset_cmd { + + /** + * struct ionic_port_reset_comp - Port reset command completion +- * @status: The status of the command (enum status_code) ++ * @status: Status of the command (enum ionic_status_code) + */ + struct ionic_port_reset_comp { + u8 status; +@@ -1243,15 +1302,23 @@ struct ionic_port_reset_comp { + }; + + /** +- * enum stats_ctl_cmd - List of commands for stats control ++ * enum ionic_stats_ctl_cmd - List of commands for stats control ++ * @IONIC_STATS_CTL_RESET: Reset statistics + */ + enum ionic_stats_ctl_cmd { + IONIC_STATS_CTL_RESET = 0, + }; + +- + /** + * enum ionic_port_attr - List of device attributes ++ * @IONIC_PORT_ATTR_STATE: Port state attribute ++ * @IONIC_PORT_ATTR_SPEED: Port speed attribute ++ * @IONIC_PORT_ATTR_MTU: Port MTU attribute ++ * @IONIC_PORT_ATTR_AUTONEG: Port autonegotation attribute ++ * @IONIC_PORT_ATTR_FEC: Port FEC attribute ++ * @IONIC_PORT_ATTR_PAUSE: Port pause attribute ++ * @IONIC_PORT_ATTR_LOOPBACK: Port loopback attribute ++ * @IONIC_PORT_ATTR_STATS_CTRL: Port statistics control attribute + */ + enum ionic_port_attr { + IONIC_PORT_ATTR_STATE = 0, +@@ -1266,9 +1333,17 @@ enum ionic_port_attr { + + /** + * struct ionic_port_setattr_cmd - Set port attributes on the NIC +- * @opcode: Opcode +- * @index: port index +- * @attr: Attribute type (enum ionic_port_attr) ++ * @opcode: Opcode ++ * @index: Port index ++ * @attr: Attribute type (enum ionic_port_attr) ++ * @state: Port state ++ * @speed: Port speed ++ * @mtu: Port MTU ++ * @an_enable: Port autonegotiation setting ++ * @fec_type: Port FEC type setting ++ * @pause_type: Port pause type setting ++ * @loopback_mode: Port loopback mode ++ * @stats_ctl: Port stats setting + */ + struct ionic_port_setattr_cmd { + u8 opcode; +@@ -1283,14 +1358,14 @@ struct ionic_port_setattr_cmd { + u8 fec_type; + u8 pause_type; + u8 loopback_mode; +- u8 stats_ctl; ++ u8 stats_ctl; + u8 rsvd2[60]; + }; + }; + + /** + * struct ionic_port_setattr_comp - Port set attr command completion +- * @status: The status of the command (enum status_code) ++ * @status: Status of the command (enum ionic_status_code) + * @color: Color bit + */ + struct ionic_port_setattr_comp { +@@ -1314,8 +1389,15 @@ struct ionic_port_getattr_cmd { + + /** + * struct ionic_port_getattr_comp - Port get attr command completion +- * @status: The status of the command (enum status_code) +- * @color: Color bit ++ * @status: Status of the command (enum ionic_status_code) ++ * @state: Port state ++ * @speed: Port speed ++ * @mtu: Port MTU ++ * @an_enable: Port autonegotiation setting ++ * @fec_type: Port FEC type setting ++ * @pause_type: Port pause type setting ++ * @loopback_mode: Port loopback mode ++ * @color: Color bit + */ + struct ionic_port_getattr_comp { + u8 status; +@@ -1334,12 +1416,12 @@ struct ionic_port_getattr_comp { + }; + + /** +- * struct ionic_lif_status - Lif status register ++ * struct ionic_lif_status - LIF status register + * @eid: most recent NotifyQ event id +- * @port_num: port the lif is connected to ++ * @port_num: port the LIF is connected to + * @link_status: port status (enum ionic_port_oper_status) + * @link_speed: speed of link in Mbps +- * @link_down_count: number of times link status changes ++ * @link_down_count: number of times link went from up to down + */ + struct ionic_lif_status { + __le64 eid; +@@ -1373,6 +1455,9 @@ enum ionic_dev_state { + + /** + * enum ionic_dev_attr - List of device attributes ++ * @IONIC_DEV_ATTR_STATE: Device state attribute ++ * @IONIC_DEV_ATTR_NAME: Device name attribute ++ * @IONIC_DEV_ATTR_FEATURES: Device feature attributes + */ + enum ionic_dev_attr { + IONIC_DEV_ATTR_STATE = 0, +@@ -1402,7 +1487,7 @@ struct ionic_dev_setattr_cmd { + + /** + * struct ionic_dev_setattr_comp - Device set attr command completion +- * @status: The status of the command (enum status_code) ++ * @status: Status of the command (enum ionic_status_code) + * @features: Device features + * @color: Color bit + */ +@@ -1429,7 +1514,7 @@ struct ionic_dev_getattr_cmd { + + /** + * struct ionic_dev_setattr_comp - Device set attr command completion +- * @status: The status of the command (enum status_code) ++ * @status: Status of the command (enum ionic_status_code) + * @features: Device features + * @color: Color bit + */ +@@ -1459,6 +1544,13 @@ enum ionic_rss_hash_types { + + /** + * enum ionic_lif_attr - List of LIF attributes ++ * @IONIC_LIF_ATTR_STATE: LIF state attribute ++ * @IONIC_LIF_ATTR_NAME: LIF name attribute ++ * @IONIC_LIF_ATTR_MTU: LIF MTU attribute ++ * @IONIC_LIF_ATTR_MAC: LIF MAC attribute ++ * @IONIC_LIF_ATTR_FEATURES: LIF features attribute ++ * @IONIC_LIF_ATTR_RSS: LIF RSS attribute ++ * @IONIC_LIF_ATTR_STATS_CTRL: LIF statistics control attribute + */ + enum ionic_lif_attr { + IONIC_LIF_ATTR_STATE = 0, +@@ -1473,18 +1565,18 @@ enum ionic_lif_attr { + /** + * struct ionic_lif_setattr_cmd - Set LIF attributes on the NIC + * @opcode: Opcode +- * @type: Attribute type (enum ionic_lif_attr) ++ * @attr: Attribute type (enum ionic_lif_attr) + * @index: LIF index +- * @state: lif state (enum lif_state) ++ * @state: LIF state (enum ionic_lif_state) + * @name: The netdev name string, 0 terminated + * @mtu: Mtu + * @mac: Station mac + * @features: Features (enum ionic_eth_hw_features) + * @rss: RSS properties +- * @types: The hash types to enable (see rss_hash_types). +- * @key: The hash secret key. +- * @addr: Address for the indirection table shared memory. +- * @stats_ctl: stats control commands (enum stats_ctl_cmd) ++ * @types: The hash types to enable (see rss_hash_types) ++ * @key: The hash secret key ++ * @addr: Address for the indirection table shared memory ++ * @stats_ctl: stats control commands (enum ionic_stats_ctl_cmd) + */ + struct ionic_lif_setattr_cmd { + u8 opcode; +@@ -1502,16 +1594,15 @@ struct ionic_lif_setattr_cmd { + u8 rsvd[6]; + __le64 addr; + } rss; +- u8 stats_ctl; ++ u8 stats_ctl; + u8 rsvd[60]; + } __packed; + }; + + /** + * struct ionic_lif_setattr_comp - LIF set attr command completion +- * @status: The status of the command (enum status_code) +- * @comp_index: The index in the descriptor ring for which this +- * is the completion. ++ * @status: Status of the command (enum ionic_status_code) ++ * @comp_index: Index in the descriptor ring for which this is the completion + * @features: features (enum ionic_eth_hw_features) + * @color: Color bit + */ +@@ -1541,10 +1632,9 @@ struct ionic_lif_getattr_cmd { + + /** + * struct ionic_lif_getattr_comp - LIF get attr command completion +- * @status: The status of the command (enum status_code) +- * @comp_index: The index in the descriptor ring for which this +- * is the completion. +- * @state: lif state (enum lif_state) ++ * @status: Status of the command (enum ionic_status_code) ++ * @comp_index: Index in the descriptor ring for which this is the completion ++ * @state: LIF state (enum ionic_lif_state) + * @name: The netdev name string, 0 terminated + * @mtu: Mtu + * @mac: Station mac +@@ -1566,11 +1656,12 @@ struct ionic_lif_getattr_comp { + }; + + enum ionic_rx_mode { +- IONIC_RX_MODE_F_UNICAST = BIT(0), +- IONIC_RX_MODE_F_MULTICAST = BIT(1), +- IONIC_RX_MODE_F_BROADCAST = BIT(2), +- IONIC_RX_MODE_F_PROMISC = BIT(3), +- IONIC_RX_MODE_F_ALLMULTI = BIT(4), ++ IONIC_RX_MODE_F_UNICAST = BIT(0), ++ IONIC_RX_MODE_F_MULTICAST = BIT(1), ++ IONIC_RX_MODE_F_BROADCAST = BIT(2), ++ IONIC_RX_MODE_F_PROMISC = BIT(3), ++ IONIC_RX_MODE_F_ALLMULTI = BIT(4), ++ IONIC_RX_MODE_F_RDMA_SNIFFER = BIT(5), + }; + + /** +@@ -1578,11 +1669,12 @@ enum ionic_rx_mode { + * @opcode: opcode + * @lif_index: LIF index + * @rx_mode: Rx mode flags: +- * IONIC_RX_MODE_F_UNICAST: Accept known unicast packets. +- * IONIC_RX_MODE_F_MULTICAST: Accept known multicast packets. +- * IONIC_RX_MODE_F_BROADCAST: Accept broadcast packets. +- * IONIC_RX_MODE_F_PROMISC: Accept any packets. +- * IONIC_RX_MODE_F_ALLMULTI: Accept any multicast packets. ++ * IONIC_RX_MODE_F_UNICAST: Accept known unicast packets ++ * IONIC_RX_MODE_F_MULTICAST: Accept known multicast packets ++ * IONIC_RX_MODE_F_BROADCAST: Accept broadcast packets ++ * IONIC_RX_MODE_F_PROMISC: Accept any packets ++ * IONIC_RX_MODE_F_ALLMULTI: Accept any multicast packets ++ * IONIC_RX_MODE_F_RDMA_SNIFFER: Sniff RDMA packets + */ + struct ionic_rx_mode_set_cmd { + u8 opcode; +@@ -1606,9 +1698,14 @@ enum ionic_rx_filter_match_type { + * @qtype: Queue type + * @lif_index: LIF index + * @qid: Queue ID +- * @match: Rx filter match type. (See IONIC_RX_FILTER_MATCH_xxx) +- * @vlan: VLAN ID +- * @addr: MAC address (network-byte order) ++ * @match: Rx filter match type (see IONIC_RX_FILTER_MATCH_xxx) ++ * @vlan: VLAN filter ++ * @vlan: VLAN ID ++ * @mac: MAC filter ++ * @addr: MAC address (network-byte order) ++ * @mac_vlan: MACVLAN filter ++ * @vlan: VLAN ID ++ * @addr: MAC address (network-byte order) + */ + struct ionic_rx_filter_add_cmd { + u8 opcode; +@@ -1633,11 +1730,10 @@ struct ionic_rx_filter_add_cmd { + + /** + * struct ionic_rx_filter_add_comp - Add LIF Rx filter command completion +- * @status: The status of the command (enum status_code) +- * @comp_index: The index in the descriptor ring for which this +- * is the completion. ++ * @status: Status of the command (enum ionic_status_code) ++ * @comp_index: Index in the descriptor ring for which this is the completion + * @filter_id: Filter ID +- * @color: Color bit. ++ * @color: Color bit + */ + struct ionic_rx_filter_add_comp { + u8 status; +@@ -1664,63 +1760,6 @@ struct ionic_rx_filter_del_cmd { + + typedef struct ionic_admin_comp ionic_rx_filter_del_comp; + +-/** +- * struct ionic_qos_identify_cmd - QoS identify command +- * @opcode: opcode +- * @ver: Highest version of identify supported by driver +- * +- */ +-struct ionic_qos_identify_cmd { +- u8 opcode; +- u8 ver; +- u8 rsvd[62]; +-}; +- +-/** +- * struct ionic_qos_identify_comp - QoS identify command completion +- * @status: The status of the command (enum status_code) +- * @ver: Version of identify returned by device +- */ +-struct ionic_qos_identify_comp { +- u8 status; +- u8 ver; +- u8 rsvd[14]; +-}; +- +-#define IONIC_QOS_CLASS_MAX 7 +-#define IONIC_QOS_CLASS_NAME_SZ 32 +-#define IONIC_QOS_DSCP_MAX_VALUES 64 +- +-/** +- * enum ionic_qos_class +- */ +-enum ionic_qos_class { +- IONIC_QOS_CLASS_DEFAULT = 0, +- IONIC_QOS_CLASS_USER_DEFINED_1 = 1, +- IONIC_QOS_CLASS_USER_DEFINED_2 = 2, +- IONIC_QOS_CLASS_USER_DEFINED_3 = 3, +- IONIC_QOS_CLASS_USER_DEFINED_4 = 4, +- IONIC_QOS_CLASS_USER_DEFINED_5 = 5, +- IONIC_QOS_CLASS_USER_DEFINED_6 = 6, +-}; +- +-/** +- * enum ionic_qos_class_type - Traffic classification criteria +- */ +-enum ionic_qos_class_type { +- IONIC_QOS_CLASS_TYPE_NONE = 0, +- IONIC_QOS_CLASS_TYPE_PCP = 1, /* Dot1Q pcp */ +- IONIC_QOS_CLASS_TYPE_DSCP = 2, /* IP dscp */ +-}; +- +-/** +- * enum ionic_qos_sched_type - Qos class scheduling type +- */ +-enum ionic_qos_sched_type { +- IONIC_QOS_SCHED_TYPE_STRICT = 0, /* Strict priority */ +- IONIC_QOS_SCHED_TYPE_DWRR = 1, /* Deficit weighted round-robin */ +-}; +- + enum ionic_vf_attr { + IONIC_VF_ATTR_SPOOFCHK = 1, + IONIC_VF_ATTR_TRUST = 2, +@@ -1732,26 +1771,29 @@ enum ionic_vf_attr { + }; + + /** +- * VF link status ++ * enum ionic_vf_link_status - Virtual Function link status ++ * @IONIC_VF_LINK_STATUS_AUTO: Use link state of the uplink ++ * @IONIC_VF_LINK_STATUS_UP: Link always up ++ * @IONIC_VF_LINK_STATUS_DOWN: Link always down + */ + enum ionic_vf_link_status { +- IONIC_VF_LINK_STATUS_AUTO = 0, /* link state of the uplink */ +- IONIC_VF_LINK_STATUS_UP = 1, /* link is always up */ +- IONIC_VF_LINK_STATUS_DOWN = 2, /* link is always down */ ++ IONIC_VF_LINK_STATUS_AUTO = 0, ++ IONIC_VF_LINK_STATUS_UP = 1, ++ IONIC_VF_LINK_STATUS_DOWN = 2, + }; + + /** + * struct ionic_vf_setattr_cmd - Set VF attributes on the NIC + * @opcode: Opcode +- * @index: VF index + * @attr: Attribute type (enum ionic_vf_attr) +- * macaddr mac address +- * vlanid vlan ID +- * maxrate max Tx rate in Mbps +- * spoofchk enable address spoof checking +- * trust enable VF trust +- * linkstate set link up or down +- * stats_pa set DMA address for VF stats ++ * @vf_index: VF index ++ * @macaddr: mac address ++ * @vlanid: vlan ID ++ * @maxrate: max Tx rate in Mbps ++ * @spoofchk: enable address spoof checking ++ * @trust: enable VF trust ++ * @linkstate: set link up or down ++ * @stats_pa: set DMA address for VF stats + */ + struct ionic_vf_setattr_cmd { + u8 opcode; +@@ -1781,8 +1823,8 @@ struct ionic_vf_setattr_comp { + /** + * struct ionic_vf_getattr_cmd - Get VF attributes from the NIC + * @opcode: Opcode +- * @index: VF index + * @attr: Attribute type (enum ionic_vf_attr) ++ * @vf_index: VF index + */ + struct ionic_vf_getattr_cmd { + u8 opcode; +@@ -1809,19 +1851,85 @@ struct ionic_vf_getattr_comp { + }; + + /** +- * union ionic_qos_config - Qos configuration structure ++ * struct ionic_qos_identify_cmd - QoS identify command ++ * @opcode: opcode ++ * @ver: Highest version of identify supported by driver ++ * ++ */ ++struct ionic_qos_identify_cmd { ++ u8 opcode; ++ u8 ver; ++ u8 rsvd[62]; ++}; ++ ++/** ++ * struct ionic_qos_identify_comp - QoS identify command completion ++ * @status: Status of the command (enum ionic_status_code) ++ * @ver: Version of identify returned by device ++ */ ++struct ionic_qos_identify_comp { ++ u8 status; ++ u8 ver; ++ u8 rsvd[14]; ++}; ++ ++#define IONIC_QOS_TC_MAX 8 ++/* Capri max supported, should be renamed. */ ++#define IONIC_QOS_CLASS_MAX 7 ++#define IONIC_QOS_PCP_MAX 8 ++#define IONIC_QOS_CLASS_NAME_SZ 32 ++#define IONIC_QOS_DSCP_MAX 64 ++#define IONIC_QOS_ALL_PCP 0xFF ++ ++/** ++ * enum ionic_qos_class ++ */ ++enum ionic_qos_class { ++ IONIC_QOS_CLASS_DEFAULT = 0, ++ IONIC_QOS_CLASS_USER_DEFINED_1 = 1, ++ IONIC_QOS_CLASS_USER_DEFINED_2 = 2, ++ IONIC_QOS_CLASS_USER_DEFINED_3 = 3, ++ IONIC_QOS_CLASS_USER_DEFINED_4 = 4, ++ IONIC_QOS_CLASS_USER_DEFINED_5 = 5, ++ IONIC_QOS_CLASS_USER_DEFINED_6 = 6, ++}; ++ ++/** ++ * enum ionic_qos_class_type - Traffic classification criteria ++ * @IONIC_QOS_CLASS_TYPE_NONE: No QoS ++ * @IONIC_QOS_CLASS_TYPE_PCP: Dot1Q PCP ++ * @IONIC_QOS_CLASS_TYPE_DSCP: IP DSCP ++ */ ++enum ionic_qos_class_type { ++ IONIC_QOS_CLASS_TYPE_NONE = 0, ++ IONIC_QOS_CLASS_TYPE_PCP = 1, ++ IONIC_QOS_CLASS_TYPE_DSCP = 2, ++}; ++ ++/** ++ * enum ionic_qos_sched_type - QoS class scheduling type ++ * @IONIC_QOS_SCHED_TYPE_STRICT: Strict priority ++ * @IONIC_QOS_SCHED_TYPE_DWRR: Deficit weighted round-robin ++ */ ++enum ionic_qos_sched_type { ++ IONIC_QOS_SCHED_TYPE_STRICT = 0, ++ IONIC_QOS_SCHED_TYPE_DWRR = 1, ++}; ++ ++/** ++ * union ionic_qos_config - QoS configuration structure + * @flags: Configuration flags + * IONIC_QOS_CONFIG_F_ENABLE enable +- * IONIC_QOS_CONFIG_F_DROP drop/nodrop ++ * IONIC_QOS_CONFIG_F_NO_DROP drop/nodrop + * IONIC_QOS_CONFIG_F_RW_DOT1Q_PCP enable dot1q pcp rewrite + * IONIC_QOS_CONFIG_F_RW_IP_DSCP enable ip dscp rewrite +- * @sched_type: Qos class scheduling type (enum ionic_qos_sched_type) +- * @class_type: Qos class type (enum ionic_qos_class_type) +- * @pause_type: Qos pause type (enum ionic_qos_pause_type) +- * @name: Qos class name ++ * @sched_type: QoS class scheduling type (enum ionic_qos_sched_type) ++ * @class_type: QoS class type (enum ionic_qos_class_type) ++ * @pause_type: QoS pause type (enum ionic_qos_pause_type) ++ * @name: QoS class name + * @mtu: MTU of the class +- * @pfc_dot1q_pcp: Pcp value for pause frames (valid iff F_NODROP) +- * @dwrr_weight: Qos class scheduling weight ++ * @pfc_cos: Priority-Flow Control class of service ++ * @dwrr_weight: QoS class scheduling weight + * @strict_rlmt: Rate limit for strict priority scheduling + * @rw_dot1q_pcp: Rewrite dot1q pcp to this value (valid iff F_RW_DOT1Q_PCP) + * @rw_ip_dscp: Rewrite ip dscp to this value (valid iff F_RW_IP_DSCP) +@@ -1832,7 +1940,8 @@ struct ionic_vf_getattr_comp { + union ionic_qos_config { + struct { + #define IONIC_QOS_CONFIG_F_ENABLE BIT(0) +-#define IONIC_QOS_CONFIG_F_DROP BIT(1) ++#define IONIC_QOS_CONFIG_F_NO_DROP BIT(1) ++/* Used to rewrite PCP or DSCP value. */ + #define IONIC_QOS_CONFIG_F_RW_DOT1Q_PCP BIT(2) + #define IONIC_QOS_CONFIG_F_RW_IP_DSCP BIT(3) + u8 flags; +@@ -1849,6 +1958,7 @@ union ionic_qos_config { + __le64 strict_rlmt; + }; + /* marking */ ++ /* Used to rewrite PCP or DSCP value. */ + union { + u8 rw_dot1q_pcp; + u8 rw_ip_dscp; +@@ -1858,7 +1968,7 @@ union ionic_qos_config { + u8 dot1q_pcp; + struct { + u8 ndscp; +- u8 ip_dscp[IONIC_QOS_DSCP_MAX_VALUES]; ++ u8 ip_dscp[IONIC_QOS_DSCP_MAX]; + }; + }; + }; +@@ -1877,15 +1987,15 @@ union ionic_qos_identity { + u8 version; + u8 type; + u8 rsvd[62]; +- union ionic_qos_config config[IONIC_QOS_CLASS_MAX]; ++ union ionic_qos_config config[IONIC_QOS_CLASS_MAX]; + }; +- __le32 words[512]; ++ __le32 words[478]; + }; + + /** +- * struct qos_init_cmd - QoS config init command ++ * struct ionic_qos_init_cmd - QoS config init command + * @opcode: Opcode +- * @group: Qos class id ++ * @group: QoS class id + * @info_pa: destination address for qos info + */ + struct ionic_qos_init_cmd { +@@ -1899,8 +2009,9 @@ struct ionic_qos_init_cmd { + typedef struct ionic_admin_comp ionic_qos_init_comp; + + /** +- * struct ionic_qos_reset_cmd - Qos config reset command ++ * struct ionic_qos_reset_cmd - QoS config reset command + * @opcode: Opcode ++ * @group: QoS class id + */ + struct ionic_qos_reset_cmd { + u8 opcode; +@@ -1927,10 +2038,16 @@ struct ionic_fw_download_cmd { + + typedef struct ionic_admin_comp ionic_fw_download_comp; + ++/** ++ * enum ionic_fw_control_oper - FW control operations ++ * @IONIC_FW_RESET: Reset firmware ++ * @IONIC_FW_INSTALL: Install firmware ++ * @IONIC_FW_ACTIVATE: Activate firmware ++ */ + enum ionic_fw_control_oper { +- IONIC_FW_RESET = 0, /* Reset firmware */ +- IONIC_FW_INSTALL = 1, /* Install firmware */ +- IONIC_FW_ACTIVATE = 2, /* Activate firmware */ ++ IONIC_FW_RESET = 0, ++ IONIC_FW_INSTALL = 1, ++ IONIC_FW_ACTIVATE = 2, + }; + + /** +@@ -1949,8 +2066,10 @@ struct ionic_fw_control_cmd { + + /** + * struct ionic_fw_control_comp - Firmware control copletion +- * @opcode: opcode +- * @slot: slot where the firmware was installed ++ * @status: Status of the command (enum ionic_status_code) ++ * @comp_index: Index in the descriptor ring for which this is the completion ++ * @slot: Slot where the firmware was installed ++ * @color: Color bit + */ + struct ionic_fw_control_comp { + u8 status; +@@ -1968,11 +2087,11 @@ struct ionic_fw_control_comp { + /** + * struct ionic_rdma_reset_cmd - Reset RDMA LIF cmd + * @opcode: opcode +- * @lif_index: lif index ++ * @lif_index: LIF index + * +- * There is no rdma specific dev command completion struct. Completion uses ++ * There is no RDMA specific dev command completion struct. Completion uses + * the common struct ionic_admin_comp. Only the status is indicated. +- * Nonzero status means the LIF does not support rdma. ++ * Nonzero status means the LIF does not support RDMA. + **/ + struct ionic_rdma_reset_cmd { + u8 opcode; +@@ -1984,30 +2103,29 @@ struct ionic_rdma_reset_cmd { + /** + * struct ionic_rdma_queue_cmd - Create RDMA Queue command + * @opcode: opcode, 52, 53 +- * @lif_index lif index +- * @qid_ver: (qid | (rdma version << 24)) ++ * @lif_index: LIF index ++ * @qid_ver: (qid | (RDMA version << 24)) + * @cid: intr, eq_id, or cq_id + * @dbid: doorbell page id + * @depth_log2: log base two of queue depth + * @stride_log2: log base two of queue stride + * @dma_addr: address of the queue memory +- * @xxx_table_index: temporary, but should not need pgtbl for contig. queues. + * +- * The same command struct is used to create an rdma event queue, completion +- * queue, or rdma admin queue. The cid is an interrupt number for an event ++ * The same command struct is used to create an RDMA event queue, completion ++ * queue, or RDMA admin queue. The cid is an interrupt number for an event + * queue, an event queue id for a completion queue, or a completion queue id +- * for an rdma admin queue. ++ * for an RDMA admin queue. + * + * The queue created via a dev command must be contiguous in dma space. + * + * The dev commands are intended only to be used during driver initialization, +- * to create queues supporting the rdma admin queue. Other queues, and other +- * types of rdma resources like memory regions, will be created and registered +- * via the rdma admin queue, and will support a more complete interface ++ * to create queues supporting the RDMA admin queue. Other queues, and other ++ * types of RDMA resources like memory regions, will be created and registered ++ * via the RDMA admin queue, and will support a more complete interface + * providing scatter gather lists for larger, scattered queue buffers and + * memory registration. + * +- * There is no rdma specific dev command completion struct. Completion uses ++ * There is no RDMA specific dev command completion struct. Completion uses + * the common struct ionic_admin_comp. Only the status is indicated. + **/ + struct ionic_rdma_queue_cmd { +@@ -2020,8 +2138,7 @@ struct ionic_rdma_queue_cmd { + u8 depth_log2; + u8 stride_log2; + __le64 dma_addr; +- u8 rsvd2[36]; +- __le32 xxx_table_index; ++ u8 rsvd2[40]; + }; + + /****************************************************************** +@@ -2029,7 +2146,7 @@ struct ionic_rdma_queue_cmd { + ******************************************************************/ + + /** +- * struct ionic_notifyq_event ++ * struct ionic_notifyq_event - Generic event reporting structure + * @eid: event number + * @ecode: event code + * @data: unspecified data about the event +@@ -2044,9 +2161,9 @@ struct ionic_notifyq_event { + }; + + /** +- * struct ionic_link_change_event ++ * struct ionic_link_change_event - Link change event notification + * @eid: event number +- * @ecode: event code = EVENT_OPCODE_LINK_CHANGE ++ * @ecode: event code = IONIC_EVENT_LINK_CHANGE + * @link_status: link up or down, with error bits (enum port_status) + * @link_speed: speed of the network link + * +@@ -2061,9 +2178,9 @@ struct ionic_link_change_event { + }; + + /** +- * struct ionic_reset_event ++ * struct ionic_reset_event - Reset event notification + * @eid: event number +- * @ecode: event code = EVENT_OPCODE_RESET ++ * @ecode: event code = IONIC_EVENT_RESET + * @reset_code: reset type + * @state: 0=pending, 1=complete, 2=error + * +@@ -2079,11 +2196,9 @@ struct ionic_reset_event { + }; + + /** +- * struct ionic_heartbeat_event ++ * struct ionic_heartbeat_event - Sent periodically by NIC to indicate health + * @eid: event number +- * @ecode: event code = EVENT_OPCODE_HEARTBEAT +- * +- * Sent periodically by the NIC to indicate continued health ++ * @ecode: event code = IONIC_EVENT_HEARTBEAT + */ + struct ionic_heartbeat_event { + __le64 eid; +@@ -2092,12 +2207,10 @@ struct ionic_heartbeat_event { + }; + + /** +- * struct ionic_log_event ++ * struct ionic_log_event - Sent to notify the driver of an internal error + * @eid: event number +- * @ecode: event code = EVENT_OPCODE_LOG ++ * @ecode: event code = IONIC_EVENT_LOG + * @data: log data +- * +- * Sent to notify the driver of an internal error. + */ + struct ionic_log_event { + __le64 eid; +@@ -2106,7 +2219,18 @@ struct ionic_log_event { + }; + + /** +- * struct ionic_port_stats ++ * struct ionic_xcvr_event - Transceiver change event ++ * @eid: event number ++ * @ecode: event code = IONIC_EVENT_XCVR ++ */ ++struct ionic_xcvr_event { ++ __le64 eid; ++ __le16 ecode; ++ u8 rsvd[54]; ++}; ++ ++/** ++ * struct ionic_port_stats - Port statistics structure + */ + struct ionic_port_stats { + __le64 frames_rx_ok; +@@ -2211,28 +2335,61 @@ struct ionic_mgmt_port_stats { + __le64 frames_rx_multicast; + __le64 frames_rx_broadcast; + __le64 frames_rx_pause; +- __le64 frames_rx_bad_length0; +- __le64 frames_rx_undersized1; +- __le64 frames_rx_oversized2; +- __le64 frames_rx_fragments3; +- __le64 frames_rx_jabber4; +- __le64 frames_rx_64b5; +- __le64 frames_rx_65b_127b6; +- __le64 frames_rx_128b_255b7; +- __le64 frames_rx_256b_511b8; +- __le64 frames_rx_512b_1023b9; +- __le64 frames_rx_1024b_1518b0; +- __le64 frames_rx_gt_1518b1; +- __le64 frames_rx_fifo_full2; +- __le64 frames_tx_ok3; +- __le64 frames_tx_all4; +- __le64 frames_tx_bad5; +- __le64 octets_tx_ok6; +- __le64 octets_tx_total7; +- __le64 frames_tx_unicast8; +- __le64 frames_tx_multicast9; +- __le64 frames_tx_broadcast0; +- __le64 frames_tx_pause1; ++ __le64 frames_rx_bad_length; ++ __le64 frames_rx_undersized; ++ __le64 frames_rx_oversized; ++ __le64 frames_rx_fragments; ++ __le64 frames_rx_jabber; ++ __le64 frames_rx_64b; ++ __le64 frames_rx_65b_127b; ++ __le64 frames_rx_128b_255b; ++ __le64 frames_rx_256b_511b; ++ __le64 frames_rx_512b_1023b; ++ __le64 frames_rx_1024b_1518b; ++ __le64 frames_rx_gt_1518b; ++ __le64 frames_rx_fifo_full; ++ __le64 frames_tx_ok; ++ __le64 frames_tx_all; ++ __le64 frames_tx_bad; ++ __le64 octets_tx_ok; ++ __le64 octets_tx_total; ++ __le64 frames_tx_unicast; ++ __le64 frames_tx_multicast; ++ __le64 frames_tx_broadcast; ++ __le64 frames_tx_pause; ++}; ++ ++enum ionic_pb_buffer_drop_stats { ++ IONIC_BUFFER_INTRINSIC_DROP = 0, ++ IONIC_BUFFER_DISCARDED, ++ IONIC_BUFFER_ADMITTED, ++ IONIC_BUFFER_OUT_OF_CELLS_DROP, ++ IONIC_BUFFER_OUT_OF_CELLS_DROP_2, ++ IONIC_BUFFER_OUT_OF_CREDIT_DROP, ++ IONIC_BUFFER_TRUNCATION_DROP, ++ IONIC_BUFFER_PORT_DISABLED_DROP, ++ IONIC_BUFFER_COPY_TO_CPU_TAIL_DROP, ++ IONIC_BUFFER_SPAN_TAIL_DROP, ++ IONIC_BUFFER_MIN_SIZE_VIOLATION_DROP, ++ IONIC_BUFFER_ENQUEUE_ERROR_DROP, ++ IONIC_BUFFER_INVALID_PORT_DROP, ++ IONIC_BUFFER_INVALID_OUTPUT_QUEUE_DROP, ++ IONIC_BUFFER_DROP_MAX, ++}; ++ ++/** ++ * struct port_pb_stats - packet buffers system stats ++ * uses ionic_pb_buffer_drop_stats for drop_counts[] ++ */ ++struct ionic_port_pb_stats { ++ __le64 sop_count_in; ++ __le64 eop_count_in; ++ __le64 sop_count_out; ++ __le64 eop_count_out; ++ __le64 drop_counts[IONIC_BUFFER_DROP_MAX]; ++ __le64 input_queue_buffer_occupancy[IONIC_QOS_TC_MAX]; ++ __le64 input_queue_port_monitor[IONIC_QOS_TC_MAX]; ++ __le64 output_queue_port_monitor[IONIC_QOS_TC_MAX]; + }; + + /** +@@ -2264,22 +2421,31 @@ union ionic_port_identity { + u8 rsvd2[44]; + union ionic_port_config config; + }; +- __le32 words[512]; ++ __le32 words[478]; + }; + + /** + * struct ionic_port_info - port info structure +- * @port_status: port status +- * @port_stats: port stats ++ * @config: Port configuration data ++ * @status: Port status data ++ * @stats: Port statistics data ++ * @mgmt_stats: Port management statistics data ++ * @port_pb_drop_stats: uplink pb drop stats + */ + struct ionic_port_info { + union ionic_port_config config; + struct ionic_port_status status; +- struct ionic_port_stats stats; ++ union { ++ struct ionic_port_stats stats; ++ struct ionic_mgmt_port_stats mgmt_stats; ++ }; ++ /* room for pb_stats to start at 2k offset */ ++ u8 rsvd[760]; ++ struct ionic_port_pb_stats pb_stats; + }; + + /** +- * struct ionic_lif_stats ++ * struct ionic_lif_stats - LIF statistics structure + */ + struct ionic_lif_stats { + /* RX */ +@@ -2332,7 +2498,7 @@ struct ionic_lif_stats { + __le64 tx_queue_error; + __le64 tx_desc_fetch_error; + __le64 tx_desc_data_error; +- __le64 rsvd9; ++ __le64 tx_queue_empty; + __le64 rsvd10; + __le64 rsvd11; + __le64 rsvd12; +@@ -2433,7 +2599,10 @@ struct ionic_lif_stats { + }; + + /** +- * struct ionic_lif_info - lif info structure ++ * struct ionic_lif_info - LIF info structure ++ * @config: LIF configuration structure ++ * @status: LIF status structure ++ * @stats: LIF statistics structure + */ + struct ionic_lif_info { + union ionic_lif_config config; +@@ -2471,6 +2640,7 @@ union ionic_dev_cmd { + + struct ionic_q_identify_cmd q_identify; + struct ionic_q_init_cmd q_init; ++ struct ionic_q_control_cmd q_control; + }; + + union ionic_dev_cmd_comp { +@@ -2507,15 +2677,15 @@ union ionic_dev_cmd_comp { + }; + + /** +- * union dev_info - Device info register format (read-only) +- * @signature: Signature value of 0x44455649 ('DEVI'). +- * @version: Current version of info. +- * @asic_type: Asic type. +- * @asic_rev: Asic revision. +- * @fw_status: Firmware status. +- * @fw_heartbeat: Firmware heartbeat counter. +- * @serial_num: Serial number. +- * @fw_version: Firmware version. ++ * union ionic_dev_info_regs - Device info register format (read-only) ++ * @signature: Signature value of 0x44455649 ('DEVI') ++ * @version: Current version of info ++ * @asic_type: Asic type ++ * @asic_rev: Asic revision ++ * @fw_status: Firmware status ++ * @fw_heartbeat: Firmware heartbeat counter ++ * @serial_num: Serial number ++ * @fw_version: Firmware version + */ + union ionic_dev_info_regs { + #define IONIC_DEVINFO_FWVERS_BUFLEN 32 +@@ -2536,10 +2706,10 @@ union ionic_dev_info_regs { + + /** + * union ionic_dev_cmd_regs - Device command register format (read-write) +- * @doorbell: Device Cmd Doorbell, write-only. ++ * @doorbell: Device Cmd Doorbell, write-only + * Write a 1 to signal device to process cmd, + * poll done for completion. +- * @done: Done indicator, bit 0 == 1 when command is complete. ++ * @done: Done indicator, bit 0 == 1 when command is complete + * @cmd: Opcode-specific command bytes + * @comp: Opcode-specific response bytes + * @data: Opcode-specific side-data +@@ -2557,7 +2727,7 @@ union ionic_dev_cmd_regs { + }; + + /** +- * union ionic_dev_regs - Device register format in for bar 0 page 0 ++ * union ionic_dev_regs - Device register format for bar 0 page 0 + * @info: Device info registers + * @devcmd: Device command registers + */ +@@ -2572,6 +2742,7 @@ union ionic_dev_regs { + union ionic_adminq_cmd { + struct ionic_admin_cmd cmd; + struct ionic_nop_cmd nop; ++ struct ionic_q_identify_cmd q_identify; + struct ionic_q_init_cmd q_init; + struct ionic_q_control_cmd q_control; + struct ionic_lif_setattr_cmd lif_setattr; +@@ -2588,6 +2759,7 @@ union ionic_adminq_cmd { + union ionic_adminq_comp { + struct ionic_admin_comp comp; + struct ionic_nop_comp nop; ++ struct ionic_q_identify_comp q_identify; + struct ionic_q_init_comp q_init; + struct ionic_lif_setattr_comp lif_setattr; + struct ionic_lif_getattr_comp lif_getattr; +@@ -2613,14 +2785,14 @@ union ionic_adminq_comp { + /** + * struct ionic_doorbell - Doorbell register layout + * @p_index: Producer index +- * @ring: Selects the specific ring of the queue to update. ++ * @ring: Selects the specific ring of the queue to update + * Type-specific meaning: +- * ring=0: Default producer/consumer queue. ++ * ring=0: Default producer/consumer queue + * ring=1: (CQ, EQ) Re-Arm queue. RDMA CQs + * send events to EQs when armed. EQs send + * interrupts when armed. +- * @qid: The queue id selects the queue destination for the +- * producer index and flags. ++ * @qid_lo: Queue destination for the producer index and flags (low bits) ++ * @qid_hi: Queue destination for the producer index and flags (high bits) + */ + struct ionic_doorbell { + __le16 p_index; +@@ -2653,6 +2825,7 @@ struct ionic_identity { + union ionic_lif_identity lif; + union ionic_port_identity port; + union ionic_qos_identity qos; ++ union ionic_q_identity txq; + }; + + #endif /* _IONIC_IF_H_ */ +-- +2.16.4 + + diff --git a/SOURCES/0004-ionic_protect_vf_calls_from_fw_reset.patch b/SOURCES/0004-ionic_protect_vf_calls_from_fw_reset.patch new file mode 100644 index 0000000..fb432af --- /dev/null +++ b/SOURCES/0004-ionic_protect_vf_calls_from_fw_reset.patch @@ -0,0 +1,120 @@ +Date: Thu, 18 Jun 2020 19:42:40 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 05/16] ionic: protect vf calls from fw reset + +When going into a firmware upgrade cycle, we set the device as +not present to keep some user commands from trying to change +the driver while we're only half there. Unfortunately, the +ndo_vf_* calls don't check netif_device_present() so we need +to add a check in the callbacks. + +Signed-off-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit a836c352291d4ad4031743a97a61f7916fe519b7) +Bugzilla: 1848149 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 26 ++++++++++++++++++++++++- + 1 file changed, 25 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index d60ef816604a..423d2443d1c8 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -1707,7 +1707,7 @@ int ionic_stop(struct net_device *netdev) + { + struct ionic_lif *lif = netdev_priv(netdev); + +- if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) ++ if (!netif_device_present(netdev)) + return 0; + + ionic_stop_queues(lif); +@@ -1724,6 +1724,9 @@ static int ionic_get_vf_config(struct net_device *netdev, + struct ionic *ionic = lif->ionic; + int ret = 0; + ++ if (!netif_device_present(netdev)) ++ return -EBUSY; ++ + down_read(&ionic->vf_op_lock); + + if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) { +@@ -1751,6 +1754,9 @@ static int ionic_get_vf_stats(struct net_device *netdev, int vf, + struct ionic_lif_stats *vs; + int ret = 0; + ++ if (!netif_device_present(netdev)) ++ return -EBUSY; ++ + down_read(&ionic->vf_op_lock); + + if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) { +@@ -1786,6 +1792,9 @@ static int ionic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) + if (!(is_zero_ether_addr(mac) || is_valid_ether_addr(mac))) + return -EINVAL; + ++ if (!netif_device_present(netdev)) ++ return -EBUSY; ++ + down_write(&ionic->vf_op_lock); + + if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) { +@@ -1817,6 +1826,9 @@ static int ionic_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, + if (proto != htons(ETH_P_8021Q)) + return -EPROTONOSUPPORT; + ++ if (!netif_device_present(netdev)) ++ return -EBUSY; ++ + down_write(&ionic->vf_op_lock); + + if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) { +@@ -1843,6 +1855,9 @@ static int ionic_set_vf_rate(struct net_device *netdev, int vf, + if (tx_min) + return -EINVAL; + ++ if (!netif_device_present(netdev)) ++ return -EBUSY; ++ + down_write(&ionic->vf_op_lock); + + if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) { +@@ -1865,6 +1880,9 @@ static int ionic_set_vf_spoofchk(struct net_device *netdev, int vf, bool set) + u8 data = set; /* convert to u8 for config */ + int ret; + ++ if (!netif_device_present(netdev)) ++ return -EBUSY; ++ + down_write(&ionic->vf_op_lock); + + if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) { +@@ -1887,6 +1905,9 @@ static int ionic_set_vf_trust(struct net_device *netdev, int vf, bool set) + u8 data = set; /* convert to u8 for config */ + int ret; + ++ if (!netif_device_present(netdev)) ++ return -EBUSY; ++ + down_write(&ionic->vf_op_lock); + + if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) { +@@ -1923,6 +1944,9 @@ static int ionic_set_vf_link_state(struct net_device *netdev, int vf, int set) + return -EINVAL; + } + ++ if (!netif_device_present(netdev)) ++ return -EBUSY; ++ + down_write(&ionic->vf_op_lock); + + if (vf >= pci_num_vf(ionic->pdev) || !ionic->vfs) { +-- +2.16.4 + + diff --git a/SOURCES/0005-ionic_add_support_for_more_xcvr_types.patch b/SOURCES/0005-ionic_add_support_for_more_xcvr_types.patch new file mode 100644 index 0000000..3434f98 --- /dev/null +++ b/SOURCES/0005-ionic_add_support_for_more_xcvr_types.patch @@ -0,0 +1,45 @@ +Date: Thu, 18 Jun 2020 19:42:41 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 06/16] ionic: add support for more xcvr types + +Add a couple more SFP and QSFP transceiver types to our +ethtool get link ksettings. + +Signed-off-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit cba155d591aa28689332bc568632d2f868690be1) +Bugzilla: 1848149 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +index 3f9a73aaef61..170e72f31197 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +@@ -159,6 +159,8 @@ static int ionic_get_link_ksettings(struct net_device *netdev, + ethtool_link_ksettings_add_link_mode(ks, supported, + 100000baseSR4_Full); + break; ++ case IONIC_XCVR_PID_QSFP_100G_CWDM4: ++ case IONIC_XCVR_PID_QSFP_100G_PSM4: + case IONIC_XCVR_PID_QSFP_100G_LR4: + ethtool_link_ksettings_add_link_mode(ks, supported, + 100000baseLR4_ER4_Full); +@@ -178,6 +180,7 @@ static int ionic_get_link_ksettings(struct net_device *netdev, + break; + case IONIC_XCVR_PID_SFP_25GBASE_SR: + case IONIC_XCVR_PID_SFP_25GBASE_AOC: ++ case IONIC_XCVR_PID_SFP_25GBASE_ACC: + ethtool_link_ksettings_add_link_mode(ks, supported, + 25000baseSR_Full); + break; +-- +2.16.4 + + diff --git a/SOURCES/0006-ionic_shorter_dev_cmd_wait_time.patch b/SOURCES/0006-ionic_shorter_dev_cmd_wait_time.patch new file mode 100644 index 0000000..54aa7c8 --- /dev/null +++ b/SOURCES/0006-ionic_shorter_dev_cmd_wait_time.patch @@ -0,0 +1,39 @@ +Date: Thu, 18 Jun 2020 19:42:42 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 07/16] ionic: shorter dev cmd wait time + +Shorten our msleep time while polling for the dev command +request to finish. Yes, checkpatch.pl complains that the +msleep might actually go longer - that won't hurt, but we'll +take the shorter time if we can get it. + +Signed-off-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit 62ba8766f775e5e26c21731c695f68541d504ea6) +Bugzilla: 1848149 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c +index 34ccb8f53cda..782fff35c1c1 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_main.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c +@@ -358,7 +358,7 @@ int ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds) + done = ionic_dev_cmd_done(idev); + if (done) + break; +- msleep(20); ++ msleep(5); + hb = ionic_heartbeat_check(ionic); + } while (!done && !hb && time_before(jiffies, max_wait)); + duration = jiffies - start_time; +-- +2.16.4 + + diff --git a/SOURCES/0007-ionic_reset_device_at_probe.patch b/SOURCES/0007-ionic_reset_device_at_probe.patch new file mode 100644 index 0000000..bfddb5f --- /dev/null +++ b/SOURCES/0007-ionic_reset_device_at_probe.patch @@ -0,0 +1,36 @@ +Date: Thu, 18 Jun 2020 19:42:43 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 08/16] ionic: reset device at probe + +Once we're talking to the device, tell it to reset to +be sure we've got a fresh, clean environment. + +Signed-off-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit 5c7843112543c7726e7fe31ecc76476f296b7960) +Bugzilla: 1848149 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c +index 782fff35c1c1..df5b9bcc3aba 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_main.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c +@@ -415,6 +415,7 @@ int ionic_setup(struct ionic *ionic) + err = ionic_dev_setup(ionic); + if (err) + return err; ++ ionic_reset(ionic); + + return 0; + } +-- +2.16.4 + + diff --git a/SOURCES/0008-ionic_ionic_intr_free_parameter_change.patch b/SOURCES/0008-ionic_ionic_intr_free_parameter_change.patch new file mode 100644 index 0000000..8d9d2cd --- /dev/null +++ b/SOURCES/0008-ionic_ionic_intr_free_parameter_change.patch @@ -0,0 +1,69 @@ +Date: Thu, 18 Jun 2020 19:42:44 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 09/16] ionic: ionic_intr_free parameter change + +Change the ionic_intr_free parameter from struct ionic_lif to +struct ionic since that's what it actually cares about. + +Signed-off-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit 36ac2c50924892a28e17ff463e354fec7650ee19) +Bugzilla: 1848149 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index 423d2443d1c8..d52928ea539d 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -197,10 +197,10 @@ static int ionic_intr_alloc(struct ionic_lif *lif, struct ionic_intr_info *intr) + return 0; + } + +-static void ionic_intr_free(struct ionic_lif *lif, int index) ++static void ionic_intr_free(struct ionic *ionic, int index) + { +- if (index != INTR_INDEX_NOT_ASSIGNED && index < lif->ionic->nintrs) +- clear_bit(index, lif->ionic->intrs); ++ if (index != INTR_INDEX_NOT_ASSIGNED && index < ionic->nintrs) ++ clear_bit(index, ionic->intrs); + } + + static int ionic_qcq_enable(struct ionic_qcq *qcq) +@@ -310,7 +310,7 @@ static void ionic_qcq_free(struct ionic_lif *lif, struct ionic_qcq *qcq) + irq_set_affinity_hint(qcq->intr.vector, NULL); + devm_free_irq(dev, qcq->intr.vector, &qcq->napi); + qcq->intr.vector = 0; +- ionic_intr_free(lif, qcq->intr.index); ++ ionic_intr_free(lif->ionic, qcq->intr.index); + } + + devm_kfree(dev, qcq->cq.info); +@@ -356,7 +356,7 @@ static void ionic_link_qcq_interrupts(struct ionic_qcq *src_qcq, + struct ionic_qcq *n_qcq) + { + if (WARN_ON(n_qcq->flags & IONIC_QCQ_F_INTR)) { +- ionic_intr_free(n_qcq->cq.lif, n_qcq->intr.index); ++ ionic_intr_free(n_qcq->cq.lif->ionic, n_qcq->intr.index); + n_qcq->flags &= ~IONIC_QCQ_F_INTR; + } + +@@ -508,7 +508,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, + devm_free_irq(dev, new->intr.vector, &new->napi); + err_out_free_intr: + if (flags & IONIC_QCQ_F_INTR) +- ionic_intr_free(lif, new->intr.index); ++ ionic_intr_free(lif->ionic, new->intr.index); + err_out: + dev_err(dev, "qcq alloc of %s%d failed %d\n", name, index, err); + return err; +-- +2.16.4 + + diff --git a/SOURCES/0009-ionic_more_ionic_name_tweaks.patch b/SOURCES/0009-ionic_more_ionic_name_tweaks.patch new file mode 100644 index 0000000..d2073e7 --- /dev/null +++ b/SOURCES/0009-ionic_more_ionic_name_tweaks.patch @@ -0,0 +1,133 @@ +Date: Thu, 18 Jun 2020 19:42:45 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 10/16] ionic: more ionic name tweaks + +Fix up a few more local names that need an "ionic" prefix. + +Signed-off-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit c06107cabea356db62f45bf8049a260c238fadf2) +Bugzilla: 1848149 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_dev.h | 10 +++++----- + drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 13 +++++++------ + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 4 ++-- + 3 files changed, 14 insertions(+), 13 deletions(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h +index 33519a8765eb..525434f10025 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h ++++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h +@@ -182,7 +182,7 @@ struct ionic_desc_info { + void *cb_arg; + }; + +-#define QUEUE_NAME_MAX_SZ 32 ++#define IONIC_QUEUE_NAME_MAX_SZ 32 + + struct ionic_queue { + u64 dbell_count; +@@ -207,14 +207,14 @@ struct ionic_queue { + unsigned int desc_size; + unsigned int sg_desc_size; + unsigned int pid; +- char name[QUEUE_NAME_MAX_SZ]; ++ char name[IONIC_QUEUE_NAME_MAX_SZ]; + }; + +-#define INTR_INDEX_NOT_ASSIGNED -1 +-#define INTR_NAME_MAX_SZ 32 ++#define IONIC_INTR_INDEX_NOT_ASSIGNED -1 ++#define IONIC_INTR_NAME_MAX_SZ 32 + + struct ionic_intr_info { +- char name[INTR_NAME_MAX_SZ]; ++ char name[IONIC_INTR_NAME_MAX_SZ]; + unsigned int index; + unsigned int vector; + u64 rearm_count; +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +index 170e72f31197..f7e3ce3de04d 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +@@ -12,10 +12,11 @@ + #include "ionic_stats.h" + + static const char ionic_priv_flags_strings[][ETH_GSTRING_LEN] = { +-#define PRIV_F_SW_DBG_STATS BIT(0) ++#define IONIC_PRIV_F_SW_DBG_STATS BIT(0) + "sw-dbg-stats", + }; +-#define PRIV_FLAGS_COUNT ARRAY_SIZE(ionic_priv_flags_strings) ++ ++#define IONIC_PRIV_FLAGS_COUNT ARRAY_SIZE(ionic_priv_flags_strings) + + static void ionic_get_stats_strings(struct ionic_lif *lif, u8 *buf) + { +@@ -58,7 +59,7 @@ static int ionic_get_sset_count(struct net_device *netdev, int sset) + count = ionic_get_stats_count(lif); + break; + case ETH_SS_PRIV_FLAGS: +- count = PRIV_FLAGS_COUNT; ++ count = IONIC_PRIV_FLAGS_COUNT; + break; + } + return count; +@@ -75,7 +76,7 @@ static void ionic_get_strings(struct net_device *netdev, + break; + case ETH_SS_PRIV_FLAGS: + memcpy(buf, ionic_priv_flags_strings, +- PRIV_FLAGS_COUNT * ETH_GSTRING_LEN); ++ IONIC_PRIV_FLAGS_COUNT * ETH_GSTRING_LEN); + break; + } + } +@@ -557,7 +558,7 @@ static u32 ionic_get_priv_flags(struct net_device *netdev) + u32 priv_flags = 0; + + if (test_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state)) +- priv_flags |= PRIV_F_SW_DBG_STATS; ++ priv_flags |= IONIC_PRIV_F_SW_DBG_STATS; + + return priv_flags; + } +@@ -567,7 +568,7 @@ static int ionic_set_priv_flags(struct net_device *netdev, u32 priv_flags) + struct ionic_lif *lif = netdev_priv(netdev); + + clear_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state); +- if (priv_flags & PRIV_F_SW_DBG_STATS) ++ if (priv_flags & IONIC_PRIV_F_SW_DBG_STATS) + set_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state); + + return 0; +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index d52928ea539d..e47da3127bf3 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -199,7 +199,7 @@ static int ionic_intr_alloc(struct ionic_lif *lif, struct ionic_intr_info *intr) + + static void ionic_intr_free(struct ionic *ionic, int index) + { +- if (index != INTR_INDEX_NOT_ASSIGNED && index < ionic->nintrs) ++ if (index != IONIC_INTR_INDEX_NOT_ASSIGNED && index < ionic->nintrs) + clear_bit(index, ionic->intrs); + } + +@@ -455,7 +455,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type, + cpumask_set_cpu(new->intr.cpu, + &new->intr.affinity_mask); + } else { +- new->intr.index = INTR_INDEX_NOT_ASSIGNED; ++ new->intr.index = IONIC_INTR_INDEX_NOT_ASSIGNED; + } + + new->cq.info = devm_kzalloc(dev, sizeof(*new->cq.info) * num_descs, +-- +2.16.4 + + diff --git a/SOURCES/0010-ionic_add_more_ethtool_stats.patch b/SOURCES/0010-ionic_add_more_ethtool_stats.patch new file mode 100644 index 0000000..e43cc6d --- /dev/null +++ b/SOURCES/0010-ionic_add_more_ethtool_stats.patch @@ -0,0 +1,400 @@ +Date: Thu, 18 Jun 2020 19:42:46 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 11/16] ionic: add more ethtool stats + +Add hardware port stats and a few more driver collected +statistics to the ethtool stats output. + +Signed-off-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit f64e0c5698b7b1abb08b3d5bc07f95db45e87d76) +Bugzilla: 1848149 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 4 +- + drivers/net/ethernet/pensando/ionic/ionic_lif.h | 15 ++- + drivers/net/ethernet/pensando/ionic/ionic_stats.c | 136 +++++++++++++++++++++- + drivers/net/ethernet/pensando/ionic/ionic_stats.h | 6 + + drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 22 ++-- + 5 files changed, 170 insertions(+), 13 deletions(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index e47da3127bf3..7321a92f8395 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -792,8 +792,8 @@ static int ionic_adminq_napi(struct napi_struct *napi, int budget) + return max(n_work, a_work); + } + +-static void ionic_get_stats64(struct net_device *netdev, +- struct rtnl_link_stats64 *ns) ++void ionic_get_stats64(struct net_device *netdev, ++ struct rtnl_link_stats64 *ns) + { + struct ionic_lif *lif = netdev_priv(netdev); + struct ionic_lif_stats *ls; +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h +index 1a30f0fb20b9..c3428034a17b 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h +@@ -20,11 +20,13 @@ struct ionic_tx_stats { + u64 bytes; + u64 clean; + u64 linearize; +- u64 no_csum; ++ u64 csum_none; + u64 csum; + u64 crc32_csum; + u64 tso; ++ u64 tso_bytes; + u64 frags; ++ u64 vlan_inserted; + u64 sg_cntr[IONIC_MAX_NUM_SG_CNTR]; + }; + +@@ -38,6 +40,7 @@ struct ionic_rx_stats { + u64 csum_error; + u64 buffers_posted; + u64 dropped; ++ u64 vlan_stripped; + }; + + #define IONIC_QCQ_F_INITED BIT(0) +@@ -114,11 +117,17 @@ struct ionic_lif_sw_stats { + u64 rx_packets; + u64 rx_bytes; + u64 tx_tso; +- u64 tx_no_csum; ++ u64 tx_tso_bytes; ++ u64 tx_csum_none; + u64 tx_csum; + u64 rx_csum_none; + u64 rx_csum_complete; + u64 rx_csum_error; ++ u64 hw_tx_dropped; ++ u64 hw_rx_dropped; ++ u64 hw_rx_over_errors; ++ u64 hw_rx_missed_errors; ++ u64 hw_tx_aborted_errors; + }; + + enum ionic_lif_state_flags { +@@ -240,6 +249,8 @@ static inline u32 ionic_coal_hw_to_usec(struct ionic *ionic, u32 units) + } + + void ionic_link_status_check_request(struct ionic_lif *lif); ++void ionic_get_stats64(struct net_device *netdev, ++ struct rtnl_link_stats64 *ns); + void ionic_lif_deferred_enqueue(struct ionic_deferred *def, + struct ionic_deferred_work *work); + int ionic_lifs_alloc(struct ionic *ionic); +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_stats.c b/drivers/net/ethernet/pensando/ionic/ionic_stats.c +index 8f2a8fb029f1..2a1885da58a6 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_stats.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_stats.c +@@ -15,11 +15,109 @@ static const struct ionic_stat_desc ionic_lif_stats_desc[] = { + IONIC_LIF_STAT_DESC(rx_packets), + IONIC_LIF_STAT_DESC(rx_bytes), + IONIC_LIF_STAT_DESC(tx_tso), +- IONIC_LIF_STAT_DESC(tx_no_csum), ++ IONIC_LIF_STAT_DESC(tx_tso_bytes), ++ IONIC_LIF_STAT_DESC(tx_csum_none), + IONIC_LIF_STAT_DESC(tx_csum), + IONIC_LIF_STAT_DESC(rx_csum_none), + IONIC_LIF_STAT_DESC(rx_csum_complete), + IONIC_LIF_STAT_DESC(rx_csum_error), ++ IONIC_LIF_STAT_DESC(hw_tx_dropped), ++ IONIC_LIF_STAT_DESC(hw_rx_dropped), ++ IONIC_LIF_STAT_DESC(hw_rx_over_errors), ++ IONIC_LIF_STAT_DESC(hw_rx_missed_errors), ++ IONIC_LIF_STAT_DESC(hw_tx_aborted_errors), ++}; ++ ++static const struct ionic_stat_desc ionic_port_stats_desc[] = { ++ IONIC_PORT_STAT_DESC(frames_rx_ok), ++ IONIC_PORT_STAT_DESC(frames_rx_all), ++ IONIC_PORT_STAT_DESC(frames_rx_bad_fcs), ++ IONIC_PORT_STAT_DESC(frames_rx_bad_all), ++ IONIC_PORT_STAT_DESC(octets_rx_ok), ++ IONIC_PORT_STAT_DESC(octets_rx_all), ++ IONIC_PORT_STAT_DESC(frames_rx_unicast), ++ IONIC_PORT_STAT_DESC(frames_rx_multicast), ++ IONIC_PORT_STAT_DESC(frames_rx_broadcast), ++ IONIC_PORT_STAT_DESC(frames_rx_pause), ++ IONIC_PORT_STAT_DESC(frames_rx_bad_length), ++ IONIC_PORT_STAT_DESC(frames_rx_undersized), ++ IONIC_PORT_STAT_DESC(frames_rx_oversized), ++ IONIC_PORT_STAT_DESC(frames_rx_fragments), ++ IONIC_PORT_STAT_DESC(frames_rx_jabber), ++ IONIC_PORT_STAT_DESC(frames_rx_pripause), ++ IONIC_PORT_STAT_DESC(frames_rx_stomped_crc), ++ IONIC_PORT_STAT_DESC(frames_rx_too_long), ++ IONIC_PORT_STAT_DESC(frames_rx_vlan_good), ++ IONIC_PORT_STAT_DESC(frames_rx_dropped), ++ IONIC_PORT_STAT_DESC(frames_rx_less_than_64b), ++ IONIC_PORT_STAT_DESC(frames_rx_64b), ++ IONIC_PORT_STAT_DESC(frames_rx_65b_127b), ++ IONIC_PORT_STAT_DESC(frames_rx_128b_255b), ++ IONIC_PORT_STAT_DESC(frames_rx_256b_511b), ++ IONIC_PORT_STAT_DESC(frames_rx_512b_1023b), ++ IONIC_PORT_STAT_DESC(frames_rx_1024b_1518b), ++ IONIC_PORT_STAT_DESC(frames_rx_1519b_2047b), ++ IONIC_PORT_STAT_DESC(frames_rx_2048b_4095b), ++ IONIC_PORT_STAT_DESC(frames_rx_4096b_8191b), ++ IONIC_PORT_STAT_DESC(frames_rx_8192b_9215b), ++ IONIC_PORT_STAT_DESC(frames_rx_other), ++ IONIC_PORT_STAT_DESC(frames_tx_ok), ++ IONIC_PORT_STAT_DESC(frames_tx_all), ++ IONIC_PORT_STAT_DESC(frames_tx_bad), ++ IONIC_PORT_STAT_DESC(octets_tx_ok), ++ IONIC_PORT_STAT_DESC(octets_tx_total), ++ IONIC_PORT_STAT_DESC(frames_tx_unicast), ++ IONIC_PORT_STAT_DESC(frames_tx_multicast), ++ IONIC_PORT_STAT_DESC(frames_tx_broadcast), ++ IONIC_PORT_STAT_DESC(frames_tx_pause), ++ IONIC_PORT_STAT_DESC(frames_tx_pripause), ++ IONIC_PORT_STAT_DESC(frames_tx_vlan), ++ IONIC_PORT_STAT_DESC(frames_tx_less_than_64b), ++ IONIC_PORT_STAT_DESC(frames_tx_64b), ++ IONIC_PORT_STAT_DESC(frames_tx_65b_127b), ++ IONIC_PORT_STAT_DESC(frames_tx_128b_255b), ++ IONIC_PORT_STAT_DESC(frames_tx_256b_511b), ++ IONIC_PORT_STAT_DESC(frames_tx_512b_1023b), ++ IONIC_PORT_STAT_DESC(frames_tx_1024b_1518b), ++ IONIC_PORT_STAT_DESC(frames_tx_1519b_2047b), ++ IONIC_PORT_STAT_DESC(frames_tx_2048b_4095b), ++ IONIC_PORT_STAT_DESC(frames_tx_4096b_8191b), ++ IONIC_PORT_STAT_DESC(frames_tx_8192b_9215b), ++ IONIC_PORT_STAT_DESC(frames_tx_other), ++ IONIC_PORT_STAT_DESC(frames_tx_pri_0), ++ IONIC_PORT_STAT_DESC(frames_tx_pri_1), ++ IONIC_PORT_STAT_DESC(frames_tx_pri_2), ++ IONIC_PORT_STAT_DESC(frames_tx_pri_3), ++ IONIC_PORT_STAT_DESC(frames_tx_pri_4), ++ IONIC_PORT_STAT_DESC(frames_tx_pri_5), ++ IONIC_PORT_STAT_DESC(frames_tx_pri_6), ++ IONIC_PORT_STAT_DESC(frames_tx_pri_7), ++ IONIC_PORT_STAT_DESC(frames_rx_pri_0), ++ IONIC_PORT_STAT_DESC(frames_rx_pri_1), ++ IONIC_PORT_STAT_DESC(frames_rx_pri_2), ++ IONIC_PORT_STAT_DESC(frames_rx_pri_3), ++ IONIC_PORT_STAT_DESC(frames_rx_pri_4), ++ IONIC_PORT_STAT_DESC(frames_rx_pri_5), ++ IONIC_PORT_STAT_DESC(frames_rx_pri_6), ++ IONIC_PORT_STAT_DESC(frames_rx_pri_7), ++ IONIC_PORT_STAT_DESC(tx_pripause_0_1us_count), ++ IONIC_PORT_STAT_DESC(tx_pripause_1_1us_count), ++ IONIC_PORT_STAT_DESC(tx_pripause_2_1us_count), ++ IONIC_PORT_STAT_DESC(tx_pripause_3_1us_count), ++ IONIC_PORT_STAT_DESC(tx_pripause_4_1us_count), ++ IONIC_PORT_STAT_DESC(tx_pripause_5_1us_count), ++ IONIC_PORT_STAT_DESC(tx_pripause_6_1us_count), ++ IONIC_PORT_STAT_DESC(tx_pripause_7_1us_count), ++ IONIC_PORT_STAT_DESC(rx_pripause_0_1us_count), ++ IONIC_PORT_STAT_DESC(rx_pripause_1_1us_count), ++ IONIC_PORT_STAT_DESC(rx_pripause_2_1us_count), ++ IONIC_PORT_STAT_DESC(rx_pripause_3_1us_count), ++ IONIC_PORT_STAT_DESC(rx_pripause_4_1us_count), ++ IONIC_PORT_STAT_DESC(rx_pripause_5_1us_count), ++ IONIC_PORT_STAT_DESC(rx_pripause_6_1us_count), ++ IONIC_PORT_STAT_DESC(rx_pripause_7_1us_count), ++ IONIC_PORT_STAT_DESC(rx_pause_1us_count), ++ IONIC_PORT_STAT_DESC(frames_tx_truncated), + }; + + static const struct ionic_stat_desc ionic_tx_stats_desc[] = { +@@ -29,6 +127,11 @@ static const struct ionic_stat_desc ionic_tx_stats_desc[] = { + IONIC_TX_STAT_DESC(dma_map_err), + IONIC_TX_STAT_DESC(linearize), + IONIC_TX_STAT_DESC(frags), ++ IONIC_TX_STAT_DESC(tso), ++ IONIC_TX_STAT_DESC(tso_bytes), ++ IONIC_TX_STAT_DESC(csum_none), ++ IONIC_TX_STAT_DESC(csum), ++ IONIC_TX_STAT_DESC(vlan_inserted), + }; + + static const struct ionic_stat_desc ionic_rx_stats_desc[] = { +@@ -40,6 +143,7 @@ static const struct ionic_stat_desc ionic_rx_stats_desc[] = { + IONIC_RX_STAT_DESC(csum_complete), + IONIC_RX_STAT_DESC(csum_error), + IONIC_RX_STAT_DESC(dropped), ++ IONIC_RX_STAT_DESC(vlan_stripped), + }; + + static const struct ionic_stat_desc ionic_txq_stats_desc[] = { +@@ -62,6 +166,7 @@ static const struct ionic_stat_desc ionic_dbg_napi_stats_desc[] = { + }; + + #define IONIC_NUM_LIF_STATS ARRAY_SIZE(ionic_lif_stats_desc) ++#define IONIC_NUM_PORT_STATS ARRAY_SIZE(ionic_port_stats_desc) + #define IONIC_NUM_TX_STATS ARRAY_SIZE(ionic_tx_stats_desc) + #define IONIC_NUM_RX_STATS ARRAY_SIZE(ionic_rx_stats_desc) + #define IONIC_NUM_TX_Q_STATS ARRAY_SIZE(ionic_txq_stats_desc) +@@ -76,6 +181,7 @@ static void ionic_get_lif_stats(struct ionic_lif *lif, + { + struct ionic_tx_stats *tstats; + struct ionic_rx_stats *rstats; ++ struct rtnl_link_stats64 ns; + struct ionic_qcq *txqcq; + struct ionic_qcq *rxqcq; + int q_num; +@@ -89,7 +195,8 @@ static void ionic_get_lif_stats(struct ionic_lif *lif, + stats->tx_packets += tstats->pkts; + stats->tx_bytes += tstats->bytes; + stats->tx_tso += tstats->tso; +- stats->tx_no_csum += tstats->no_csum; ++ stats->tx_tso_bytes += tstats->tso_bytes; ++ stats->tx_csum_none += tstats->csum_none; + stats->tx_csum += tstats->csum; + } + +@@ -103,6 +210,13 @@ static void ionic_get_lif_stats(struct ionic_lif *lif, + stats->rx_csum_error += rstats->csum_error; + } + } ++ ++ ionic_get_stats64(lif->netdev, &ns); ++ stats->hw_tx_dropped = ns.tx_dropped; ++ stats->hw_rx_dropped = ns.rx_dropped; ++ stats->hw_rx_over_errors = ns.rx_over_errors; ++ stats->hw_rx_missed_errors = ns.rx_missed_errors; ++ stats->hw_tx_aborted_errors = ns.tx_aborted_errors; + } + + static u64 ionic_sw_stats_get_count(struct ionic_lif *lif) +@@ -118,6 +232,9 @@ static u64 ionic_sw_stats_get_count(struct ionic_lif *lif) + /* rx stats */ + total += MAX_Q(lif) * IONIC_NUM_RX_STATS; + ++ /* port stats */ ++ total += IONIC_NUM_PORT_STATS; ++ + if (test_bit(IONIC_LIF_F_UP, lif->state) && + test_bit(IONIC_LIF_F_SW_DEBUG_STATS, lif->state)) { + /* tx debug stats */ +@@ -144,6 +261,13 @@ static void ionic_sw_stats_get_strings(struct ionic_lif *lif, u8 **buf) + snprintf(*buf, ETH_GSTRING_LEN, ionic_lif_stats_desc[i].name); + *buf += ETH_GSTRING_LEN; + } ++ ++ for (i = 0; i < IONIC_NUM_PORT_STATS; i++) { ++ snprintf(*buf, ETH_GSTRING_LEN, ++ ionic_port_stats_desc[i].name); ++ *buf += ETH_GSTRING_LEN; ++ } ++ + for (q_num = 0; q_num < MAX_Q(lif); q_num++) { + for (i = 0; i < IONIC_NUM_TX_STATS; i++) { + snprintf(*buf, ETH_GSTRING_LEN, "tx_%d_%s", +@@ -225,6 +349,7 @@ static void ionic_sw_stats_get_strings(struct ionic_lif *lif, u8 **buf) + + static void ionic_sw_stats_get_values(struct ionic_lif *lif, u64 **buf) + { ++ struct ionic_port_stats *port_stats; + struct ionic_lif_sw_stats lif_stats; + struct ionic_qcq *txqcq, *rxqcq; + struct ionic_tx_stats *txstats; +@@ -238,6 +363,13 @@ static void ionic_sw_stats_get_values(struct ionic_lif *lif, u64 **buf) + (*buf)++; + } + ++ port_stats = &lif->ionic->idev.port_info->stats; ++ for (i = 0; i < IONIC_NUM_PORT_STATS; i++) { ++ **buf = IONIC_READ_STAT_LE64(port_stats, ++ &ionic_port_stats_desc[i]); ++ (*buf)++; ++ } ++ + for (q_num = 0; q_num < MAX_Q(lif); q_num++) { + txstats = &lif_to_txstats(lif, q_num); + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_stats.h b/drivers/net/ethernet/pensando/ionic/ionic_stats.h +index d2c1122a2c6e..3f543512616e 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_stats.h ++++ b/drivers/net/ethernet/pensando/ionic/ionic_stats.h +@@ -11,6 +11,9 @@ + .offset = IONIC_STAT_TO_OFFSET(type, stat_name) \ + } + ++#define IONIC_PORT_STAT_DESC(stat_name) \ ++ IONIC_STAT_DESC(struct ionic_port_stats, stat_name) ++ + #define IONIC_LIF_STAT_DESC(stat_name) \ + IONIC_STAT_DESC(struct ionic_lif_sw_stats, stat_name) + +@@ -45,6 +48,9 @@ extern const int ionic_num_stats_grps; + #define IONIC_READ_STAT64(base_ptr, desc_ptr) \ + (*((u64 *)(((u8 *)(base_ptr)) + (desc_ptr)->offset))) + ++#define IONIC_READ_STAT_LE64(base_ptr, desc_ptr) \ ++ __le64_to_cpu(*((u64 *)(((u8 *)(base_ptr)) + (desc_ptr)->offset))) ++ + struct ionic_stat_desc { + char name[ETH_GSTRING_LEN]; + u64 offset; +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +index 6b14e55a6780..b7f900c11834 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +@@ -214,10 +214,11 @@ static void ionic_rx_clean(struct ionic_queue *q, + (comp->csum_flags & IONIC_RXQ_COMP_CSUM_F_IP_BAD))) + stats->csum_error++; + +- if (likely(netdev->features & NETIF_F_HW_VLAN_CTAG_RX)) { +- if (comp->csum_flags & IONIC_RXQ_COMP_CSUM_F_VLAN) +- __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), +- le16_to_cpu(comp->vlan_tci)); ++ if (likely(netdev->features & NETIF_F_HW_VLAN_CTAG_RX) && ++ (comp->csum_flags & IONIC_RXQ_COMP_CSUM_F_VLAN)) { ++ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ++ le16_to_cpu(comp->vlan_tci)); ++ stats->vlan_stripped++; + } + + if (le16_to_cpu(comp->len) <= q->lif->rx_copybreak) +@@ -860,6 +861,7 @@ static int ionic_tx_tso(struct ionic_queue *q, struct sk_buff *skb) + stats->pkts += total_pkts; + stats->bytes += total_bytes; + stats->tso++; ++ stats->tso_bytes += total_bytes; + + return 0; + +@@ -898,9 +900,12 @@ static int ionic_tx_calc_csum(struct ionic_queue *q, struct sk_buff *skb) + flags, skb_shinfo(skb)->nr_frags, dma_addr); + desc->cmd = cpu_to_le64(cmd); + desc->len = cpu_to_le16(skb_headlen(skb)); +- desc->vlan_tci = cpu_to_le16(skb_vlan_tag_get(skb)); + desc->csum_start = cpu_to_le16(skb_checksum_start_offset(skb)); + desc->csum_offset = cpu_to_le16(skb->csum_offset); ++ if (has_vlan) { ++ desc->vlan_tci = cpu_to_le16(skb_vlan_tag_get(skb)); ++ stats->vlan_inserted++; ++ } + + if (skb->csum_not_inet) + stats->crc32_csum++; +@@ -935,9 +940,12 @@ static int ionic_tx_calc_no_csum(struct ionic_queue *q, struct sk_buff *skb) + flags, skb_shinfo(skb)->nr_frags, dma_addr); + desc->cmd = cpu_to_le64(cmd); + desc->len = cpu_to_le16(skb_headlen(skb)); +- desc->vlan_tci = cpu_to_le16(skb_vlan_tag_get(skb)); ++ if (has_vlan) { ++ desc->vlan_tci = cpu_to_le16(skb_vlan_tag_get(skb)); ++ stats->vlan_inserted++; ++ } + +- stats->no_csum++; ++ stats->csum_none++; + + return 0; + } +-- +2.16.4 + + diff --git a/SOURCES/0011-ionic_wait_on_queue_start_until_after_IFF_UP.patch b/SOURCES/0011-ionic_wait_on_queue_start_until_after_IFF_UP.patch new file mode 100644 index 0000000..274d5a4 --- /dev/null +++ b/SOURCES/0011-ionic_wait_on_queue_start_until_after_IFF_UP.patch @@ -0,0 +1,59 @@ +Date: Thu, 18 Jun 2020 19:42:47 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 12/16] ionic: wait on queue start until after IFF_UP + +The netif_running() test looks at __LINK_STATE_START which +gets set before ndo_open() is called, there is a window of +time between that and when the queues are actually ready to +be run. If ionic_check_link_status() notices that the link is +up very soon after netif_running() becomes true, it might try +to run the queues before they are ready, causing all manner of +potential issues. Since the netdev->flags IFF_UP isn't set +until after ndo_open() returns, we can wait for that before +we allow ionic_check_link_status() to start the queues. + +On the way back to close, __LINK_STATE_START is cleared before +calling ndo_stop(), and IFF_UP is cleared after. Both of +these need to be true in order to safely stop the queues +from ionic_check_link_status(). + +Fixes: 49d3b493673a ("ionic: disable the queues on link down") +Signed-off-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit 976ee3b21119dcf5c6d96233d688a1453f29fa83) +Bugzilla: 1844924 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index 7321a92f8395..fbc36e9e4729 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -116,7 +116,7 @@ static void ionic_link_status_check(struct ionic_lif *lif) + netif_carrier_on(netdev); + } + +- if (netif_running(lif->netdev)) ++ if (lif->netdev->flags & IFF_UP && netif_running(lif->netdev)) + ionic_start_queues(lif); + } else { + if (netif_carrier_ok(netdev)) { +@@ -124,7 +124,7 @@ static void ionic_link_status_check(struct ionic_lif *lif) + netif_carrier_off(netdev); + } + +- if (netif_running(lif->netdev)) ++ if (lif->netdev->flags & IFF_UP && netif_running(lif->netdev)) + ionic_stop_queues(lif); + } + +-- +2.16.4 + + diff --git a/SOURCES/0012-ionic_remove_support_for_mgmt_device.patch b/SOURCES/0012-ionic_remove_support_for_mgmt_device.patch new file mode 100644 index 0000000..49bcc42 --- /dev/null +++ b/SOURCES/0012-ionic_remove_support_for_mgmt_device.patch @@ -0,0 +1,134 @@ +Date: Thu, 18 Jun 2020 19:42:48 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 13/16] ionic: remove support for mgmt device + +We no longer support the mgmt device in the ionic driver, +so remove the device id and related code. + +Fixes: b3f064e9746d ("ionic: add support for device id 0x1004") +Signed-off-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit 77f972a7077d06d565243ecc192f45e1e5813cf1) + +Bugzilla: 1846506 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner + +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic.h | 2 -- + drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 6 ------ + drivers/net/ethernet/pensando/ionic/ionic_devlink.c | 4 ---- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 13 ------------- + 4 files changed, 25 deletions(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic.h b/drivers/net/ethernet/pensando/ionic/ionic.h +index 23ccc0da2341..f5a910c458ba 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic.h ++++ b/drivers/net/ethernet/pensando/ionic/ionic.h +@@ -17,7 +17,6 @@ struct ionic_lif; + + #define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF 0x1002 + #define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF 0x1003 +-#define PCI_DEVICE_ID_PENSANDO_IONIC_ETH_MGMT 0x1004 + + #define DEVCMD_TIMEOUT 10 + +@@ -42,7 +41,6 @@ struct ionic { + struct dentry *dentry; + struct ionic_dev_bar bars[IONIC_BARS_MAX]; + unsigned int num_bars; +- bool is_mgmt_nic; + struct ionic_identity ident; + struct list_head lifs; + struct ionic_lif *master_lif; +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +index 60fc191a35e5..0ac6acbc5f31 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +@@ -15,7 +15,6 @@ + static const struct pci_device_id ionic_id_table[] = { + { PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_PF) }, + { PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_VF) }, +- { PCI_VDEVICE(PENSANDO, PCI_DEVICE_ID_PENSANDO_IONIC_ETH_MGMT) }, + { 0, } /* end of table */ + }; + MODULE_DEVICE_TABLE(pci, ionic_id_table); +@@ -225,9 +224,6 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + pci_set_drvdata(pdev, ionic); + mutex_init(&ionic->dev_cmd_lock); + +- ionic->is_mgmt_nic = +- ent->device == PCI_DEVICE_ID_PENSANDO_IONIC_ETH_MGMT; +- + /* Query system for DMA addressing limitation for the device. */ + err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(IONIC_ADDR_LEN)); + if (err) { +@@ -252,8 +248,6 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + } + + pci_set_master(pdev); +- if (!ionic->is_mgmt_nic) +- pcie_print_link_status(pdev); + + err = ionic_map_bars(ionic); + if (err) +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c +index 273c889faaad..2d590e571133 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c +@@ -77,10 +77,6 @@ int ionic_devlink_register(struct ionic *ionic) + return err; + } + +- /* don't register the mgmt_nic as a port */ +- if (ionic->is_mgmt_nic) +- return 0; +- + devlink_port_attrs_set(&ionic->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL, + 0, false, 0, NULL, 0); + err = devlink_port_register(dl, &ionic->dl_port, 0); +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index fbc36e9e4729..9d8c969f21cb 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -99,9 +99,6 @@ static void ionic_link_status_check(struct ionic_lif *lif) + if (!test_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state)) + return; + +- if (lif->ionic->is_mgmt_nic) +- return; +- + link_status = le16_to_cpu(lif->info->status.link_status); + link_up = link_status == IONIC_PORT_OPER_STATUS_UP; + +@@ -1193,10 +1190,6 @@ static int ionic_init_nic_features(struct ionic_lif *lif) + netdev_features_t features; + int err; + +- /* no netdev features on the management device */ +- if (lif->ionic->is_mgmt_nic) +- return 0; +- + /* set up what we expect to support by default */ + features = NETIF_F_HW_VLAN_CTAG_TX | + NETIF_F_HW_VLAN_CTAG_RX | +@@ -2594,12 +2587,6 @@ int ionic_lifs_register(struct ionic *ionic) + { + int err; + +- /* the netdev is not registered on the management device, it is +- * only used as a vehicle for napi operations on the adminq +- */ +- if (ionic->is_mgmt_nic) +- return 0; +- + INIT_WORK(&ionic->nb_work, ionic_lif_notify_work); + + ionic->nb.notifier_call = ionic_lif_notify; +-- +2.16.4 + + diff --git a/SOURCES/0013-ionic_export_features_for_vlans_to_use.patch b/SOURCES/0013-ionic_export_features_for_vlans_to_use.patch new file mode 100644 index 0000000..3c67013 --- /dev/null +++ b/SOURCES/0013-ionic_export_features_for_vlans_to_use.patch @@ -0,0 +1,37 @@ +Date: Thu, 18 Jun 2020 19:42:49 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 14/16] ionic: export features for vlans to use + +Set up vlan_features for use by any vlans above us. + +Fixes: beead698b173 ("ionic: Add the basic NDO callbacks for netdev support") +Signed-off-by: Shannon Nelson +Acked-by: Jonathan Toppins +Signed-off-by: David S. Miller +(cherry picked from commit ef7232da6bcd4294cbb2d424bc35885721570f01) +Bugzilla: 1846868 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index 9d8c969f21cb..7cc1ef657b10 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -1245,6 +1245,7 @@ static int ionic_init_nic_features(struct ionic_lif *lif) + + netdev->hw_features |= netdev->hw_enc_features; + netdev->features |= netdev->hw_features; ++ netdev->vlan_features |= netdev->features & ~NETIF_F_VLAN_FEATURES; + + netdev->priv_flags |= IFF_UNICAST_FLT | + IFF_LIVE_ADDR_CHANGE; +-- +2.16.4 + + diff --git a/SOURCES/0014-ionic_no_link_check_while_resetting_queues.patch b/SOURCES/0014-ionic_no_link_check_while_resetting_queues.patch new file mode 100644 index 0000000..e173d34 --- /dev/null +++ b/SOURCES/0014-ionic_no_link_check_while_resetting_queues.patch @@ -0,0 +1,41 @@ +Date: Thu, 18 Jun 2020 19:42:50 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 15/16] ionic: no link check while resetting queues + +If the driver is busy resetting queues after a change in +MTU or queue parameters, don't bother checking the link, +wait until the next watchdog cycle. + +Fixes: 987c0871e8ae ("ionic: check for linkup in watchdog") +Signed-off-by: Shannon Nelson +Acked-by: Jonathan Toppins +Signed-off-by: David S. Miller +(cherry picked from commit 3103b6feb4454646558eedc50ece728bc469f341) +Bugzilla: 1846953 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index 7cc1ef657b10..8f29ef133743 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -96,7 +96,8 @@ static void ionic_link_status_check(struct ionic_lif *lif) + u16 link_status; + bool link_up; + +- if (!test_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state)) ++ if (!test_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state) || ++ test_bit(IONIC_LIF_F_QUEUE_RESET, lif->state)) + return; + + link_status = le16_to_cpu(lif->info->status.link_status); +-- +2.16.4 + + diff --git a/SOURCES/0015-ionic_add_pcie_print_link_status.patch b/SOURCES/0015-ionic_add_pcie_print_link_status.patch new file mode 100644 index 0000000..84ec4df --- /dev/null +++ b/SOURCES/0015-ionic_add_pcie_print_link_status.patch @@ -0,0 +1,36 @@ +Date: Thu, 18 Jun 2020 19:42:51 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3 16/16] ionic: add pcie_print_link_status + +Print the PCIe link information for our device. + +Fixes: 77f972a7077d ("ionic: remove support for mgmt device") +Signed-off-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit c25cba3689c7ab5ae6ee7228d1d49a5652429229) +Bugzilla: 1846506 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29498383 +Tested: QE tested devel kernel as well as the partner +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +index 0ac6acbc5f31..2924cde440aa 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +@@ -248,6 +248,7 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) + } + + pci_set_master(pdev); ++ pcie_print_link_status(pdev); + + err = ionic_map_bars(ionic); + if (err) +-- +2.16.4 + + diff --git a/SOURCES/0016-ionic_tame_the_watchdog_timer_on_reconfig.patch b/SOURCES/0016-ionic_tame_the_watchdog_timer_on_reconfig.patch new file mode 100644 index 0000000..3a59f71 --- /dev/null +++ b/SOURCES/0016-ionic_tame_the_watchdog_timer_on_reconfig.patch @@ -0,0 +1,79 @@ +Date: Mon, 22 Jun 2020 01:25:29 -0400 +From: Jonathan Toppins +To: rhkernel-list@redhat.com +Cc: darcari@redhat.com, nhorman@redhat.com, linville@redhat.com +Subject: [PATCH RHEL-8.3] ionic: tame the watchdog timer on reconfig + +Even with moving netif_tx_disable() to an earlier point when +taking down the queues for a reconfiguration, we still end +up with the occasional netdev watchdog Tx Timeout complaint. +The old method of using netif_trans_update() works fine for +queue 0, but has no effect on the remaining queues. Using +netif_device_detach() allows us to signal to the watchdog to +ignore us for the moment. + +Fixes: beead698b173 ("ionic: Add the basic NDO callbacks for netdev support") +Signed-off-by: Shannon Nelson +Acked-by: Jonathan Toppins +Signed-off-by: David S. Miller +(cherry picked from commit b59eabd23ee53e8c3492602722e1697f9a2f63ad) +Bugzilla: 1846879 +Bugzilla: 1846280 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=29551761 +Tested: partner tested +Signed-off-by: Jonathan Toppins +--- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index 8f29ef133743..aaa00edd9d5b 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -1694,15 +1694,15 @@ static void ionic_stop_queues(struct ionic_lif *lif) + if (!test_and_clear_bit(IONIC_LIF_F_UP, lif->state)) + return; + +- ionic_txrx_disable(lif); + netif_tx_disable(lif->netdev); ++ ionic_txrx_disable(lif); + } + + int ionic_stop(struct net_device *netdev) + { + struct ionic_lif *lif = netdev_priv(netdev); + +- if (!netif_device_present(netdev)) ++ if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) + return 0; + + ionic_stop_queues(lif); +@@ -1985,18 +1985,19 @@ int ionic_reset_queues(struct ionic_lif *lif) + bool running; + int err = 0; + +- /* Put off the next watchdog timeout */ +- netif_trans_update(lif->netdev); +- + err = ionic_wait_for_bit(lif, IONIC_LIF_F_QUEUE_RESET); + if (err) + return err; + + running = netif_running(lif->netdev); +- if (running) ++ if (running) { ++ netif_device_detach(lif->netdev); + err = ionic_stop(lif->netdev); +- if (!err && running) ++ } ++ if (!err && running) { + ionic_open(lif->netdev); ++ netif_device_attach(lif->netdev); ++ } + + clear_bit(IONIC_LIF_F_QUEUE_RESET, lif->state); + +-- +2.16.4 + + diff --git a/SOURCES/0017-ionic-update-the-queue-count-on-open.patch b/SOURCES/0017-ionic-update-the-queue-count-on-open.patch new file mode 100644 index 0000000..0e26516 --- /dev/null +++ b/SOURCES/0017-ionic-update-the-queue-count-on-open.patch @@ -0,0 +1,40 @@ +From fa48494cce5f6360b0f8683cdf258fb45c666287 Mon Sep 17 00:00:00 2001 +From: Shannon Nelson +Date: Thu, 25 Jun 2020 22:58:37 -0700 +Subject: [PATCH] ionic: update the queue count on open + +Let the network stack know the real number of queues that +we are using. + +v2: added error checking + +Fixes: 49d3b493673a ("ionic: disable the queues on link down") +Signed-off-by: Shannon Nelson +Reviewed-by: Jakub Kicinski +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +index aaa00edd9d5b..3c9dde31f3fa 100644 +--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c ++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c +@@ -1673,6 +1673,14 @@ int ionic_open(struct net_device *netdev) + if (err) + goto err_out; + ++ err = netif_set_real_num_tx_queues(netdev, lif->nxqs); ++ if (err) ++ goto err_txrx_deinit; ++ ++ err = netif_set_real_num_rx_queues(netdev, lif->nxqs); ++ if (err) ++ goto err_txrx_deinit; ++ + /* don't start the queues until we have link */ + if (netif_carrier_ok(netdev)) { + err = ionic_start_queues(lif); +-- +2.13.6 + diff --git a/SOURCES/9000-Makefile-CONFIG_IONIC.patch b/SOURCES/9000-Makefile-CONFIG_IONIC.patch new file mode 100644 index 0000000..4d7e89f --- /dev/null +++ b/SOURCES/9000-Makefile-CONFIG_IONIC.patch @@ -0,0 +1,14 @@ +Index: src/drivers/net/ethernet/pensando/ionic/Makefile +=================================================================== +--- src.orig/drivers/net/ethernet/pensando/ionic/Makefile 2020-06-28 15:21:53.545664652 +0200 ++++ src/drivers/net/ethernet/pensando/ionic/Makefile 2020-06-28 15:22:39.483729298 +0200 +@@ -1,6 +1,9 @@ + # SPDX-License-Identifier: GPL-2.0 + # Copyright(c) 2017 - 2019 Pensando Systems, Inc + ++CONFIG_NET_VENDOR_PENSANDO := y ++CONFIG_IONIC := m ++ + obj-$(CONFIG_IONIC) := ionic.o + + ionic-y := ionic_main.o ionic_bus_pci.o ionic_devlink.o ionic_dev.o \ diff --git a/SOURCES/9001-add-ionic_backport_compat-h.patch b/SOURCES/9001-add-ionic_backport_compat-h.patch new file mode 100644 index 0000000..f8f785a --- /dev/null +++ b/SOURCES/9001-add-ionic_backport_compat-h.patch @@ -0,0 +1,23 @@ +Index: src/drivers/net/ethernet/pensando/ionic/ionic.h +=================================================================== +--- src.orig/drivers/net/ethernet/pensando/ionic/ionic.h 2020-06-23 12:25:59.338224007 +0200 ++++ src/drivers/net/ethernet/pensando/ionic/ionic.h 2020-06-27 14:53:12.175233977 +0200 +@@ -10,6 +10,8 @@ + #include "ionic_dev.h" + #include "ionic_devlink.h" + ++#include "ionic_backport_compat.h" ++ + #define IONIC_DRV_NAME "ionic" + #define IONIC_DRV_DESCRIPTION "Pensando Ethernet NIC Driver" + +Index: src/drivers/net/ethernet/pensando/ionic/ionic_backport_compat.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ src/drivers/net/ethernet/pensando/ionic/ionic_backport_compat.h 2020-06-27 14:52:31.974179393 +0200 +@@ -0,0 +1,5 @@ ++#ifndef IONIC_BACKPORT_COMPAT_H ++#define IONIC_BACKPORT_COMPAT_H ++ ++ ++#endif /* IONIC_BACKPORT_COMPAT_H */ diff --git a/SOURCES/9002-SFF8024-enum.patch b/SOURCES/9002-SFF8024-enum.patch new file mode 100644 index 0000000..fad43ec --- /dev/null +++ b/SOURCES/9002-SFF8024-enum.patch @@ -0,0 +1,66 @@ +Index: src/drivers/net/ethernet/pensando/ionic/ionic_backport_compat.h +=================================================================== +--- src.orig/drivers/net/ethernet/pensando/ionic/ionic_backport_compat.h 2020-06-27 14:52:31.974179393 +0200 ++++ src/drivers/net/ethernet/pensando/ionic/ionic_backport_compat.h 2020-06-28 15:13:55.980992671 +0200 +@@ -1,5 +1,61 @@ + #ifndef IONIC_BACKPORT_COMPAT_H + #define IONIC_BACKPORT_COMPAT_H + ++#include ++ ++/* SFF8024 defined constants */ ++enum { ++ SFF8024_ID_UNK = 0x00, ++ SFF8024_ID_SFF_8472 = SFP_PHYS_ID_SFF, ++ SFF8024_ID_SFP = SFP_PHYS_ID_SFP, ++ SFF8024_ID_DWDM_SFP = 0x0b, ++ SFF8024_ID_QSFP_8438 = 0x0c, ++ SFF8024_ID_QSFP_8436_8636 = 0x0d, ++ SFF8024_ID_QSFP28_8636 = 0x11, ++ ++ SFF8024_ENCODING_UNSPEC = SFP_ENCODING_UNSPEC, ++ SFF8024_ENCODING_8B10B = SFP_ENCODING_8B10B, ++ SFF8024_ENCODING_4B5B = SFP_ENCODING_4B5B, ++ SFF8024_ENCODING_NRZ = SFP_ENCODING_NRZ, ++ SFF8024_ENCODING_8472_MANCHESTER= SFP_ENCODING_8472_MANCHESTER, ++ SFF8024_ENCODING_8472_SONET = SFP_ENCODING_8472_SONET, ++ SFF8024_ENCODING_8472_64B66B = SFP_ENCODING_8472_64B66B, ++ SFF8024_ENCODING_8436_MANCHESTER= 0x06, ++ SFF8024_ENCODING_8436_SONET = 0x04, ++ SFF8024_ENCODING_8436_64B66B = 0x05, ++ SFF8024_ENCODING_256B257B = SFP_ENCODING_256B257B, ++ SFF8024_ENCODING_PAM4 = SFP_ENCODING_PAM4, ++ ++ SFF8024_CONNECTOR_UNSPEC = SFP_CONNECTOR_UNSPEC, ++ /* codes 01-05 not supportable on SFP, but some modules have single SC */ ++ SFF8024_CONNECTOR_SC = SFP_CONNECTOR_SC, ++ SFF8024_CONNECTOR_FIBERJACK = SFP_CONNECTOR_FIBERJACK, ++ SFF8024_CONNECTOR_LC = SFP_CONNECTOR_LC, ++ SFF8024_CONNECTOR_MT_RJ = SFP_CONNECTOR_MT_RJ, ++ SFF8024_CONNECTOR_MU = SFP_CONNECTOR_MU, ++ SFF8024_CONNECTOR_SG = SFP_CONNECTOR_SG, ++ SFF8024_CONNECTOR_OPTICAL_PIGTAIL= SFP_CONNECTOR_OPTICAL_PIGTAIL, ++ SFF8024_CONNECTOR_MPO_1X12 = SFP_CONNECTOR_MPO_1X12, ++ SFF8024_CONNECTOR_MPO_2X16 = SFP_CONNECTOR_MPO_2X16, ++ SFF8024_CONNECTOR_HSSDC_II = SFP_CONNECTOR_HSSDC_II, ++ SFF8024_CONNECTOR_COPPER_PIGTAIL= SFP_CONNECTOR_COPPER_PIGTAIL, ++ SFF8024_CONNECTOR_RJ45 = SFP_CONNECTOR_RJ45, ++ SFF8024_CONNECTOR_NOSEPARATE = SFP_CONNECTOR_NOSEPARATE, ++ SFF8024_CONNECTOR_MXC_2X16 = SFP_CONNECTOR_MXC_2X16, ++ ++ SFF8024_ECC_UNSPEC = 0x00, ++ SFF8024_ECC_100G_25GAUI_C2M_AOC = 0x01, ++ SFF8024_ECC_100GBASE_SR4_25GBASE_SR = 0x02, ++ SFF8024_ECC_100GBASE_LR4_25GBASE_LR = 0x03, ++ SFF8024_ECC_100GBASE_ER4_25GBASE_ER = 0x04, ++ SFF8024_ECC_100GBASE_SR10 = 0x05, ++ SFF8024_ECC_100GBASE_CR4 = 0x0b, ++ SFF8024_ECC_25GBASE_CR_S = 0x0c, ++ SFF8024_ECC_25GBASE_CR_N = 0x0d, ++ SFF8024_ECC_10GBASE_T_SFI = 0x16, ++ SFF8024_ECC_10GBASE_T_SR = 0x1c, ++ SFF8024_ECC_5GBASE_T = 0x1d, ++ SFF8024_ECC_2_5GBASE_T = 0x1e, ++}; + + #endif /* IONIC_BACKPORT_COMPAT_H */ diff --git a/SOURCES/9003-add-dynamic_hex_dump.patch b/SOURCES/9003-add-dynamic_hex_dump.patch new file mode 100644 index 0000000..2fdbca7 --- /dev/null +++ b/SOURCES/9003-add-dynamic_hex_dump.patch @@ -0,0 +1,29 @@ +Index: src/drivers/net/ethernet/pensando/ionic/ionic_backport_compat.h +=================================================================== +--- src.orig/drivers/net/ethernet/pensando/ionic/ionic_backport_compat.h 2020-06-28 15:23:55.318836007 +0200 ++++ src/drivers/net/ethernet/pensando/ionic/ionic_backport_compat.h 2020-06-28 15:29:46.854330796 +0200 +@@ -1,6 +1,8 @@ + #ifndef IONIC_BACKPORT_COMPAT_H + #define IONIC_BACKPORT_COMPAT_H + ++#include ++#include + #include + + /* SFF8024 defined constants */ +@@ -58,4 +60,15 @@ + SFF8024_ECC_2_5GBASE_T = 0x1e, + }; + ++ ++#ifndef dynamic_hex_dump ++# define dynamic_hex_dump(prefix_str, prefix_type, rowsize, \ ++ groupsize, buf, len, ascii) \ ++ do { if (0) \ ++ print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, \ ++ rowsize, groupsize, buf, len, ascii); \ ++ } while (0) ++#endif ++ ++ + #endif /* IONIC_BACKPORT_COMPAT_H */ diff --git a/SOURCES/9004-Revert-netdrv-netdev-pass-the-stuck-queue-to-the-timeout-ha.patch b/SOURCES/9004-Revert-netdrv-netdev-pass-the-stuck-queue-to-the-timeout-ha.patch new file mode 100644 index 0000000..a8c9af2 --- /dev/null +++ b/SOURCES/9004-Revert-netdrv-netdev-pass-the-stuck-queue-to-the-timeout-ha.patch @@ -0,0 +1,401 @@ +This patch reverts the following patch: + +From 64285e39141d31d9d09a22394ff79ecc1dd912f6 Mon Sep 17 00:00:00 2001 +From: Jonathan Toppins +Date: Tue, 28 Apr 2020 19:08:42 -0400 +Subject: [PATCH] [netdrv] netdev:pass the stuck queue to the timeout handler + +Message-id: <94acdbd3257582e68f8c931ec148e9debd57e61c.1588100140.git.jtoppins@redhat.com> +Patchwork-id: 305685 +Patchwork-instance: patchwork +O-Subject: [PATCH RHEL-8.3 58/84] netdev: [ionic only] pass the stuck queue to the timeout handler +Bugzilla: 1780645 +RH-Acked-by: John Linville +RH-Acked-by: Corinna Vinschen +RH-Acked-by: Tony Camuso + +This allows incrementing the correct timeout statistic without any mess. +Down the road, devices can learn to reset just the specific queue. + +The patch was generated with the following script: + +use strict; +use warnings; + +our $^I = '.bak'; + +my @work = ( +["arch/m68k/emu/nfeth.c", "nfeth_tx_timeout"], +["arch/um/drivers/net_kern.c", "uml_net_tx_timeout"], +["arch/um/drivers/vector_kern.c", "vector_net_tx_timeout"], +["arch/xtensa/platforms/iss/network.c", "iss_net_tx_timeout"], +["drivers/char/pcmcia/synclink_cs.c", "hdlcdev_tx_timeout"], +["drivers/infiniband/ulp/ipoib/ipoib_main.c", "ipoib_timeout"], +["drivers/infiniband/ulp/ipoib/ipoib_main.c", "ipoib_timeout"], +["drivers/message/fusion/mptlan.c", "mpt_lan_tx_timeout"], +["drivers/misc/sgi-xp/xpnet.c", "xpnet_dev_tx_timeout"], +["drivers/net/appletalk/cops.c", "cops_timeout"], +["drivers/net/arcnet/arcdevice.h", "arcnet_timeout"], +["drivers/net/arcnet/arcnet.c", "arcnet_timeout"], +["drivers/net/arcnet/com20020.c", "arcnet_timeout"], +["drivers/net/ethernet/3com/3c509.c", "el3_tx_timeout"], +["drivers/net/ethernet/3com/3c515.c", "corkscrew_timeout"], +["drivers/net/ethernet/3com/3c574_cs.c", "el3_tx_timeout"], +["drivers/net/ethernet/3com/3c589_cs.c", "el3_tx_timeout"], +["drivers/net/ethernet/3com/3c59x.c", "vortex_tx_timeout"], +["drivers/net/ethernet/3com/3c59x.c", "vortex_tx_timeout"], +["drivers/net/ethernet/3com/typhoon.c", "typhoon_tx_timeout"], +["drivers/net/ethernet/8390/8390.h", "ei_tx_timeout"], +["drivers/net/ethernet/8390/8390.h", "eip_tx_timeout"], +["drivers/net/ethernet/8390/8390.c", "ei_tx_timeout"], +["drivers/net/ethernet/8390/8390p.c", "eip_tx_timeout"], +["drivers/net/ethernet/8390/ax88796.c", "ax_ei_tx_timeout"], +["drivers/net/ethernet/8390/axnet_cs.c", "axnet_tx_timeout"], +["drivers/net/ethernet/8390/etherh.c", "__ei_tx_timeout"], +["drivers/net/ethernet/8390/hydra.c", "__ei_tx_timeout"], +["drivers/net/ethernet/8390/mac8390.c", "__ei_tx_timeout"], +["drivers/net/ethernet/8390/mcf8390.c", "__ei_tx_timeout"], +["drivers/net/ethernet/8390/lib8390.c", "__ei_tx_timeout"], +["drivers/net/ethernet/8390/ne2k-pci.c", "ei_tx_timeout"], +["drivers/net/ethernet/8390/pcnet_cs.c", "ei_tx_timeout"], +["drivers/net/ethernet/8390/smc-ultra.c", "ei_tx_timeout"], +["drivers/net/ethernet/8390/wd.c", "ei_tx_timeout"], +["drivers/net/ethernet/8390/zorro8390.c", "__ei_tx_timeout"], +["drivers/net/ethernet/adaptec/starfire.c", "tx_timeout"], +["drivers/net/ethernet/agere/et131x.c", "et131x_tx_timeout"], +["drivers/net/ethernet/allwinner/sun4i-emac.c", "emac_timeout"], +["drivers/net/ethernet/alteon/acenic.c", "ace_watchdog"], +["drivers/net/ethernet/amazon/ena/ena_netdev.c", "ena_tx_timeout"], +["drivers/net/ethernet/amd/7990.h", "lance_tx_timeout"], +["drivers/net/ethernet/amd/7990.c", "lance_tx_timeout"], +["drivers/net/ethernet/amd/a2065.c", "lance_tx_timeout"], +["drivers/net/ethernet/amd/am79c961a.c", "am79c961_timeout"], +["drivers/net/ethernet/amd/amd8111e.c", "amd8111e_tx_timeout"], +["drivers/net/ethernet/amd/ariadne.c", "ariadne_tx_timeout"], +["drivers/net/ethernet/amd/atarilance.c", "lance_tx_timeout"], +["drivers/net/ethernet/amd/au1000_eth.c", "au1000_tx_timeout"], +["drivers/net/ethernet/amd/declance.c", "lance_tx_timeout"], +["drivers/net/ethernet/amd/lance.c", "lance_tx_timeout"], +["drivers/net/ethernet/amd/mvme147.c", "lance_tx_timeout"], +["drivers/net/ethernet/amd/ni65.c", "ni65_timeout"], +["drivers/net/ethernet/amd/nmclan_cs.c", "mace_tx_timeout"], +["drivers/net/ethernet/amd/pcnet32.c", "pcnet32_tx_timeout"], +["drivers/net/ethernet/amd/sunlance.c", "lance_tx_timeout"], +["drivers/net/ethernet/amd/xgbe/xgbe-drv.c", "xgbe_tx_timeout"], +["drivers/net/ethernet/apm/xgene-v2/main.c", "xge_timeout"], +["drivers/net/ethernet/apm/xgene/xgene_enet_main.c", "xgene_enet_timeout"], +["drivers/net/ethernet/apple/macmace.c", "mace_tx_timeout"], +["drivers/net/ethernet/atheros/ag71xx.c", "ag71xx_tx_timeout"], +["drivers/net/ethernet/atheros/alx/main.c", "alx_tx_timeout"], +["drivers/net/ethernet/atheros/atl1c/atl1c_main.c", "atl1c_tx_timeout"], +["drivers/net/ethernet/atheros/atl1e/atl1e_main.c", "atl1e_tx_timeout"], +["drivers/net/ethernet/atheros/atlx/atl.c", "atlx_tx_timeout"], +["drivers/net/ethernet/atheros/atlx/atl1.c", "atlx_tx_timeout"], +["drivers/net/ethernet/atheros/atlx/atl2.c", "atl2_tx_timeout"], +["drivers/net/ethernet/broadcom/b44.c", "b44_tx_timeout"], +["drivers/net/ethernet/broadcom/bcmsysport.c", "bcm_sysport_tx_timeout"], +["drivers/net/ethernet/broadcom/bnx2.c", "bnx2_tx_timeout"], +["drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h", "bnx2x_tx_timeout"], +["drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c", "bnx2x_tx_timeout"], +["drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c", "bnx2x_tx_timeout"], +["drivers/net/ethernet/broadcom/bnxt/bnxt.c", "bnxt_tx_timeout"], +["drivers/net/ethernet/broadcom/genet/bcmgenet.c", "bcmgenet_timeout"], +["drivers/net/ethernet/broadcom/sb1250-mac.c", "sbmac_tx_timeout"], +["drivers/net/ethernet/broadcom/tg3.c", "tg3_tx_timeout"], +["drivers/net/ethernet/calxeda/xgmac.c", "xgmac_tx_timeout"], +["drivers/net/ethernet/cavium/liquidio/lio_main.c", "liquidio_tx_timeout"], +["drivers/net/ethernet/cavium/liquidio/lio_vf_main.c", "liquidio_tx_timeout"], +["drivers/net/ethernet/cavium/liquidio/lio_vf_rep.c", "lio_vf_rep_tx_timeout"], +["drivers/net/ethernet/cavium/thunder/nicvf_main.c", "nicvf_tx_timeout"], +["drivers/net/ethernet/cirrus/cs89x0.c", "net_timeout"], +["drivers/net/ethernet/cisco/enic/enic_main.c", "enic_tx_timeout"], +["drivers/net/ethernet/cisco/enic/enic_main.c", "enic_tx_timeout"], +["drivers/net/ethernet/cortina/gemini.c", "gmac_tx_timeout"], +["drivers/net/ethernet/davicom/dm9000.c", "dm9000_timeout"], +["drivers/net/ethernet/dec/tulip/de2104x.c", "de_tx_timeout"], +["drivers/net/ethernet/dec/tulip/tulip_core.c", "tulip_tx_timeout"], +["drivers/net/ethernet/dec/tulip/winbond-840.c", "tx_timeout"], +["drivers/net/ethernet/dlink/dl2k.c", "rio_tx_timeout"], +["drivers/net/ethernet/dlink/sundance.c", "tx_timeout"], +["drivers/net/ethernet/emulex/benet/be_main.c", "be_tx_timeout"], +["drivers/net/ethernet/ethoc.c", "ethoc_tx_timeout"], +["drivers/net/ethernet/faraday/ftgmac100.c", "ftgmac100_tx_timeout"], +["drivers/net/ethernet/fealnx.c", "fealnx_tx_timeout"], +["drivers/net/ethernet/freescale/dpaa/dpaa_eth.c", "dpaa_tx_timeout"], +["drivers/net/ethernet/freescale/fec_main.c", "fec_timeout"], +["drivers/net/ethernet/freescale/fec_mpc52xx.c", "mpc52xx_fec_tx_timeout"], +["drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c", "fs_timeout"], +["drivers/net/ethernet/freescale/gianfar.c", "gfar_timeout"], +["drivers/net/ethernet/freescale/ucc_geth.c", "ucc_geth_timeout"], +["drivers/net/ethernet/fujitsu/fmvj18x_cs.c", "fjn_tx_timeout"], +["drivers/net/ethernet/google/gve/gve_main.c", "gve_tx_timeout"], +["drivers/net/ethernet/hisilicon/hip04_eth.c", "hip04_timeout"], +["drivers/net/ethernet/hisilicon/hix5hd2_gmac.c", "hix5hd2_net_timeout"], +["drivers/net/ethernet/hisilicon/hns/hns_enet.c", "hns_nic_net_timeout"], +["drivers/net/ethernet/hisilicon/hns3/hns3_enet.c", "hns3_nic_net_timeout"], +["drivers/net/ethernet/huawei/hinic/hinic_main.c", "hinic_tx_timeout"], +["drivers/net/ethernet/i825xx/82596.c", "i596_tx_timeout"], +["drivers/net/ethernet/i825xx/ether1.c", "ether1_timeout"], +["drivers/net/ethernet/i825xx/lib82596.c", "i596_tx_timeout"], +["drivers/net/ethernet/i825xx/sun3_82586.c", "sun3_82586_timeout"], +["drivers/net/ethernet/ibm/ehea/ehea_main.c", "ehea_tx_watchdog"], +["drivers/net/ethernet/ibm/emac/core.c", "emac_tx_timeout"], +["drivers/net/ethernet/ibm/emac/core.c", "emac_tx_timeout"], +["drivers/net/ethernet/ibm/ibmvnic.c", "ibmvnic_tx_timeout"], +["drivers/net/ethernet/intel/e100.c", "e100_tx_timeout"], +["drivers/net/ethernet/intel/e1000/e1000_main.c", "e1000_tx_timeout"], +["drivers/net/ethernet/intel/e1000e/netdev.c", "e1000_tx_timeout"], +["drivers/net/ethernet/intel/fm10k/fm10k_netdev.c", "fm10k_tx_timeout"], +["drivers/net/ethernet/intel/i40e/i40e_main.c", "i40e_tx_timeout"], +["drivers/net/ethernet/intel/iavf/iavf_main.c", "iavf_tx_timeout"], +["drivers/net/ethernet/intel/ice/ice_main.c", "ice_tx_timeout"], +["drivers/net/ethernet/intel/ice/ice_main.c", "ice_tx_timeout"], +["drivers/net/ethernet/intel/igb/igb_main.c", "igb_tx_timeout"], +["drivers/net/ethernet/intel/igbvf/netdev.c", "igbvf_tx_timeout"], +["drivers/net/ethernet/intel/ixgb/ixgb_main.c", "ixgb_tx_timeout"], +["drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c", "adapter->netdev->netdev_ops->ndo_tx_timeout(adapter->netdev);"], +["drivers/net/ethernet/intel/ixgbe/ixgbe_main.c", "ixgbe_tx_timeout"], +["drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c", "ixgbevf_tx_timeout"], +["drivers/net/ethernet/jme.c", "jme_tx_timeout"], +["drivers/net/ethernet/korina.c", "korina_tx_timeout"], +["drivers/net/ethernet/lantiq_etop.c", "ltq_etop_tx_timeout"], +["drivers/net/ethernet/marvell/mv643xx_eth.c", "mv643xx_eth_tx_timeout"], +["drivers/net/ethernet/marvell/pxa168_eth.c", "pxa168_eth_tx_timeout"], +["drivers/net/ethernet/marvell/skge.c", "skge_tx_timeout"], +["drivers/net/ethernet/marvell/sky2.c", "sky2_tx_timeout"], +["drivers/net/ethernet/marvell/sky2.c", "sky2_tx_timeout"], +["drivers/net/ethernet/mediatek/mtk_eth_soc.c", "mtk_tx_timeout"], +["drivers/net/ethernet/mellanox/mlx4/en_netdev.c", "mlx4_en_tx_timeout"], +["drivers/net/ethernet/mellanox/mlx4/en_netdev.c", "mlx4_en_tx_timeout"], +["drivers/net/ethernet/mellanox/mlx5/core/en_main.c", "mlx5e_tx_timeout"], +["drivers/net/ethernet/micrel/ks8842.c", "ks8842_tx_timeout"], +["drivers/net/ethernet/micrel/ksz884x.c", "netdev_tx_timeout"], +["drivers/net/ethernet/microchip/enc28j60.c", "enc28j60_tx_timeout"], +["drivers/net/ethernet/microchip/encx24j600.c", "encx24j600_tx_timeout"], +["drivers/net/ethernet/natsemi/sonic.h", "sonic_tx_timeout"], +["drivers/net/ethernet/natsemi/sonic.c", "sonic_tx_timeout"], +["drivers/net/ethernet/natsemi/jazzsonic.c", "sonic_tx_timeout"], +["drivers/net/ethernet/natsemi/macsonic.c", "sonic_tx_timeout"], +["drivers/net/ethernet/natsemi/natsemi.c", "ns_tx_timeout"], +["drivers/net/ethernet/natsemi/ns83820.c", "ns83820_tx_timeout"], +["drivers/net/ethernet/natsemi/xtsonic.c", "sonic_tx_timeout"], +["drivers/net/ethernet/neterion/s2io.h", "s2io_tx_watchdog"], +["drivers/net/ethernet/neterion/s2io.c", "s2io_tx_watchdog"], +["drivers/net/ethernet/neterion/vxge/vxge-main.c", "vxge_tx_watchdog"], +["drivers/net/ethernet/netronome/nfp/nfp_net_common.c", "nfp_net_tx_timeout"], +["drivers/net/ethernet/nvidia/forcedeth.c", "nv_tx_timeout"], +["drivers/net/ethernet/nvidia/forcedeth.c", "nv_tx_timeout"], +["drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c", "pch_gbe_tx_timeout"], +["drivers/net/ethernet/packetengines/hamachi.c", "hamachi_tx_timeout"], +["drivers/net/ethernet/packetengines/yellowfin.c", "yellowfin_tx_timeout"], +["drivers/net/ethernet/pensando/ionic/ionic_lif.c", "ionic_tx_timeout"], +["drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c", "netxen_tx_timeout"], +["drivers/net/ethernet/qlogic/qla3xxx.c", "ql3xxx_tx_timeout"], +["drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c", "qlcnic_tx_timeout"], +["drivers/net/ethernet/qualcomm/emac/emac.c", "emac_tx_timeout"], +["drivers/net/ethernet/qualcomm/qca_spi.c", "qcaspi_netdev_tx_timeout"], +["drivers/net/ethernet/qualcomm/qca_uart.c", "qcauart_netdev_tx_timeout"], +["drivers/net/ethernet/rdc/r6040.c", "r6040_tx_timeout"], +["drivers/net/ethernet/realtek/8139cp.c", "cp_tx_timeout"], +["drivers/net/ethernet/realtek/8139too.c", "rtl8139_tx_timeout"], +["drivers/net/ethernet/realtek/atp.c", "tx_timeout"], +["drivers/net/ethernet/realtek/r8169_main.c", "rtl8169_tx_timeout"], +["drivers/net/ethernet/renesas/ravb_main.c", "ravb_tx_timeout"], +["drivers/net/ethernet/renesas/sh_eth.c", "sh_eth_tx_timeout"], +["drivers/net/ethernet/renesas/sh_eth.c", "sh_eth_tx_timeout"], +["drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c", "sxgbe_tx_timeout"], +["drivers/net/ethernet/seeq/ether3.c", "ether3_timeout"], +["drivers/net/ethernet/seeq/sgiseeq.c", "timeout"], +["drivers/net/ethernet/sfc/efx.c", "efx_watchdog"], +["drivers/net/ethernet/sfc/falcon/efx.c", "ef4_watchdog"], +["drivers/net/ethernet/sgi/ioc3-eth.c", "ioc3_timeout"], +["drivers/net/ethernet/sgi/meth.c", "meth_tx_timeout"], +["drivers/net/ethernet/silan/sc92031.c", "sc92031_tx_timeout"], +["drivers/net/ethernet/sis/sis190.c", "sis190_tx_timeout"], +["drivers/net/ethernet/sis/sis900.c", "sis900_tx_timeout"], +["drivers/net/ethernet/smsc/epic100.c", "epic_tx_timeout"], +["drivers/net/ethernet/smsc/smc911x.c", "smc911x_timeout"], +["drivers/net/ethernet/smsc/smc9194.c", "smc_timeout"], +["drivers/net/ethernet/smsc/smc91c92_cs.c", "smc_tx_timeout"], +["drivers/net/ethernet/smsc/smc91x.c", "smc_timeout"], +["drivers/net/ethernet/stmicro/stmmac/stmmac_main.c", "stmmac_tx_timeout"], +["drivers/net/ethernet/sun/cassini.c", "cas_tx_timeout"], +["drivers/net/ethernet/sun/ldmvsw.c", "sunvnet_tx_timeout_common"], +["drivers/net/ethernet/sun/niu.c", "niu_tx_timeout"], +["drivers/net/ethernet/sun/sunbmac.c", "bigmac_tx_timeout"], +["drivers/net/ethernet/sun/sungem.c", "gem_tx_timeout"], +["drivers/net/ethernet/sun/sunhme.c", "happy_meal_tx_timeout"], +["drivers/net/ethernet/sun/sunqe.c", "qe_tx_timeout"], +["drivers/net/ethernet/sun/sunvnet.c", "sunvnet_tx_timeout_common"], +["drivers/net/ethernet/sun/sunvnet_common.c", "sunvnet_tx_timeout_common"], +["drivers/net/ethernet/sun/sunvnet_common.h", "sunvnet_tx_timeout_common"], +["drivers/net/ethernet/synopsys/dwc-xlgmac-net.c", "xlgmac_tx_timeout"], +["drivers/net/ethernet/ti/cpmac.c", "cpmac_tx_timeout"], +["drivers/net/ethernet/ti/cpsw.c", "cpsw_ndo_tx_timeout"], +["drivers/net/ethernet/ti/cpsw_priv.c", "cpsw_ndo_tx_timeout"], +["drivers/net/ethernet/ti/cpsw_priv.h", "cpsw_ndo_tx_timeout"], +["drivers/net/ethernet/ti/davinci_emac.c", "emac_dev_tx_timeout"], +["drivers/net/ethernet/ti/netcp_core.c", "netcp_ndo_tx_timeout"], +["drivers/net/ethernet/ti/tlan.c", "tlan_tx_timeout"], +["drivers/net/ethernet/toshiba/ps3_gelic_net.h", "gelic_net_tx_timeout"], +["drivers/net/ethernet/toshiba/ps3_gelic_net.c", "gelic_net_tx_timeout"], +["drivers/net/ethernet/toshiba/ps3_gelic_wireless.c", "gelic_net_tx_timeout"], +["drivers/net/ethernet/toshiba/spider_net.c", "spider_net_tx_timeout"], +["drivers/net/ethernet/toshiba/tc35815.c", "tc35815_tx_timeout"], +["drivers/net/ethernet/via/via-rhine.c", "rhine_tx_timeout"], +["drivers/net/ethernet/wiznet/w5100.c", "w5100_tx_timeout"], +["drivers/net/ethernet/wiznet/w5300.c", "w5300_tx_timeout"], +["drivers/net/ethernet/xilinx/xilinx_emaclite.c", "xemaclite_tx_timeout"], +["drivers/net/ethernet/xircom/xirc2ps_cs.c", "xirc_tx_timeout"], +["drivers/net/fjes/fjes_main.c", "fjes_tx_retry"], +["drivers/net/slip/slip.c", "sl_tx_timeout"], +["include/linux/usb/usbnet.h", "usbnet_tx_timeout"], +["drivers/net/usb/aqc111.c", "usbnet_tx_timeout"], +["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"], +["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"], +["drivers/net/usb/asix_devices.c", "usbnet_tx_timeout"], +["drivers/net/usb/ax88172a.c", "usbnet_tx_timeout"], +["drivers/net/usb/ax88179_178a.c", "usbnet_tx_timeout"], +["drivers/net/usb/catc.c", "catc_tx_timeout"], +["drivers/net/usb/cdc_mbim.c", "usbnet_tx_timeout"], +["drivers/net/usb/cdc_ncm.c", "usbnet_tx_timeout"], +["drivers/net/usb/dm9601.c", "usbnet_tx_timeout"], +["drivers/net/usb/hso.c", "hso_net_tx_timeout"], +["drivers/net/usb/int51x1.c", "usbnet_tx_timeout"], +["drivers/net/usb/ipheth.c", "ipheth_tx_timeout"], +["drivers/net/usb/kaweth.c", "kaweth_tx_timeout"], +["drivers/net/usb/lan78xx.c", "lan78xx_tx_timeout"], +["drivers/net/usb/mcs7830.c", "usbnet_tx_timeout"], +["drivers/net/usb/pegasus.c", "pegasus_tx_timeout"], +["drivers/net/usb/qmi_wwan.c", "usbnet_tx_timeout"], +["drivers/net/usb/r8152.c", "rtl8152_tx_timeout"], +["drivers/net/usb/rndis_host.c", "usbnet_tx_timeout"], +["drivers/net/usb/rtl8150.c", "rtl8150_tx_timeout"], +["drivers/net/usb/sierra_net.c", "usbnet_tx_timeout"], +["drivers/net/usb/smsc75xx.c", "usbnet_tx_timeout"], +["drivers/net/usb/smsc95xx.c", "usbnet_tx_timeout"], +["drivers/net/usb/sr9700.c", "usbnet_tx_timeout"], +["drivers/net/usb/sr9800.c", "usbnet_tx_timeout"], +["drivers/net/usb/usbnet.c", "usbnet_tx_timeout"], +["drivers/net/vmxnet3/vmxnet3_drv.c", "vmxnet3_tx_timeout"], +["drivers/net/wan/cosa.c", "cosa_net_timeout"], +["drivers/net/wan/farsync.c", "fst_tx_timeout"], +["drivers/net/wan/fsl_ucc_hdlc.c", "uhdlc_tx_timeout"], +["drivers/net/wan/lmc/lmc_main.c", "lmc_driver_timeout"], +["drivers/net/wan/x25_asy.c", "x25_asy_timeout"], +["drivers/net/wimax/i2400m/netdev.c", "i2400m_tx_timeout"], +["drivers/net/wireless/intel/ipw2x00/ipw2100.c", "ipw2100_tx_timeout"], +["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"], +["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"], +["drivers/net/wireless/intersil/hostap/hostap_main.c", "prism2_tx_timeout"], +["drivers/net/wireless/intersil/orinoco/main.c", "orinoco_tx_timeout"], +["drivers/net/wireless/intersil/orinoco/orinoco_usb.c", "orinoco_tx_timeout"], +["drivers/net/wireless/intersil/orinoco/orinoco.h", "orinoco_tx_timeout"], +["drivers/net/wireless/intersil/prism54/islpci_dev.c", "islpci_eth_tx_timeout"], +["drivers/net/wireless/intersil/prism54/islpci_eth.c", "islpci_eth_tx_timeout"], +["drivers/net/wireless/intersil/prism54/islpci_eth.h", "islpci_eth_tx_timeout"], +["drivers/net/wireless/marvell/mwifiex/main.c", "mwifiex_tx_timeout"], +["drivers/net/wireless/quantenna/qtnfmac/core.c", "qtnf_netdev_tx_timeout"], +["drivers/net/wireless/quantenna/qtnfmac/core.h", "qtnf_netdev_tx_timeout"], +["drivers/net/wireless/rndis_wlan.c", "usbnet_tx_timeout"], +["drivers/net/wireless/wl3501_cs.c", "wl3501_tx_timeout"], +["drivers/net/wireless/zydas/zd1201.c", "zd1201_tx_timeout"], +["drivers/s390/net/qeth_core.h", "qeth_tx_timeout"], +["drivers/s390/net/qeth_core_main.c", "qeth_tx_timeout"], +["drivers/s390/net/qeth_l2_main.c", "qeth_tx_timeout"], +["drivers/s390/net/qeth_l2_main.c", "qeth_tx_timeout"], +["drivers/s390/net/qeth_l3_main.c", "qeth_tx_timeout"], +["drivers/s390/net/qeth_l3_main.c", "qeth_tx_timeout"], +["drivers/staging/ks7010/ks_wlan_net.c", "ks_wlan_tx_timeout"], +["drivers/staging/qlge/qlge_main.c", "qlge_tx_timeout"], +["drivers/staging/rtl8192e/rtl8192e/rtl_core.c", "_rtl92e_tx_timeout"], +["drivers/staging/rtl8192u/r8192U_core.c", "tx_timeout"], +["drivers/staging/unisys/visornic/visornic_main.c", "visornic_xmit_timeout"], +["drivers/staging/wlan-ng/p80211netdev.c", "p80211knetdev_tx_timeout"], +["drivers/tty/n_gsm.c", "gsm_mux_net_tx_timeout"], +["drivers/tty/synclink.c", "hdlcdev_tx_timeout"], +["drivers/tty/synclink_gt.c", "hdlcdev_tx_timeout"], +["drivers/tty/synclinkmp.c", "hdlcdev_tx_timeout"], +["net/atm/lec.c", "lec_tx_timeout"], +["net/bluetooth/bnep/netdev.c", "bnep_net_timeout"] +); + +for my $p (@work) { + my @pair = @$p; + my $file = $pair[0]; + my $func = $pair[1]; + print STDERR $file , ": ", $func,"\n"; + our @ARGV = ($file); + while () { + if (m/($func\s*\(struct\s+net_device\s+\*[A-Za-z_]?[A-Za-z-0-9_]*)(\))/) { + print STDERR "found $1+$2 in $file\n"; + } + if (s/($func\s*\(struct\s+net_device\s+\*[A-Za-z_]?[A-Za-z-0-9_]*)(\))/$1, unsigned int txqueue$2/) { + print STDERR "$func found in $file\n"; + } + print; + } +} + +where the list of files and functions is simply from: + +git grep ndo_tx_timeout, with manual addition of headers +in the rare cases where the function is from a header, +then manually changing the few places which actually +call ndo_tx_timeout. + +Signed-off-by: Michael S. Tsirkin +Acked-by: Heiner Kallweit +Acked-by: Jakub Kicinski +Acked-by: Shannon Nelson +Reviewed-by: Martin Habets + +changes from v9: + fixup a forward declaration +changes from v9: + more leftovers from v3 change +changes from v8: + fix up a missing direct call to timeout + rebased on net-next +changes from v7: + fixup leftovers from v3 change +changes from v6: + fix typo in rtl driver +changes from v5: + add missing files (allow any net device argument name) +changes from v4: + add a missing driver header +changes from v3: + change queue # to unsigned +Changes from v2: + added headers +Changes from v1: + Fix errors found by kbuild: + generalize the pattern a bit, to pick up + a couple of instances missed by the previous + version. + +Signed-off-by: David S. Miller +(cherry picked from commit 0290bd291cc0e0488e35e66bf39efcd7d9d9122b) +Signed-off-by: Jonathan Toppins +Bugzilla: 1780645 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=28076826 +Tested: partner and local testing show driver seems to work as expected +Signed-off-by: Frantisek Hrbata +--- + drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: src/drivers/net/ethernet/pensando/ionic/ionic_lif.c +=================================================================== +--- src.orig/drivers/net/ethernet/pensando/ionic/ionic_lif.c 2020-06-28 19:17:46.286933519 +0200 ++++ src/drivers/net/ethernet/pensando/ionic/ionic_lif.c 2020-06-28 19:17:46.332933578 +0200 +@@ -1329,7 +1329,7 @@ + rtnl_unlock(); + } + +-static void ionic_tx_timeout(struct net_device *netdev, unsigned int txqueue) ++static void ionic_tx_timeout(struct net_device *netdev) + { + struct ionic_lif *lif = netdev_priv(netdev); + diff --git a/SOURCES/9005-add-devlink-constants.patch b/SOURCES/9005-add-devlink-constants.patch new file mode 100644 index 0000000..1c79fdb --- /dev/null +++ b/SOURCES/9005-add-devlink-constants.patch @@ -0,0 +1,18 @@ +Index: src/drivers/net/ethernet/pensando/ionic/ionic_backport_compat.h +=================================================================== +--- src.orig/drivers/net/ethernet/pensando/ionic/ionic_backport_compat.h 2020-06-28 19:17:55.546945346 +0200 ++++ src/drivers/net/ethernet/pensando/ionic/ionic_backport_compat.h 2020-06-28 19:18:04.765957119 +0200 +@@ -71,4 +71,13 @@ + #endif + + ++/* Part number, identifier of asic design */ ++#define DEVLINK_INFO_VERSION_GENERIC_ASIC_ID "asic.id" ++/* Revision of asic design */ ++#define DEVLINK_INFO_VERSION_GENERIC_ASIC_REV "asic.rev" ++ ++/* Overall FW version */ ++#define DEVLINK_INFO_VERSION_GENERIC_FW "fw" ++ ++ + #endif /* IONIC_BACKPORT_COMPAT_H */ diff --git a/SOURCES/9006-Revert-netdrv-ionic-let-core-reject-the-unsupported-coalesc.patch b/SOURCES/9006-Revert-netdrv-ionic-let-core-reject-the-unsupported-coalesc.patch new file mode 100644 index 0000000..e061091 --- /dev/null +++ b/SOURCES/9006-Revert-netdrv-ionic-let-core-reject-the-unsupported-coalesc.patch @@ -0,0 +1,80 @@ +Reverting the following patch: + +From 8d7542cf03abbf25caa2be86fa9e99a3cecbc971 Mon Sep 17 00:00:00 2001 +From: Jonathan Toppins +Date: Tue, 28 Apr 2020 19:08:32 -0400 +Subject: [PATCH] [netdrv] ionic: let core reject the unsupported coalescing + parameters + +Message-id: +Patchwork-id: 305678 +Patchwork-instance: patchwork +O-Subject: [PATCH RHEL-8.3 48/84] ionic: let core reject the unsupported coalescing parameters +Bugzilla: 1780645 +RH-Acked-by: John Linville +RH-Acked-by: Corinna Vinschen +RH-Acked-by: Tony Camuso + +Set ethtool_ops->supported_coalesce_params to let +the core reject unsupported coalescing parameters. + +This driver correctly rejects all unsupported parameters. +As a side effect of these changes the error code for +unsupported params changes from EINVAL to EOPNOTSUPP. + +v3: adjust commit message for new error code and member name + +Signed-off-by: Jakub Kicinski +Acked-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit 987b191c16f9b7568a756b0745ee4a93611879ae) +Bugzilla: 1780645 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=28076826 +Tested: partner and local testing show driver seems to work as expected +Signed-off-by: Jonathan Toppins +Signed-off-by: Frantisek Hrbata +--- + .../net/ethernet/pensando/ionic/ionic_ethtool.c | 23 +--------------------- + 1 file changed, 1 insertion(+), 22 deletions(-) + +Index: src/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +=================================================================== +--- src.orig/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c 2020-06-28 19:17:55.043944702 +0200 ++++ src/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c 2020-06-28 19:18:06.838959767 +0200 +@@ -416,6 +416,28 @@ + unsigned int i; + u32 coal; + ++ if (coalesce->rx_max_coalesced_frames || ++ coalesce->rx_coalesce_usecs_irq || ++ coalesce->rx_max_coalesced_frames_irq || ++ coalesce->tx_max_coalesced_frames || ++ coalesce->tx_coalesce_usecs_irq || ++ coalesce->tx_max_coalesced_frames_irq || ++ coalesce->stats_block_coalesce_usecs || ++ coalesce->use_adaptive_rx_coalesce || ++ coalesce->use_adaptive_tx_coalesce || ++ coalesce->pkt_rate_low || ++ coalesce->rx_coalesce_usecs_low || ++ coalesce->rx_max_coalesced_frames_low || ++ coalesce->tx_coalesce_usecs_low || ++ coalesce->tx_max_coalesced_frames_low || ++ coalesce->pkt_rate_high || ++ coalesce->rx_coalesce_usecs_high || ++ coalesce->rx_max_coalesced_frames_high || ++ coalesce->tx_coalesce_usecs_high || ++ coalesce->tx_max_coalesced_frames_high || ++ coalesce->rate_sample_interval) ++ return -EINVAL; ++ + ident = &lif->ionic->ident; + if (ident->dev.intr_coal_div == 0) { + netdev_warn(netdev, "bad HW value in dev.intr_coal_div = %d\n", +@@ -766,7 +788,6 @@ + } + + static const struct ethtool_ops ionic_ethtool_ops = { +- .supported_coalesce_params = ETHTOOL_COALESCE_USECS, + .get_drvinfo = ionic_get_drvinfo, + .get_regs_len = ionic_get_regs_len, + .get_regs = ionic_get_regs, diff --git a/SOURCES/9007-Revert-netdrv-ionic-use-new-helper-tcp_v6_gso_csum_prep.patch b/SOURCES/9007-Revert-netdrv-ionic-use-new-helper-tcp_v6_gso_csum_prep.patch new file mode 100644 index 0000000..7759bd6 --- /dev/null +++ b/SOURCES/9007-Revert-netdrv-ionic-use-new-helper-tcp_v6_gso_csum_prep.patch @@ -0,0 +1,45 @@ +From 15d95cc39f17d6edccdbbbabdb105055d420baa9 Mon Sep 17 00:00:00 2001 +From: Jonathan Toppins +Date: Tue, 28 Apr 2020 19:08:30 -0400 +Subject: [PATCH] [netdrv] ionic: use new helper tcp_v6_gso_csum_prep + +Message-id: <703cf10dc3ec18f4b7ccd734863ba19c26039bb6.1588100139.git.jtoppins@redhat.com> +Patchwork-id: 305675 +Patchwork-instance: patchwork +O-Subject: [PATCH RHEL-8.3 46/84] ionic: use new helper tcp_v6_gso_csum_prep +Bugzilla: 1780645 +RH-Acked-by: John Linville +RH-Acked-by: Corinna Vinschen +RH-Acked-by: Tony Camuso + +Use new helper tcp_v6_gso_csum_prep in additional network drivers. + +Signed-off-by: Heiner Kallweit +Acked-by: Shannon Nelson +Signed-off-by: David S. Miller +(cherry picked from commit fa6b84295225b96bed9321301f218eda6ca73edc) +Bugzilla: 1780645 +Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=28076826 +Tested: partner and local testing show driver seems to work as expected +Signed-off-by: Jonathan Toppins +Signed-off-by: Frantisek Hrbata +--- + drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +Index: src/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +=================================================================== +--- src.orig/drivers/net/ethernet/pensando/ionic/ionic_txrx.c 2020-06-28 19:17:54.295943746 +0200 ++++ src/drivers/net/ethernet/pensando/ionic/ionic_txrx.c 2020-06-28 19:18:08.537961935 +0200 +@@ -657,7 +657,10 @@ + ip_hdr(skb)->daddr, + 0, IPPROTO_TCP, 0); + } else if (skb->protocol == cpu_to_be16(ETH_P_IPV6)) { +- tcp_v6_gso_csum_prep(skb); ++ tcp_hdr(skb)->check = ++ ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr, ++ &ipv6_hdr(skb)->daddr, ++ 0, IPPROTO_TCP, 0); + } + + return 0; diff --git a/SOURCES/9008-module-version.patch b/SOURCES/9008-module-version.patch new file mode 100644 index 0000000..2b77332 --- /dev/null +++ b/SOURCES/9008-module-version.patch @@ -0,0 +1,12 @@ +Index: src/drivers/net/ethernet/pensando/ionic/ionic_main.c +=================================================================== +--- src.orig/drivers/net/ethernet/pensando/ionic/ionic_main.c 2020-06-28 22:33:12.257522904 +0200 ++++ src/drivers/net/ethernet/pensando/ionic/ionic_main.c 2020-06-28 22:33:58.336569011 +0200 +@@ -16,6 +16,7 @@ + MODULE_DESCRIPTION(IONIC_DRV_DESCRIPTION); + MODULE_AUTHOR("Pensando Systems, Inc"); + MODULE_LICENSE("GPL"); ++MODULE_VERSION("4.18.0.210_dup8.2"); + + static const char *ionic_error_to_str(enum ionic_status_code code) + { diff --git a/SPECS/kmod-redhat-ionic.spec b/SPECS/kmod-redhat-ionic.spec new file mode 100644 index 0000000..6365f6d --- /dev/null +++ b/SPECS/kmod-redhat-ionic.spec @@ -0,0 +1,355 @@ +%define kmod_name ionic +%define kmod_vendor redhat +%define kmod_rpm_name kmod-redhat-ionic +%define kmod_driver_version 4.18.0.210_dup8.2 +%define kmod_driver_epoch %{nil} +%define kmod_rpm_release 2 +%define kmod_kernel_version 4.18.0-193.el8 +%define kmod_kernel_version_min %{nil} +%define kmod_kernel_version_dep %{nil} +%define kmod_kbuild_dir drivers/net/ethernet/pensando/ionic +%define kmod_dependencies %{nil} +%define kmod_dist_build_deps %{nil} +%define kmod_build_dependencies %{nil} +%define kmod_devel_package 0 +%define kmod_devel_src_paths %{nil} +%define kmod_install_path extra/kmod-redhat-ionic +%define kernel_pkg kernel +%define kernel_devel_pkg kernel-devel +%define kernel_modules_pkg kernel-modules + +%{!?dist: %define dist .el8_2} +%{!?make_build: %define make_build make} + +%if "%{kmod_kernel_version_dep}" == "" +%define kmod_kernel_version_dep %{kmod_kernel_version} +%endif + +%if "%{kmod_dist_build_deps}" == "" +%if (0%{?rhel} > 7) || (0%{?centos} > 7) +%define kmod_dist_build_deps redhat-rpm-config kernel-abi-whitelists elfutils-libelf-devel kernel-rpm-macros kmod +%else +%define kmod_dist_build_deps redhat-rpm-config kernel-abi-whitelists +%endif +%endif + +Source0: %{kmod_name}-%{kmod_vendor}-%{kmod_driver_version}.tar.bz2 +# Source code patches +Patch0: 0000-drivers_ionic_only_Remove_inclusion_of_vermagic_.patch +Patch1: 0001-ionic_Use_debugfs_create_bool__to_export_bool.patch +Patch2: 0002-ionic_support_longer_tx_sg_lists.patch +Patch3: 0003-ionic_updates_to_ionic_FW_api_description.patch +Patch4: 0004-ionic_protect_vf_calls_from_fw_reset.patch +Patch5: 0005-ionic_add_support_for_more_xcvr_types.patch +Patch6: 0006-ionic_shorter_dev_cmd_wait_time.patch +Patch7: 0007-ionic_reset_device_at_probe.patch +Patch8: 0008-ionic_ionic_intr_free_parameter_change.patch +Patch9: 0009-ionic_more_ionic_name_tweaks.patch +Patch10: 0010-ionic_add_more_ethtool_stats.patch +Patch11: 0011-ionic_wait_on_queue_start_until_after_IFF_UP.patch +Patch12: 0012-ionic_remove_support_for_mgmt_device.patch +Patch13: 0013-ionic_export_features_for_vlans_to_use.patch +Patch14: 0014-ionic_no_link_check_while_resetting_queues.patch +Patch15: 0015-ionic_add_pcie_print_link_status.patch +Patch16: 0016-ionic_tame_the_watchdog_timer_on_reconfig.patch +Patch17: 0017-ionic-update-the-queue-count-on-open.patch +Patch18: 9000-Makefile-CONFIG_IONIC.patch +Patch19: 9001-add-ionic_backport_compat-h.patch +Patch20: 9002-SFF8024-enum.patch +Patch21: 9003-add-dynamic_hex_dump.patch +Patch22: 9004-Revert-netdrv-netdev-pass-the-stuck-queue-to-the-timeout-ha.patch +Patch23: 9005-add-devlink-constants.patch +Patch24: 9006-Revert-netdrv-ionic-let-core-reject-the-unsupported-coalesc.patch +Patch25: 9007-Revert-netdrv-ionic-use-new-helper-tcp_v6_gso_csum_prep.patch +Patch26: 9008-module-version.patch + +%define findpat %( echo "%""P" ) +%define __find_requires /usr/lib/rpm/redhat/find-requires.ksyms +%define __find_provides /usr/lib/rpm/redhat/find-provides.ksyms %{kmod_name} %{?epoch:%{epoch}:}%{version}-%{release} +%define sbindir %( if [ -d "/sbin" -a \! -h "/sbin" ]; then echo "/sbin"; else echo %{_sbindir}; fi ) +%define dup_state_dir %{_localstatedir}/lib/rpm-state/kmod-dups +%define kver_state_dir %{dup_state_dir}/kver +%define kver_state_file %{kver_state_dir}/%{kmod_kernel_version}.%(arch) +%define dup_module_list %{dup_state_dir}/rpm-kmod-%{kmod_name}-modules + +Name: kmod-redhat-ionic +Version: %{kmod_driver_version} +Release: %{kmod_rpm_release}%{?dist} +%if "%{kmod_driver_epoch}" != "" +Epoch: %{kmod_driver_epoch} +%endif +Summary: ionic kernel module for Driver Update Program +Group: System/Kernel +License: GPLv2 +URL: https://www.kernel.org/ +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +BuildRequires: %kernel_devel_pkg = %kmod_kernel_version +%if "%{kmod_dist_build_deps}" != "" +BuildRequires: %{kmod_dist_build_deps} +%endif +ExclusiveArch: x86_64 +%global kernel_source() /usr/src/kernels/%{kmod_kernel_version}.$(arch) + +%global _use_internal_dependency_generator 0 +%if "%{?kmod_kernel_version_min}" != "" +Provides: %kernel_modules_pkg >= %{kmod_kernel_version_min}.%{_target_cpu} +%else +Provides: %kernel_modules_pkg = %{kmod_kernel_version_dep}.%{_target_cpu} +%endif +Provides: kmod-%{kmod_name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires(post): %{sbindir}/weak-modules +Requires(postun): %{sbindir}/weak-modules +Requires: kernel >= 4.18.0-193.el8 + +Requires: kernel < 4.18.0-194.el8 +%if 0 +Requires: firmware(%{kmod_name}) = ENTER_FIRMWARE_VERSION +%endif +%if "%{kmod_build_dependencies}" != "" +BuildRequires: %{kmod_build_dependencies} +%endif +%if "%{kmod_dependencies}" != "" +Requires: %{kmod_dependencies} +%endif +# if there are multiple kmods for the same driver from different vendors, +# they should conflict with each other. +Conflicts: kmod-%{kmod_name} + +%description +ionic kernel module for Driver Update Program + +%if 0 + +%package -n kmod-redhat-ionic-firmware +Version: ENTER_FIRMWARE_VERSION +Summary: ionic firmware for Driver Update Program +Provides: firmware(%{kmod_name}) = ENTER_FIRMWARE_VERSION +%if "%{kmod_kernel_version_min}" != "" +Provides: %kernel_modules_pkg >= %{kmod_kernel_version_min}.%{_target_cpu} +%else +Provides: %kernel_modules_pkg = %{kmod_kernel_version_dep}.%{_target_cpu} +%endif +%description -n kmod-redhat-ionic-firmware +ionic firmware for Driver Update Program + + +%files -n kmod-redhat-ionic-firmware +%defattr(644,root,root,755) +%{FIRMWARE_FILES} + +%endif + +# Development package +%if 0%{kmod_devel_package} +%package -n kmod-redhat-ionic-devel +Version: %{kmod_driver_version} +Requires: kernel >= 4.18.0-193.el8 + +Requires: kernel < 4.18.0-194.el8 +Summary: ionic development files for Driver Update Program + +%description -n kmod-redhat-ionic-devel +ionic development files for Driver Update Program + + +%files -n kmod-redhat-ionic-devel +%defattr(644,root,root,755) +/lib/modules/%{kmod_rpm_name}-%{kmod_driver_version}/ +%endif + +%post +modules=( $(find /lib/modules/%{kmod_kernel_version}.%(arch)/%{kmod_install_path} | grep '\.ko$') ) +printf '%s\n' "${modules[@]}" | %{sbindir}/weak-modules --add-modules --no-initramfs + +mkdir -p "%{kver_state_dir}" +touch "%{kver_state_file}" + +exit 0 + +%posttrans +# We have to re-implement part of weak-modules here because it doesn't allow +# calling initramfs regeneration separately +if [ -f "%{kver_state_file}" ]; then + kver_base="%{kmod_kernel_version_dep}" + kvers=$(ls -d "/lib/modules/${kver_base%%.*}"*) + + for k_dir in $kvers; do + k="${k_dir#/lib/modules/}" + + tmp_initramfs="/boot/initramfs-$k.tmp" + dst_initramfs="/boot/initramfs-$k.img" + + # The same check as in weak-modules: we assume that the kernel present + # if the symvers file exists. + if [ -e "/boot/symvers-$k.gz" ]; then + /usr/bin/dracut -f "$tmp_initramfs" "$k" || exit 1 + cmp -s "$tmp_initramfs" "$dst_initramfs" + if [ "$?" = 1 ]; then + mv "$tmp_initramfs" "$dst_initramfs" + else + rm -f "$tmp_initramfs" + fi + fi + done + + rm -f "%{kver_state_file}" + rmdir "%{kver_state_dir}" 2> /dev/null +fi + +rmdir "%{dup_state_dir}" 2> /dev/null + +exit 0 + +%preun +if rpm -q --filetriggers kmod 2> /dev/null| grep -q "Trigger for weak-modules call on kmod removal"; then + mkdir -p "%{kver_state_dir}" + touch "%{kver_state_file}" +fi + +mkdir -p "%{dup_state_dir}" +rpm -ql kmod-redhat-ionic-%{kmod_driver_version}-%{kmod_rpm_release}%{?dist}.$(arch) | \ + grep '\.ko$' > "%{dup_module_list}" + +%postun +if rpm -q --filetriggers kmod 2> /dev/null| grep -q "Trigger for weak-modules call on kmod removal"; then + initramfs_opt="--no-initramfs" +else + initramfs_opt="" +fi + +modules=( $(cat "%{dup_module_list}") ) +rm -f "%{dup_module_list}" +printf '%s\n' "${modules[@]}" | %{sbindir}/weak-modules --remove-modules $initramfs_opt + +rmdir "%{dup_state_dir}" 2> /dev/null + +exit 0 + +%files +%defattr(644,root,root,755) +/lib/modules/%{kmod_kernel_version}.%(arch) +/etc/depmod.d/%{kmod_name}.conf +%doc /usr/share/doc/%{kmod_rpm_name}/greylist.txt +%doc /usr/share/doc/kmod-redhat-ionic/README.interface_naming +%doc /usr/share/doc/kmod-redhat-ionic/examples/81-pensando-net.rules +%doc /usr/share/doc/kmod-redhat-ionic/examples/10-ionic.link + +%prep +%setup -n %{kmod_name}-%{kmod_vendor}-%{kmod_driver_version} + +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 +set -- * +mkdir source +mv "$@" source/ +mkdir obj + +%build +rm -rf obj +cp -r source obj + +PWD_PATH="$PWD" +%if "%{workaround_no_pwd_rel_path}" != "1" +PWD_PATH=$(realpath --relative-to="%{kernel_source}" . 2>/dev/null || echo "$PWD") +%endif +%{make_build} -C %{kernel_source} V=1 M="$PWD_PATH/obj/%{kmod_kbuild_dir}" \ + NOSTDINC_FLAGS="-I$PWD_PATH/obj/include -I$PWD_PATH/obj/include/uapi %{nil}" \ + EXTRA_CFLAGS="%{nil}" \ + %{nil} +# mark modules executable so that strip-to-file can strip them +find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -exec chmod u+x '{}' + + +whitelist="/lib/modules/kabi-current/kabi_whitelist_%{_target_cpu}" +for modules in $( find obj/%{kmod_kbuild_dir} -name "*.ko" -type f -printf "%{findpat}\n" | sed 's|\.ko$||' | sort -u ) ; do + # update depmod.conf + module_weak_path=$(echo "$modules" | sed 's/[\/]*[^\/]*$//') + if [ -z "$module_weak_path" ]; then + module_weak_path=%{name} + else + module_weak_path=%{name}/$module_weak_path + fi + echo "override $(echo $modules | sed 's/.*\///')" \ + "$(echo "%{kmod_kernel_version_dep}" | + sed 's/\.[^\.]*$//; + s/\([.+?^$\/\\|()\[]\|\]\)/\\\0/g').*" \ + "weak-updates/$module_weak_path" >> source/depmod.conf + + # update greylist + nm -u obj/%{kmod_kbuild_dir}/$modules.ko | sed 's/.*U //' | sed 's/^\.//' | sort -u | while read -r symbol; do + grep -q "^\s*$symbol\$" $whitelist || echo "$symbol" >> source/greylist + done +done +sort -u source/greylist | uniq > source/greylist.txt + +%install +export INSTALL_MOD_PATH=$RPM_BUILD_ROOT +export INSTALL_MOD_DIR=%{kmod_install_path} +PWD_PATH="$PWD" +%if "%{workaround_no_pwd_rel_path}" != "1" +PWD_PATH=$(realpath --relative-to="%{kernel_source}" . 2>/dev/null || echo "$PWD") +%endif +make -C %{kernel_source} modules_install \ + M=$PWD_PATH/obj/%{kmod_kbuild_dir} +# Cleanup unnecessary kernel-generated module dependency files. +find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \; + +install -m 644 -D source/depmod.conf $RPM_BUILD_ROOT/etc/depmod.d/%{kmod_name}.conf +install -m 644 -D source/greylist.txt $RPM_BUILD_ROOT/usr/share/doc/%{kmod_rpm_name}/greylist.txt +%if 0 +%{FIRMWARE_FILES_INSTALL} +%endif +%if 0%{kmod_devel_package} +install -m 644 -D $PWD/obj/%{kmod_kbuild_dir}/Module.symvers $RPM_BUILD_ROOT/lib/modules/%{kmod_rpm_name}-%{kmod_driver_version}/build/Module.symvers + +if [ -n "%{kmod_devel_src_paths}" ]; then + for i in %{kmod_devel_src_paths}; do + mkdir -p "$RPM_BUILD_ROOT/lib/modules/%{kmod_rpm_name}-%{kmod_driver_version}/build/$(dirname "$i")" + cp -rv "$PWD/source/$i" \ + "$RPM_BUILD_ROOT/lib/modules/%{kmod_rpm_name}-%{kmod_driver_version}/build/$i" + done +fi +%endif +install -m 664 -D source/extra//usr/share/doc/kmod-redhat-ionic/README.interface_naming $RPM_BUILD_ROOT//usr/share/doc/kmod-redhat-ionic/README.interface_naming + +install -m 664 -D source/extra//usr/share/doc/kmod-redhat-ionic/examples/81-pensando-net.rules $RPM_BUILD_ROOT//usr/share/doc/kmod-redhat-ionic/examples/81-pensando-net.rules + +install -m 664 -D source/extra//usr/share/doc/kmod-redhat-ionic/examples/10-ionic.link $RPM_BUILD_ROOT//usr/share/doc/kmod-redhat-ionic/examples/10-ionic.link + + +%clean +rm -rf $RPM_BUILD_ROOT + +%changelog +* Thu Jul 16 2020 Eugene Syromiatnikov 4.18.0.210_dup8.2-2 +- Bump release due to "Package build kmod-redhat-ionic-4.18.0.210_dup8.2-1.el8_2 + kept gated because not onboarded to gating". + +* Thu Jul 16 2020 Eugene Syromiatnikov 4.18.0.210_dup8.2-1 +- 2f22e260c6b75f2acb86bd91292dc8c66f56c481 +- ionic kernel module for Driver Update Program +- Resolves: #bz1851940