Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2025-04-29 (igb, igc, ixgbe, idpf)

For igb:
Kurt Kanzenbach adds linking of IRQs and queues to NAPI instances and
adds persistent NAPI config. Lastly, he removes undesired IRQs that
occur while busy polling.

For igc:
Kurt Kanzenbach switches the Tx mode for MQPRIO offload to harmonize the
current implementation with TAPRIO.

For ixgbe:
Jedrzej adds separate ethtool ops for E610 devices to account for device
differences.

Slawomir adds devlink region support for E610 devices.

For idpf:
Mateusz assigns and utilizes the ptype field out of libeth_rqe_info.

Michal removes unreachable code.

* '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
idpf: remove unreachable code from setting mailbox
idpf: assign extracted ptype to struct libeth_rqe_info field
ixgbe: devlink: add devlink region support for E610
ixgbe: add E610 .set_phys_id() callback implementation
ixgbe: apply different rules for setting FC on E610
ixgbe: add support for ACPI WOL for E610
ixgbe: create E610 specific ethtool_ops structure
igc: Change Tx mode for MQPRIO offloading
igc: Limit netdev_tc calls to MQPRIO
igb: Get rid of spurious interrupts
igb: Add support for persistent NAPI config
igb: Link queues to NAPI instances
igb: Link IRQs to NAPI instances
====================

Link: https://patch.msgid.link/20250429234651.3982025-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+667 -97
+49
Documentation/networking/devlink/ixgbe.rst
··· 120 120 121 121 The driver does not currently support reloading the driver via 122 122 ``DEVLINK_RELOAD_ACTION_DRIVER_REINIT``. 123 + 124 + Regions 125 + ======= 126 + 127 + The ``ixgbe`` driver implements the following regions for accessing internal 128 + device data. 129 + 130 + .. list-table:: regions implemented 131 + :widths: 15 85 132 + 133 + * - Name 134 + - Description 135 + * - ``nvm-flash`` 136 + - The contents of the entire flash chip, sometimes referred to as 137 + the device's Non Volatile Memory. 138 + * - ``shadow-ram`` 139 + - The contents of the Shadow RAM, which is loaded from the beginning 140 + of the flash. Although the contents are primarily from the flash, 141 + this area also contains data generated during device boot which is 142 + not stored in flash. 143 + * - ``device-caps`` 144 + - The contents of the device firmware's capabilities buffer. Useful to 145 + determine the current state and configuration of the device. 146 + 147 + Both the ``nvm-flash`` and ``shadow-ram`` regions can be accessed without a 148 + snapshot. The ``device-caps`` region requires a snapshot as the contents are 149 + sent by firmware and can't be split into separate reads. 150 + 151 + Users can request an immediate capture of a snapshot for all three regions 152 + via the ``DEVLINK_CMD_REGION_NEW`` command. 153 + 154 + .. code:: shell 155 + 156 + $ devlink region show 157 + pci/0000:01:00.0/nvm-flash: size 10485760 snapshot [] max 1 158 + pci/0000:01:00.0/device-caps: size 4096 snapshot [] max 10 159 + 160 + $ devlink region new pci/0000:01:00.0/nvm-flash snapshot 1 161 + 162 + $ devlink region dump pci/0000:01:00.0/nvm-flash snapshot 1 163 + 0000000000000000 0014 95dc 0014 9514 0035 1670 0034 db30 164 + 0000000000000010 0000 0000 ffff ff04 0029 8c00 0028 8cc8 165 + 0000000000000020 0016 0bb8 0016 1720 0000 0000 c00f 3ffc 166 + 0000000000000030 bada cce5 bada cce5 bada cce5 bada cce5 167 + 168 + $ devlink region read pci/0000:01:00.0/nvm-flash snapshot 1 address 0 length 16 169 + 0000000000000000 0014 95dc 0014 9514 0035 1670 0034 db30 170 + 171 + $ devlink region delete pci/0000:01:00.0/device-caps snapshot 1
+1 -17
drivers/net/ethernet/intel/idpf/idpf_lib.c
··· 144 144 } 145 145 146 146 /** 147 - * idpf_set_mb_vec_id - Set vector index for mailbox 148 - * @adapter: adapter structure to access the vector chunks 149 - * 150 - * The first vector id in the requested vector chunks from the CP is for 151 - * the mailbox 152 - */ 153 - static void idpf_set_mb_vec_id(struct idpf_adapter *adapter) 154 - { 155 - if (adapter->req_vec_chunks) 156 - adapter->mb_vector.v_idx = 157 - le16_to_cpu(adapter->caps.mailbox_vector_id); 158 - else 159 - adapter->mb_vector.v_idx = 0; 160 - } 161 - 162 - /** 163 147 * idpf_mb_intr_init - Initialize the mailbox interrupt 164 148 * @adapter: adapter structure to store the mailbox vector 165 149 */ ··· 333 349 goto free_irq; 334 350 } 335 351 336 - idpf_set_mb_vec_id(adapter); 352 + adapter->mb_vector.v_idx = le16_to_cpu(adapter->caps.mailbox_vector_id); 337 353 338 354 vecids = kcalloc(total_vecs, sizeof(u16), GFP_KERNEL); 339 355 if (!vecids) {
+11 -14
drivers/net/ethernet/intel/idpf/idpf_singleq_txrx.c
··· 891 891 * idpf_rx_singleq_extract_base_fields - Extract fields from the Rx descriptor 892 892 * @rx_desc: the descriptor to process 893 893 * @fields: storage for extracted values 894 - * @ptype: pointer that will store packet type 895 894 * 896 895 * Decode the Rx descriptor and extract relevant information including the 897 896 * size and Rx packet type. ··· 900 901 */ 901 902 static void 902 903 idpf_rx_singleq_extract_base_fields(const union virtchnl2_rx_desc *rx_desc, 903 - struct libeth_rqe_info *fields, u32 *ptype) 904 + struct libeth_rqe_info *fields) 904 905 { 905 906 u64 qword; 906 907 907 908 qword = le64_to_cpu(rx_desc->base_wb.qword1.status_error_ptype_len); 908 909 909 910 fields->len = FIELD_GET(VIRTCHNL2_RX_BASE_DESC_QW1_LEN_PBUF_M, qword); 910 - *ptype = FIELD_GET(VIRTCHNL2_RX_BASE_DESC_QW1_PTYPE_M, qword); 911 + fields->ptype = FIELD_GET(VIRTCHNL2_RX_BASE_DESC_QW1_PTYPE_M, qword); 911 912 } 912 913 913 914 /** 914 915 * idpf_rx_singleq_extract_flex_fields - Extract fields from the Rx descriptor 915 916 * @rx_desc: the descriptor to process 916 917 * @fields: storage for extracted values 917 - * @ptype: pointer that will store packet type 918 918 * 919 919 * Decode the Rx descriptor and extract relevant information including the 920 920 * size and Rx packet type. ··· 923 925 */ 924 926 static void 925 927 idpf_rx_singleq_extract_flex_fields(const union virtchnl2_rx_desc *rx_desc, 926 - struct libeth_rqe_info *fields, u32 *ptype) 928 + struct libeth_rqe_info *fields) 927 929 { 928 930 fields->len = FIELD_GET(VIRTCHNL2_RX_FLEX_DESC_PKT_LEN_M, 929 931 le16_to_cpu(rx_desc->flex_nic_wb.pkt_len)); 930 - *ptype = FIELD_GET(VIRTCHNL2_RX_FLEX_DESC_PTYPE_M, 931 - le16_to_cpu(rx_desc->flex_nic_wb.ptype_flex_flags0)); 932 + fields->ptype = FIELD_GET(VIRTCHNL2_RX_FLEX_DESC_PTYPE_M, 933 + le16_to_cpu(rx_desc->flex_nic_wb.ptype_flex_flags0)); 932 934 } 933 935 934 936 /** ··· 936 938 * @rx_q: Rx descriptor queue 937 939 * @rx_desc: the descriptor to process 938 940 * @fields: storage for extracted values 939 - * @ptype: pointer that will store packet type 940 941 * 941 942 */ 942 943 static void 943 944 idpf_rx_singleq_extract_fields(const struct idpf_rx_queue *rx_q, 944 945 const union virtchnl2_rx_desc *rx_desc, 945 - struct libeth_rqe_info *fields, u32 *ptype) 946 + struct libeth_rqe_info *fields) 946 947 { 947 948 if (rx_q->rxdids == VIRTCHNL2_RXDID_1_32B_BASE_M) 948 - idpf_rx_singleq_extract_base_fields(rx_desc, fields, ptype); 949 + idpf_rx_singleq_extract_base_fields(rx_desc, fields); 949 950 else 950 - idpf_rx_singleq_extract_flex_fields(rx_desc, fields, ptype); 951 + idpf_rx_singleq_extract_flex_fields(rx_desc, fields); 951 952 } 952 953 953 954 /** ··· 969 972 struct libeth_rqe_info fields = { }; 970 973 union virtchnl2_rx_desc *rx_desc; 971 974 struct idpf_rx_buf *rx_buf; 972 - u32 ptype; 973 975 974 976 /* get the Rx desc from Rx queue based on 'next_to_clean' */ 975 977 rx_desc = &rx_q->rx[ntc]; ··· 989 993 */ 990 994 dma_rmb(); 991 995 992 - idpf_rx_singleq_extract_fields(rx_q, rx_desc, &fields, &ptype); 996 + idpf_rx_singleq_extract_fields(rx_q, rx_desc, &fields); 993 997 994 998 rx_buf = &rx_q->rx_buf[ntc]; 995 999 if (!libeth_rx_sync_for_cpu(rx_buf, fields.len)) ··· 1033 1037 total_rx_bytes += skb->len; 1034 1038 1035 1039 /* protocol */ 1036 - idpf_rx_singleq_process_skb_fields(rx_q, skb, rx_desc, ptype); 1040 + idpf_rx_singleq_process_skb_fields(rx_q, skb, rx_desc, 1041 + fields.ptype); 1037 1042 1038 1043 /* send completed skb up the stack */ 1039 1044 napi_gro_receive(rx_q->pp->p.napi, skb);
+4 -1
drivers/net/ethernet/intel/igb/igb.h
··· 391 391 IGB_RING_FLAG_RX_LB_VLAN_BSWAP, 392 392 IGB_RING_FLAG_TX_CTX_IDX, 393 393 IGB_RING_FLAG_TX_DETECT_HANG, 394 - IGB_RING_FLAG_TX_DISABLED 394 + IGB_RING_FLAG_TX_DISABLED, 395 + IGB_RING_FLAG_RX_ALLOC_FAILED, 395 396 }; 396 397 397 398 #define ring_uses_large_buffer(ring) \ ··· 723 722 724 723 extern char igb_driver_name[]; 725 724 725 + void igb_set_queue_napi(struct igb_adapter *adapter, int q_idx, 726 + struct napi_struct *napi); 726 727 int igb_xmit_xdp_ring(struct igb_adapter *adapter, 727 728 struct igb_ring *ring, 728 729 struct xdp_frame *xdpf);
+68 -10
drivers/net/ethernet/intel/igb/igb_main.c
··· 947 947 q_vector); 948 948 if (err) 949 949 goto err_free; 950 + 951 + netif_napi_set_irq(&q_vector->napi, 952 + adapter->msix_entries[vector].vector); 950 953 } 951 954 952 955 igb_configure_msix(adapter); ··· 1197 1194 return -ENOMEM; 1198 1195 1199 1196 /* initialize NAPI */ 1200 - netif_napi_add(adapter->netdev, &q_vector->napi, igb_poll); 1197 + netif_napi_add_config(adapter->netdev, &q_vector->napi, igb_poll, 1198 + v_idx); 1201 1199 1202 1200 /* tie q_vector and adapter together */ 1203 1201 adapter->q_vector[v_idx] = q_vector; ··· 2100 2096 wr32(E1000_CTRL_EXT, ctrl_ext); 2101 2097 } 2102 2098 2099 + void igb_set_queue_napi(struct igb_adapter *adapter, int vector, 2100 + struct napi_struct *napi) 2101 + { 2102 + struct igb_q_vector *q_vector = adapter->q_vector[vector]; 2103 + 2104 + if (q_vector->rx.ring) 2105 + netif_queue_set_napi(adapter->netdev, 2106 + q_vector->rx.ring->queue_index, 2107 + NETDEV_QUEUE_TYPE_RX, napi); 2108 + 2109 + if (q_vector->tx.ring) 2110 + netif_queue_set_napi(adapter->netdev, 2111 + q_vector->tx.ring->queue_index, 2112 + NETDEV_QUEUE_TYPE_TX, napi); 2113 + } 2114 + 2103 2115 /** 2104 2116 * igb_up - Open the interface and prepare it to handle traffic 2105 2117 * @adapter: board private structure ··· 2123 2103 int igb_up(struct igb_adapter *adapter) 2124 2104 { 2125 2105 struct e1000_hw *hw = &adapter->hw; 2106 + struct napi_struct *napi; 2126 2107 int i; 2127 2108 2128 2109 /* hardware has been reset, we need to reload some things */ ··· 2131 2110 2132 2111 clear_bit(__IGB_DOWN, &adapter->state); 2133 2112 2134 - for (i = 0; i < adapter->num_q_vectors; i++) 2135 - napi_enable(&(adapter->q_vector[i]->napi)); 2113 + for (i = 0; i < adapter->num_q_vectors; i++) { 2114 + napi = &adapter->q_vector[i]->napi; 2115 + napi_enable(napi); 2116 + igb_set_queue_napi(adapter, i, napi); 2117 + } 2136 2118 2137 2119 if (adapter->flags & IGB_FLAG_HAS_MSIX) 2138 2120 igb_configure_msix(adapter); ··· 2205 2181 for (i = 0; i < adapter->num_q_vectors; i++) { 2206 2182 if (adapter->q_vector[i]) { 2207 2183 napi_synchronize(&adapter->q_vector[i]->napi); 2184 + igb_set_queue_napi(adapter, i, NULL); 2208 2185 napi_disable(&adapter->q_vector[i]->napi); 2209 2186 } 2210 2187 } ··· 4138 4113 static int __igb_open(struct net_device *netdev, bool resuming) 4139 4114 { 4140 4115 struct igb_adapter *adapter = netdev_priv(netdev); 4141 - struct e1000_hw *hw = &adapter->hw; 4142 4116 struct pci_dev *pdev = adapter->pdev; 4117 + struct e1000_hw *hw = &adapter->hw; 4118 + struct napi_struct *napi; 4143 4119 int err; 4144 4120 int i; 4145 4121 ··· 4192 4166 /* From here on the code is the same as igb_up() */ 4193 4167 clear_bit(__IGB_DOWN, &adapter->state); 4194 4168 4195 - for (i = 0; i < adapter->num_q_vectors; i++) 4196 - napi_enable(&(adapter->q_vector[i]->napi)); 4169 + for (i = 0; i < adapter->num_q_vectors; i++) { 4170 + napi = &adapter->q_vector[i]->napi; 4171 + napi_enable(napi); 4172 + igb_set_queue_napi(adapter, i, napi); 4173 + } 4197 4174 4198 4175 /* Clear any pending interrupts. */ 4199 4176 rd32(E1000_TSICR); ··· 5755 5726 if (adapter->flags & IGB_FLAG_HAS_MSIX) { 5756 5727 u32 eics = 0; 5757 5728 5758 - for (i = 0; i < adapter->num_q_vectors; i++) 5759 - eics |= adapter->q_vector[i]->eims_value; 5760 - wr32(E1000_EICS, eics); 5729 + for (i = 0; i < adapter->num_q_vectors; i++) { 5730 + struct igb_q_vector *q_vector = adapter->q_vector[i]; 5731 + struct igb_ring *rx_ring; 5732 + 5733 + if (!q_vector->rx.ring) 5734 + continue; 5735 + 5736 + rx_ring = adapter->rx_ring[q_vector->rx.ring->queue_index]; 5737 + 5738 + if (test_bit(IGB_RING_FLAG_RX_ALLOC_FAILED, &rx_ring->flags)) { 5739 + eics |= q_vector->eims_value; 5740 + clear_bit(IGB_RING_FLAG_RX_ALLOC_FAILED, &rx_ring->flags); 5741 + } 5742 + } 5743 + if (eics) 5744 + wr32(E1000_EICS, eics); 5761 5745 } else { 5762 - wr32(E1000_ICS, E1000_ICS_RXDMT0); 5746 + struct igb_ring *rx_ring = adapter->rx_ring[0]; 5747 + 5748 + if (test_bit(IGB_RING_FLAG_RX_ALLOC_FAILED, &rx_ring->flags)) { 5749 + clear_bit(IGB_RING_FLAG_RX_ALLOC_FAILED, &rx_ring->flags); 5750 + wr32(E1000_ICS, E1000_ICS_RXDMT0); 5751 + } 5763 5752 } 5764 5753 5765 5754 igb_spoof_check(adapter); ··· 9108 9061 if (!xdp_res && !skb) { 9109 9062 rx_ring->rx_stats.alloc_failed++; 9110 9063 rx_buffer->pagecnt_bias++; 9064 + set_bit(IGB_RING_FLAG_RX_ALLOC_FAILED, &rx_ring->flags); 9111 9065 break; 9112 9066 } 9113 9067 ··· 9168 9120 page = dev_alloc_pages(igb_rx_pg_order(rx_ring)); 9169 9121 if (unlikely(!page)) { 9170 9122 rx_ring->rx_stats.alloc_failed++; 9123 + set_bit(IGB_RING_FLAG_RX_ALLOC_FAILED, &rx_ring->flags); 9171 9124 return false; 9172 9125 } 9173 9126 ··· 9185 9136 __free_pages(page, igb_rx_pg_order(rx_ring)); 9186 9137 9187 9138 rx_ring->rx_stats.alloc_failed++; 9139 + set_bit(IGB_RING_FLAG_RX_ALLOC_FAILED, &rx_ring->flags); 9188 9140 return false; 9189 9141 } 9190 9142 ··· 9724 9674 if (state == pci_channel_io_perm_failure) 9725 9675 return PCI_ERS_RESULT_DISCONNECT; 9726 9676 9677 + rtnl_lock(); 9727 9678 if (netif_running(netdev)) 9728 9679 igb_down(adapter); 9680 + rtnl_unlock(); 9681 + 9729 9682 pci_disable_device(pdev); 9730 9683 9731 9684 /* Request a slot reset. */ ··· 9787 9734 struct net_device *netdev = pci_get_drvdata(pdev); 9788 9735 struct igb_adapter *adapter = netdev_priv(netdev); 9789 9736 9737 + rtnl_lock(); 9790 9738 if (netif_running(netdev)) { 9791 9739 if (!test_bit(__IGB_DOWN, &adapter->state)) { 9792 9740 dev_dbg(&pdev->dev, "Resuming from non-fatal error, do nothing.\n"); 9741 + rtnl_unlock(); 9793 9742 return; 9794 9743 } 9744 + 9795 9745 if (igb_up(adapter)) { 9796 9746 dev_err(&pdev->dev, "igb_up failed after reset\n"); 9747 + rtnl_unlock(); 9797 9748 return; 9798 9749 } 9799 9750 } 9751 + rtnl_unlock(); 9800 9752 9801 9753 netif_device_attach(netdev); 9802 9754
+1
drivers/net/ethernet/intel/igb/igb_xsk.c
··· 415 415 /* exit if we failed to retrieve a buffer */ 416 416 if (!skb) { 417 417 rx_ring->rx_stats.alloc_failed++; 418 + set_bit(IGB_RING_FLAG_RX_ALLOC_FAILED, &rx_ring->flags); 418 419 break; 419 420 } 420 421
+2 -3
drivers/net/ethernet/intel/igc/igc.h
··· 394 394 #define IGC_FLAG_RX_LEGACY BIT(16) 395 395 #define IGC_FLAG_TSN_QBV_ENABLED BIT(17) 396 396 #define IGC_FLAG_TSN_QAV_ENABLED BIT(18) 397 - #define IGC_FLAG_TSN_LEGACY_ENABLED BIT(19) 398 - #define IGC_FLAG_TSN_PREEMPT_ENABLED BIT(20) 397 + #define IGC_FLAG_TSN_PREEMPT_ENABLED BIT(19) 399 398 400 399 #define IGC_FLAG_TSN_ANY_ENABLED \ 401 400 (IGC_FLAG_TSN_QBV_ENABLED | IGC_FLAG_TSN_QAV_ENABLED | \ 402 - IGC_FLAG_TSN_LEGACY_ENABLED | IGC_FLAG_TSN_PREEMPT_ENABLED) 401 + IGC_FLAG_TSN_PREEMPT_ENABLED) 403 402 404 403 #define IGC_FLAG_RSS_FIELD_IPV4_UDP BIT(6) 405 404 #define IGC_FLAG_RSS_FIELD_IPV6_UDP BIT(7)
+17 -1
drivers/net/ethernet/intel/igc/igc_main.c
··· 6730 6730 struct tc_mqprio_qopt_offload *mqprio) 6731 6731 { 6732 6732 struct igc_hw *hw = &adapter->hw; 6733 - int i; 6733 + int err, i; 6734 6734 6735 6735 if (hw->mac.type != igc_i225) 6736 6736 return -EOPNOTSUPP; 6737 6737 6738 6738 if (!mqprio->qopt.num_tc) { 6739 6739 adapter->strict_priority_enable = false; 6740 + netdev_reset_tc(adapter->netdev); 6740 6741 goto apply; 6741 6742 } 6742 6743 ··· 6767 6766 6768 6767 igc_save_mqprio_params(adapter, mqprio->qopt.num_tc, 6769 6768 mqprio->qopt.offset); 6769 + 6770 + err = netdev_set_num_tc(adapter->netdev, adapter->num_tc); 6771 + if (err) 6772 + return err; 6773 + 6774 + for (i = 0; i < adapter->num_tc; i++) { 6775 + err = netdev_set_tc_queue(adapter->netdev, i, 1, 6776 + adapter->queue_per_tc[i]); 6777 + if (err) 6778 + return err; 6779 + } 6780 + 6781 + /* In case the card is configured with less than four queues. */ 6782 + for (; i < IGC_MAX_TX_QUEUES; i++) 6783 + adapter->queue_per_tc[i] = i; 6770 6784 6771 6785 mqprio->qopt.hw = TC_MQPRIO_HW_OFFLOAD_TCS; 6772 6786
+2 -37
drivers/net/ethernet/intel/igc/igc_tsn.c
··· 171 171 { 172 172 unsigned int new_flags = adapter->flags & ~IGC_FLAG_TSN_ANY_ENABLED; 173 173 174 - if (adapter->taprio_offload_enable) 175 - new_flags |= IGC_FLAG_TSN_QBV_ENABLED; 176 174 177 - if (is_any_launchtime(adapter)) 175 + if (adapter->taprio_offload_enable || is_any_launchtime(adapter) || 176 + adapter->strict_priority_enable) 178 177 new_flags |= IGC_FLAG_TSN_QBV_ENABLED; 179 178 180 179 if (is_cbs_enabled(adapter)) 181 180 new_flags |= IGC_FLAG_TSN_QAV_ENABLED; 182 - 183 - if (adapter->strict_priority_enable) 184 - new_flags |= IGC_FLAG_TSN_LEGACY_ENABLED; 185 181 186 182 if (adapter->fpe.mmsv.pmac_enabled) 187 183 new_flags |= IGC_FLAG_TSN_PREEMPT_ENABLED; ··· 316 320 wr32(IGC_QBVCYCLET_S, 0); 317 321 wr32(IGC_QBVCYCLET, NSEC_PER_SEC); 318 322 319 - /* Reset mqprio TC configuration. */ 320 - netdev_reset_tc(adapter->netdev); 321 - 322 323 /* Restore the default Tx arbitration: Priority 0 has the highest 323 324 * priority and is assigned to queue 0 and so on and so forth. 324 325 */ 325 326 igc_tsn_tx_arb(adapter, queue_per_tc); 326 327 327 328 adapter->flags &= ~IGC_FLAG_TSN_QBV_ENABLED; 328 - adapter->flags &= ~IGC_FLAG_TSN_LEGACY_ENABLED; 329 329 330 330 return 0; 331 331 } ··· 386 394 igc_tsn_set_retx_qbvfullthreshold(adapter); 387 395 388 396 if (adapter->strict_priority_enable) { 389 - int err; 390 - 391 - err = netdev_set_num_tc(adapter->netdev, adapter->num_tc); 392 - if (err) 393 - return err; 394 - 395 - for (i = 0; i < adapter->num_tc; i++) { 396 - err = netdev_set_tc_queue(adapter->netdev, i, 1, 397 - adapter->queue_per_tc[i]); 398 - if (err) 399 - return err; 400 - } 401 - 402 - /* In case the card is configured with less than four queues. */ 403 - for (; i < IGC_MAX_TX_QUEUES; i++) 404 - adapter->queue_per_tc[i] = i; 405 - 406 397 /* Configure queue priorities according to the user provided 407 398 * mapping. 408 399 */ 409 400 igc_tsn_tx_arb(adapter, adapter->queue_per_tc); 410 - 411 - /* Enable legacy TSN mode which will do strict priority without 412 - * any other TSN features. 413 - */ 414 - tqavctrl = rd32(IGC_TQAVCTRL); 415 - tqavctrl |= IGC_TQAVCTRL_TRANSMIT_MODE_TSN; 416 - tqavctrl &= ~IGC_TQAVCTRL_ENHANCED_QAV; 417 - wr32(IGC_TQAVCTRL, tqavctrl); 418 - 419 - return 0; 420 401 } 421 402 422 403 for (i = 0; i < adapter->num_tx_queues; i++) {
+2 -1
drivers/net/ethernet/intel/ixgbe/Makefile
··· 10 10 ixgbe-y := ixgbe_main.o ixgbe_common.o ixgbe_ethtool.o \ 11 11 ixgbe_82599.o ixgbe_82598.o ixgbe_phy.o ixgbe_sriov.o \ 12 12 ixgbe_mbx.o ixgbe_x540.o ixgbe_x550.o ixgbe_lib.o ixgbe_ptp.o \ 13 - ixgbe_xsk.o ixgbe_e610.o devlink/devlink.o ixgbe_fw_update.o 13 + ixgbe_xsk.o ixgbe_e610.o devlink/devlink.o ixgbe_fw_update.o \ 14 + devlink/region.o 14 15 15 16 ixgbe-$(CONFIG_IXGBE_DCB) += ixgbe_dcb.o ixgbe_dcb_82598.o \ 16 17 ixgbe_dcb_82599.o ixgbe_dcb_nl.o
+2
drivers/net/ethernet/intel/ixgbe/devlink/devlink.h
··· 6 6 7 7 struct ixgbe_adapter *ixgbe_allocate_devlink(struct device *dev); 8 8 int ixgbe_devlink_register_port(struct ixgbe_adapter *adapter); 9 + void ixgbe_devlink_init_regions(struct ixgbe_adapter *adapter); 10 + void ixgbe_devlink_destroy_regions(struct ixgbe_adapter *adapter); 9 11 10 12 #endif /* _IXGBE_DEVLINK_H_ */
+290
drivers/net/ethernet/intel/ixgbe/devlink/region.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* Copyright (c) 2025, Intel Corporation. */ 3 + 4 + #include "ixgbe.h" 5 + #include "devlink.h" 6 + 7 + #define IXGBE_DEVLINK_READ_BLK_SIZE (1024 * 1024) 8 + 9 + static const struct devlink_region_ops ixgbe_nvm_region_ops; 10 + static const struct devlink_region_ops ixgbe_sram_region_ops; 11 + 12 + static int ixgbe_devlink_parse_region(struct ixgbe_hw *hw, 13 + const struct devlink_region_ops *ops, 14 + bool *read_shadow_ram, u32 *nvm_size) 15 + { 16 + if (ops == &ixgbe_nvm_region_ops) { 17 + *read_shadow_ram = false; 18 + *nvm_size = hw->flash.flash_size; 19 + } else if (ops == &ixgbe_sram_region_ops) { 20 + *read_shadow_ram = true; 21 + *nvm_size = hw->flash.sr_words * 2u; 22 + } else { 23 + return -EOPNOTSUPP; 24 + } 25 + 26 + return 0; 27 + } 28 + 29 + /** 30 + * ixgbe_devlink_nvm_snapshot - Capture a snapshot of the NVM content 31 + * @devlink: the devlink instance 32 + * @ops: the devlink region being snapshotted 33 + * @extack: extended ACK response structure 34 + * @data: on exit points to snapshot data buffer 35 + * 36 + * This function is called in response to the DEVLINK_CMD_REGION_NEW cmd. 37 + * 38 + * Capture a snapshot of the whole requested NVM region. 39 + * 40 + * No need to worry with freeing @data, devlink core takes care if it. 41 + * 42 + * Return: 0 on success, -EOPNOTSUPP for unsupported regions, -EBUSY when 43 + * cannot lock NVM, -ENOMEM when cannot alloc mem and -EIO when error 44 + * occurs during reading. 45 + */ 46 + static int ixgbe_devlink_nvm_snapshot(struct devlink *devlink, 47 + const struct devlink_region_ops *ops, 48 + struct netlink_ext_ack *extack, u8 **data) 49 + { 50 + struct ixgbe_adapter *adapter = devlink_priv(devlink); 51 + struct ixgbe_hw *hw = &adapter->hw; 52 + bool read_shadow_ram; 53 + u8 *nvm_data, *buf; 54 + u32 nvm_size, left; 55 + u8 num_blks; 56 + int err; 57 + 58 + err = ixgbe_devlink_parse_region(hw, ops, &read_shadow_ram, &nvm_size); 59 + if (err) 60 + return err; 61 + 62 + nvm_data = kvzalloc(nvm_size, GFP_KERNEL); 63 + if (!nvm_data) 64 + return -ENOMEM; 65 + 66 + num_blks = DIV_ROUND_UP(nvm_size, IXGBE_DEVLINK_READ_BLK_SIZE); 67 + buf = nvm_data; 68 + left = nvm_size; 69 + 70 + for (int i = 0; i < num_blks; i++) { 71 + u32 read_sz = min_t(u32, IXGBE_DEVLINK_READ_BLK_SIZE, left); 72 + 73 + /* Need to acquire NVM lock during each loop run because the 74 + * total period of reading whole NVM is longer than the maximum 75 + * period the lock can be taken defined by the IXGBE_NVM_TIMEOUT. 76 + */ 77 + err = ixgbe_acquire_nvm(hw, IXGBE_RES_READ); 78 + if (err) { 79 + NL_SET_ERR_MSG_MOD(extack, 80 + "Failed to acquire NVM semaphore"); 81 + kvfree(nvm_data); 82 + return -EBUSY; 83 + } 84 + 85 + err = ixgbe_read_flat_nvm(hw, i * IXGBE_DEVLINK_READ_BLK_SIZE, 86 + &read_sz, buf, read_shadow_ram); 87 + if (err) { 88 + NL_SET_ERR_MSG_MOD(extack, 89 + "Failed to read RAM content"); 90 + ixgbe_release_nvm(hw); 91 + kvfree(nvm_data); 92 + return -EIO; 93 + } 94 + 95 + ixgbe_release_nvm(hw); 96 + 97 + buf += read_sz; 98 + left -= read_sz; 99 + } 100 + 101 + *data = nvm_data; 102 + return 0; 103 + } 104 + 105 + /** 106 + * ixgbe_devlink_devcaps_snapshot - Capture a snapshot of device capabilities 107 + * @devlink: the devlink instance 108 + * @ops: the devlink region being snapshotted 109 + * @extack: extended ACK response structure 110 + * @data: on exit points to snapshot data buffer 111 + * 112 + * This function is called in response to the DEVLINK_CMD_REGION_NEW for 113 + * the device-caps devlink region. 114 + * 115 + * Capture a snapshot of the device capabilities reported by firmware. 116 + * 117 + * No need to worry with freeing @data, devlink core takes care if it. 118 + * 119 + * Return: 0 on success, -ENOMEM when cannot alloc mem, or return code of 120 + * the reading operation. 121 + */ 122 + static int ixgbe_devlink_devcaps_snapshot(struct devlink *devlink, 123 + const struct devlink_region_ops *ops, 124 + struct netlink_ext_ack *extack, 125 + u8 **data) 126 + { 127 + struct ixgbe_adapter *adapter = devlink_priv(devlink); 128 + struct ixgbe_aci_cmd_list_caps_elem *caps; 129 + struct ixgbe_hw *hw = &adapter->hw; 130 + int err; 131 + 132 + caps = kvzalloc(IXGBE_ACI_MAX_BUFFER_SIZE, GFP_KERNEL); 133 + if (!caps) 134 + return -ENOMEM; 135 + 136 + err = ixgbe_aci_list_caps(hw, caps, IXGBE_ACI_MAX_BUFFER_SIZE, NULL, 137 + ixgbe_aci_opc_list_dev_caps); 138 + if (err) { 139 + NL_SET_ERR_MSG_MOD(extack, 140 + "Failed to read device capabilities"); 141 + kvfree(caps); 142 + return err; 143 + } 144 + 145 + *data = (u8 *)caps; 146 + return 0; 147 + } 148 + 149 + /** 150 + * ixgbe_devlink_nvm_read - Read a portion of NVM flash content 151 + * @devlink: the devlink instance 152 + * @ops: the devlink region to snapshot 153 + * @extack: extended ACK response structure 154 + * @offset: the offset to start at 155 + * @size: the amount to read 156 + * @data: the data buffer to read into 157 + * 158 + * This function is called in response to DEVLINK_CMD_REGION_READ to directly 159 + * read a section of the NVM contents. 160 + * 161 + * Read from either the nvm-flash region either shadow-ram region. 162 + * 163 + * Return: 0 on success, -EOPNOTSUPP for unsupported regions, -EBUSY when 164 + * cannot lock NVM, -ERANGE when buffer limit exceeded and -EIO when error 165 + * occurs during reading. 166 + */ 167 + static int ixgbe_devlink_nvm_read(struct devlink *devlink, 168 + const struct devlink_region_ops *ops, 169 + struct netlink_ext_ack *extack, 170 + u64 offset, u32 size, u8 *data) 171 + { 172 + struct ixgbe_adapter *adapter = devlink_priv(devlink); 173 + struct ixgbe_hw *hw = &adapter->hw; 174 + bool read_shadow_ram; 175 + u32 nvm_size; 176 + int err; 177 + 178 + err = ixgbe_devlink_parse_region(hw, ops, &read_shadow_ram, &nvm_size); 179 + if (err) 180 + return err; 181 + 182 + if (offset + size > nvm_size) { 183 + NL_SET_ERR_MSG_MOD(extack, "Cannot read beyond the region size"); 184 + return -ERANGE; 185 + } 186 + 187 + err = ixgbe_acquire_nvm(hw, IXGBE_RES_READ); 188 + if (err) { 189 + NL_SET_ERR_MSG_MOD(extack, "Failed to acquire NVM semaphore"); 190 + return -EBUSY; 191 + } 192 + 193 + err = ixgbe_read_flat_nvm(hw, (u32)offset, &size, data, read_shadow_ram); 194 + if (err) { 195 + NL_SET_ERR_MSG_MOD(extack, "Failed to read NVM contents"); 196 + ixgbe_release_nvm(hw); 197 + return -EIO; 198 + } 199 + 200 + ixgbe_release_nvm(hw); 201 + return 0; 202 + } 203 + 204 + static const struct devlink_region_ops ixgbe_nvm_region_ops = { 205 + .name = "nvm-flash", 206 + .destructor = kvfree, 207 + .snapshot = ixgbe_devlink_nvm_snapshot, 208 + .read = ixgbe_devlink_nvm_read, 209 + }; 210 + 211 + static const struct devlink_region_ops ixgbe_sram_region_ops = { 212 + .name = "shadow-ram", 213 + .destructor = kvfree, 214 + .snapshot = ixgbe_devlink_nvm_snapshot, 215 + .read = ixgbe_devlink_nvm_read, 216 + }; 217 + 218 + static const struct devlink_region_ops ixgbe_devcaps_region_ops = { 219 + .name = "device-caps", 220 + .destructor = kvfree, 221 + .snapshot = ixgbe_devlink_devcaps_snapshot, 222 + }; 223 + 224 + /** 225 + * ixgbe_devlink_init_regions - Initialize devlink regions 226 + * @adapter: adapter instance 227 + * 228 + * Create devlink regions used to enable access to dump the contents of the 229 + * flash memory of the device. 230 + */ 231 + void ixgbe_devlink_init_regions(struct ixgbe_adapter *adapter) 232 + { 233 + struct devlink *devlink = adapter->devlink; 234 + struct device *dev = &adapter->pdev->dev; 235 + u64 nvm_size, sram_size; 236 + 237 + if (adapter->hw.mac.type != ixgbe_mac_e610) 238 + return; 239 + 240 + nvm_size = adapter->hw.flash.flash_size; 241 + adapter->nvm_region = devl_region_create(devlink, &ixgbe_nvm_region_ops, 242 + 1, nvm_size); 243 + if (IS_ERR(adapter->nvm_region)) { 244 + dev_err(dev, 245 + "Failed to create NVM devlink region, err %ld\n", 246 + PTR_ERR(adapter->nvm_region)); 247 + adapter->nvm_region = NULL; 248 + } 249 + 250 + sram_size = adapter->hw.flash.sr_words * 2u; 251 + adapter->sram_region = devl_region_create(devlink, &ixgbe_sram_region_ops, 252 + 1, sram_size); 253 + if (IS_ERR(adapter->sram_region)) { 254 + dev_err(dev, 255 + "Failed to create shadow-ram devlink region, err %ld\n", 256 + PTR_ERR(adapter->sram_region)); 257 + adapter->sram_region = NULL; 258 + } 259 + 260 + adapter->devcaps_region = devl_region_create(devlink, 261 + &ixgbe_devcaps_region_ops, 262 + 10, IXGBE_ACI_MAX_BUFFER_SIZE); 263 + if (IS_ERR(adapter->devcaps_region)) { 264 + dev_err(dev, 265 + "Failed to create device-caps devlink region, err %ld\n", 266 + PTR_ERR(adapter->devcaps_region)); 267 + adapter->devcaps_region = NULL; 268 + } 269 + } 270 + 271 + /** 272 + * ixgbe_devlink_destroy_regions - Destroy devlink regions 273 + * @adapter: adapter instance 274 + * 275 + * Remove previously created regions for this adapter instance. 276 + */ 277 + void ixgbe_devlink_destroy_regions(struct ixgbe_adapter *adapter) 278 + { 279 + if (adapter->hw.mac.type != ixgbe_mac_e610) 280 + return; 281 + 282 + if (adapter->nvm_region) 283 + devl_region_destroy(adapter->nvm_region); 284 + 285 + if (adapter->sram_region) 286 + devl_region_destroy(adapter->sram_region); 287 + 288 + if (adapter->devcaps_region) 289 + devl_region_destroy(adapter->devcaps_region); 290 + }
+3
drivers/net/ethernet/intel/ixgbe/ixgbe.h
··· 616 616 struct mii_bus *mii_bus; 617 617 struct devlink *devlink; 618 618 struct devlink_port devlink_port; 619 + struct devlink_region *nvm_region; 620 + struct devlink_region *sram_region; 621 + struct devlink_region *devcaps_region; 619 622 620 623 unsigned long state; 621 624
+29
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
··· 1485 1485 } 1486 1486 1487 1487 /** 1488 + * ixgbe_aci_set_port_id_led - set LED value for the given port 1489 + * @hw: pointer to the HW struct 1490 + * @orig_mode: set LED original mode 1491 + * 1492 + * Set LED value for the given port (0x06E9) 1493 + * 1494 + * Return: the exit code of the operation. 1495 + */ 1496 + int ixgbe_aci_set_port_id_led(struct ixgbe_hw *hw, bool orig_mode) 1497 + { 1498 + struct ixgbe_aci_cmd_set_port_id_led *cmd; 1499 + struct ixgbe_aci_desc desc; 1500 + 1501 + cmd = &desc.params.set_port_id_led; 1502 + 1503 + ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_set_port_id_led); 1504 + 1505 + cmd->lport_num = (u8)hw->bus.func; 1506 + cmd->lport_num_valid = IXGBE_ACI_PORT_ID_PORT_NUM_VALID; 1507 + 1508 + if (orig_mode) 1509 + cmd->ident_mode = IXGBE_ACI_PORT_IDENT_LED_ORIG; 1510 + else 1511 + cmd->ident_mode = IXGBE_ACI_PORT_IDENT_LED_BLINK; 1512 + 1513 + return ixgbe_aci_send_cmd(hw, &desc, NULL, 0); 1514 + } 1515 + 1516 + /** 1488 1517 * ixgbe_get_media_type_e610 - Gets media type 1489 1518 * @hw: pointer to the HW struct 1490 1519 *
+1
drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h
··· 36 36 struct ixgbe_link_status *link); 37 37 int ixgbe_aci_set_event_mask(struct ixgbe_hw *hw, u8 port_num, u16 mask); 38 38 int ixgbe_configure_lse(struct ixgbe_hw *hw, bool activate, u16 mask); 39 + int ixgbe_aci_set_port_id_led(struct ixgbe_hw *hw, bool orig_mode); 39 40 enum ixgbe_media_type ixgbe_get_media_type_e610(struct ixgbe_hw *hw); 40 41 int ixgbe_setup_link_e610(struct ixgbe_hw *hw, ixgbe_link_speed speed, 41 42 bool autoneg_wait);
+163 -8
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
··· 564 564 } 565 565 } 566 566 567 + static void ixgbe_set_pauseparam_finalize(struct net_device *netdev, 568 + struct ixgbe_fc_info *fc) 569 + { 570 + struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev); 571 + struct ixgbe_hw *hw = &adapter->hw; 572 + 573 + /* If the thing changed then we'll update and use new autoneg. */ 574 + if (memcmp(fc, &hw->fc, sizeof(*fc))) { 575 + hw->fc = *fc; 576 + if (netif_running(netdev)) 577 + ixgbe_reinit_locked(adapter); 578 + else 579 + ixgbe_reset(adapter); 580 + } 581 + } 582 + 567 583 static int ixgbe_set_pauseparam(struct net_device *netdev, 568 584 struct ethtool_pauseparam *pause) 569 585 { ··· 608 592 else 609 593 fc.requested_mode = ixgbe_fc_none; 610 594 611 - /* if the thing changed then we'll update and use new autoneg */ 612 - if (memcmp(&fc, &hw->fc, sizeof(struct ixgbe_fc_info))) { 613 - hw->fc = fc; 614 - if (netif_running(netdev)) 615 - ixgbe_reinit_locked(adapter); 616 - else 617 - ixgbe_reset(adapter); 595 + ixgbe_set_pauseparam_finalize(netdev, &fc); 596 + 597 + return 0; 598 + } 599 + 600 + static int ixgbe_set_pauseparam_e610(struct net_device *netdev, 601 + struct ethtool_pauseparam *pause) 602 + { 603 + struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev); 604 + struct ixgbe_hw *hw = &adapter->hw; 605 + struct ixgbe_fc_info fc = hw->fc; 606 + 607 + if (!ixgbe_device_supports_autoneg_fc(hw)) 608 + return -EOPNOTSUPP; 609 + 610 + if (pause->autoneg == AUTONEG_DISABLE) { 611 + netdev_info(netdev, 612 + "Cannot disable autonegotiation on this device.\n"); 613 + return -EOPNOTSUPP; 618 614 } 615 + 616 + fc.disable_fc_autoneg = false; 617 + 618 + if (pause->rx_pause && pause->tx_pause) 619 + fc.requested_mode = ixgbe_fc_full; 620 + else if (pause->rx_pause) 621 + fc.requested_mode = ixgbe_fc_rx_pause; 622 + else if (pause->tx_pause) 623 + fc.requested_mode = ixgbe_fc_tx_pause; 624 + else 625 + fc.requested_mode = ixgbe_fc_none; 626 + 627 + ixgbe_set_pauseparam_finalize(netdev, &fc); 619 628 620 629 return 0; 621 630 } ··· 2406 2365 return 0; 2407 2366 } 2408 2367 2368 + static int ixgbe_set_wol_acpi(struct net_device *netdev, 2369 + struct ethtool_wolinfo *wol) 2370 + { 2371 + struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev); 2372 + struct ixgbe_hw *hw = &adapter->hw; 2373 + u32 grc; 2374 + 2375 + if (ixgbe_wol_exclusion(adapter, wol)) 2376 + return wol->wolopts ? -EOPNOTSUPP : 0; 2377 + 2378 + /* disable APM wakeup */ 2379 + grc = IXGBE_READ_REG(hw, IXGBE_GRC_X550EM_a); 2380 + grc &= ~IXGBE_GRC_APME; 2381 + IXGBE_WRITE_REG(hw, IXGBE_GRC_X550EM_a, grc); 2382 + 2383 + /* erase existing filters */ 2384 + IXGBE_WRITE_REG(hw, IXGBE_WUFC, 0); 2385 + adapter->wol = 0; 2386 + 2387 + if (wol->wolopts & WAKE_UCAST) 2388 + adapter->wol |= IXGBE_WUFC_EX; 2389 + if (wol->wolopts & WAKE_MCAST) 2390 + adapter->wol |= IXGBE_WUFC_MC; 2391 + if (wol->wolopts & WAKE_BCAST) 2392 + adapter->wol |= IXGBE_WUFC_BC; 2393 + 2394 + IXGBE_WRITE_REG(hw, IXGBE_WUC, IXGBE_WUC_PME_EN); 2395 + IXGBE_WRITE_REG(hw, IXGBE_WUFC, adapter->wol); 2396 + 2397 + hw->wol_enabled = adapter->wol; 2398 + device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 2399 + 2400 + return 0; 2401 + } 2402 + 2403 + static int ixgbe_set_wol_e610(struct net_device *netdev, 2404 + struct ethtool_wolinfo *wol) 2405 + { 2406 + if (wol->wolopts & (WAKE_UCAST | WAKE_MCAST | WAKE_BCAST)) 2407 + return ixgbe_set_wol_acpi(netdev, wol); 2408 + else 2409 + return ixgbe_set_wol(netdev, wol); 2410 + } 2411 + 2409 2412 static int ixgbe_nway_reset(struct net_device *netdev) 2410 2413 { 2411 2414 struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev); ··· 2489 2404 } 2490 2405 2491 2406 return 0; 2407 + } 2408 + 2409 + static int ixgbe_set_phys_id_e610(struct net_device *netdev, 2410 + enum ethtool_phys_id_state state) 2411 + { 2412 + struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev); 2413 + bool led_active; 2414 + 2415 + switch (state) { 2416 + case ETHTOOL_ID_ACTIVE: 2417 + led_active = true; 2418 + break; 2419 + case ETHTOOL_ID_INACTIVE: 2420 + led_active = false; 2421 + break; 2422 + default: 2423 + return -EOPNOTSUPP; 2424 + } 2425 + 2426 + return ixgbe_aci_set_port_id_led(&adapter->hw, !led_active); 2492 2427 } 2493 2428 2494 2429 static int ixgbe_get_coalesce(struct net_device *netdev, ··· 3755 3650 .set_link_ksettings = ixgbe_set_link_ksettings, 3756 3651 }; 3757 3652 3653 + static const struct ethtool_ops ixgbe_ethtool_ops_e610 = { 3654 + .supported_coalesce_params = ETHTOOL_COALESCE_USECS, 3655 + .get_drvinfo = ixgbe_get_drvinfo, 3656 + .get_regs_len = ixgbe_get_regs_len, 3657 + .get_regs = ixgbe_get_regs, 3658 + .get_wol = ixgbe_get_wol, 3659 + .set_wol = ixgbe_set_wol_e610, 3660 + .nway_reset = ixgbe_nway_reset, 3661 + .get_link = ethtool_op_get_link, 3662 + .get_eeprom_len = ixgbe_get_eeprom_len, 3663 + .get_eeprom = ixgbe_get_eeprom, 3664 + .set_eeprom = ixgbe_set_eeprom, 3665 + .get_ringparam = ixgbe_get_ringparam, 3666 + .set_ringparam = ixgbe_set_ringparam, 3667 + .get_pause_stats = ixgbe_get_pause_stats, 3668 + .get_pauseparam = ixgbe_get_pauseparam, 3669 + .set_pauseparam = ixgbe_set_pauseparam_e610, 3670 + .get_msglevel = ixgbe_get_msglevel, 3671 + .set_msglevel = ixgbe_set_msglevel, 3672 + .self_test = ixgbe_diag_test, 3673 + .get_strings = ixgbe_get_strings, 3674 + .set_phys_id = ixgbe_set_phys_id_e610, 3675 + .get_sset_count = ixgbe_get_sset_count, 3676 + .get_ethtool_stats = ixgbe_get_ethtool_stats, 3677 + .get_coalesce = ixgbe_get_coalesce, 3678 + .set_coalesce = ixgbe_set_coalesce, 3679 + .get_rxnfc = ixgbe_get_rxnfc, 3680 + .set_rxnfc = ixgbe_set_rxnfc, 3681 + .get_rxfh_indir_size = ixgbe_rss_indir_size, 3682 + .get_rxfh_key_size = ixgbe_get_rxfh_key_size, 3683 + .get_rxfh = ixgbe_get_rxfh, 3684 + .set_rxfh = ixgbe_set_rxfh, 3685 + .get_eee = ixgbe_get_eee, 3686 + .set_eee = ixgbe_set_eee, 3687 + .get_channels = ixgbe_get_channels, 3688 + .set_channels = ixgbe_set_channels, 3689 + .get_priv_flags = ixgbe_get_priv_flags, 3690 + .set_priv_flags = ixgbe_set_priv_flags, 3691 + .get_ts_info = ixgbe_get_ts_info, 3692 + .get_module_info = ixgbe_get_module_info, 3693 + .get_module_eeprom = ixgbe_get_module_eeprom, 3694 + .get_link_ksettings = ixgbe_get_link_ksettings, 3695 + .set_link_ksettings = ixgbe_set_link_ksettings, 3696 + }; 3697 + 3758 3698 void ixgbe_set_ethtool_ops(struct net_device *netdev) 3759 3699 { 3760 - netdev->ethtool_ops = &ixgbe_ethtool_ops; 3700 + struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev); 3701 + 3702 + if (adapter->hw.mac.type == ixgbe_mac_e610) 3703 + netdev->ethtool_ops = &ixgbe_ethtool_ops_e610; 3704 + else 3705 + netdev->ethtool_ops = &ixgbe_ethtool_ops; 3761 3706 }
+8 -5
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
··· 11317 11317 ixgbe_devlink_register_port(adapter); 11318 11318 SET_NETDEV_DEVLINK_PORT(adapter->netdev, 11319 11319 &adapter->devlink_port); 11320 + ixgbe_devlink_init_regions(adapter); 11320 11321 devl_register(adapter->devlink); 11321 11322 devl_unlock(adapter->devlink); 11322 11323 ··· 11434 11433 goto err_ioremap; 11435 11434 } 11436 11435 11437 - netdev->netdev_ops = &ixgbe_netdev_ops; 11438 - ixgbe_set_ethtool_ops(netdev); 11439 - netdev->watchdog_timeo = 5 * HZ; 11440 - strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name)); 11441 - 11442 11436 /* Setup hw api */ 11443 11437 hw->mac.ops = *ii->mac_ops; 11444 11438 hw->mac.type = ii->mac; ··· 11462 11466 hw->phy.mdio.dev = netdev; 11463 11467 hw->phy.mdio.mdio_read = ixgbe_mdio_read; 11464 11468 hw->phy.mdio.mdio_write = ixgbe_mdio_write; 11469 + 11470 + netdev->netdev_ops = &ixgbe_netdev_ops; 11471 + ixgbe_set_ethtool_ops(netdev); 11472 + netdev->watchdog_timeo = 5 * HZ; 11473 + strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name)); 11465 11474 11466 11475 /* setup the private structure */ 11467 11476 err = ixgbe_sw_init(adapter, ii); ··· 11825 11824 if (err) 11826 11825 goto err_netdev; 11827 11826 11827 + ixgbe_devlink_init_regions(adapter); 11828 11828 devl_register(adapter->devlink); 11829 11829 devl_unlock(adapter->devlink); 11830 11830 return 0; ··· 11884 11882 netdev = adapter->netdev; 11885 11883 devl_lock(adapter->devlink); 11886 11884 devl_unregister(adapter->devlink); 11885 + ixgbe_devlink_destroy_regions(adapter); 11887 11886 ixgbe_dbg_adapter_exit(adapter); 11888 11887 11889 11888 set_bit(__IXGBE_REMOVING, &adapter->state);
+14
drivers/net/ethernet/intel/ixgbe/ixgbe_type_e610.h
··· 223 223 ixgbe_aci_opc_write_mdio = 0x06E5, 224 224 ixgbe_aci_opc_set_gpio_by_func = 0x06E6, 225 225 ixgbe_aci_opc_get_gpio_by_func = 0x06E7, 226 + ixgbe_aci_opc_set_port_id_led = 0x06E9, 226 227 ixgbe_aci_opc_set_gpio = 0x06EC, 227 228 ixgbe_aci_opc_get_gpio = 0x06ED, 228 229 ixgbe_aci_opc_sff_eeprom = 0x06EE, ··· 809 808 u8 rsvd[7]; 810 809 }; 811 810 811 + /* Set Port Identification LED (direct, 0x06E9) */ 812 + struct ixgbe_aci_cmd_set_port_id_led { 813 + u8 lport_num; 814 + u8 lport_num_valid; 815 + u8 ident_mode; 816 + u8 rsvd[13]; 817 + }; 818 + 819 + #define IXGBE_ACI_PORT_ID_PORT_NUM_VALID BIT(0) 820 + #define IXGBE_ACI_PORT_IDENT_LED_ORIG 0 821 + #define IXGBE_ACI_PORT_IDENT_LED_BLINK BIT(0) 822 + 812 823 /* Read/Write SFF EEPROM command (indirect 0x06EE) */ 813 824 struct ixgbe_aci_cmd_sff_eeprom { 814 825 u8 lport_num; ··· 998 985 struct ixgbe_aci_cmd_restart_an restart_an; 999 986 struct ixgbe_aci_cmd_get_link_status get_link_status; 1000 987 struct ixgbe_aci_cmd_set_event_mask set_event_mask; 988 + struct ixgbe_aci_cmd_set_port_id_led set_port_id_led; 1001 989 struct ixgbe_aci_cmd_get_link_topo get_link_topo; 1002 990 struct ixgbe_aci_cmd_get_link_topo_pin get_link_topo_pin; 1003 991 struct ixgbe_aci_cmd_sff_eeprom read_write_sff_param;