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

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

Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2024-02-02 (ice)

This series contains updates to ice driver only.

Maciej changes some queue configuration calls to existing ones which are
better suited for the purpose.

Aniruddha adds separate reporting for Rx EIPE errors as hardware may
incorrectly report errors on certain packets.

Paul removes an incorrect comment.

* '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
ice: remove incorrect comment
ice: Add a new counter for Rx EIPE errors
ice: make ice_vsi_cfg_txq() static
ice: make ice_vsi_cfg_rxq() static
====================

Link: https://lore.kernel.org/r/20240202175613.3470818-1-anthony.l.nguyen@intel.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+150 -168
+1
drivers/net/ethernet/intel/ice/ice.h
··· 605 605 wait_queue_head_t reset_wait_queue; 606 606 607 607 u32 hw_csum_rx_error; 608 + u32 hw_rx_eipe_error; 608 609 u32 oicr_err_reg; 609 610 struct msi_map oicr_irq; /* Other interrupt cause MSIX vector */ 610 611 struct msi_map ll_ts_irq; /* LL_TS interrupt MSIX vector */
+132 -2
drivers/net/ethernet/intel/ice/ice_base.c
··· 538 538 * 539 539 * Return 0 on success and a negative value on error. 540 540 */ 541 - int ice_vsi_cfg_rxq(struct ice_rx_ring *ring) 541 + static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring) 542 542 { 543 543 struct device *dev = ice_pf_to_dev(ring->vsi->back); 544 544 u32 num_bufs = ICE_RX_DESC_UNUSED(ring); ··· 629 629 } 630 630 631 631 ice_alloc_rx_bufs(ring, num_bufs); 632 + 633 + return 0; 634 + } 635 + 636 + int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx) 637 + { 638 + if (q_idx >= vsi->num_rxq) 639 + return -EINVAL; 640 + 641 + return ice_vsi_cfg_rxq(vsi->rx_rings[q_idx]); 642 + } 643 + 644 + /** 645 + * ice_vsi_cfg_frame_size - setup max frame size and Rx buffer length 646 + * @vsi: VSI 647 + */ 648 + static void ice_vsi_cfg_frame_size(struct ice_vsi *vsi) 649 + { 650 + if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags)) { 651 + vsi->max_frame = ICE_MAX_FRAME_LEGACY_RX; 652 + vsi->rx_buf_len = ICE_RXBUF_1664; 653 + #if (PAGE_SIZE < 8192) 654 + } else if (!ICE_2K_TOO_SMALL_WITH_PADDING && 655 + (vsi->netdev->mtu <= ETH_DATA_LEN)) { 656 + vsi->max_frame = ICE_RXBUF_1536 - NET_IP_ALIGN; 657 + vsi->rx_buf_len = ICE_RXBUF_1536 - NET_IP_ALIGN; 658 + #endif 659 + } else { 660 + vsi->max_frame = ICE_AQ_SET_MAC_FRAME_SIZE_MAX; 661 + vsi->rx_buf_len = ICE_RXBUF_3072; 662 + } 663 + } 664 + 665 + /** 666 + * ice_vsi_cfg_rxqs - Configure the VSI for Rx 667 + * @vsi: the VSI being configured 668 + * 669 + * Return 0 on success and a negative value on error 670 + * Configure the Rx VSI for operation. 671 + */ 672 + int ice_vsi_cfg_rxqs(struct ice_vsi *vsi) 673 + { 674 + u16 i; 675 + 676 + if (vsi->type == ICE_VSI_VF) 677 + goto setup_rings; 678 + 679 + ice_vsi_cfg_frame_size(vsi); 680 + setup_rings: 681 + /* set up individual rings */ 682 + ice_for_each_rxq(vsi, i) { 683 + int err = ice_vsi_cfg_rxq(vsi->rx_rings[i]); 684 + 685 + if (err) 686 + return err; 687 + } 632 688 633 689 return 0; 634 690 } ··· 884 828 * @ring: Tx ring to be configured 885 829 * @qg_buf: queue group buffer 886 830 */ 887 - int 831 + static int 888 832 ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring, 889 833 struct ice_aqc_add_tx_qgrp *qg_buf) 890 834 { ··· 951 895 txq = &qg_buf->txqs[0]; 952 896 if (pf_q == le16_to_cpu(txq->txq_id)) 953 897 ring->txq_teid = le32_to_cpu(txq->q_teid); 898 + 899 + return 0; 900 + } 901 + 902 + int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, 903 + u16 q_idx) 904 + { 905 + DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); 906 + 907 + if (q_idx >= vsi->alloc_txq || !tx_rings || !tx_rings[q_idx]) 908 + return -EINVAL; 909 + 910 + qg_buf->num_txqs = 1; 911 + 912 + return ice_vsi_cfg_txq(vsi, tx_rings[q_idx], qg_buf); 913 + } 914 + 915 + /** 916 + * ice_vsi_cfg_txqs - Configure the VSI for Tx 917 + * @vsi: the VSI being configured 918 + * @rings: Tx ring array to be configured 919 + * @count: number of Tx ring array elements 920 + * 921 + * Return 0 on success and a negative value on error 922 + * Configure the Tx VSI for operation. 923 + */ 924 + static int 925 + ice_vsi_cfg_txqs(struct ice_vsi *vsi, struct ice_tx_ring **rings, u16 count) 926 + { 927 + DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); 928 + int err = 0; 929 + u16 q_idx; 930 + 931 + qg_buf->num_txqs = 1; 932 + 933 + for (q_idx = 0; q_idx < count; q_idx++) { 934 + err = ice_vsi_cfg_txq(vsi, rings[q_idx], qg_buf); 935 + if (err) 936 + break; 937 + } 938 + 939 + return err; 940 + } 941 + 942 + /** 943 + * ice_vsi_cfg_lan_txqs - Configure the VSI for Tx 944 + * @vsi: the VSI being configured 945 + * 946 + * Return 0 on success and a negative value on error 947 + * Configure the Tx VSI for operation. 948 + */ 949 + int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi) 950 + { 951 + return ice_vsi_cfg_txqs(vsi, vsi->tx_rings, vsi->num_txq); 952 + } 953 + 954 + /** 955 + * ice_vsi_cfg_xdp_txqs - Configure Tx queues dedicated for XDP in given VSI 956 + * @vsi: the VSI being configured 957 + * 958 + * Return 0 on success and a negative value on error 959 + * Configure the Tx queues dedicated for XDP in given VSI for operation. 960 + */ 961 + int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi) 962 + { 963 + int ret; 964 + int i; 965 + 966 + ret = ice_vsi_cfg_txqs(vsi, vsi->xdp_rings, vsi->num_xdp_txq); 967 + if (ret) 968 + return ret; 969 + 970 + ice_for_each_rxq(vsi, i) 971 + ice_tx_xsk_pool(vsi, i); 954 972 955 973 return 0; 956 974 }
+6 -4
drivers/net/ethernet/intel/ice/ice_base.h
··· 6 6 7 7 #include "ice.h" 8 8 9 - int ice_vsi_cfg_rxq(struct ice_rx_ring *ring); 9 + int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx); 10 + int ice_vsi_cfg_rxqs(struct ice_vsi *vsi); 10 11 int __ice_vsi_get_qs(struct ice_qs_cfg *qs_cfg); 11 12 int 12 13 ice_vsi_ctrl_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx, bool wait); ··· 15 14 int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi); 16 15 void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi); 17 16 void ice_vsi_free_q_vectors(struct ice_vsi *vsi); 18 - int 19 - ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring, 20 - struct ice_aqc_add_tx_qgrp *qg_buf); 17 + int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, 18 + u16 q_idx); 19 + int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi); 20 + int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi); 21 21 void ice_cfg_itr(struct ice_hw *hw, struct ice_q_vector *q_vector); 22 22 void 23 23 ice_cfg_txq_interrupt(struct ice_vsi *vsi, u16 txq, u16 msix_idx, u16 itr_idx);
-3
drivers/net/ethernet/intel/ice/ice_debugfs.c
··· 64 64 "verbose", 65 65 }; 66 66 67 - /* the order in this array is important. it matches the ordering of the 68 - * values in the FW so the index is the same value as in ice_fwlog_level 69 - */ 70 67 static const char * const ice_fwlog_log_size[] = { 71 68 "128K", 72 69 "256K",
+1
drivers/net/ethernet/intel/ice/ice_ethtool.c
··· 129 129 ICE_PF_STAT("rx_oversize.nic", stats.rx_oversize), 130 130 ICE_PF_STAT("rx_jabber.nic", stats.rx_jabber), 131 131 ICE_PF_STAT("rx_csum_bad.nic", hw_csum_rx_error), 132 + ICE_PF_STAT("rx_eipe_error.nic", hw_rx_eipe_error), 132 133 ICE_PF_STAT("rx_dropped.nic", stats.eth.rx_discards), 133 134 ICE_PF_STAT("rx_crc_errors.nic", stats.crc_errors), 134 135 ICE_PF_STAT("illegal_bytes.nic", stats.illegal_bytes),
-129
drivers/net/ethernet/intel/ice/ice_lib.c
··· 1672 1672 } 1673 1673 1674 1674 /** 1675 - * ice_vsi_cfg_frame_size - setup max frame size and Rx buffer length 1676 - * @vsi: VSI 1677 - */ 1678 - static void ice_vsi_cfg_frame_size(struct ice_vsi *vsi) 1679 - { 1680 - if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags)) { 1681 - vsi->max_frame = ICE_MAX_FRAME_LEGACY_RX; 1682 - vsi->rx_buf_len = ICE_RXBUF_1664; 1683 - #if (PAGE_SIZE < 8192) 1684 - } else if (!ICE_2K_TOO_SMALL_WITH_PADDING && 1685 - (vsi->netdev->mtu <= ETH_DATA_LEN)) { 1686 - vsi->max_frame = ICE_RXBUF_1536 - NET_IP_ALIGN; 1687 - vsi->rx_buf_len = ICE_RXBUF_1536 - NET_IP_ALIGN; 1688 - #endif 1689 - } else { 1690 - vsi->max_frame = ICE_AQ_SET_MAC_FRAME_SIZE_MAX; 1691 - vsi->rx_buf_len = ICE_RXBUF_3072; 1692 - } 1693 - } 1694 - 1695 - /** 1696 1675 * ice_pf_state_is_nominal - checks the PF for nominal state 1697 1676 * @pf: pointer to PF to check 1698 1677 * ··· 1772 1793 regval |= QRXFLXP_CNTXT_TS_M; 1773 1794 1774 1795 wr32(hw, QRXFLXP_CNTXT(pf_q), regval); 1775 - } 1776 - 1777 - int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx) 1778 - { 1779 - if (q_idx >= vsi->num_rxq) 1780 - return -EINVAL; 1781 - 1782 - return ice_vsi_cfg_rxq(vsi->rx_rings[q_idx]); 1783 - } 1784 - 1785 - int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx) 1786 - { 1787 - DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); 1788 - 1789 - if (q_idx >= vsi->alloc_txq || !tx_rings || !tx_rings[q_idx]) 1790 - return -EINVAL; 1791 - 1792 - qg_buf->num_txqs = 1; 1793 - 1794 - return ice_vsi_cfg_txq(vsi, tx_rings[q_idx], qg_buf); 1795 - } 1796 - 1797 - /** 1798 - * ice_vsi_cfg_rxqs - Configure the VSI for Rx 1799 - * @vsi: the VSI being configured 1800 - * 1801 - * Return 0 on success and a negative value on error 1802 - * Configure the Rx VSI for operation. 1803 - */ 1804 - int ice_vsi_cfg_rxqs(struct ice_vsi *vsi) 1805 - { 1806 - u16 i; 1807 - 1808 - if (vsi->type == ICE_VSI_VF) 1809 - goto setup_rings; 1810 - 1811 - ice_vsi_cfg_frame_size(vsi); 1812 - setup_rings: 1813 - /* set up individual rings */ 1814 - ice_for_each_rxq(vsi, i) { 1815 - int err = ice_vsi_cfg_rxq(vsi->rx_rings[i]); 1816 - 1817 - if (err) 1818 - return err; 1819 - } 1820 - 1821 - return 0; 1822 - } 1823 - 1824 - /** 1825 - * ice_vsi_cfg_txqs - Configure the VSI for Tx 1826 - * @vsi: the VSI being configured 1827 - * @rings: Tx ring array to be configured 1828 - * @count: number of Tx ring array elements 1829 - * 1830 - * Return 0 on success and a negative value on error 1831 - * Configure the Tx VSI for operation. 1832 - */ 1833 - static int 1834 - ice_vsi_cfg_txqs(struct ice_vsi *vsi, struct ice_tx_ring **rings, u16 count) 1835 - { 1836 - DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); 1837 - int err = 0; 1838 - u16 q_idx; 1839 - 1840 - qg_buf->num_txqs = 1; 1841 - 1842 - for (q_idx = 0; q_idx < count; q_idx++) { 1843 - err = ice_vsi_cfg_txq(vsi, rings[q_idx], qg_buf); 1844 - if (err) 1845 - break; 1846 - } 1847 - 1848 - return err; 1849 - } 1850 - 1851 - /** 1852 - * ice_vsi_cfg_lan_txqs - Configure the VSI for Tx 1853 - * @vsi: the VSI being configured 1854 - * 1855 - * Return 0 on success and a negative value on error 1856 - * Configure the Tx VSI for operation. 1857 - */ 1858 - int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi) 1859 - { 1860 - return ice_vsi_cfg_txqs(vsi, vsi->tx_rings, vsi->num_txq); 1861 - } 1862 - 1863 - /** 1864 - * ice_vsi_cfg_xdp_txqs - Configure Tx queues dedicated for XDP in given VSI 1865 - * @vsi: the VSI being configured 1866 - * 1867 - * Return 0 on success and a negative value on error 1868 - * Configure the Tx queues dedicated for XDP in given VSI for operation. 1869 - */ 1870 - int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi) 1871 - { 1872 - int ret; 1873 - int i; 1874 - 1875 - ret = ice_vsi_cfg_txqs(vsi, vsi->xdp_rings, vsi->num_xdp_txq); 1876 - if (ret) 1877 - return ret; 1878 - 1879 - ice_for_each_rxq(vsi, i) 1880 - ice_tx_xsk_pool(vsi, i); 1881 - 1882 - return 0; 1883 1796 } 1884 1797 1885 1798 /**
-10
drivers/net/ethernet/intel/ice/ice_lib.h
··· 54 54 55 55 void ice_update_eth_stats(struct ice_vsi *vsi); 56 56 57 - int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx); 58 - 59 - int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx); 60 - 61 - int ice_vsi_cfg_rxqs(struct ice_vsi *vsi); 62 - 63 - int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi); 64 - 65 57 void ice_vsi_cfg_msix(struct ice_vsi *vsi); 66 58 67 59 int ice_vsi_start_all_rx_rings(struct ice_vsi *vsi); ··· 63 71 int 64 72 ice_vsi_stop_lan_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, 65 73 u16 rel_vmvf_num); 66 - 67 - int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi); 68 74 69 75 int ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi); 70 76
+6 -2
drivers/net/ethernet/intel/ice/ice_txrx_lib.c
··· 143 143 ipv6 = (decoded.outer_ip == ICE_RX_PTYPE_OUTER_IP) && 144 144 (decoded.outer_ip_ver == ICE_RX_PTYPE_OUTER_IPV6); 145 145 146 - if (ipv4 && (rx_status0 & (BIT(ICE_RX_FLEX_DESC_STATUS0_XSUM_IPE_S) | 147 - BIT(ICE_RX_FLEX_DESC_STATUS0_XSUM_EIPE_S)))) 146 + if (ipv4 && (rx_status0 & (BIT(ICE_RX_FLEX_DESC_STATUS0_XSUM_EIPE_S)))) { 147 + ring->vsi->back->hw_rx_eipe_error++; 148 + return; 149 + } 150 + 151 + if (ipv4 && (rx_status0 & (BIT(ICE_RX_FLEX_DESC_STATUS0_XSUM_IPE_S)))) 148 152 goto checksum_fail; 149 153 150 154 if (ipv6 && (rx_status0 & (BIT(ICE_RX_FLEX_DESC_STATUS0_IPV6EXADD_S))))
+4 -18
drivers/net/ethernet/intel/ice/ice_xsk.c
··· 217 217 */ 218 218 static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx) 219 219 { 220 - DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); 221 - u16 size = __struct_size(qg_buf); 222 220 struct ice_q_vector *q_vector; 223 - struct ice_tx_ring *tx_ring; 224 - struct ice_rx_ring *rx_ring; 225 221 int err; 226 222 227 - if (q_idx >= vsi->num_rxq || q_idx >= vsi->num_txq) 228 - return -EINVAL; 229 - 230 - qg_buf->num_txqs = 1; 231 - 232 - tx_ring = vsi->tx_rings[q_idx]; 233 - rx_ring = vsi->rx_rings[q_idx]; 234 - q_vector = rx_ring->q_vector; 235 - 236 - err = ice_vsi_cfg_txq(vsi, tx_ring, qg_buf); 223 + err = ice_vsi_cfg_single_txq(vsi, vsi->tx_rings, q_idx); 237 224 if (err) 238 225 return err; 239 226 240 227 if (ice_is_xdp_ena_vsi(vsi)) { 241 228 struct ice_tx_ring *xdp_ring = vsi->xdp_rings[q_idx]; 242 229 243 - memset(qg_buf, 0, size); 244 - qg_buf->num_txqs = 1; 245 - err = ice_vsi_cfg_txq(vsi, xdp_ring, qg_buf); 230 + err = ice_vsi_cfg_single_txq(vsi, vsi->xdp_rings, q_idx); 246 231 if (err) 247 232 return err; 248 233 ice_set_ring_xdp(xdp_ring); 249 234 ice_tx_xsk_pool(vsi, q_idx); 250 235 } 251 236 252 - err = ice_vsi_cfg_rxq(rx_ring); 237 + err = ice_vsi_cfg_single_rxq(vsi, q_idx); 253 238 if (err) 254 239 return err; 255 240 241 + q_vector = vsi->rx_rings[q_idx]->q_vector; 256 242 ice_qvec_cfg_msix(vsi, q_vector); 257 243 258 244 err = ice_vsi_ctrl_one_rx_ring(vsi, true, q_idx, true);