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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

No conflicts and no adjacent changes.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+116 -132
+16 -23
drivers/net/ethernet/marvell/octeon_ep/octep_ethtool.c
··· 150 150 iface_rx_stats, 151 151 iface_tx_stats); 152 152 153 - for (q = 0; q < oct->num_oqs; q++) { 154 - struct octep_iq *iq = oct->iq[q]; 155 - struct octep_oq *oq = oct->oq[q]; 153 + for (q = 0; q < OCTEP_MAX_QUEUES; q++) { 154 + tx_packets += oct->stats_iq[q].instr_completed; 155 + tx_bytes += oct->stats_iq[q].bytes_sent; 156 + tx_busy_errors += oct->stats_iq[q].tx_busy; 156 157 157 - tx_packets += iq->stats.instr_completed; 158 - tx_bytes += iq->stats.bytes_sent; 159 - tx_busy_errors += iq->stats.tx_busy; 160 - 161 - rx_packets += oq->stats.packets; 162 - rx_bytes += oq->stats.bytes; 163 - rx_alloc_errors += oq->stats.alloc_failures; 158 + rx_packets += oct->stats_oq[q].packets; 159 + rx_bytes += oct->stats_oq[q].bytes; 160 + rx_alloc_errors += oct->stats_oq[q].alloc_failures; 164 161 } 165 162 i = 0; 166 163 data[i++] = rx_packets; ··· 195 198 data[i++] = iface_rx_stats->err_pkts; 196 199 197 200 /* Per Tx Queue stats */ 198 - for (q = 0; q < oct->num_iqs; q++) { 199 - struct octep_iq *iq = oct->iq[q]; 200 - 201 - data[i++] = iq->stats.instr_posted; 202 - data[i++] = iq->stats.instr_completed; 203 - data[i++] = iq->stats.bytes_sent; 204 - data[i++] = iq->stats.tx_busy; 201 + for (q = 0; q < OCTEP_MAX_QUEUES; q++) { 202 + data[i++] = oct->stats_iq[q].instr_posted; 203 + data[i++] = oct->stats_iq[q].instr_completed; 204 + data[i++] = oct->stats_iq[q].bytes_sent; 205 + data[i++] = oct->stats_iq[q].tx_busy; 205 206 } 206 207 207 208 /* Per Rx Queue stats */ 208 - for (q = 0; q < oct->num_oqs; q++) { 209 - struct octep_oq *oq = oct->oq[q]; 210 - 211 - data[i++] = oq->stats.packets; 212 - data[i++] = oq->stats.bytes; 213 - data[i++] = oq->stats.alloc_failures; 209 + for (q = 0; q < OCTEP_MAX_QUEUES; q++) { 210 + data[i++] = oct->stats_oq[q].packets; 211 + data[i++] = oct->stats_oq[q].bytes; 212 + data[i++] = oct->stats_oq[q].alloc_failures; 214 213 } 215 214 } 216 215
+8 -21
drivers/net/ethernet/marvell/octeon_ep/octep_main.c
··· 822 822 if (unlikely(IQ_INSTR_SPACE(iq) > 823 823 OCTEP_WAKE_QUEUE_THRESHOLD)) { 824 824 netif_start_subqueue(iq->netdev, iq->q_no); 825 - iq->stats.restart_cnt++; 825 + iq->stats->restart_cnt++; 826 826 return 0; 827 827 } 828 828 ··· 960 960 wmb(); 961 961 /* Ring Doorbell to notify the NIC of new packets */ 962 962 writel(iq->fill_cnt, iq->doorbell_reg); 963 - iq->stats.instr_posted += iq->fill_cnt; 963 + iq->stats->instr_posted += iq->fill_cnt; 964 964 iq->fill_cnt = 0; 965 965 return NETDEV_TX_OK; 966 966 ··· 991 991 static void octep_get_stats64(struct net_device *netdev, 992 992 struct rtnl_link_stats64 *stats) 993 993 { 994 - u64 tx_packets, tx_bytes, rx_packets, rx_bytes; 995 994 struct octep_device *oct = netdev_priv(netdev); 995 + u64 tx_packets, tx_bytes, rx_packets, rx_bytes; 996 996 int q; 997 - 998 - if (netif_running(netdev)) 999 - octep_ctrl_net_get_if_stats(oct, 1000 - OCTEP_CTRL_NET_INVALID_VFID, 1001 - &oct->iface_rx_stats, 1002 - &oct->iface_tx_stats); 1003 997 1004 998 tx_packets = 0; 1005 999 tx_bytes = 0; 1006 1000 rx_packets = 0; 1007 1001 rx_bytes = 0; 1008 - for (q = 0; q < oct->num_oqs; q++) { 1009 - struct octep_iq *iq = oct->iq[q]; 1010 - struct octep_oq *oq = oct->oq[q]; 1011 - 1012 - tx_packets += iq->stats.instr_completed; 1013 - tx_bytes += iq->stats.bytes_sent; 1014 - rx_packets += oq->stats.packets; 1015 - rx_bytes += oq->stats.bytes; 1002 + for (q = 0; q < OCTEP_MAX_QUEUES; q++) { 1003 + tx_packets += oct->stats_iq[q].instr_completed; 1004 + tx_bytes += oct->stats_iq[q].bytes_sent; 1005 + rx_packets += oct->stats_oq[q].packets; 1006 + rx_bytes += oct->stats_oq[q].bytes; 1016 1007 } 1017 1008 stats->tx_packets = tx_packets; 1018 1009 stats->tx_bytes = tx_bytes; 1019 1010 stats->rx_packets = rx_packets; 1020 1011 stats->rx_bytes = rx_bytes; 1021 - stats->multicast = oct->iface_rx_stats.mcast_pkts; 1022 - stats->rx_errors = oct->iface_rx_stats.err_pkts; 1023 - stats->collisions = oct->iface_tx_stats.xscol; 1024 - stats->tx_fifo_errors = oct->iface_tx_stats.undflw; 1025 1012 } 1026 1013 1027 1014 /**
+6
drivers/net/ethernet/marvell/octeon_ep/octep_main.h
··· 258 258 /* Pointers to Octeon Tx queues */ 259 259 struct octep_iq *iq[OCTEP_MAX_IQ]; 260 260 261 + /* Per iq stats */ 262 + struct octep_iq_stats stats_iq[OCTEP_MAX_IQ]; 263 + 261 264 /* Rx queues (OQ: Output Queue) */ 262 265 u16 num_oqs; 263 266 /* Pointers to Octeon Rx queues */ 264 267 struct octep_oq *oq[OCTEP_MAX_OQ]; 268 + 269 + /* Per oq stats */ 270 + struct octep_oq_stats stats_oq[OCTEP_MAX_OQ]; 265 271 266 272 /* Hardware port number of the PCIe interface */ 267 273 u16 pcie_port;
+6 -5
drivers/net/ethernet/marvell/octeon_ep/octep_rx.c
··· 87 87 page = dev_alloc_page(); 88 88 if (unlikely(!page)) { 89 89 dev_err(oq->dev, "refill: rx buffer alloc failed\n"); 90 - oq->stats.alloc_failures++; 90 + oq->stats->alloc_failures++; 91 91 break; 92 92 } 93 93 ··· 98 98 "OQ-%d buffer refill: DMA mapping error!\n", 99 99 oq->q_no); 100 100 put_page(page); 101 - oq->stats.alloc_failures++; 101 + oq->stats->alloc_failures++; 102 102 break; 103 103 } 104 104 oq->buff_info[refill_idx].page = page; ··· 134 134 oq->netdev = oct->netdev; 135 135 oq->dev = &oct->pdev->dev; 136 136 oq->q_no = q_no; 137 + oq->stats = &oct->stats_oq[q_no]; 137 138 oq->max_count = CFG_GET_OQ_NUM_DESC(oct->conf); 138 139 oq->ring_size_mask = oq->max_count - 1; 139 140 oq->buffer_size = CFG_GET_OQ_BUF_SIZE(oct->conf); ··· 444 443 if (!skb) { 445 444 octep_oq_drop_rx(oq, buff_info, 446 445 &read_idx, &desc_used); 447 - oq->stats.alloc_failures++; 446 + oq->stats->alloc_failures++; 448 447 continue; 449 448 } 450 449 skb_reserve(skb, data_offset); ··· 495 494 496 495 oq->host_read_idx = read_idx; 497 496 oq->refill_count += desc_used; 498 - oq->stats.packets += pkt; 499 - oq->stats.bytes += rx_bytes; 497 + oq->stats->packets += pkt; 498 + oq->stats->bytes += rx_bytes; 500 499 501 500 return pkt; 502 501 }
+2 -2
drivers/net/ethernet/marvell/octeon_ep/octep_rx.h
··· 186 186 */ 187 187 u8 __iomem *pkts_sent_reg; 188 188 189 - /* Statistics for this OQ. */ 190 - struct octep_oq_stats stats; 189 + /* Pointer to statistics for this OQ. */ 190 + struct octep_oq_stats *stats; 191 191 192 192 /* Packets pending to be processed */ 193 193 u32 pkts_pending;
+4 -3
drivers/net/ethernet/marvell/octeon_ep/octep_tx.c
··· 81 81 } 82 82 83 83 iq->pkts_processed += compl_pkts; 84 - iq->stats.instr_completed += compl_pkts; 85 - iq->stats.bytes_sent += compl_bytes; 86 - iq->stats.sgentry_sent += compl_sg; 84 + iq->stats->instr_completed += compl_pkts; 85 + iq->stats->bytes_sent += compl_bytes; 86 + iq->stats->sgentry_sent += compl_sg; 87 87 iq->flush_index = fi; 88 88 89 89 netdev_tx_completed_queue(iq->netdev_q, compl_pkts, compl_bytes); ··· 187 187 iq->netdev = oct->netdev; 188 188 iq->dev = &oct->pdev->dev; 189 189 iq->q_no = q_no; 190 + iq->stats = &oct->stats_iq[q_no]; 190 191 iq->max_count = CFG_GET_IQ_NUM_DESC(oct->conf); 191 192 iq->ring_size_mask = iq->max_count - 1; 192 193 iq->fill_threshold = CFG_GET_IQ_DB_MIN(oct->conf);
+2 -2
drivers/net/ethernet/marvell/octeon_ep/octep_tx.h
··· 170 170 */ 171 171 u16 flush_index; 172 172 173 - /* Statistics for this input queue. */ 174 - struct octep_iq_stats stats; 173 + /* Pointer to statistics for this input queue. */ 174 + struct octep_iq_stats *stats; 175 175 176 176 /* Pointer to the Virtual Base addr of the input ring. */ 177 177 struct octep_tx_desc_hw *desc_ring;
+11 -18
drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_ethtool.c
··· 114 114 iface_tx_stats = &oct->iface_tx_stats; 115 115 iface_rx_stats = &oct->iface_rx_stats; 116 116 117 - for (q = 0; q < oct->num_oqs; q++) { 118 - struct octep_vf_iq *iq = oct->iq[q]; 119 - struct octep_vf_oq *oq = oct->oq[q]; 120 - 121 - tx_busy_errors += iq->stats.tx_busy; 122 - rx_alloc_errors += oq->stats.alloc_failures; 117 + for (q = 0; q < OCTEP_VF_MAX_QUEUES; q++) { 118 + tx_busy_errors += oct->stats_iq[q].tx_busy; 119 + rx_alloc_errors += oct->stats_oq[q].alloc_failures; 123 120 } 124 121 i = 0; 125 122 data[i++] = rx_alloc_errors; ··· 131 134 data[i++] = iface_rx_stats->dropped_octets_fifo_full; 132 135 133 136 /* Per Tx Queue stats */ 134 - for (q = 0; q < oct->num_iqs; q++) { 135 - struct octep_vf_iq *iq = oct->iq[q]; 136 - 137 - data[i++] = iq->stats.instr_posted; 138 - data[i++] = iq->stats.instr_completed; 139 - data[i++] = iq->stats.bytes_sent; 140 - data[i++] = iq->stats.tx_busy; 137 + for (q = 0; q < OCTEP_VF_MAX_QUEUES; q++) { 138 + data[i++] = oct->stats_iq[q].instr_posted; 139 + data[i++] = oct->stats_iq[q].instr_completed; 140 + data[i++] = oct->stats_iq[q].bytes_sent; 141 + data[i++] = oct->stats_iq[q].tx_busy; 141 142 } 142 143 143 144 /* Per Rx Queue stats */ 144 145 for (q = 0; q < oct->num_oqs; q++) { 145 - struct octep_vf_oq *oq = oct->oq[q]; 146 - 147 - data[i++] = oq->stats.packets; 148 - data[i++] = oq->stats.bytes; 149 - data[i++] = oq->stats.alloc_failures; 146 + data[i++] = oct->stats_oq[q].packets; 147 + data[i++] = oct->stats_oq[q].bytes; 148 + data[i++] = oct->stats_oq[q].alloc_failures; 150 149 } 151 150 } 152 151
+7 -18
drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
··· 574 574 * caused queues to get re-enabled after 575 575 * being stopped 576 576 */ 577 - iq->stats.restart_cnt++; 577 + iq->stats->restart_cnt++; 578 578 fallthrough; 579 579 case 1: /* Queue left enabled, since IQ is not yet full*/ 580 580 return 0; ··· 731 731 /* Flush the hw descriptors before writing to doorbell */ 732 732 smp_wmb(); 733 733 writel(iq->fill_cnt, iq->doorbell_reg); 734 - iq->stats.instr_posted += iq->fill_cnt; 734 + iq->stats->instr_posted += iq->fill_cnt; 735 735 iq->fill_cnt = 0; 736 736 return NETDEV_TX_OK; 737 737 } ··· 786 786 tx_bytes = 0; 787 787 rx_packets = 0; 788 788 rx_bytes = 0; 789 - for (q = 0; q < oct->num_oqs; q++) { 790 - struct octep_vf_iq *iq = oct->iq[q]; 791 - struct octep_vf_oq *oq = oct->oq[q]; 792 - 793 - tx_packets += iq->stats.instr_completed; 794 - tx_bytes += iq->stats.bytes_sent; 795 - rx_packets += oq->stats.packets; 796 - rx_bytes += oq->stats.bytes; 789 + for (q = 0; q < OCTEP_VF_MAX_QUEUES; q++) { 790 + tx_packets += oct->stats_iq[q].instr_completed; 791 + tx_bytes += oct->stats_iq[q].bytes_sent; 792 + rx_packets += oct->stats_oq[q].packets; 793 + rx_bytes += oct->stats_oq[q].bytes; 797 794 } 798 795 stats->tx_packets = tx_packets; 799 796 stats->tx_bytes = tx_bytes; 800 797 stats->rx_packets = rx_packets; 801 798 stats->rx_bytes = rx_bytes; 802 - if (!octep_vf_get_if_stats(oct)) { 803 - stats->multicast = oct->iface_rx_stats.mcast_pkts; 804 - stats->rx_errors = oct->iface_rx_stats.err_pkts; 805 - stats->rx_dropped = oct->iface_rx_stats.dropped_pkts_fifo_full + 806 - oct->iface_rx_stats.err_pkts; 807 - stats->rx_missed_errors = oct->iface_rx_stats.dropped_pkts_fifo_full; 808 - stats->tx_dropped = oct->iface_tx_stats.dropped; 809 - } 810 799 } 811 800 812 801 /**
+6
drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.h
··· 246 246 /* Pointers to Octeon Tx queues */ 247 247 struct octep_vf_iq *iq[OCTEP_VF_MAX_IQ]; 248 248 249 + /* Per iq stats */ 250 + struct octep_vf_iq_stats stats_iq[OCTEP_VF_MAX_IQ]; 251 + 249 252 /* Rx queues (OQ: Output Queue) */ 250 253 u16 num_oqs; 251 254 /* Pointers to Octeon Rx queues */ 252 255 struct octep_vf_oq *oq[OCTEP_VF_MAX_OQ]; 256 + 257 + /* Per oq stats */ 258 + struct octep_vf_oq_stats stats_oq[OCTEP_VF_MAX_OQ]; 253 259 254 260 /* Hardware port number of the PCIe interface */ 255 261 u16 pcie_port;
+5 -4
drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.c
··· 87 87 page = dev_alloc_page(); 88 88 if (unlikely(!page)) { 89 89 dev_err(oq->dev, "refill: rx buffer alloc failed\n"); 90 - oq->stats.alloc_failures++; 90 + oq->stats->alloc_failures++; 91 91 break; 92 92 } 93 93 ··· 98 98 "OQ-%d buffer refill: DMA mapping error!\n", 99 99 oq->q_no); 100 100 put_page(page); 101 - oq->stats.alloc_failures++; 101 + oq->stats->alloc_failures++; 102 102 break; 103 103 } 104 104 oq->buff_info[refill_idx].page = page; ··· 134 134 oq->netdev = oct->netdev; 135 135 oq->dev = &oct->pdev->dev; 136 136 oq->q_no = q_no; 137 + oq->stats = &oct->stats_oq[q_no]; 137 138 oq->max_count = CFG_GET_OQ_NUM_DESC(oct->conf); 138 139 oq->ring_size_mask = oq->max_count - 1; 139 140 oq->buffer_size = CFG_GET_OQ_BUF_SIZE(oct->conf); ··· 459 458 460 459 oq->host_read_idx = read_idx; 461 460 oq->refill_count += desc_used; 462 - oq->stats.packets += pkt; 463 - oq->stats.bytes += rx_bytes; 461 + oq->stats->packets += pkt; 462 + oq->stats->bytes += rx_bytes; 464 463 465 464 return pkt; 466 465 }
+1 -1
drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.h
··· 187 187 u8 __iomem *pkts_sent_reg; 188 188 189 189 /* Statistics for this OQ. */ 190 - struct octep_vf_oq_stats stats; 190 + struct octep_vf_oq_stats *stats; 191 191 192 192 /* Packets pending to be processed */ 193 193 u32 pkts_pending;
+4 -3
drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_tx.c
··· 82 82 } 83 83 84 84 iq->pkts_processed += compl_pkts; 85 - iq->stats.instr_completed += compl_pkts; 86 - iq->stats.bytes_sent += compl_bytes; 87 - iq->stats.sgentry_sent += compl_sg; 85 + iq->stats->instr_completed += compl_pkts; 86 + iq->stats->bytes_sent += compl_bytes; 87 + iq->stats->sgentry_sent += compl_sg; 88 88 iq->flush_index = fi; 89 89 90 90 netif_subqueue_completed_wake(iq->netdev, iq->q_no, compl_pkts, ··· 186 186 iq->netdev = oct->netdev; 187 187 iq->dev = &oct->pdev->dev; 188 188 iq->q_no = q_no; 189 + iq->stats = &oct->stats_iq[q_no]; 189 190 iq->max_count = CFG_GET_IQ_NUM_DESC(oct->conf); 190 191 iq->ring_size_mask = iq->max_count - 1; 191 192 iq->fill_threshold = CFG_GET_IQ_DB_MIN(oct->conf);
+1 -1
drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_tx.h
··· 129 129 u16 flush_index; 130 130 131 131 /* Statistics for this input queue. */ 132 - struct octep_vf_iq_stats stats; 132 + struct octep_vf_iq_stats *stats; 133 133 134 134 /* Pointer to the Virtual Base addr of the input ring. */ 135 135 struct octep_vf_tx_desc_hw *desc_ring;
-2
drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c
··· 14 14 #define MLXFW_FSM_STATE_WAIT_TIMEOUT_MS 30000 15 15 #define MLXFW_FSM_STATE_WAIT_ROUNDS \ 16 16 (MLXFW_FSM_STATE_WAIT_TIMEOUT_MS / MLXFW_FSM_STATE_WAIT_CYCLE_MS) 17 - #define MLXFW_FSM_MAX_COMPONENT_SIZE (10 * (1 << 20)) 18 17 19 18 static const int mlxfw_fsm_state_errno[] = { 20 19 [MLXFW_FSM_STATE_ERR_ERROR] = -EIO, ··· 228 229 return err; 229 230 } 230 231 231 - comp_max_size = min_t(u32, comp_max_size, MLXFW_FSM_MAX_COMPONENT_SIZE); 232 232 if (comp->data_size > comp_max_size) { 233 233 MLXFW_ERR_MSG(mlxfw_dev, extack, 234 234 "Component size is bigger than limit", -EINVAL);
+1 -1
drivers/net/ethernet/ti/am65-cpsw-nuss.c
··· 2282 2282 for (i = 0; i < common->tx_ch_num; i++) { 2283 2283 struct am65_cpsw_tx_chn *tx_chn = &common->tx_chns[i]; 2284 2284 2285 - if (tx_chn->irq) 2285 + if (tx_chn->irq > 0) 2286 2286 devm_free_irq(dev, tx_chn->irq, tx_chn); 2287 2287 2288 2288 netif_napi_del(&tx_chn->napi_tx);
+14 -15
drivers/net/phy/realtek/realtek_main.c
··· 971 971 { 972 972 int lpadv, ret; 973 973 974 + mii_10gbt_stat_mod_linkmode_lpa_t(phydev->lp_advertising, 0); 975 + 974 976 ret = rtlgen_read_status(phydev); 975 977 if (ret < 0) 976 978 return ret; 977 979 978 980 if (phydev->autoneg == AUTONEG_DISABLE || 979 - !phydev->autoneg_complete) { 980 - mii_10gbt_stat_mod_linkmode_lpa_t(phydev->lp_advertising, 0); 981 + !phydev->autoneg_complete) 981 982 return 0; 982 - } 983 983 984 984 lpadv = phy_read_paged(phydev, 0xa5d, 0x13); 985 985 if (lpadv < 0) ··· 1042 1042 { 1043 1043 int ret, val; 1044 1044 1045 - ret = genphy_c45_read_status(phydev); 1046 - if (ret < 0) 1047 - return ret; 1048 - 1049 - if (phydev->autoneg == AUTONEG_DISABLE || 1050 - !genphy_c45_aneg_done(phydev)) 1051 - mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising, 0); 1052 - 1053 1045 /* Vendor register as C45 has no standardized support for 1000BaseT */ 1054 - if (phydev->autoneg == AUTONEG_ENABLE) { 1046 + if (phydev->autoneg == AUTONEG_ENABLE && genphy_c45_aneg_done(phydev)) { 1055 1047 val = phy_read_mmd(phydev, MDIO_MMD_VEND2, 1056 1048 RTL822X_VND2_GANLPAR); 1057 1049 if (val < 0) 1058 1050 return val; 1059 - 1060 - mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising, val); 1051 + } else { 1052 + val = 0; 1061 1053 } 1054 + mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising, val); 1062 1055 1063 - if (!phydev->link) 1056 + ret = genphy_c45_read_status(phydev); 1057 + if (ret < 0) 1058 + return ret; 1059 + 1060 + if (!phydev->link) { 1061 + phydev->master_slave_state = MASTER_SLAVE_STATE_UNKNOWN; 1064 1062 return 0; 1063 + } 1065 1064 1066 1065 /* Read actual speed from vendor register. */ 1067 1066 val = phy_read_mmd(phydev, MDIO_MMD_VEND2, RTL_VND2_PHYSR);
+4 -1
net/core/sysctl_net_core.c
··· 319 319 int ret, weight; 320 320 321 321 mutex_lock(&dev_weight_mutex); 322 - ret = proc_dointvec(table, write, buffer, lenp, ppos); 322 + ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); 323 323 if (!ret && write) { 324 324 weight = READ_ONCE(weight_p); 325 325 WRITE_ONCE(net_hotdata.dev_rx_weight, weight * dev_weight_rx_bias); ··· 412 412 .maxlen = sizeof(int), 413 413 .mode = 0644, 414 414 .proc_handler = proc_do_dev_weight, 415 + .extra1 = SYSCTL_ONE, 415 416 }, 416 417 { 417 418 .procname = "dev_weight_rx_bias", ··· 420 419 .maxlen = sizeof(int), 421 420 .mode = 0644, 422 421 .proc_handler = proc_do_dev_weight, 422 + .extra1 = SYSCTL_ONE, 423 423 }, 424 424 { 425 425 .procname = "dev_weight_tx_bias", ··· 428 426 .maxlen = sizeof(int), 429 427 .mode = 0644, 430 428 .proc_handler = proc_do_dev_weight, 429 + .extra1 = SYSCTL_ONE, 431 430 }, 432 431 { 433 432 .procname = "netdev_max_backlog",
+1 -1
net/ethtool/netlink.c
··· 91 91 pm_runtime_get_sync(dev->dev.parent); 92 92 93 93 if (!netif_device_present(dev) || 94 - dev->reg_state == NETREG_UNREGISTERING) { 94 + dev->reg_state >= NETREG_UNREGISTERING) { 95 95 ret = -ENODEV; 96 96 goto err; 97 97 }
+5 -3
net/ipv4/tcp_cubic.c
··· 392 392 if (after(tp->snd_una, ca->end_seq)) 393 393 bictcp_hystart_reset(sk); 394 394 395 + /* hystart triggers when cwnd is larger than some threshold */ 396 + if (tcp_snd_cwnd(tp) < hystart_low_window) 397 + return; 398 + 395 399 if (hystart_detect & HYSTART_ACK_TRAIN) { 396 400 u32 now = bictcp_clock_us(sk); 397 401 ··· 471 467 if (ca->delay_min == 0 || ca->delay_min > delay) 472 468 ca->delay_min = delay; 473 469 474 - /* hystart triggers when cwnd is larger than some threshold */ 475 - if (!ca->found && tcp_in_slow_start(tp) && hystart && 476 - tcp_snd_cwnd(tp) >= hystart_low_window) 470 + if (!ca->found && tcp_in_slow_start(tp) && hystart) 477 471 hystart_update(sk, delay); 478 472 } 479 473
+8 -8
net/rose/af_rose.c
··· 397 397 { 398 398 struct sock *sk = sock->sk; 399 399 struct rose_sock *rose = rose_sk(sk); 400 - int opt; 400 + unsigned int opt; 401 401 402 402 if (level != SOL_ROSE) 403 403 return -ENOPROTOOPT; 404 404 405 - if (optlen < sizeof(int)) 405 + if (optlen < sizeof(unsigned int)) 406 406 return -EINVAL; 407 407 408 - if (copy_from_sockptr(&opt, optval, sizeof(int))) 408 + if (copy_from_sockptr(&opt, optval, sizeof(unsigned int))) 409 409 return -EFAULT; 410 410 411 411 switch (optname) { ··· 414 414 return 0; 415 415 416 416 case ROSE_T1: 417 - if (opt < 1) 417 + if (opt < 1 || opt > UINT_MAX / HZ) 418 418 return -EINVAL; 419 419 rose->t1 = opt * HZ; 420 420 return 0; 421 421 422 422 case ROSE_T2: 423 - if (opt < 1) 423 + if (opt < 1 || opt > UINT_MAX / HZ) 424 424 return -EINVAL; 425 425 rose->t2 = opt * HZ; 426 426 return 0; 427 427 428 428 case ROSE_T3: 429 - if (opt < 1) 429 + if (opt < 1 || opt > UINT_MAX / HZ) 430 430 return -EINVAL; 431 431 rose->t3 = opt * HZ; 432 432 return 0; 433 433 434 434 case ROSE_HOLDBACK: 435 - if (opt < 1) 435 + if (opt < 1 || opt > UINT_MAX / HZ) 436 436 return -EINVAL; 437 437 rose->hb = opt * HZ; 438 438 return 0; 439 439 440 440 case ROSE_IDLE: 441 - if (opt < 0) 441 + if (opt > UINT_MAX / (60 * HZ)) 442 442 return -EINVAL; 443 443 rose->idle = opt * 60 * HZ; 444 444 return 0;
+4
net/sched/sch_api.c
··· 1664 1664 q = qdisc_lookup(dev, tcm->tcm_handle); 1665 1665 if (!q) 1666 1666 goto create_n_graft; 1667 + if (q->parent != tcm->tcm_parent) { 1668 + NL_SET_ERR_MSG(extack, "Cannot move an existing qdisc to a different parent"); 1669 + return -EINVAL; 1670 + } 1667 1671 if (n->nlmsg_flags & NLM_F_EXCL) { 1668 1672 NL_SET_ERR_MSG(extack, "Exclusivity flag on, cannot override"); 1669 1673 return -EEXIST;