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.

net: stmmac: convert priv->sph* to boolean and rename

priv->sph* only have 'true' and 'false' used with them, yet they are an
int. Change their type to a bool, and rename to make their usage more
clear.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/E1vLIDN-0000000Evur-2NLU@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Russell King (Oracle) and committed by
Jakub Kicinski
7ac60a14 d7dbda87

+17 -17
+2 -2
drivers/net/ethernet/stmicro/stmmac/stmmac.h
··· 254 254 int hwts_tx_en; 255 255 bool tx_path_in_lpi_mode; 256 256 bool tso; 257 - int sph; 258 - int sph_cap; 257 + bool sph_active; 258 + bool sph_capable; 259 259 u32 sarc_type; 260 260 u32 rx_riwt[MTL_MAX_RX_QUEUES]; 261 261 int hwts_rx_en;
+13 -13
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 1527 1527 buf->page_offset = stmmac_rx_offset(priv); 1528 1528 } 1529 1529 1530 - if (priv->sph && !buf->sec_page) { 1530 + if (priv->sph_active && !buf->sec_page) { 1531 1531 buf->sec_page = page_pool_alloc_pages(rx_q->page_pool, gfp); 1532 1532 if (!buf->sec_page) 1533 1533 return -ENOMEM; ··· 2113 2113 pp_params.offset = stmmac_rx_offset(priv); 2114 2114 pp_params.max_len = dma_conf->dma_buf_sz; 2115 2115 2116 - if (priv->sph) { 2116 + if (priv->sph_active) { 2117 2117 pp_params.offset = 0; 2118 2118 pp_params.max_len += stmmac_rx_offset(priv); 2119 2119 } ··· 3607 3607 } 3608 3608 3609 3609 /* Enable Split Header */ 3610 - sph_en = (priv->hw->rx_csum > 0) && priv->sph; 3610 + sph_en = (priv->hw->rx_csum > 0) && priv->sph_active; 3611 3611 for (chan = 0; chan < rx_cnt; chan++) 3612 3612 stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan); 3613 3613 ··· 4899 4899 break; 4900 4900 } 4901 4901 4902 - if (priv->sph && !buf->sec_page) { 4902 + if (priv->sph_active && !buf->sec_page) { 4903 4903 buf->sec_page = page_pool_alloc_pages(rx_q->page_pool, gfp); 4904 4904 if (!buf->sec_page) 4905 4905 break; ··· 4910 4910 buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset; 4911 4911 4912 4912 stmmac_set_desc_addr(priv, p, buf->addr); 4913 - if (priv->sph) 4913 + if (priv->sph_active) 4914 4914 stmmac_set_desc_sec_addr(priv, p, buf->sec_addr, true); 4915 4915 else 4916 4916 stmmac_set_desc_sec_addr(priv, p, buf->sec_addr, false); ··· 4945 4945 int coe = priv->hw->rx_csum; 4946 4946 4947 4947 /* Not first descriptor, buffer is always zero */ 4948 - if (priv->sph && len) 4948 + if (priv->sph_active && len) 4949 4949 return 0; 4950 4950 4951 4951 /* First descriptor, get split header length */ 4952 4952 stmmac_get_rx_header_len(priv, p, &hlen); 4953 - if (priv->sph && hlen) { 4953 + if (priv->sph_active && hlen) { 4954 4954 priv->xstats.rx_split_hdr_pkt_n++; 4955 4955 return hlen; 4956 4956 } ··· 4973 4973 unsigned int plen = 0; 4974 4974 4975 4975 /* Not split header, buffer is not available */ 4976 - if (!priv->sph) 4976 + if (!priv->sph_active) 4977 4977 return 0; 4978 4978 4979 4979 /* Not last descriptor */ ··· 6041 6041 */ 6042 6042 stmmac_rx_ipc(priv, priv->hw); 6043 6043 6044 - if (priv->sph_cap) { 6045 - bool sph_en = (priv->hw->rx_csum > 0) && priv->sph; 6044 + if (priv->sph_capable) { 6045 + bool sph_en = (priv->hw->rx_csum > 0) && priv->sph_active; 6046 6046 u32 chan; 6047 6047 6048 6048 for (chan = 0; chan < priv->plat->rx_queues_to_use; chan++) ··· 6991 6991 } 6992 6992 6993 6993 /* Adjust Split header */ 6994 - sph_en = (priv->hw->rx_csum > 0) && priv->sph; 6994 + sph_en = (priv->hw->rx_csum > 0) && priv->sph_active; 6995 6995 6996 6996 /* DMA RX Channel Configuration */ 6997 6997 for (chan = 0; chan < rx_cnt; chan++) { ··· 7740 7740 if (priv->dma_cap.sphen && 7741 7741 !(priv->plat->flags & STMMAC_FLAG_SPH_DISABLE)) { 7742 7742 ndev->hw_features |= NETIF_F_GRO; 7743 - priv->sph_cap = true; 7744 - priv->sph = priv->sph_cap; 7743 + priv->sph_capable = true; 7744 + priv->sph_active = priv->sph_capable; 7745 7745 dev_info(priv->device, "SPH feature enabled\n"); 7746 7746 } 7747 7747
+1 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
··· 1721 1721 struct stmmac_packet_attrs attr = { }; 1722 1722 int ret; 1723 1723 1724 - if (!priv->sph) 1724 + if (!priv->sph_active) 1725 1725 return -EOPNOTSUPP; 1726 1726 1727 1727 /* Check for UDP first */
+1 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_xdp.c
··· 129 129 bpf_prog_put(old_prog); 130 130 131 131 /* Disable RX SPH for XDP operation */ 132 - priv->sph = priv->sph_cap && !stmmac_xdp_is_enabled(priv); 132 + priv->sph_active = priv->sph_capable && !stmmac_xdp_is_enabled(priv); 133 133 134 134 if (if_running && need_update) 135 135 stmmac_xdp_open(dev);