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

Pull networking fixes from David Miller:

1) Fix interrupt name truncation in mv88e6xxx dsa driver, from Andrew
Lunn.

2) Process generic XDP even if SKB is cloned, from Toke Høiland-Jørgensen.

3) Fix leak of kernel memory to userspace in smc, from Eric Dumazet.

4) Add some missing netlink attribute validation to matchall and
flower, from Davide Caratti.

5) Send icmp responses properly when NAT has been applied to the frame
before we get to the tunnel emitting the icmp, from Jason Donenfeld.

6) Make sure there is enough SKB headroom when adding dsa tags for qca
and ar9331. From Per Forlin.

* git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (62 commits)
netdevice.h: fix all kernel-doc and Sphinx warnings
net: dsa: tag_ar9331: Make sure there is headroom for tag
net: dsa: tag_qca: Make sure there is headroom for tag
net, ip6_tunnel: enhance tunnel locate with link check
net/smc: no peer ID in CLC decline for SMCD
net/smc: transfer fasync_list in case of fallback
net: hns3: fix a copying IPv6 address error in hclge_fd_get_flow_tuples()
net: hns3: fix VF bandwidth does not take effect in some case
net: hns3: add management table after IMP reset
mac80211: fix wrong 160/80+80 MHz setting
cfg80211: add missing policy for NL80211_ATTR_STATUS_CODE
xfrm: interface: use icmp_ndo_send helper
wireguard: device: use icmp_ndo_send helper
sunvnet: use icmp_ndo_send helper
gtp: use icmp_ndo_send helper
icmp: introduce helper for nat'd source address in network device context
net/sched: flower: add missing validation of TCA_FLOWER_FLAGS
net/sched: matchall: add missing validation of TCA_MATCHALL_FLAGS
net/flow_dissector: remove unexist field description
page_pool: refill page when alloc.count of pool is zero
...

+648 -859
+6 -6
drivers/net/dsa/mv88e6xxx/chip.h
··· 236 236 bool mirror_ingress; 237 237 bool mirror_egress; 238 238 unsigned int serdes_irq; 239 - char serdes_irq_name[32]; 239 + char serdes_irq_name[64]; 240 240 }; 241 241 242 242 struct mv88e6xxx_chip { ··· 293 293 struct mv88e6xxx_irq g1_irq; 294 294 struct mv88e6xxx_irq g2_irq; 295 295 int irq; 296 - char irq_name[32]; 296 + char irq_name[64]; 297 297 int device_irq; 298 - char device_irq_name[32]; 298 + char device_irq_name[64]; 299 299 int watchdog_irq; 300 - char watchdog_irq_name[32]; 300 + char watchdog_irq_name[64]; 301 301 302 302 int atu_prob_irq; 303 - char atu_prob_irq_name[32]; 303 + char atu_prob_irq_name[64]; 304 304 int vtu_prob_irq; 305 - char vtu_prob_irq_name[32]; 305 + char vtu_prob_irq_name[64]; 306 306 struct kthread_worker *kworker; 307 307 struct kthread_delayed_work irq_poll_work; 308 308
+58 -38
drivers/net/ethernet/amazon/ena/ena_com.c
··· 200 200 static struct ena_comp_ctx *get_comp_ctxt(struct ena_com_admin_queue *queue, 201 201 u16 command_id, bool capture) 202 202 { 203 + if (unlikely(!queue->comp_ctx)) { 204 + pr_err("Completion context is NULL\n"); 205 + return NULL; 206 + } 207 + 203 208 if (unlikely(command_id >= queue->q_depth)) { 204 209 pr_err("command id is larger than the queue size. cmd_id: %u queue size %d\n", 205 210 command_id, queue->q_depth); ··· 1046 1041 feature_ver); 1047 1042 } 1048 1043 1044 + int ena_com_get_current_hash_function(struct ena_com_dev *ena_dev) 1045 + { 1046 + return ena_dev->rss.hash_func; 1047 + } 1048 + 1049 + static void ena_com_hash_key_fill_default_key(struct ena_com_dev *ena_dev) 1050 + { 1051 + struct ena_admin_feature_rss_flow_hash_control *hash_key = 1052 + (ena_dev->rss).hash_key; 1053 + 1054 + netdev_rss_key_fill(&hash_key->key, sizeof(hash_key->key)); 1055 + /* The key is stored in the device in u32 array 1056 + * as well as the API requires the key to be passed in this 1057 + * format. Thus the size of our array should be divided by 4 1058 + */ 1059 + hash_key->keys_num = sizeof(hash_key->key) / sizeof(u32); 1060 + } 1061 + 1049 1062 static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) 1050 1063 { 1051 1064 struct ena_rss *rss = &ena_dev->rss; 1065 + struct ena_admin_feature_rss_flow_hash_control *hash_key; 1066 + struct ena_admin_get_feat_resp get_resp; 1067 + int rc; 1068 + 1069 + hash_key = (ena_dev->rss).hash_key; 1070 + 1071 + rc = ena_com_get_feature_ex(ena_dev, &get_resp, 1072 + ENA_ADMIN_RSS_HASH_FUNCTION, 1073 + ena_dev->rss.hash_key_dma_addr, 1074 + sizeof(ena_dev->rss.hash_key), 0); 1075 + if (unlikely(rc)) { 1076 + hash_key = NULL; 1077 + return -EOPNOTSUPP; 1078 + } 1052 1079 1053 1080 rss->hash_key = 1054 1081 dma_alloc_coherent(ena_dev->dmadev, sizeof(*rss->hash_key), ··· 1286 1249 return -EINVAL; 1287 1250 1288 1251 rss->rss_ind_tbl[i].cq_idx = io_sq->idx; 1289 - } 1290 - 1291 - return 0; 1292 - } 1293 - 1294 - static int ena_com_ind_tbl_convert_from_device(struct ena_com_dev *ena_dev) 1295 - { 1296 - u16 dev_idx_to_host_tbl[ENA_TOTAL_NUM_QUEUES] = { (u16)-1 }; 1297 - struct ena_rss *rss = &ena_dev->rss; 1298 - u8 idx; 1299 - u16 i; 1300 - 1301 - for (i = 0; i < ENA_TOTAL_NUM_QUEUES; i++) 1302 - dev_idx_to_host_tbl[ena_dev->io_sq_queues[i].idx] = i; 1303 - 1304 - for (i = 0; i < 1 << rss->tbl_log_size; i++) { 1305 - if (rss->rss_ind_tbl[i].cq_idx > ENA_TOTAL_NUM_QUEUES) 1306 - return -EINVAL; 1307 - idx = (u8)rss->rss_ind_tbl[i].cq_idx; 1308 - 1309 - if (dev_idx_to_host_tbl[idx] > ENA_TOTAL_NUM_QUEUES) 1310 - return -EINVAL; 1311 - 1312 - rss->host_rss_ind_tbl[i] = dev_idx_to_host_tbl[idx]; 1313 1252 } 1314 1253 1315 1254 return 0; ··· 2310 2297 2311 2298 switch (func) { 2312 2299 case ENA_ADMIN_TOEPLITZ: 2313 - if (key_len > sizeof(hash_key->key)) { 2314 - pr_err("key len (%hu) is bigger than the max supported (%zu)\n", 2315 - key_len, sizeof(hash_key->key)); 2316 - return -EINVAL; 2300 + if (key) { 2301 + if (key_len != sizeof(hash_key->key)) { 2302 + pr_err("key len (%hu) doesn't equal the supported size (%zu)\n", 2303 + key_len, sizeof(hash_key->key)); 2304 + return -EINVAL; 2305 + } 2306 + memcpy(hash_key->key, key, key_len); 2307 + rss->hash_init_val = init_val; 2308 + hash_key->keys_num = key_len >> 2; 2317 2309 } 2318 - 2319 - memcpy(hash_key->key, key, key_len); 2320 - rss->hash_init_val = init_val; 2321 - hash_key->keys_num = key_len >> 2; 2322 2310 break; 2323 2311 case ENA_ADMIN_CRC32: 2324 2312 rss->hash_init_val = init_val; ··· 2356 2342 if (unlikely(rc)) 2357 2343 return rc; 2358 2344 2359 - rss->hash_func = get_resp.u.flow_hash_func.selected_func; 2345 + /* ffs() returns 1 in case the lsb is set */ 2346 + rss->hash_func = ffs(get_resp.u.flow_hash_func.selected_func); 2347 + if (rss->hash_func) 2348 + rss->hash_func--; 2349 + 2360 2350 if (func) 2361 2351 *func = rss->hash_func; 2362 2352 ··· 2624 2606 if (!ind_tbl) 2625 2607 return 0; 2626 2608 2627 - rc = ena_com_ind_tbl_convert_from_device(ena_dev); 2628 - if (unlikely(rc)) 2629 - return rc; 2630 - 2631 2609 for (i = 0; i < (1 << rss->tbl_log_size); i++) 2632 2610 ind_tbl[i] = rss->host_rss_ind_tbl[i]; 2633 2611 ··· 2640 2626 if (unlikely(rc)) 2641 2627 goto err_indr_tbl; 2642 2628 2629 + /* The following function might return unsupported in case the 2630 + * device doesn't support setting the key / hash function. We can safely 2631 + * ignore this error and have indirection table support only. 2632 + */ 2643 2633 rc = ena_com_hash_key_allocate(ena_dev); 2644 - if (unlikely(rc)) 2634 + if (unlikely(rc) && rc != -EOPNOTSUPP) 2645 2635 goto err_hash_key; 2636 + else if (rc != -EOPNOTSUPP) 2637 + ena_com_hash_key_fill_default_key(ena_dev); 2646 2638 2647 2639 rc = ena_com_hash_ctrl_init(ena_dev); 2648 2640 if (unlikely(rc))
+9
drivers/net/ethernet/amazon/ena/ena_com.h
··· 44 44 #include <linux/spinlock.h> 45 45 #include <linux/types.h> 46 46 #include <linux/wait.h> 47 + #include <linux/netdevice.h> 47 48 48 49 #include "ena_common_defs.h" 49 50 #include "ena_admin_defs.h" ··· 655 654 * Free all the RSS/RFS resources. 656 655 */ 657 656 void ena_com_rss_destroy(struct ena_com_dev *ena_dev); 657 + 658 + /* ena_com_get_current_hash_function - Get RSS hash function 659 + * @ena_dev: ENA communication layer struct 660 + * 661 + * Return the current hash function. 662 + * @return: 0 or one of the ena_admin_hash_functions values. 663 + */ 664 + int ena_com_get_current_hash_function(struct ena_com_dev *ena_dev); 658 665 659 666 /* ena_com_fill_hash_function - Fill RSS hash function 660 667 * @ena_dev: ENA communication layer struct
+43 -3
drivers/net/ethernet/amazon/ena/ena_ethtool.c
··· 636 636 return ENA_HASH_KEY_SIZE; 637 637 } 638 638 639 + static int ena_indirection_table_get(struct ena_adapter *adapter, u32 *indir) 640 + { 641 + struct ena_com_dev *ena_dev = adapter->ena_dev; 642 + int i, rc; 643 + 644 + if (!indir) 645 + return 0; 646 + 647 + rc = ena_com_indirect_table_get(ena_dev, indir); 648 + if (rc) 649 + return rc; 650 + 651 + /* Our internal representation of the indices is: even indices 652 + * for Tx and uneven indices for Rx. We need to convert the Rx 653 + * indices to be consecutive 654 + */ 655 + for (i = 0; i < ENA_RX_RSS_TABLE_SIZE; i++) 656 + indir[i] = ENA_IO_RXQ_IDX_TO_COMBINED_IDX(indir[i]); 657 + 658 + return rc; 659 + } 660 + 639 661 static int ena_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, 640 662 u8 *hfunc) 641 663 { ··· 666 644 u8 func; 667 645 int rc; 668 646 669 - rc = ena_com_indirect_table_get(adapter->ena_dev, indir); 647 + rc = ena_indirection_table_get(adapter, indir); 670 648 if (rc) 671 649 return rc; 672 650 651 + /* We call this function in order to check if the device 652 + * supports getting/setting the hash function. 653 + */ 673 654 rc = ena_com_get_hash_function(adapter->ena_dev, &ena_func, key); 655 + 656 + if (rc) { 657 + if (rc == -EOPNOTSUPP) { 658 + key = NULL; 659 + hfunc = NULL; 660 + rc = 0; 661 + } 662 + 663 + return rc; 664 + } 665 + 674 666 if (rc) 675 667 return rc; 676 668 ··· 693 657 func = ETH_RSS_HASH_TOP; 694 658 break; 695 659 case ENA_ADMIN_CRC32: 696 - func = ETH_RSS_HASH_XOR; 660 + func = ETH_RSS_HASH_CRC32; 697 661 break; 698 662 default: 699 663 netif_err(adapter, drv, netdev, ··· 736 700 } 737 701 738 702 switch (hfunc) { 703 + case ETH_RSS_HASH_NO_CHANGE: 704 + func = ena_com_get_current_hash_function(ena_dev); 705 + break; 739 706 case ETH_RSS_HASH_TOP: 740 707 func = ENA_ADMIN_TOEPLITZ; 741 708 break; 742 - case ETH_RSS_HASH_XOR: 709 + case ETH_RSS_HASH_CRC32: 743 710 func = ENA_ADMIN_CRC32; 744 711 break; 745 712 default: ··· 853 814 .set_channels = ena_set_channels, 854 815 .get_tunable = ena_get_tunable, 855 816 .set_tunable = ena_set_tunable, 817 + .get_ts_info = ethtool_op_get_ts_info, 856 818 }; 857 819 858 820 void ena_set_ethtool_ops(struct net_device *netdev)
+3 -3
drivers/net/ethernet/amazon/ena/ena_netdev.c
··· 3706 3706 if (adapter->keep_alive_timeout == ENA_HW_HINTS_NO_TIMEOUT) 3707 3707 return; 3708 3708 3709 - keep_alive_expired = round_jiffies(adapter->last_keep_alive_jiffies + 3710 - adapter->keep_alive_timeout); 3709 + keep_alive_expired = adapter->last_keep_alive_jiffies + 3710 + adapter->keep_alive_timeout; 3711 3711 if (unlikely(time_is_before_jiffies(keep_alive_expired))) { 3712 3712 netif_err(adapter, drv, adapter->netdev, 3713 3713 "Keep alive watchdog timeout.\n"); ··· 3809 3809 } 3810 3810 3811 3811 /* Reset the timer */ 3812 - mod_timer(&adapter->timer_service, jiffies + HZ); 3812 + mod_timer(&adapter->timer_service, round_jiffies(jiffies + HZ)); 3813 3813 } 3814 3814 3815 3815 static int ena_calc_max_io_queue_num(struct pci_dev *pdev,
+2
drivers/net/ethernet/amazon/ena/ena_netdev.h
··· 130 130 131 131 #define ENA_IO_TXQ_IDX(q) (2 * (q)) 132 132 #define ENA_IO_RXQ_IDX(q) (2 * (q) + 1) 133 + #define ENA_IO_TXQ_IDX_TO_COMBINED_IDX(q) ((q) / 2) 134 + #define ENA_IO_RXQ_IDX_TO_COMBINED_IDX(q) (((q) - 1) / 2) 133 135 134 136 #define ENA_MGMNT_IRQ_IDX 0 135 137 #define ENA_IO_IRQ_FIRST_IDX 1
+1 -1
drivers/net/ethernet/cisco/enic/enic_main.c
··· 2013 2013 napi_disable(&enic->napi[i]); 2014 2014 2015 2015 netif_carrier_off(netdev); 2016 - netif_tx_disable(netdev); 2017 2016 if (vnic_dev_get_intr_mode(enic->vdev) == VNIC_DEV_INTR_MODE_MSIX) 2018 2017 for (i = 0; i < enic->wq_count; i++) 2019 2018 napi_disable(&enic->napi[enic_cq_wq(enic, i)]); 2019 + netif_tx_disable(netdev); 2020 2020 2021 2021 if (!enic_is_dynamic(enic) && !enic_is_sriov_vf(enic)) 2022 2022 enic_dev_del_station_addr(enic);
+16 -6
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
··· 6113 6113 static void hclge_fd_get_flow_tuples(const struct flow_keys *fkeys, 6114 6114 struct hclge_fd_rule_tuples *tuples) 6115 6115 { 6116 + #define flow_ip6_src fkeys->addrs.v6addrs.src.in6_u.u6_addr32 6117 + #define flow_ip6_dst fkeys->addrs.v6addrs.dst.in6_u.u6_addr32 6118 + 6116 6119 tuples->ether_proto = be16_to_cpu(fkeys->basic.n_proto); 6117 6120 tuples->ip_proto = fkeys->basic.ip_proto; 6118 6121 tuples->dst_port = be16_to_cpu(fkeys->ports.dst); ··· 6124 6121 tuples->src_ip[3] = be32_to_cpu(fkeys->addrs.v4addrs.src); 6125 6122 tuples->dst_ip[3] = be32_to_cpu(fkeys->addrs.v4addrs.dst); 6126 6123 } else { 6127 - memcpy(tuples->src_ip, 6128 - fkeys->addrs.v6addrs.src.in6_u.u6_addr32, 6129 - sizeof(tuples->src_ip)); 6130 - memcpy(tuples->dst_ip, 6131 - fkeys->addrs.v6addrs.dst.in6_u.u6_addr32, 6132 - sizeof(tuples->dst_ip)); 6124 + int i; 6125 + 6126 + for (i = 0; i < IPV6_SIZE; i++) { 6127 + tuples->src_ip[i] = be32_to_cpu(flow_ip6_src[i]); 6128 + tuples->dst_ip[i] = be32_to_cpu(flow_ip6_dst[i]); 6129 + } 6133 6130 } 6134 6131 } 6135 6132 ··· 9834 9831 ret = hclge_rss_init_hw(hdev); 9835 9832 if (ret) { 9836 9833 dev_err(&pdev->dev, "Rss init fail, ret =%d\n", ret); 9834 + return ret; 9835 + } 9836 + 9837 + ret = init_mgr_tbl(hdev); 9838 + if (ret) { 9839 + dev_err(&pdev->dev, 9840 + "failed to reinit manager table, ret = %d\n", ret); 9837 9841 return ret; 9838 9842 } 9839 9843
+1 -1
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
··· 566 566 */ 567 567 kinfo->num_tc = vport->vport_id ? 1 : 568 568 min_t(u16, vport->alloc_tqps, hdev->tm_info.num_tc); 569 - vport->qs_offset = (vport->vport_id ? hdev->tm_info.num_tc : 0) + 569 + vport->qs_offset = (vport->vport_id ? HNAE3_MAX_TC : 0) + 570 570 (vport->vport_id ? (vport->vport_id - 1) : 0); 571 571 572 572 max_rss_size = min_t(u16, hdev->rss_size_max,
+2 -2
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
··· 2362 2362 goto error_param; 2363 2363 } 2364 2364 2365 - if (i40e_vc_validate_vqs_bitmaps(vqs)) { 2365 + if (!i40e_vc_validate_vqs_bitmaps(vqs)) { 2366 2366 aq_ret = I40E_ERR_PARAM; 2367 2367 goto error_param; 2368 2368 } ··· 2424 2424 goto error_param; 2425 2425 } 2426 2426 2427 - if (i40e_vc_validate_vqs_bitmaps(vqs)) { 2427 + if (!i40e_vc_validate_vqs_bitmaps(vqs)) { 2428 2428 aq_ret = I40E_ERR_PARAM; 2429 2429 goto error_param; 2430 2430 }
+1
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
··· 1660 1660 __le32 count; 1661 1661 struct ice_aqc_get_pkg_info pkg_info[1]; 1662 1662 }; 1663 + 1663 1664 /** 1664 1665 * struct ice_aq_desc - Admin Queue (AQ) descriptor 1665 1666 * @flags: ICE_AQ_FLAG_* flags
+12 -23
drivers/net/ethernet/intel/ice/ice_base.c
··· 324 324 if (err) 325 325 return err; 326 326 327 - dev_info(&vsi->back->pdev->dev, "Registered XDP mem model MEM_TYPE_ZERO_COPY on Rx ring %d\n", 327 + dev_info(ice_pf_to_dev(vsi->back), "Registered XDP mem model MEM_TYPE_ZERO_COPY on Rx ring %d\n", 328 328 ring->q_index); 329 329 } else { 330 330 ring->zca.free = NULL; ··· 405 405 /* Absolute queue number out of 2K needs to be passed */ 406 406 err = ice_write_rxq_ctx(hw, &rlan_ctx, pf_q); 407 407 if (err) { 408 - dev_err(&vsi->back->pdev->dev, 409 - "Failed to set LAN Rx queue context for absolute Rx queue %d error: %d\n", 408 + dev_err(ice_pf_to_dev(vsi->back), "Failed to set LAN Rx queue context for absolute Rx queue %d error: %d\n", 410 409 pf_q, err); 411 410 return -EIO; 412 411 } ··· 427 428 ice_alloc_rx_bufs_slow_zc(ring, ICE_DESC_UNUSED(ring)) : 428 429 ice_alloc_rx_bufs(ring, ICE_DESC_UNUSED(ring)); 429 430 if (err) 430 - dev_info(&vsi->back->pdev->dev, 431 - "Failed allocate some buffers on %sRx ring %d (pf_q %d)\n", 431 + dev_info(ice_pf_to_dev(vsi->back), "Failed allocate some buffers on %sRx ring %d (pf_q %d)\n", 432 432 ring->xsk_umem ? "UMEM enabled " : "", 433 433 ring->q_index, pf_q); 434 434 ··· 488 490 /* wait for the change to finish */ 489 491 ret = ice_pf_rxq_wait(pf, pf_q, ena); 490 492 if (ret) 491 - dev_err(ice_pf_to_dev(pf), 492 - "VSI idx %d Rx ring %d %sable timeout\n", 493 + dev_err(ice_pf_to_dev(pf), "VSI idx %d Rx ring %d %sable timeout\n", 493 494 vsi->idx, pf_q, (ena ? "en" : "dis")); 494 495 495 496 return ret; ··· 503 506 */ 504 507 int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi) 505 508 { 506 - struct ice_pf *pf = vsi->back; 507 - int v_idx = 0, num_q_vectors; 508 - struct device *dev; 509 - int err; 509 + struct device *dev = ice_pf_to_dev(vsi->back); 510 + int v_idx, err; 510 511 511 - dev = ice_pf_to_dev(pf); 512 512 if (vsi->q_vectors[0]) { 513 513 dev_dbg(dev, "VSI %d has existing q_vectors\n", vsi->vsi_num); 514 514 return -EEXIST; 515 515 } 516 516 517 - num_q_vectors = vsi->num_q_vectors; 518 - 519 - for (v_idx = 0; v_idx < num_q_vectors; v_idx++) { 517 + for (v_idx = 0; v_idx < vsi->num_q_vectors; v_idx++) { 520 518 err = ice_vsi_alloc_q_vector(vsi, v_idx); 521 519 if (err) 522 520 goto err_out; ··· 640 648 status = ice_ena_vsi_txq(vsi->port_info, vsi->idx, tc, ring->q_handle, 641 649 1, qg_buf, buf_len, NULL); 642 650 if (status) { 643 - dev_err(ice_pf_to_dev(pf), 644 - "Failed to set LAN Tx queue context, error: %d\n", 651 + dev_err(ice_pf_to_dev(pf), "Failed to set LAN Tx queue context, error: %d\n", 645 652 status); 646 653 return -ENODEV; 647 654 } ··· 806 815 * queues at the hardware level anyway. 807 816 */ 808 817 if (status == ICE_ERR_RESET_ONGOING) { 809 - dev_dbg(&vsi->back->pdev->dev, 810 - "Reset in progress. LAN Tx queues already disabled\n"); 818 + dev_dbg(ice_pf_to_dev(vsi->back), "Reset in progress. LAN Tx queues already disabled\n"); 811 819 } else if (status == ICE_ERR_DOES_NOT_EXIST) { 812 - dev_dbg(&vsi->back->pdev->dev, 813 - "LAN Tx queues do not exist, nothing to disable\n"); 820 + dev_dbg(ice_pf_to_dev(vsi->back), "LAN Tx queues do not exist, nothing to disable\n"); 814 821 } else if (status) { 815 - dev_err(&vsi->back->pdev->dev, 816 - "Failed to disable LAN Tx queues, error: %d\n", status); 822 + dev_err(ice_pf_to_dev(vsi->back), "Failed to disable LAN Tx queues, error: %d\n", 823 + status); 817 824 return -ENODEV; 818 825 } 819 826
+14 -23
drivers/net/ethernet/intel/ice/ice_common.c
··· 25 25 } 26 26 27 27 /** 28 - * ice_dev_onetime_setup - Temporary HW/FW workarounds 29 - * @hw: pointer to the HW structure 30 - * 31 - * This function provides temporary workarounds for certain issues 32 - * that are expected to be fixed in the HW/FW. 33 - */ 34 - void ice_dev_onetime_setup(struct ice_hw *hw) 35 - { 36 - #define MBX_PF_VT_PFALLOC 0x00231E80 37 - /* set VFs per PF */ 38 - wr32(hw, MBX_PF_VT_PFALLOC, rd32(hw, PF_VT_PFALLOC_HIF)); 39 - } 40 - 41 - /** 42 28 * ice_clear_pf_cfg - Clear PF configuration 43 29 * @hw: pointer to the hardware structure 44 30 * ··· 588 602 } 589 603 590 604 /** 591 - * ice_get_itr_intrl_gran - determine int/intrl granularity 605 + * ice_get_itr_intrl_gran 592 606 * @hw: pointer to the HW struct 593 607 * 594 - * Determines the ITR/intrl granularities based on the maximum aggregate 608 + * Determines the ITR/INTRL granularities based on the maximum aggregate 595 609 * bandwidth according to the device's configuration during power-on. 596 610 */ 597 611 static void ice_get_itr_intrl_gran(struct ice_hw *hw) ··· 749 763 if (status) 750 764 goto err_unroll_sched; 751 765 752 - ice_dev_onetime_setup(hw); 753 - 754 766 /* Get MAC information */ 755 767 /* A single port can report up to two (LAN and WoL) addresses */ 756 768 mac_buf = devm_kcalloc(ice_hw_to_dev(hw), 2, ··· 818 834 */ 819 835 enum ice_status ice_check_reset(struct ice_hw *hw) 820 836 { 821 - u32 cnt, reg = 0, grst_delay; 837 + u32 cnt, reg = 0, grst_delay, uld_mask; 822 838 823 839 /* Poll for Device Active state in case a recent CORER, GLOBR, 824 840 * or EMPR has occurred. The grst delay value is in 100ms units. ··· 840 856 return ICE_ERR_RESET_FAILED; 841 857 } 842 858 843 - #define ICE_RESET_DONE_MASK (GLNVM_ULD_CORER_DONE_M | \ 844 - GLNVM_ULD_GLOBR_DONE_M) 859 + #define ICE_RESET_DONE_MASK (GLNVM_ULD_PCIER_DONE_M |\ 860 + GLNVM_ULD_PCIER_DONE_1_M |\ 861 + GLNVM_ULD_CORER_DONE_M |\ 862 + GLNVM_ULD_GLOBR_DONE_M |\ 863 + GLNVM_ULD_POR_DONE_M |\ 864 + GLNVM_ULD_POR_DONE_1_M |\ 865 + GLNVM_ULD_PCIER_DONE_2_M) 866 + 867 + uld_mask = ICE_RESET_DONE_MASK; 845 868 846 869 /* Device is Active; check Global Reset processes are done */ 847 870 for (cnt = 0; cnt < ICE_PF_RESET_WAIT_COUNT; cnt++) { 848 - reg = rd32(hw, GLNVM_ULD) & ICE_RESET_DONE_MASK; 849 - if (reg == ICE_RESET_DONE_MASK) { 871 + reg = rd32(hw, GLNVM_ULD) & uld_mask; 872 + if (reg == uld_mask) { 850 873 ice_debug(hw, ICE_DBG_INIT, 851 874 "Global reset processes done. %d\n", cnt); 852 875 break;
-2
drivers/net/ethernet/intel/ice/ice_common.h
··· 54 54 55 55 void ice_set_safe_mode_caps(struct ice_hw *hw); 56 56 57 - void ice_dev_onetime_setup(struct ice_hw *hw); 58 - 59 57 enum ice_status 60 58 ice_write_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx, 61 59 u32 rxq_index);
+4 -4
drivers/net/ethernet/intel/ice/ice_dcb.c
··· 1323 1323 } 1324 1324 1325 1325 /** 1326 - * ice_aq_query_port_ets - query port ets configuration 1326 + * ice_aq_query_port_ets - query port ETS configuration 1327 1327 * @pi: port information structure 1328 1328 * @buf: pointer to buffer 1329 1329 * @buf_size: buffer size in bytes 1330 1330 * @cd: pointer to command details structure or NULL 1331 1331 * 1332 - * query current port ets configuration 1332 + * query current port ETS configuration 1333 1333 */ 1334 1334 static enum ice_status 1335 1335 ice_aq_query_port_ets(struct ice_port_info *pi, ··· 1416 1416 } 1417 1417 1418 1418 /** 1419 - * ice_query_port_ets - query port ets configuration 1419 + * ice_query_port_ets - query port ETS configuration 1420 1420 * @pi: port information structure 1421 1421 * @buf: pointer to buffer 1422 1422 * @buf_size: buffer size in bytes 1423 1423 * @cd: pointer to command details structure or NULL 1424 1424 * 1425 - * query current port ets configuration and update the 1425 + * query current port ETS configuration and update the 1426 1426 * SW DB with the TC changes 1427 1427 */ 1428 1428 enum ice_status
+40 -59
drivers/net/ethernet/intel/ice/ice_dcb_lib.c
··· 315 315 */ 316 316 void ice_dcb_rebuild(struct ice_pf *pf) 317 317 { 318 - struct ice_dcbx_cfg *local_dcbx_cfg, *desired_dcbx_cfg, *prev_cfg; 319 318 struct ice_aqc_port_ets_elem buf = { 0 }; 320 319 struct device *dev = ice_pf_to_dev(pf); 320 + struct ice_dcbx_cfg *err_cfg; 321 321 enum ice_status ret; 322 322 323 323 ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL); ··· 330 330 if (!test_bit(ICE_FLAG_DCB_ENA, pf->flags)) 331 331 return; 332 332 333 - local_dcbx_cfg = &pf->hw.port_info->local_dcbx_cfg; 334 - desired_dcbx_cfg = &pf->hw.port_info->desired_dcbx_cfg; 333 + mutex_lock(&pf->tc_mutex); 335 334 336 - /* Save current willing state and force FW to unwilling */ 337 - local_dcbx_cfg->etscfg.willing = 0x0; 338 - local_dcbx_cfg->pfc.willing = 0x0; 339 - local_dcbx_cfg->app_mode = ICE_DCBX_APPS_NON_WILLING; 335 + if (!pf->hw.port_info->is_sw_lldp) 336 + ice_cfg_etsrec_defaults(pf->hw.port_info); 340 337 341 - ice_cfg_etsrec_defaults(pf->hw.port_info); 342 338 ret = ice_set_dcb_cfg(pf->hw.port_info); 343 339 if (ret) { 344 - dev_err(dev, "Failed to set DCB to unwilling\n"); 340 + dev_err(dev, "Failed to set DCB config in rebuild\n"); 345 341 goto dcb_error; 346 342 } 347 343 348 - /* Retrieve DCB config and ensure same as current in SW */ 349 - prev_cfg = kmemdup(local_dcbx_cfg, sizeof(*prev_cfg), GFP_KERNEL); 350 - if (!prev_cfg) 351 - goto dcb_error; 352 - 353 - ice_init_dcb(&pf->hw, true); 354 - if (pf->hw.port_info->dcbx_status == ICE_DCBX_STATUS_DIS) 355 - pf->hw.port_info->is_sw_lldp = true; 356 - else 357 - pf->hw.port_info->is_sw_lldp = false; 358 - 359 - if (ice_dcb_need_recfg(pf, prev_cfg, local_dcbx_cfg)) { 360 - /* difference in cfg detected - disable DCB till next MIB */ 361 - dev_err(dev, "Set local MIB not accurate\n"); 362 - kfree(prev_cfg); 363 - goto dcb_error; 344 + if (!pf->hw.port_info->is_sw_lldp) { 345 + ret = ice_cfg_lldp_mib_change(&pf->hw, true); 346 + if (ret && !pf->hw.port_info->is_sw_lldp) { 347 + dev_err(dev, "Failed to register for MIB changes\n"); 348 + goto dcb_error; 349 + } 364 350 } 365 351 366 - /* fetched config congruent to previous configuration */ 367 - kfree(prev_cfg); 368 - 369 - /* Set the local desired config */ 370 - if (local_dcbx_cfg->dcbx_mode == ICE_DCBX_MODE_CEE) 371 - memcpy(local_dcbx_cfg, desired_dcbx_cfg, 372 - sizeof(*local_dcbx_cfg)); 373 - 374 - ice_cfg_etsrec_defaults(pf->hw.port_info); 375 - ret = ice_set_dcb_cfg(pf->hw.port_info); 376 - if (ret) { 377 - dev_err(dev, "Failed to set desired config\n"); 378 - goto dcb_error; 379 - } 380 352 dev_info(dev, "DCB restored after reset\n"); 381 353 ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL); 382 354 if (ret) { ··· 356 384 goto dcb_error; 357 385 } 358 386 387 + mutex_unlock(&pf->tc_mutex); 388 + 359 389 return; 360 390 361 391 dcb_error: 362 392 dev_err(dev, "Disabling DCB until new settings occur\n"); 363 - prev_cfg = kzalloc(sizeof(*prev_cfg), GFP_KERNEL); 364 - if (!prev_cfg) 393 + err_cfg = kzalloc(sizeof(*err_cfg), GFP_KERNEL); 394 + if (!err_cfg) { 395 + mutex_unlock(&pf->tc_mutex); 365 396 return; 397 + } 366 398 367 - prev_cfg->etscfg.willing = true; 368 - prev_cfg->etscfg.tcbwtable[0] = ICE_TC_MAX_BW; 369 - prev_cfg->etscfg.tsatable[0] = ICE_IEEE_TSA_ETS; 370 - memcpy(&prev_cfg->etsrec, &prev_cfg->etscfg, sizeof(prev_cfg->etsrec)); 399 + err_cfg->etscfg.willing = true; 400 + err_cfg->etscfg.tcbwtable[0] = ICE_TC_MAX_BW; 401 + err_cfg->etscfg.tsatable[0] = ICE_IEEE_TSA_ETS; 402 + memcpy(&err_cfg->etsrec, &err_cfg->etscfg, sizeof(err_cfg->etsrec)); 371 403 /* Coverity warns the return code of ice_pf_dcb_cfg() is not checked 372 404 * here as is done for other calls to that function. That check is 373 405 * not necessary since this is in this function's error cleanup path. 374 406 * Suppress the Coverity warning with the following comment... 375 407 */ 376 408 /* coverity[check_return] */ 377 - ice_pf_dcb_cfg(pf, prev_cfg, false); 378 - kfree(prev_cfg); 409 + ice_pf_dcb_cfg(pf, err_cfg, false); 410 + kfree(err_cfg); 411 + 412 + mutex_unlock(&pf->tc_mutex); 379 413 } 380 414 381 415 /** ··· 412 434 } 413 435 414 436 /** 415 - * ice_dcb_sw_default_config - Apply a default DCB config 437 + * ice_dcb_sw_dflt_cfg - Apply a default DCB config 416 438 * @pf: PF to apply config to 417 - * @ets_willing: configure ets willing 439 + * @ets_willing: configure ETS willing 418 440 * @locked: was this function called with RTNL held 419 441 */ 420 442 static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf, bool ets_willing, bool locked) ··· 577 599 goto dcb_init_err; 578 600 } 579 601 580 - dev_info(dev, 581 - "DCB is enabled in the hardware, max number of TCs supported on this port are %d\n", 602 + dev_info(dev, "DCB is enabled in the hardware, max number of TCs supported on this port are %d\n", 582 603 pf->hw.func_caps.common_cap.maxtc); 583 604 if (err) { 584 605 struct ice_vsi *pf_vsi; ··· 587 610 clear_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags); 588 611 err = ice_dcb_sw_dflt_cfg(pf, true, locked); 589 612 if (err) { 590 - dev_err(dev, 591 - "Failed to set local DCB config %d\n", err); 613 + dev_err(dev, "Failed to set local DCB config %d\n", 614 + err); 592 615 err = -EIO; 593 616 goto dcb_init_err; 594 617 } ··· 754 777 } 755 778 } 756 779 780 + mutex_lock(&pf->tc_mutex); 781 + 757 782 /* store the old configuration */ 758 783 tmp_dcbx_cfg = pf->hw.port_info->local_dcbx_cfg; 759 784 ··· 766 787 ret = ice_get_dcb_cfg(pf->hw.port_info); 767 788 if (ret) { 768 789 dev_err(dev, "Failed to get DCB config\n"); 769 - return; 790 + goto out; 770 791 } 771 792 772 793 /* No change detected in DCBX configs */ 773 794 if (!memcmp(&tmp_dcbx_cfg, &pi->local_dcbx_cfg, sizeof(tmp_dcbx_cfg))) { 774 795 dev_dbg(dev, "No change detected in DCBX configuration.\n"); 775 - return; 796 + goto out; 776 797 } 777 798 778 799 need_reconfig = ice_dcb_need_recfg(pf, &tmp_dcbx_cfg, 779 800 &pi->local_dcbx_cfg); 780 801 ice_dcbnl_flush_apps(pf, &tmp_dcbx_cfg, &pi->local_dcbx_cfg); 781 802 if (!need_reconfig) 782 - return; 803 + goto out; 783 804 784 805 /* Enable DCB tagging only when more than one TC */ 785 806 if (ice_dcb_get_num_tc(&pi->local_dcbx_cfg) > 1) { ··· 793 814 pf_vsi = ice_get_main_vsi(pf); 794 815 if (!pf_vsi) { 795 816 dev_dbg(dev, "PF VSI doesn't exist\n"); 796 - return; 817 + goto out; 797 818 } 798 819 799 820 rtnl_lock(); ··· 802 823 ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL); 803 824 if (ret) { 804 825 dev_err(dev, "Query Port ETS failed\n"); 805 - rtnl_unlock(); 806 - return; 826 + goto unlock_rtnl; 807 827 } 808 828 809 829 /* changes in configuration update VSI */ 810 830 ice_pf_dcb_recfg(pf); 811 831 812 832 ice_ena_vsi(pf_vsi, true); 833 + unlock_rtnl: 813 834 rtnl_unlock(); 835 + out: 836 + mutex_unlock(&pf->tc_mutex); 814 837 }
+9 -11
drivers/net/ethernet/intel/ice/ice_dcb_nl.c
··· 297 297 return; 298 298 299 299 *setting = (pi->local_dcbx_cfg.pfc.pfcena >> prio) & 0x1; 300 - dev_dbg(ice_pf_to_dev(pf), 301 - "Get PFC Config up=%d, setting=%d, pfcenable=0x%x\n", 300 + dev_dbg(ice_pf_to_dev(pf), "Get PFC Config up=%d, setting=%d, pfcenable=0x%x\n", 302 301 prio, *setting, pi->local_dcbx_cfg.pfc.pfcena); 303 302 } 304 303 ··· 417 418 return; 418 419 419 420 *pgid = pi->local_dcbx_cfg.etscfg.prio_table[prio]; 420 - dev_dbg(ice_pf_to_dev(pf), 421 - "Get PG config prio=%d tc=%d\n", prio, *pgid); 421 + dev_dbg(ice_pf_to_dev(pf), "Get PG config prio=%d tc=%d\n", prio, 422 + *pgid); 422 423 } 423 424 424 425 /** ··· 712 713 return -EINVAL; 713 714 714 715 mutex_lock(&pf->tc_mutex); 715 - ret = dcb_ieee_delapp(netdev, app); 716 - if (ret) 717 - goto delapp_out; 718 - 719 716 old_cfg = &pf->hw.port_info->local_dcbx_cfg; 720 717 721 - if (old_cfg->numapps == 1) 718 + if (old_cfg->numapps <= 1) 719 + goto delapp_out; 720 + 721 + ret = dcb_ieee_delapp(netdev, app); 722 + if (ret) 722 723 goto delapp_out; 723 724 724 725 new_cfg = &pf->hw.port_info->desired_dcbx_cfg; ··· 881 882 sapp.protocol = app->prot_id; 882 883 sapp.priority = app->priority; 883 884 err = ice_dcbnl_delapp(vsi->netdev, &sapp); 884 - dev_dbg(&vsi->back->pdev->dev, 885 - "Deleting app for VSI idx=%d err=%d sel=%d proto=0x%x, prio=%d\n", 885 + dev_dbg(ice_pf_to_dev(vsi->back), "Deleting app for VSI idx=%d err=%d sel=%d proto=0x%x, prio=%d\n", 886 886 vsi->idx, err, app->selector, app->prot_id, app->priority); 887 887 } 888 888
+37 -318
drivers/net/ethernet/intel/ice/ice_ethtool.c
··· 166 166 ice_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) 167 167 { 168 168 struct ice_netdev_priv *np = netdev_priv(netdev); 169 + u8 oem_ver, oem_patch, nvm_ver_hi, nvm_ver_lo; 169 170 struct ice_vsi *vsi = np->vsi; 170 171 struct ice_pf *pf = vsi->back; 172 + struct ice_hw *hw = &pf->hw; 173 + u16 oem_build; 171 174 172 175 strlcpy(drvinfo->driver, KBUILD_MODNAME, sizeof(drvinfo->driver)); 173 176 strlcpy(drvinfo->version, ice_drv_ver, sizeof(drvinfo->version)); 174 - strlcpy(drvinfo->fw_version, ice_nvm_version_str(&pf->hw), 175 - sizeof(drvinfo->fw_version)); 177 + 178 + /* Display NVM version (from which the firmware version can be 179 + * determined) which contains more pertinent information. 180 + */ 181 + ice_get_nvm_version(hw, &oem_ver, &oem_build, &oem_patch, 182 + &nvm_ver_hi, &nvm_ver_lo); 183 + snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), 184 + "%x.%02x 0x%x %d.%d.%d", nvm_ver_hi, nvm_ver_lo, 185 + hw->nvm.eetrack, oem_ver, oem_build, oem_patch); 186 + 176 187 strlcpy(drvinfo->bus_info, pci_name(pf->pdev), 177 188 sizeof(drvinfo->bus_info)); 178 189 drvinfo->n_priv_flags = ICE_PRIV_FLAG_ARRAY_SIZE; ··· 374 363 val = rd32(hw, reg); 375 364 if (val == pattern) 376 365 continue; 377 - dev_err(dev, 378 - "%s: reg pattern test failed - reg 0x%08x pat 0x%08x val 0x%08x\n" 366 + dev_err(dev, "%s: reg pattern test failed - reg 0x%08x pat 0x%08x val 0x%08x\n" 379 367 , __func__, reg, pattern, val); 380 368 return 1; 381 369 } ··· 382 372 wr32(hw, reg, orig_val); 383 373 val = rd32(hw, reg); 384 374 if (val != orig_val) { 385 - dev_err(dev, 386 - "%s: reg restore test failed - reg 0x%08x orig 0x%08x val 0x%08x\n" 375 + dev_err(dev, "%s: reg restore test failed - reg 0x%08x orig 0x%08x val 0x%08x\n" 387 376 , __func__, reg, orig_val, val); 388 377 return 1; 389 378 } ··· 800 791 set_bit(__ICE_TESTING, pf->state); 801 792 802 793 if (ice_active_vfs(pf)) { 803 - dev_warn(dev, 804 - "Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\n"); 794 + dev_warn(dev, "Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\n"); 805 795 data[ICE_ETH_TEST_REG] = 1; 806 796 data[ICE_ETH_TEST_EEPROM] = 1; 807 797 data[ICE_ETH_TEST_INTR] = 1; ··· 1055 1047 fec = ICE_FEC_NONE; 1056 1048 break; 1057 1049 default: 1058 - dev_warn(&vsi->back->pdev->dev, "Unsupported FEC mode: %d\n", 1050 + dev_warn(ice_pf_to_dev(vsi->back), "Unsupported FEC mode: %d\n", 1059 1051 fecparam->fec); 1060 1052 return -EINVAL; 1061 1053 } ··· 1208 1200 * events to respond to. 1209 1201 */ 1210 1202 if (status) 1211 - dev_info(dev, 1212 - "Failed to unreg for LLDP events\n"); 1203 + dev_info(dev, "Failed to unreg for LLDP events\n"); 1213 1204 1214 1205 /* The AQ call to stop the FW LLDP agent will generate 1215 1206 * an error if the agent is already stopped. ··· 1263 1256 /* Register for MIB change events */ 1264 1257 status = ice_cfg_lldp_mib_change(&pf->hw, true); 1265 1258 if (status) 1266 - dev_dbg(dev, 1267 - "Fail to enable MIB change events\n"); 1259 + dev_dbg(dev, "Fail to enable MIB change events\n"); 1268 1260 } 1269 1261 } 1270 1262 if (test_bit(ICE_FLAG_LEGACY_RX, change_flags)) { ··· 1716 1710 { 1717 1711 struct ice_netdev_priv *np = netdev_priv(netdev); 1718 1712 struct ice_port_info *pi = np->vsi->port_info; 1719 - struct ethtool_link_ksettings cap_ksettings; 1720 1713 struct ice_link_status *link_info; 1721 1714 struct ice_vsi *vsi = np->vsi; 1722 - bool unrecog_phy_high = false; 1723 - bool unrecog_phy_low = false; 1724 1715 1725 1716 link_info = &vsi->port_info->phy.link_info; 1726 1717 1727 - /* Initialize supported and advertised settings based on PHY settings */ 1728 - switch (link_info->phy_type_low) { 1729 - case ICE_PHY_TYPE_LOW_100BASE_TX: 1730 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1731 - ethtool_link_ksettings_add_link_mode(ks, supported, 1732 - 100baseT_Full); 1733 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1734 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1735 - 100baseT_Full); 1736 - break; 1737 - case ICE_PHY_TYPE_LOW_100M_SGMII: 1738 - ethtool_link_ksettings_add_link_mode(ks, supported, 1739 - 100baseT_Full); 1740 - break; 1741 - case ICE_PHY_TYPE_LOW_1000BASE_T: 1742 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1743 - ethtool_link_ksettings_add_link_mode(ks, supported, 1744 - 1000baseT_Full); 1745 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1746 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1747 - 1000baseT_Full); 1748 - break; 1749 - case ICE_PHY_TYPE_LOW_1G_SGMII: 1750 - ethtool_link_ksettings_add_link_mode(ks, supported, 1751 - 1000baseT_Full); 1752 - break; 1753 - case ICE_PHY_TYPE_LOW_1000BASE_SX: 1754 - case ICE_PHY_TYPE_LOW_1000BASE_LX: 1755 - ethtool_link_ksettings_add_link_mode(ks, supported, 1756 - 1000baseX_Full); 1757 - break; 1758 - case ICE_PHY_TYPE_LOW_1000BASE_KX: 1759 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1760 - ethtool_link_ksettings_add_link_mode(ks, supported, 1761 - 1000baseKX_Full); 1762 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1763 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1764 - 1000baseKX_Full); 1765 - break; 1766 - case ICE_PHY_TYPE_LOW_2500BASE_T: 1767 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1768 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1769 - ethtool_link_ksettings_add_link_mode(ks, supported, 1770 - 2500baseT_Full); 1771 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1772 - 2500baseT_Full); 1773 - break; 1774 - case ICE_PHY_TYPE_LOW_2500BASE_X: 1775 - ethtool_link_ksettings_add_link_mode(ks, supported, 1776 - 2500baseX_Full); 1777 - break; 1778 - case ICE_PHY_TYPE_LOW_2500BASE_KX: 1779 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1780 - ethtool_link_ksettings_add_link_mode(ks, supported, 1781 - 2500baseX_Full); 1782 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1783 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1784 - 2500baseX_Full); 1785 - break; 1786 - case ICE_PHY_TYPE_LOW_5GBASE_T: 1787 - case ICE_PHY_TYPE_LOW_5GBASE_KR: 1788 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1789 - ethtool_link_ksettings_add_link_mode(ks, supported, 1790 - 5000baseT_Full); 1791 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1792 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1793 - 5000baseT_Full); 1794 - break; 1795 - case ICE_PHY_TYPE_LOW_10GBASE_T: 1796 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1797 - ethtool_link_ksettings_add_link_mode(ks, supported, 1798 - 10000baseT_Full); 1799 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1800 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1801 - 10000baseT_Full); 1802 - break; 1803 - case ICE_PHY_TYPE_LOW_10G_SFI_DA: 1804 - case ICE_PHY_TYPE_LOW_10G_SFI_AOC_ACC: 1805 - case ICE_PHY_TYPE_LOW_10G_SFI_C2C: 1806 - ethtool_link_ksettings_add_link_mode(ks, supported, 1807 - 10000baseT_Full); 1808 - break; 1809 - case ICE_PHY_TYPE_LOW_10GBASE_SR: 1810 - ethtool_link_ksettings_add_link_mode(ks, supported, 1811 - 10000baseSR_Full); 1812 - break; 1813 - case ICE_PHY_TYPE_LOW_10GBASE_LR: 1814 - ethtool_link_ksettings_add_link_mode(ks, supported, 1815 - 10000baseLR_Full); 1816 - break; 1817 - case ICE_PHY_TYPE_LOW_10GBASE_KR_CR1: 1818 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1819 - ethtool_link_ksettings_add_link_mode(ks, supported, 1820 - 10000baseKR_Full); 1821 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1822 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1823 - 10000baseKR_Full); 1824 - break; 1825 - case ICE_PHY_TYPE_LOW_25GBASE_T: 1826 - case ICE_PHY_TYPE_LOW_25GBASE_CR: 1827 - case ICE_PHY_TYPE_LOW_25GBASE_CR_S: 1828 - case ICE_PHY_TYPE_LOW_25GBASE_CR1: 1829 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1830 - ethtool_link_ksettings_add_link_mode(ks, supported, 1831 - 25000baseCR_Full); 1832 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1833 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1834 - 25000baseCR_Full); 1835 - break; 1836 - case ICE_PHY_TYPE_LOW_25G_AUI_AOC_ACC: 1837 - case ICE_PHY_TYPE_LOW_25G_AUI_C2C: 1838 - ethtool_link_ksettings_add_link_mode(ks, supported, 1839 - 25000baseCR_Full); 1840 - break; 1841 - case ICE_PHY_TYPE_LOW_25GBASE_SR: 1842 - case ICE_PHY_TYPE_LOW_25GBASE_LR: 1843 - ethtool_link_ksettings_add_link_mode(ks, supported, 1844 - 25000baseSR_Full); 1845 - break; 1846 - case ICE_PHY_TYPE_LOW_25GBASE_KR: 1847 - case ICE_PHY_TYPE_LOW_25GBASE_KR1: 1848 - case ICE_PHY_TYPE_LOW_25GBASE_KR_S: 1849 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1850 - ethtool_link_ksettings_add_link_mode(ks, supported, 1851 - 25000baseKR_Full); 1852 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1853 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1854 - 25000baseKR_Full); 1855 - break; 1856 - case ICE_PHY_TYPE_LOW_40GBASE_CR4: 1857 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1858 - ethtool_link_ksettings_add_link_mode(ks, supported, 1859 - 40000baseCR4_Full); 1860 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1861 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1862 - 40000baseCR4_Full); 1863 - break; 1864 - case ICE_PHY_TYPE_LOW_40G_XLAUI_AOC_ACC: 1865 - case ICE_PHY_TYPE_LOW_40G_XLAUI: 1866 - ethtool_link_ksettings_add_link_mode(ks, supported, 1867 - 40000baseCR4_Full); 1868 - break; 1869 - case ICE_PHY_TYPE_LOW_40GBASE_SR4: 1870 - ethtool_link_ksettings_add_link_mode(ks, supported, 1871 - 40000baseSR4_Full); 1872 - break; 1873 - case ICE_PHY_TYPE_LOW_40GBASE_LR4: 1874 - ethtool_link_ksettings_add_link_mode(ks, supported, 1875 - 40000baseLR4_Full); 1876 - break; 1877 - case ICE_PHY_TYPE_LOW_40GBASE_KR4: 1878 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1879 - ethtool_link_ksettings_add_link_mode(ks, supported, 1880 - 40000baseKR4_Full); 1881 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1882 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1883 - 40000baseKR4_Full); 1884 - break; 1885 - case ICE_PHY_TYPE_LOW_50GBASE_CR2: 1886 - case ICE_PHY_TYPE_LOW_50GBASE_CP: 1887 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1888 - ethtool_link_ksettings_add_link_mode(ks, supported, 1889 - 50000baseCR2_Full); 1890 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1891 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1892 - 50000baseCR2_Full); 1893 - break; 1894 - case ICE_PHY_TYPE_LOW_50G_LAUI2_AOC_ACC: 1895 - case ICE_PHY_TYPE_LOW_50G_LAUI2: 1896 - case ICE_PHY_TYPE_LOW_50G_AUI2_AOC_ACC: 1897 - case ICE_PHY_TYPE_LOW_50G_AUI2: 1898 - case ICE_PHY_TYPE_LOW_50GBASE_SR: 1899 - case ICE_PHY_TYPE_LOW_50G_AUI1_AOC_ACC: 1900 - case ICE_PHY_TYPE_LOW_50G_AUI1: 1901 - ethtool_link_ksettings_add_link_mode(ks, supported, 1902 - 50000baseCR2_Full); 1903 - break; 1904 - case ICE_PHY_TYPE_LOW_50GBASE_KR2: 1905 - case ICE_PHY_TYPE_LOW_50GBASE_KR_PAM4: 1906 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1907 - ethtool_link_ksettings_add_link_mode(ks, supported, 1908 - 50000baseKR2_Full); 1909 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1910 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1911 - 50000baseKR2_Full); 1912 - break; 1913 - case ICE_PHY_TYPE_LOW_50GBASE_SR2: 1914 - case ICE_PHY_TYPE_LOW_50GBASE_LR2: 1915 - case ICE_PHY_TYPE_LOW_50GBASE_FR: 1916 - case ICE_PHY_TYPE_LOW_50GBASE_LR: 1917 - ethtool_link_ksettings_add_link_mode(ks, supported, 1918 - 50000baseSR2_Full); 1919 - break; 1920 - case ICE_PHY_TYPE_LOW_100GBASE_CR4: 1921 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1922 - ethtool_link_ksettings_add_link_mode(ks, supported, 1923 - 100000baseCR4_Full); 1924 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1925 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1926 - 100000baseCR4_Full); 1927 - break; 1928 - case ICE_PHY_TYPE_LOW_100G_CAUI4_AOC_ACC: 1929 - case ICE_PHY_TYPE_LOW_100G_CAUI4: 1930 - case ICE_PHY_TYPE_LOW_100G_AUI4_AOC_ACC: 1931 - case ICE_PHY_TYPE_LOW_100G_AUI4: 1932 - case ICE_PHY_TYPE_LOW_100GBASE_CR_PAM4: 1933 - ethtool_link_ksettings_add_link_mode(ks, supported, 1934 - 100000baseCR4_Full); 1935 - break; 1936 - case ICE_PHY_TYPE_LOW_100GBASE_CP2: 1937 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1938 - ethtool_link_ksettings_add_link_mode(ks, supported, 1939 - 100000baseCR4_Full); 1940 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1941 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1942 - 100000baseCR4_Full); 1943 - break; 1944 - case ICE_PHY_TYPE_LOW_100GBASE_SR4: 1945 - case ICE_PHY_TYPE_LOW_100GBASE_SR2: 1946 - ethtool_link_ksettings_add_link_mode(ks, supported, 1947 - 100000baseSR4_Full); 1948 - break; 1949 - case ICE_PHY_TYPE_LOW_100GBASE_LR4: 1950 - case ICE_PHY_TYPE_LOW_100GBASE_DR: 1951 - ethtool_link_ksettings_add_link_mode(ks, supported, 1952 - 100000baseLR4_ER4_Full); 1953 - break; 1954 - case ICE_PHY_TYPE_LOW_100GBASE_KR4: 1955 - case ICE_PHY_TYPE_LOW_100GBASE_KR_PAM4: 1956 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1957 - ethtool_link_ksettings_add_link_mode(ks, supported, 1958 - 100000baseKR4_Full); 1959 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1960 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1961 - 100000baseKR4_Full); 1962 - break; 1963 - default: 1964 - unrecog_phy_low = true; 1965 - } 1966 - 1967 - switch (link_info->phy_type_high) { 1968 - case ICE_PHY_TYPE_HIGH_100GBASE_KR2_PAM4: 1969 - ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg); 1970 - ethtool_link_ksettings_add_link_mode(ks, supported, 1971 - 100000baseKR4_Full); 1972 - ethtool_link_ksettings_add_link_mode(ks, advertising, Autoneg); 1973 - ethtool_link_ksettings_add_link_mode(ks, advertising, 1974 - 100000baseKR4_Full); 1975 - break; 1976 - case ICE_PHY_TYPE_HIGH_100G_CAUI2_AOC_ACC: 1977 - case ICE_PHY_TYPE_HIGH_100G_CAUI2: 1978 - case ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC: 1979 - case ICE_PHY_TYPE_HIGH_100G_AUI2: 1980 - ethtool_link_ksettings_add_link_mode(ks, supported, 1981 - 100000baseCR4_Full); 1982 - break; 1983 - default: 1984 - unrecog_phy_high = true; 1985 - } 1986 - 1987 - if (unrecog_phy_low && unrecog_phy_high) { 1988 - /* if we got here and link is up something bad is afoot */ 1989 - netdev_info(netdev, 1990 - "WARNING: Unrecognized PHY_Low (0x%llx).\n", 1991 - (u64)link_info->phy_type_low); 1992 - netdev_info(netdev, 1993 - "WARNING: Unrecognized PHY_High (0x%llx).\n", 1994 - (u64)link_info->phy_type_high); 1995 - } 1996 - 1997 - /* Now that we've worked out everything that could be supported by the 1998 - * current PHY type, get what is supported by the NVM and intersect 1999 - * them to get what is truly supported 2000 - */ 2001 - memset(&cap_ksettings, 0, sizeof(cap_ksettings)); 2002 - ice_phy_type_to_ethtool(netdev, &cap_ksettings); 2003 - ethtool_intersect_link_masks(ks, &cap_ksettings); 1718 + /* Get supported and advertised settings from PHY ability with media */ 1719 + ice_phy_type_to_ethtool(netdev, ks); 2004 1720 2005 1721 switch (link_info->link_speed) { 2006 1722 case ICE_AQ_LINK_SPEED_100GB: ··· 1756 2028 ks->base.speed = SPEED_100; 1757 2029 break; 1758 2030 default: 1759 - netdev_info(netdev, 1760 - "WARNING: Unrecognized link_speed (0x%x).\n", 2031 + netdev_info(netdev, "WARNING: Unrecognized link_speed (0x%x).\n", 1761 2032 link_info->link_speed); 1762 2033 break; 1763 2034 } ··· 2572 2845 2573 2846 new_tx_cnt = ALIGN(ring->tx_pending, ICE_REQ_DESC_MULTIPLE); 2574 2847 if (new_tx_cnt != ring->tx_pending) 2575 - netdev_info(netdev, 2576 - "Requested Tx descriptor count rounded up to %d\n", 2848 + netdev_info(netdev, "Requested Tx descriptor count rounded up to %d\n", 2577 2849 new_tx_cnt); 2578 2850 new_rx_cnt = ALIGN(ring->rx_pending, ICE_REQ_DESC_MULTIPLE); 2579 2851 if (new_rx_cnt != ring->rx_pending) 2580 - netdev_info(netdev, 2581 - "Requested Rx descriptor count rounded up to %d\n", 2852 + netdev_info(netdev, "Requested Rx descriptor count rounded up to %d\n", 2582 2853 new_rx_cnt); 2583 2854 2584 2855 /* if nothing to do return success */ ··· 3443 3718 if (ec->rx_coalesce_usecs_high > ICE_MAX_INTRL || 3444 3719 (ec->rx_coalesce_usecs_high && 3445 3720 ec->rx_coalesce_usecs_high < pf->hw.intrl_gran)) { 3446 - netdev_info(vsi->netdev, 3447 - "Invalid value, %s-usecs-high valid values are 0 (disabled), %d-%d\n", 3721 + netdev_info(vsi->netdev, "Invalid value, %s-usecs-high valid values are 0 (disabled), %d-%d\n", 3448 3722 c_type_str, pf->hw.intrl_gran, 3449 3723 ICE_MAX_INTRL); 3450 3724 return -EINVAL; ··· 3461 3737 break; 3462 3738 case ICE_TX_CONTAINER: 3463 3739 if (ec->tx_coalesce_usecs_high) { 3464 - netdev_info(vsi->netdev, 3465 - "setting %s-usecs-high is not supported\n", 3740 + netdev_info(vsi->netdev, "setting %s-usecs-high is not supported\n", 3466 3741 c_type_str); 3467 3742 return -EINVAL; 3468 3743 } ··· 3478 3755 3479 3756 itr_setting = rc->itr_setting & ~ICE_ITR_DYNAMIC; 3480 3757 if (coalesce_usecs != itr_setting && use_adaptive_coalesce) { 3481 - netdev_info(vsi->netdev, 3482 - "%s interrupt throttling cannot be changed if adaptive-%s is enabled\n", 3758 + netdev_info(vsi->netdev, "%s interrupt throttling cannot be changed if adaptive-%s is enabled\n", 3483 3759 c_type_str, c_type_str); 3484 3760 return -EINVAL; 3485 3761 } 3486 3762 3487 3763 if (coalesce_usecs > ICE_ITR_MAX) { 3488 - netdev_info(vsi->netdev, 3489 - "Invalid value, %s-usecs range is 0-%d\n", 3764 + netdev_info(vsi->netdev, "Invalid value, %s-usecs range is 0-%d\n", 3490 3765 c_type_str, ICE_ITR_MAX); 3491 3766 return -EINVAL; 3492 3767 } 3493 3768 3494 3769 /* hardware only supports an ITR granularity of 2us */ 3495 3770 if (coalesce_usecs % 2 != 0) { 3496 - netdev_info(vsi->netdev, 3497 - "Invalid value, %s-usecs must be even\n", 3771 + netdev_info(vsi->netdev, "Invalid value, %s-usecs must be even\n", 3498 3772 c_type_str); 3499 3773 return -EINVAL; 3500 3774 } ··· 3732 4012 } 3733 4013 break; 3734 4014 default: 3735 - netdev_warn(netdev, 3736 - "SFF Module Type not recognized.\n"); 4015 + netdev_warn(netdev, "SFF Module Type not recognized.\n"); 3737 4016 return -EINVAL; 3738 4017 } 3739 4018 return 0; ··· 3800 4081 static const struct ethtool_ops ice_ethtool_ops = { 3801 4082 .get_link_ksettings = ice_get_link_ksettings, 3802 4083 .set_link_ksettings = ice_set_link_ksettings, 3803 - .get_drvinfo = ice_get_drvinfo, 3804 - .get_regs_len = ice_get_regs_len, 3805 - .get_regs = ice_get_regs, 3806 - .get_msglevel = ice_get_msglevel, 3807 - .set_msglevel = ice_set_msglevel, 4084 + .get_drvinfo = ice_get_drvinfo, 4085 + .get_regs_len = ice_get_regs_len, 4086 + .get_regs = ice_get_regs, 4087 + .get_msglevel = ice_get_msglevel, 4088 + .set_msglevel = ice_set_msglevel, 3808 4089 .self_test = ice_self_test, 3809 4090 .get_link = ethtool_op_get_link, 3810 4091 .get_eeprom_len = ice_get_eeprom_len, ··· 3831 4112 .get_channels = ice_get_channels, 3832 4113 .set_channels = ice_set_channels, 3833 4114 .get_ts_info = ethtool_op_get_ts_info, 3834 - .get_per_queue_coalesce = ice_get_per_q_coalesce, 3835 - .set_per_queue_coalesce = ice_set_per_q_coalesce, 4115 + .get_per_queue_coalesce = ice_get_per_q_coalesce, 4116 + .set_per_queue_coalesce = ice_set_per_q_coalesce, 3836 4117 .get_fecparam = ice_get_fecparam, 3837 4118 .set_fecparam = ice_set_fecparam, 3838 4119 .get_module_info = ice_get_module_info,
+6 -1
drivers/net/ethernet/intel/ice/ice_hw_autogen.h
··· 267 267 #define GLNVM_GENS_SR_SIZE_S 5 268 268 #define GLNVM_GENS_SR_SIZE_M ICE_M(0x7, 5) 269 269 #define GLNVM_ULD 0x000B6008 270 + #define GLNVM_ULD_PCIER_DONE_M BIT(0) 271 + #define GLNVM_ULD_PCIER_DONE_1_M BIT(1) 270 272 #define GLNVM_ULD_CORER_DONE_M BIT(3) 271 273 #define GLNVM_ULD_GLOBR_DONE_M BIT(4) 274 + #define GLNVM_ULD_POR_DONE_M BIT(5) 275 + #define GLNVM_ULD_POR_DONE_1_M BIT(8) 276 + #define GLNVM_ULD_PCIER_DONE_2_M BIT(9) 277 + #define GLNVM_ULD_PE_DONE_M BIT(10) 272 278 #define GLPCI_CNF2 0x000BE004 273 279 #define GLPCI_CNF2_CACHELINE_SIZE_M BIT(1) 274 280 #define PF_FUNC_RID 0x0009E880 ··· 337 331 #define GLV_TEPC(_VSI) (0x00312000 + ((_VSI) * 4)) 338 332 #define GLV_UPRCL(_i) (0x003B2000 + ((_i) * 8)) 339 333 #define GLV_UPTCL(_i) (0x0030A000 + ((_i) * 8)) 340 - #define PF_VT_PFALLOC_HIF 0x0009DD80 341 334 #define VSIQF_HKEY_MAX_INDEX 12 342 335 #define VSIQF_HLUT_MAX_INDEX 15 343 336 #define VFINT_DYN_CTLN(_i) (0x00003800 + ((_i) * 4))
+20 -51
drivers/net/ethernet/intel/ice/ice_lib.c
··· 117 117 vsi->num_tx_desc = ICE_DFLT_NUM_TX_DESC; 118 118 break; 119 119 default: 120 - dev_dbg(&vsi->back->pdev->dev, 121 - "Not setting number of Tx/Rx descriptors for VSI type %d\n", 120 + dev_dbg(ice_pf_to_dev(vsi->back), "Not setting number of Tx/Rx descriptors for VSI type %d\n", 122 121 vsi->type); 123 122 break; 124 123 } ··· 723 724 vsi->num_txq = tx_count; 724 725 725 726 if (vsi->type == ICE_VSI_VF && vsi->num_txq != vsi->num_rxq) { 726 - dev_dbg(&vsi->back->pdev->dev, "VF VSI should have same number of Tx and Rx queues. Hence making them equal\n"); 727 + dev_dbg(ice_pf_to_dev(vsi->back), "VF VSI should have same number of Tx and Rx queues. Hence making them equal\n"); 727 728 /* since there is a chance that num_rxq could have been changed 728 729 * in the above for loop, make num_txq equal to num_rxq. 729 730 */ ··· 928 929 vsi->base_vector = ice_get_res(pf, pf->irq_tracker, num_q_vectors, 929 930 vsi->idx); 930 931 if (vsi->base_vector < 0) { 931 - dev_err(dev, 932 - "Failed to get tracking for %d vectors for VSI %d, err=%d\n", 932 + dev_err(dev, "Failed to get tracking for %d vectors for VSI %d, err=%d\n", 933 933 num_q_vectors, vsi->vsi_num, vsi->base_vector); 934 934 return -ENOENT; 935 935 } ··· 1230 1232 * 1231 1233 * Returns 0 on success or ENOMEM on failure. 1232 1234 */ 1233 - int ice_add_mac_to_list(struct ice_vsi *vsi, struct list_head *add_list, 1234 - const u8 *macaddr) 1235 + int 1236 + ice_add_mac_to_list(struct ice_vsi *vsi, struct list_head *add_list, 1237 + const u8 *macaddr) 1235 1238 { 1236 1239 struct ice_fltr_list_entry *tmp; 1237 1240 struct ice_pf *pf = vsi->back; ··· 1391 1392 1392 1393 status = ice_remove_vlan(&pf->hw, &tmp_add_list); 1393 1394 if (status == ICE_ERR_DOES_NOT_EXIST) { 1394 - dev_dbg(dev, 1395 - "Failed to remove VLAN %d on VSI %i, it does not exist, status: %d\n", 1395 + dev_dbg(dev, "Failed to remove VLAN %d on VSI %i, it does not exist, status: %d\n", 1396 1396 vid, vsi->vsi_num, status); 1397 1397 } else if (status) { 1398 - dev_err(dev, 1399 - "Error removing VLAN %d on vsi %i error: %d\n", 1398 + dev_err(dev, "Error removing VLAN %d on vsi %i error: %d\n", 1400 1399 vid, vsi->vsi_num, status); 1401 1400 err = -EIO; 1402 1401 } ··· 1450 1453 1451 1454 err = ice_setup_rx_ctx(vsi->rx_rings[i]); 1452 1455 if (err) { 1453 - dev_err(&vsi->back->pdev->dev, 1454 - "ice_setup_rx_ctx failed for RxQ %d, err %d\n", 1456 + dev_err(ice_pf_to_dev(vsi->back), "ice_setup_rx_ctx failed for RxQ %d, err %d\n", 1455 1457 i, err); 1456 1458 return err; 1457 1459 } ··· 1619 1623 1620 1624 status = ice_update_vsi(hw, vsi->idx, ctxt, NULL); 1621 1625 if (status) { 1622 - dev_err(&vsi->back->pdev->dev, "update VSI for VLAN insert failed, err %d aq_err %d\n", 1626 + dev_err(ice_pf_to_dev(vsi->back), "update VSI for VLAN insert failed, err %d aq_err %d\n", 1623 1627 status, hw->adminq.sq_last_status); 1624 1628 ret = -EIO; 1625 1629 goto out; ··· 1665 1669 1666 1670 status = ice_update_vsi(hw, vsi->idx, ctxt, NULL); 1667 1671 if (status) { 1668 - dev_err(&vsi->back->pdev->dev, "update VSI for VLAN strip failed, ena = %d err %d aq_err %d\n", 1672 + dev_err(ice_pf_to_dev(vsi->back), "update VSI for VLAN strip failed, ena = %d err %d aq_err %d\n", 1669 1673 ena, status, hw->adminq.sq_last_status); 1670 1674 ret = -EIO; 1671 1675 goto out; ··· 1830 1834 struct ice_q_vector *q_vector = vsi->q_vectors[i]; 1831 1835 1832 1836 if (!q_vector) { 1833 - dev_err(&vsi->back->pdev->dev, 1834 - "Failed to set reg_idx on q_vector %d VSI %d\n", 1837 + dev_err(ice_pf_to_dev(vsi->back), "Failed to set reg_idx on q_vector %d VSI %d\n", 1835 1838 i, vsi->vsi_num); 1836 1839 goto clear_reg_idx; 1837 1840 } ··· 1893 1898 status = ice_remove_eth_mac(&pf->hw, &tmp_add_list); 1894 1899 1895 1900 if (status) 1896 - dev_err(dev, 1897 - "Failure Adding or Removing Ethertype on VSI %i error: %d\n", 1901 + dev_err(dev, "Failure Adding or Removing Ethertype on VSI %i error: %d\n", 1898 1902 vsi->vsi_num, status); 1899 1903 1900 1904 ice_free_fltr_list(dev, &tmp_add_list); ··· 2378 2384 return -EINVAL; 2379 2385 2380 2386 if (!needed || needed > res->num_entries || id >= ICE_RES_VALID_BIT) { 2381 - dev_err(ice_pf_to_dev(pf), 2382 - "param err: needed=%d, num_entries = %d id=0x%04x\n", 2387 + dev_err(ice_pf_to_dev(pf), "param err: needed=%d, num_entries = %d id=0x%04x\n", 2383 2388 needed, res->num_entries, id); 2384 2389 return -EINVAL; 2385 2390 } ··· 2679 2686 ice_vsi_put_qs(vsi); 2680 2687 ice_vsi_clear_rings(vsi); 2681 2688 ice_vsi_free_arrays(vsi); 2682 - ice_dev_onetime_setup(&pf->hw); 2683 2689 if (vsi->type == ICE_VSI_VF) 2684 2690 ice_vsi_set_num_qs(vsi, vf->vf_id); 2685 2691 else ··· 2757 2765 status = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, vsi->tc_cfg.ena_tc, 2758 2766 max_txqs); 2759 2767 if (status) { 2760 - dev_err(ice_pf_to_dev(pf), 2761 - "VSI %d failed lan queue config, error %d\n", 2768 + dev_err(ice_pf_to_dev(pf), "VSI %d failed lan queue config, error %d\n", 2762 2769 vsi->vsi_num, status); 2763 2770 if (init_vsi) { 2764 2771 ret = -EIO; ··· 2825 2834 int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc) 2826 2835 { 2827 2836 u16 max_txqs[ICE_MAX_TRAFFIC_CLASS] = { 0 }; 2828 - struct ice_vsi_ctx *ctx; 2829 2837 struct ice_pf *pf = vsi->back; 2838 + struct ice_vsi_ctx *ctx; 2830 2839 enum ice_status status; 2831 2840 struct device *dev; 2832 2841 int i, ret = 0; ··· 2881 2890 return ret; 2882 2891 } 2883 2892 #endif /* CONFIG_DCB */ 2884 - 2885 - /** 2886 - * ice_nvm_version_str - format the NVM version strings 2887 - * @hw: ptr to the hardware info 2888 - */ 2889 - char *ice_nvm_version_str(struct ice_hw *hw) 2890 - { 2891 - u8 oem_ver, oem_patch, ver_hi, ver_lo; 2892 - static char buf[ICE_NVM_VER_LEN]; 2893 - u16 oem_build; 2894 - 2895 - ice_get_nvm_version(hw, &oem_ver, &oem_build, &oem_patch, &ver_hi, 2896 - &ver_lo); 2897 - 2898 - snprintf(buf, sizeof(buf), "%x.%02x 0x%x %d.%d.%d", ver_hi, ver_lo, 2899 - hw->nvm.eetrack, oem_ver, oem_build, oem_patch); 2900 - 2901 - return buf; 2902 - } 2903 2893 2904 2894 /** 2905 2895 * ice_update_ring_stats - Update ring statistics ··· 2953 2981 status = ice_remove_mac(&vsi->back->hw, &tmp_add_list); 2954 2982 2955 2983 cfg_mac_fltr_exit: 2956 - ice_free_fltr_list(&vsi->back->pdev->dev, &tmp_add_list); 2984 + ice_free_fltr_list(ice_pf_to_dev(vsi->back), &tmp_add_list); 2957 2985 return status; 2958 2986 } 2959 2987 ··· 3015 3043 3016 3044 /* another VSI is already the default VSI for this switch */ 3017 3045 if (ice_is_dflt_vsi_in_use(sw)) { 3018 - dev_err(dev, 3019 - "Default forwarding VSI %d already in use, disable it and try again\n", 3046 + dev_err(dev, "Default forwarding VSI %d already in use, disable it and try again\n", 3020 3047 sw->dflt_vsi->vsi_num); 3021 3048 return -EEXIST; 3022 3049 } 3023 3050 3024 3051 status = ice_cfg_dflt_vsi(&vsi->back->hw, vsi->idx, true, ICE_FLTR_RX); 3025 3052 if (status) { 3026 - dev_err(dev, 3027 - "Failed to set VSI %d as the default forwarding VSI, error %d\n", 3053 + dev_err(dev, "Failed to set VSI %d as the default forwarding VSI, error %d\n", 3028 3054 vsi->vsi_num, status); 3029 3055 return -EIO; 3030 3056 } ··· 3061 3091 status = ice_cfg_dflt_vsi(&dflt_vsi->back->hw, dflt_vsi->idx, false, 3062 3092 ICE_FLTR_RX); 3063 3093 if (status) { 3064 - dev_err(dev, 3065 - "Failed to clear the default forwarding VSI %d, error %d\n", 3094 + dev_err(dev, "Failed to clear the default forwarding VSI %d, error %d\n", 3066 3095 dflt_vsi->vsi_num, status); 3067 3096 return -EIO; 3068 3097 }
-2
drivers/net/ethernet/intel/ice/ice_lib.h
··· 97 97 98 98 u32 ice_intrl_usec_to_reg(u8 intrl, u8 gran); 99 99 100 - char *ice_nvm_version_str(struct ice_hw *hw); 101 - 102 100 enum ice_status 103 101 ice_vsi_cfg_mac_fltr(struct ice_vsi *vsi, const u8 *macaddr, bool set); 104 102
+71 -124
drivers/net/ethernet/intel/ice/ice_main.c
··· 162 162 * had an error 163 163 */ 164 164 if (status && vsi->netdev->reg_state == NETREG_REGISTERED) { 165 - dev_err(ice_pf_to_dev(pf), 166 - "Could not add MAC filters error %d. Unregistering device\n", 165 + dev_err(ice_pf_to_dev(pf), "Could not add MAC filters error %d. Unregistering device\n", 167 166 status); 168 167 unregister_netdev(vsi->netdev); 169 168 free_netdev(vsi->netdev); ··· 268 269 */ 269 270 static int ice_vsi_sync_fltr(struct ice_vsi *vsi) 270 271 { 271 - struct device *dev = &vsi->back->pdev->dev; 272 + struct device *dev = ice_pf_to_dev(vsi->back); 272 273 struct net_device *netdev = vsi->netdev; 273 274 bool promisc_forced_on = false; 274 275 struct ice_pf *pf = vsi->back; ··· 334 335 !test_and_set_bit(__ICE_FLTR_OVERFLOW_PROMISC, 335 336 vsi->state)) { 336 337 promisc_forced_on = true; 337 - netdev_warn(netdev, 338 - "Reached MAC filter limit, forcing promisc mode on VSI %d\n", 338 + netdev_warn(netdev, "Reached MAC filter limit, forcing promisc mode on VSI %d\n", 339 339 vsi->vsi_num); 340 340 } else { 341 341 err = -EIO; ··· 380 382 if (!ice_is_dflt_vsi_in_use(pf->first_sw)) { 381 383 err = ice_set_dflt_vsi(pf->first_sw, vsi); 382 384 if (err && err != -EEXIST) { 383 - netdev_err(netdev, 384 - "Error %d setting default VSI %i Rx rule\n", 385 + netdev_err(netdev, "Error %d setting default VSI %i Rx rule\n", 385 386 err, vsi->vsi_num); 386 387 vsi->current_netdev_flags &= 387 388 ~IFF_PROMISC; ··· 392 395 if (ice_is_vsi_dflt_vsi(pf->first_sw, vsi)) { 393 396 err = ice_clear_dflt_vsi(pf->first_sw); 394 397 if (err) { 395 - netdev_err(netdev, 396 - "Error %d clearing default VSI %i Rx rule\n", 398 + netdev_err(netdev, "Error %d clearing default VSI %i Rx rule\n", 397 399 err, vsi->vsi_num); 398 400 vsi->current_netdev_flags |= 399 401 IFF_PROMISC; ··· 748 752 kfree(caps); 749 753 750 754 done: 751 - netdev_info(vsi->netdev, "NIC Link is up %sbps, Requested FEC: %s, FEC: %s, Autoneg: %s, Flow Control: %s\n", 755 + netdev_info(vsi->netdev, "NIC Link is up %sbps Full Duplex, Requested FEC: %s, Negotiated FEC: %s, Autoneg: %s, Flow Control: %s\n", 752 756 speed, fec_req, fec, an, fc); 753 757 ice_print_topo_conflict(vsi); 754 758 } ··· 811 815 */ 812 816 result = ice_update_link_info(pi); 813 817 if (result) 814 - dev_dbg(dev, 815 - "Failed to update link status and re-enable link events for port %d\n", 818 + dev_dbg(dev, "Failed to update link status and re-enable link events for port %d\n", 816 819 pi->lport); 817 820 818 821 /* if the old link up/down and speed is the same as the new */ ··· 829 834 830 835 result = ice_aq_set_link_restart_an(pi, false, NULL); 831 836 if (result) { 832 - dev_dbg(dev, 833 - "Failed to set link down, VSI %d error %d\n", 837 + dev_dbg(dev, "Failed to set link down, VSI %d error %d\n", 834 838 vsi->vsi_num, result); 835 839 return result; 836 840 } 837 841 } 838 842 843 + ice_dcb_rebuild(pf); 839 844 ice_vsi_link_event(vsi, link_up); 840 845 ice_print_link_msg(vsi, link_up); 841 846 ··· 887 892 ICE_AQ_LINK_EVENT_MODULE_QUAL_FAIL)); 888 893 889 894 if (ice_aq_set_event_mask(pi->hw, pi->lport, mask, NULL)) { 890 - dev_dbg(ice_hw_to_dev(pi->hw), 891 - "Failed to set link event mask for port %d\n", 895 + dev_dbg(ice_hw_to_dev(pi->hw), "Failed to set link event mask for port %d\n", 892 896 pi->lport); 893 897 return -EIO; 894 898 } 895 899 896 900 if (ice_aq_get_link_info(pi, true, NULL, NULL)) { 897 - dev_dbg(ice_hw_to_dev(pi->hw), 898 - "Failed to enable link events for port %d\n", 901 + dev_dbg(ice_hw_to_dev(pi->hw), "Failed to enable link events for port %d\n", 899 902 pi->lport); 900 903 return -EIO; 901 904 } ··· 922 929 !!(link_data->link_info & ICE_AQ_LINK_UP), 923 930 le16_to_cpu(link_data->link_speed)); 924 931 if (status) 925 - dev_dbg(ice_pf_to_dev(pf), 926 - "Could not process link event, error %d\n", status); 932 + dev_dbg(ice_pf_to_dev(pf), "Could not process link event, error %d\n", 933 + status); 927 934 928 935 return status; 929 936 } ··· 972 979 dev_dbg(dev, "%s Receive Queue VF Error detected\n", 973 980 qtype); 974 981 if (val & PF_FW_ARQLEN_ARQOVFL_M) { 975 - dev_dbg(dev, 976 - "%s Receive Queue Overflow Error detected\n", 982 + dev_dbg(dev, "%s Receive Queue Overflow Error detected\n", 977 983 qtype); 978 984 } 979 985 if (val & PF_FW_ARQLEN_ARQCRIT_M) 980 - dev_dbg(dev, 981 - "%s Receive Queue Critical Error detected\n", 986 + dev_dbg(dev, "%s Receive Queue Critical Error detected\n", 982 987 qtype); 983 988 val &= ~(PF_FW_ARQLEN_ARQVFE_M | PF_FW_ARQLEN_ARQOVFL_M | 984 989 PF_FW_ARQLEN_ARQCRIT_M); ··· 989 998 PF_FW_ATQLEN_ATQCRIT_M)) { 990 999 oldval = val; 991 1000 if (val & PF_FW_ATQLEN_ATQVFE_M) 992 - dev_dbg(dev, 993 - "%s Send Queue VF Error detected\n", qtype); 1001 + dev_dbg(dev, "%s Send Queue VF Error detected\n", 1002 + qtype); 994 1003 if (val & PF_FW_ATQLEN_ATQOVFL_M) { 995 1004 dev_dbg(dev, "%s Send Queue Overflow Error detected\n", 996 1005 qtype); ··· 1039 1048 ice_dcb_process_lldp_set_mib_change(pf, &event); 1040 1049 break; 1041 1050 default: 1042 - dev_dbg(dev, 1043 - "%s Receive Queue unknown event 0x%04x ignored\n", 1051 + dev_dbg(dev, "%s Receive Queue unknown event 0x%04x ignored\n", 1044 1052 qtype, opcode); 1045 1053 break; 1046 1054 } ··· 1228 1238 u16 queue = ((reg & GL_MDET_TX_TCLAN_QNUM_M) >> 1229 1239 GL_MDET_TX_TCLAN_QNUM_S); 1230 1240 1231 - if (netif_msg_rx_err(pf)) 1241 + if (netif_msg_tx_err(pf)) 1232 1242 dev_info(dev, "Malicious Driver Detection event %d on TX queue %d PF# %d VF# %d\n", 1233 1243 event, queue, pf_num, vf_num); 1234 1244 wr32(hw, GL_MDET_TX_TCLAN, 0xffffffff); ··· 1325 1335 vf->num_mdd_events++; 1326 1336 if (vf->num_mdd_events && 1327 1337 vf->num_mdd_events <= ICE_MDD_EVENTS_THRESHOLD) 1328 - dev_info(dev, 1329 - "VF %d has had %llu MDD events since last boot, Admin might need to reload AVF driver with this number of events\n", 1338 + dev_info(dev, "VF %d has had %llu MDD events since last boot, Admin might need to reload AVF driver with this number of events\n", 1330 1339 i, vf->num_mdd_events); 1331 1340 } 1332 1341 } ··· 1356 1367 if (vsi->type != ICE_VSI_PF) 1357 1368 return 0; 1358 1369 1359 - dev = &vsi->back->pdev->dev; 1370 + dev = ice_pf_to_dev(vsi->back); 1360 1371 1361 1372 pi = vsi->port_info; 1362 1373 ··· 1367 1378 retcode = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_SW_CFG, pcaps, 1368 1379 NULL); 1369 1380 if (retcode) { 1370 - dev_err(dev, 1371 - "Failed to get phy capabilities, VSI %d error %d\n", 1381 + dev_err(dev, "Failed to get phy capabilities, VSI %d error %d\n", 1372 1382 vsi->vsi_num, retcode); 1373 1383 retcode = -EIO; 1374 1384 goto out; ··· 1637 1649 err = devm_request_irq(dev, irq_num, vsi->irq_handler, 0, 1638 1650 q_vector->name, q_vector); 1639 1651 if (err) { 1640 - netdev_err(vsi->netdev, 1641 - "MSIX request_irq failed, error: %d\n", err); 1652 + netdev_err(vsi->netdev, "MSIX request_irq failed, error: %d\n", 1653 + err); 1642 1654 goto free_q_irqs; 1643 1655 } 1644 1656 ··· 1673 1685 */ 1674 1686 static int ice_xdp_alloc_setup_rings(struct ice_vsi *vsi) 1675 1687 { 1676 - struct device *dev = &vsi->back->pdev->dev; 1688 + struct device *dev = ice_pf_to_dev(vsi->back); 1677 1689 int i; 1678 1690 1679 1691 for (i = 0; i < vsi->num_xdp_txq; i++) { ··· 2652 2664 clear_bit(ICE_FLAG_DCB_CAPABLE, pf->flags); 2653 2665 if (func_caps->common_cap.dcb) 2654 2666 set_bit(ICE_FLAG_DCB_CAPABLE, pf->flags); 2655 - #ifdef CONFIG_PCI_IOV 2656 2667 clear_bit(ICE_FLAG_SRIOV_CAPABLE, pf->flags); 2657 2668 if (func_caps->common_cap.sr_iov_1_1) { 2658 2669 set_bit(ICE_FLAG_SRIOV_CAPABLE, pf->flags); 2659 2670 pf->num_vfs_supported = min_t(int, func_caps->num_allocd_vfs, 2660 2671 ICE_MAX_VF_COUNT); 2661 2672 } 2662 - #endif /* CONFIG_PCI_IOV */ 2663 2673 clear_bit(ICE_FLAG_RSS_ENA, pf->flags); 2664 2674 if (func_caps->common_cap.rss_table_size) 2665 2675 set_bit(ICE_FLAG_RSS_ENA, pf->flags); ··· 2750 2764 } 2751 2765 2752 2766 if (v_actual < v_budget) { 2753 - dev_warn(dev, 2754 - "not enough OS MSI-X vectors. requested = %d, obtained = %d\n", 2767 + dev_warn(dev, "not enough OS MSI-X vectors. requested = %d, obtained = %d\n", 2755 2768 v_budget, v_actual); 2756 2769 /* 2 vectors for LAN (traffic + OICR) */ 2757 2770 #define ICE_MIN_LAN_VECS 2 ··· 2772 2787 goto exit_err; 2773 2788 2774 2789 no_hw_vecs_left_err: 2775 - dev_err(dev, 2776 - "not enough device MSI-X vectors. requested = %d, available = %d\n", 2790 + dev_err(dev, "not enough device MSI-X vectors. requested = %d, available = %d\n", 2777 2791 needed, v_left); 2778 2792 err = -ERANGE; 2779 2793 exit_err: ··· 2905 2921 !memcmp(hw->pkg_name, hw->active_pkg_name, 2906 2922 sizeof(hw->pkg_name))) { 2907 2923 if (hw->pkg_dwnld_status == ICE_AQ_RC_EEXIST) 2908 - dev_info(dev, 2909 - "DDP package already present on device: %s version %d.%d.%d.%d\n", 2924 + dev_info(dev, "DDP package already present on device: %s version %d.%d.%d.%d\n", 2910 2925 hw->active_pkg_name, 2911 2926 hw->active_pkg_ver.major, 2912 2927 hw->active_pkg_ver.minor, 2913 2928 hw->active_pkg_ver.update, 2914 2929 hw->active_pkg_ver.draft); 2915 2930 else 2916 - dev_info(dev, 2917 - "The DDP package was successfully loaded: %s version %d.%d.%d.%d\n", 2931 + dev_info(dev, "The DDP package was successfully loaded: %s version %d.%d.%d.%d\n", 2918 2932 hw->active_pkg_name, 2919 2933 hw->active_pkg_ver.major, 2920 2934 hw->active_pkg_ver.minor, ··· 2920 2938 hw->active_pkg_ver.draft); 2921 2939 } else if (hw->active_pkg_ver.major != ICE_PKG_SUPP_VER_MAJ || 2922 2940 hw->active_pkg_ver.minor != ICE_PKG_SUPP_VER_MNR) { 2923 - dev_err(dev, 2924 - "The device has a DDP package that is not supported by the driver. The device has package '%s' version %d.%d.x.x. The driver requires version %d.%d.x.x. Entering Safe Mode.\n", 2941 + dev_err(dev, "The device has a DDP package that is not supported by the driver. The device has package '%s' version %d.%d.x.x. The driver requires version %d.%d.x.x. Entering Safe Mode.\n", 2925 2942 hw->active_pkg_name, 2926 2943 hw->active_pkg_ver.major, 2927 2944 hw->active_pkg_ver.minor, ··· 2928 2947 *status = ICE_ERR_NOT_SUPPORTED; 2929 2948 } else if (hw->active_pkg_ver.major == ICE_PKG_SUPP_VER_MAJ && 2930 2949 hw->active_pkg_ver.minor == ICE_PKG_SUPP_VER_MNR) { 2931 - dev_info(dev, 2932 - "The driver could not load the DDP package file because a compatible DDP package is already present on the device. The device has package '%s' version %d.%d.%d.%d. The package file found by the driver: '%s' version %d.%d.%d.%d.\n", 2950 + dev_info(dev, "The driver could not load the DDP package file because a compatible DDP package is already present on the device. The device has package '%s' version %d.%d.%d.%d. The package file found by the driver: '%s' version %d.%d.%d.%d.\n", 2933 2951 hw->active_pkg_name, 2934 2952 hw->active_pkg_ver.major, 2935 2953 hw->active_pkg_ver.minor, ··· 2940 2960 hw->pkg_ver.update, 2941 2961 hw->pkg_ver.draft); 2942 2962 } else { 2943 - dev_err(dev, 2944 - "An unknown error occurred when loading the DDP package, please reboot the system. If the problem persists, update the NVM. Entering Safe Mode.\n"); 2963 + dev_err(dev, "An unknown error occurred when loading the DDP package, please reboot the system. If the problem persists, update the NVM. Entering Safe Mode.\n"); 2945 2964 *status = ICE_ERR_NOT_SUPPORTED; 2946 2965 } 2947 2966 break; 2948 2967 case ICE_ERR_BUF_TOO_SHORT: 2949 2968 /* fall-through */ 2950 2969 case ICE_ERR_CFG: 2951 - dev_err(dev, 2952 - "The DDP package file is invalid. Entering Safe Mode.\n"); 2970 + dev_err(dev, "The DDP package file is invalid. Entering Safe Mode.\n"); 2953 2971 break; 2954 2972 case ICE_ERR_NOT_SUPPORTED: 2955 2973 /* Package File version not supported */ 2956 2974 if (hw->pkg_ver.major > ICE_PKG_SUPP_VER_MAJ || 2957 2975 (hw->pkg_ver.major == ICE_PKG_SUPP_VER_MAJ && 2958 2976 hw->pkg_ver.minor > ICE_PKG_SUPP_VER_MNR)) 2959 - dev_err(dev, 2960 - "The DDP package file version is higher than the driver supports. Please use an updated driver. Entering Safe Mode.\n"); 2977 + dev_err(dev, "The DDP package file version is higher than the driver supports. Please use an updated driver. Entering Safe Mode.\n"); 2961 2978 else if (hw->pkg_ver.major < ICE_PKG_SUPP_VER_MAJ || 2962 2979 (hw->pkg_ver.major == ICE_PKG_SUPP_VER_MAJ && 2963 2980 hw->pkg_ver.minor < ICE_PKG_SUPP_VER_MNR)) 2964 - dev_err(dev, 2965 - "The DDP package file version is lower than the driver supports. The driver requires version %d.%d.x.x. Please use an updated DDP Package file. Entering Safe Mode.\n", 2981 + dev_err(dev, "The DDP package file version is lower than the driver supports. The driver requires version %d.%d.x.x. Please use an updated DDP Package file. Entering Safe Mode.\n", 2966 2982 ICE_PKG_SUPP_VER_MAJ, ICE_PKG_SUPP_VER_MNR); 2967 2983 break; 2968 2984 case ICE_ERR_AQ_ERROR: 2969 2985 switch (hw->pkg_dwnld_status) { 2970 2986 case ICE_AQ_RC_ENOSEC: 2971 2987 case ICE_AQ_RC_EBADSIG: 2972 - dev_err(dev, 2973 - "The DDP package could not be loaded because its signature is not valid. Please use a valid DDP Package. Entering Safe Mode.\n"); 2988 + dev_err(dev, "The DDP package could not be loaded because its signature is not valid. Please use a valid DDP Package. Entering Safe Mode.\n"); 2974 2989 return; 2975 2990 case ICE_AQ_RC_ESVN: 2976 - dev_err(dev, 2977 - "The DDP Package could not be loaded because its security revision is too low. Please use an updated DDP Package. Entering Safe Mode.\n"); 2991 + dev_err(dev, "The DDP Package could not be loaded because its security revision is too low. Please use an updated DDP Package. Entering Safe Mode.\n"); 2978 2992 return; 2979 2993 case ICE_AQ_RC_EBADMAN: 2980 2994 case ICE_AQ_RC_EBADBUF: 2981 - dev_err(dev, 2982 - "An error occurred on the device while loading the DDP package. The device will be reset.\n"); 2995 + dev_err(dev, "An error occurred on the device while loading the DDP package. The device will be reset.\n"); 2983 2996 return; 2984 2997 default: 2985 2998 break; 2986 2999 } 2987 3000 /* fall-through */ 2988 3001 default: 2989 - dev_err(dev, 2990 - "An unknown error (%d) occurred when loading the DDP package. Entering Safe Mode.\n", 3002 + dev_err(dev, "An unknown error (%d) occurred when loading the DDP package. Entering Safe Mode.\n", 2991 3003 *status); 2992 3004 break; 2993 3005 } ··· 3010 3038 status = ice_init_pkg(hw, hw->pkg_copy, hw->pkg_size); 3011 3039 ice_log_pkg_init(hw, &status); 3012 3040 } else { 3013 - dev_err(dev, 3014 - "The DDP package file failed to load. Entering Safe Mode.\n"); 3041 + dev_err(dev, "The DDP package file failed to load. Entering Safe Mode.\n"); 3015 3042 } 3016 3043 3017 3044 if (status) { ··· 3036 3065 static void ice_verify_cacheline_size(struct ice_pf *pf) 3037 3066 { 3038 3067 if (rd32(&pf->hw, GLPCI_CNF2) & GLPCI_CNF2_CACHELINE_SIZE_M) 3039 - dev_warn(ice_pf_to_dev(pf), 3040 - "%d Byte cache line assumption is invalid, driver may have Tx timeouts!\n", 3068 + dev_warn(ice_pf_to_dev(pf), "%d Byte cache line assumption is invalid, driver may have Tx timeouts!\n", 3041 3069 ICE_CACHE_LINE_BYTES); 3042 3070 } 3043 3071 ··· 3129 3159 dflt_pkg_load: 3130 3160 err = request_firmware(&firmware, ICE_DDP_PKG_FILE, dev); 3131 3161 if (err) { 3132 - dev_err(dev, 3133 - "The DDP package file was not found or could not be read. Entering Safe Mode\n"); 3162 + dev_err(dev, "The DDP package file was not found or could not be read. Entering Safe Mode\n"); 3134 3163 return; 3135 3164 } 3136 3165 ··· 3153 3184 struct ice_hw *hw; 3154 3185 int err; 3155 3186 3156 - /* this driver uses devres, see Documentation/driver-api/driver-model/devres.rst */ 3187 + /* this driver uses devres, see 3188 + * Documentation/driver-api/driver-model/devres.rst 3189 + */ 3157 3190 err = pcim_enable_device(pdev); 3158 3191 if (err) 3159 3192 return err; ··· 3216 3245 goto err_exit_unroll; 3217 3246 } 3218 3247 3219 - dev_info(dev, "firmware %d.%d.%d api %d.%d.%d nvm %s build 0x%08x\n", 3220 - hw->fw_maj_ver, hw->fw_min_ver, hw->fw_patch, 3221 - hw->api_maj_ver, hw->api_min_ver, hw->api_patch, 3222 - ice_nvm_version_str(hw), hw->fw_build); 3223 - 3224 3248 ice_request_fw(pf); 3225 3249 3226 3250 /* if ice_request_fw fails, ICE_FLAG_ADV_FEATURES bit won't be ··· 3223 3257 * true 3224 3258 */ 3225 3259 if (ice_is_safe_mode(pf)) { 3226 - dev_err(dev, 3227 - "Package download failed. Advanced features disabled - Device now in Safe Mode\n"); 3260 + dev_err(dev, "Package download failed. Advanced features disabled - Device now in Safe Mode\n"); 3228 3261 /* we already got function/device capabilities but these don't 3229 3262 * reflect what the driver needs to do in safe mode. Instead of 3230 3263 * adding conditional logic everywhere to ignore these ··· 3300 3335 /* tell the firmware we are up */ 3301 3336 err = ice_send_version(pf); 3302 3337 if (err) { 3303 - dev_err(dev, 3304 - "probe failed sending driver version %s. error: %d\n", 3338 + dev_err(dev, "probe failed sending driver version %s. error: %d\n", 3305 3339 ice_drv_ver, err); 3306 3340 goto err_alloc_sw_unroll; 3307 3341 } ··· 3441 3477 3442 3478 err = pci_enable_device_mem(pdev); 3443 3479 if (err) { 3444 - dev_err(&pdev->dev, 3445 - "Cannot re-enable PCI device after reset, error %d\n", 3480 + dev_err(&pdev->dev, "Cannot re-enable PCI device after reset, error %d\n", 3446 3481 err); 3447 3482 result = PCI_ERS_RESULT_DISCONNECT; 3448 3483 } else { ··· 3460 3497 3461 3498 err = pci_cleanup_aer_uncorrect_error_status(pdev); 3462 3499 if (err) 3463 - dev_dbg(&pdev->dev, 3464 - "pci_cleanup_aer_uncorrect_error_status failed, error %d\n", 3500 + dev_dbg(&pdev->dev, "pci_cleanup_aer_uncorrect_error_status failed, error %d\n", 3465 3501 err); 3466 3502 /* non-fatal, continue */ 3467 3503 ··· 3479 3517 struct ice_pf *pf = pci_get_drvdata(pdev); 3480 3518 3481 3519 if (!pf) { 3482 - dev_err(&pdev->dev, 3483 - "%s failed, device is unrecoverable\n", __func__); 3520 + dev_err(&pdev->dev, "%s failed, device is unrecoverable\n", 3521 + __func__); 3484 3522 return; 3485 3523 } 3486 3524 ··· 3728 3766 3729 3767 /* Validate maxrate requested is within permitted range */ 3730 3768 if (maxrate && (maxrate > (ICE_SCHED_MAX_BW / 1000))) { 3731 - netdev_err(netdev, 3732 - "Invalid max rate %d specified for the queue %d\n", 3769 + netdev_err(netdev, "Invalid max rate %d specified for the queue %d\n", 3733 3770 maxrate, queue_index); 3734 3771 return -EINVAL; 3735 3772 } ··· 3744 3783 status = ice_cfg_q_bw_lmt(vsi->port_info, vsi->idx, tc, 3745 3784 q_handle, ICE_MAX_BW, maxrate * 1000); 3746 3785 if (status) { 3747 - netdev_err(netdev, 3748 - "Unable to set Tx max rate, error %d\n", status); 3786 + netdev_err(netdev, "Unable to set Tx max rate, error %d\n", 3787 + status); 3749 3788 return -EIO; 3750 3789 } 3751 3790 ··· 3837 3876 3838 3877 /* Don't set any netdev advanced features with device in Safe Mode */ 3839 3878 if (ice_is_safe_mode(vsi->back)) { 3840 - dev_err(&vsi->back->pdev->dev, 3841 - "Device is in Safe Mode - not enabling advanced netdev features\n"); 3879 + dev_err(ice_pf_to_dev(vsi->back), "Device is in Safe Mode - not enabling advanced netdev features\n"); 3842 3880 return ret; 3843 3881 } 3844 3882 3845 3883 /* Do not change setting during reset */ 3846 3884 if (ice_is_reset_in_progress(pf->state)) { 3847 - dev_err(&vsi->back->pdev->dev, 3848 - "Device is resetting, changing advanced netdev features temporarily unavailable.\n"); 3885 + dev_err(ice_pf_to_dev(vsi->back), "Device is resetting, changing advanced netdev features temporarily unavailable.\n"); 3849 3886 return -EBUSY; 3850 3887 } 3851 3888 ··· 4331 4372 4332 4373 tx_err = ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, 0); 4333 4374 if (tx_err) 4334 - netdev_err(vsi->netdev, 4335 - "Failed stop Tx rings, VSI %d error %d\n", 4375 + netdev_err(vsi->netdev, "Failed stop Tx rings, VSI %d error %d\n", 4336 4376 vsi->vsi_num, tx_err); 4337 4377 if (!tx_err && ice_is_xdp_ena_vsi(vsi)) { 4338 4378 tx_err = ice_vsi_stop_xdp_tx_rings(vsi); 4339 4379 if (tx_err) 4340 - netdev_err(vsi->netdev, 4341 - "Failed stop XDP rings, VSI %d error %d\n", 4380 + netdev_err(vsi->netdev, "Failed stop XDP rings, VSI %d error %d\n", 4342 4381 vsi->vsi_num, tx_err); 4343 4382 } 4344 4383 4345 4384 rx_err = ice_vsi_stop_rx_rings(vsi); 4346 4385 if (rx_err) 4347 - netdev_err(vsi->netdev, 4348 - "Failed stop Rx rings, VSI %d error %d\n", 4386 + netdev_err(vsi->netdev, "Failed stop Rx rings, VSI %d error %d\n", 4349 4387 vsi->vsi_num, rx_err); 4350 4388 4351 4389 ice_napi_disable_all(vsi); ··· 4350 4394 if (test_bit(ICE_FLAG_LINK_DOWN_ON_CLOSE_ENA, vsi->back->flags)) { 4351 4395 link_err = ice_force_phys_link_state(vsi, false); 4352 4396 if (link_err) 4353 - netdev_err(vsi->netdev, 4354 - "Failed to set physical link down, VSI %d error %d\n", 4397 + netdev_err(vsi->netdev, "Failed to set physical link down, VSI %d error %d\n", 4355 4398 vsi->vsi_num, link_err); 4356 4399 } 4357 4400 ··· 4361 4406 ice_clean_rx_ring(vsi->rx_rings[i]); 4362 4407 4363 4408 if (tx_err || rx_err || link_err) { 4364 - netdev_err(vsi->netdev, 4365 - "Failed to close VSI 0x%04X on switch 0x%04X\n", 4409 + netdev_err(vsi->netdev, "Failed to close VSI 0x%04X on switch 0x%04X\n", 4366 4410 vsi->vsi_num, vsi->vsw->sw_id); 4367 4411 return -EIO; 4368 4412 } ··· 4380 4426 int i, err = 0; 4381 4427 4382 4428 if (!vsi->num_txq) { 4383 - dev_err(&vsi->back->pdev->dev, "VSI %d has 0 Tx queues\n", 4429 + dev_err(ice_pf_to_dev(vsi->back), "VSI %d has 0 Tx queues\n", 4384 4430 vsi->vsi_num); 4385 4431 return -EINVAL; 4386 4432 } ··· 4411 4457 int i, err = 0; 4412 4458 4413 4459 if (!vsi->num_rxq) { 4414 - dev_err(&vsi->back->pdev->dev, "VSI %d has 0 Rx queues\n", 4460 + dev_err(ice_pf_to_dev(vsi->back), "VSI %d has 0 Rx queues\n", 4415 4461 vsi->vsi_num); 4416 4462 return -EINVAL; 4417 4463 } ··· 4508 4554 4509 4555 err = ice_vsi_release(pf->vsi[i]); 4510 4556 if (err) 4511 - dev_dbg(ice_pf_to_dev(pf), 4512 - "Failed to release pf->vsi[%d], err %d, vsi_num = %d\n", 4557 + dev_dbg(ice_pf_to_dev(pf), "Failed to release pf->vsi[%d], err %d, vsi_num = %d\n", 4513 4558 i, err, pf->vsi[i]->vsi_num); 4514 4559 } 4515 4560 } ··· 4535 4582 /* rebuild the VSI */ 4536 4583 err = ice_vsi_rebuild(vsi, true); 4537 4584 if (err) { 4538 - dev_err(dev, 4539 - "rebuild VSI failed, err %d, VSI index %d, type %s\n", 4585 + dev_err(dev, "rebuild VSI failed, err %d, VSI index %d, type %s\n", 4540 4586 err, vsi->idx, ice_vsi_type_str(type)); 4541 4587 return err; 4542 4588 } ··· 4543 4591 /* replay filters for the VSI */ 4544 4592 status = ice_replay_vsi(&pf->hw, vsi->idx); 4545 4593 if (status) { 4546 - dev_err(dev, 4547 - "replay VSI failed, status %d, VSI index %d, type %s\n", 4594 + dev_err(dev, "replay VSI failed, status %d, VSI index %d, type %s\n", 4548 4595 status, vsi->idx, ice_vsi_type_str(type)); 4549 4596 return -EIO; 4550 4597 } ··· 4556 4605 /* enable the VSI */ 4557 4606 err = ice_ena_vsi(vsi, false); 4558 4607 if (err) { 4559 - dev_err(dev, 4560 - "enable VSI failed, err %d, VSI index %d, type %s\n", 4608 + dev_err(dev, "enable VSI failed, err %d, VSI index %d, type %s\n", 4561 4609 err, vsi->idx, ice_vsi_type_str(type)); 4562 4610 return err; 4563 4611 } ··· 4634 4684 } 4635 4685 4636 4686 if (pf->first_sw->dflt_vsi_ena) 4637 - dev_info(dev, 4638 - "Clearing default VSI, re-enable after reset completes\n"); 4687 + dev_info(dev, "Clearing default VSI, re-enable after reset completes\n"); 4639 4688 /* clear the default VSI configuration if it exists */ 4640 4689 pf->first_sw->dflt_vsi = NULL; 4641 4690 pf->first_sw->dflt_vsi_ena = false; ··· 4685 4736 /* tell the firmware we are up */ 4686 4737 ret = ice_send_version(pf); 4687 4738 if (ret) { 4688 - dev_err(dev, 4689 - "Rebuild failed due to error sending driver version: %d\n", 4739 + dev_err(dev, "Rebuild failed due to error sending driver version: %d\n", 4690 4740 ret); 4691 4741 goto err_vsi_rebuild; 4692 4742 } ··· 4941 4993 4942 4994 status = ice_update_vsi(hw, vsi->idx, ctxt, NULL); 4943 4995 if (status) { 4944 - dev_err(&vsi->back->pdev->dev, "update VSI for bridge mode failed, bmode = %d err %d aq_err %d\n", 4996 + dev_err(ice_pf_to_dev(vsi->back), "update VSI for bridge mode failed, bmode = %d err %d aq_err %d\n", 4945 4997 bmode, status, hw->adminq.sq_last_status); 4946 4998 ret = -EIO; 4947 4999 goto out; ··· 5133 5185 if (pi->phy.link_info.link_info & ICE_AQ_MEDIA_AVAILABLE) { 5134 5186 err = ice_force_phys_link_state(vsi, true); 5135 5187 if (err) { 5136 - netdev_err(netdev, 5137 - "Failed to set physical link up, error %d\n", 5188 + netdev_err(netdev, "Failed to set physical link up, error %d\n", 5138 5189 err); 5139 5190 return err; 5140 5191 }
+4 -7
drivers/net/ethernet/intel/ice/ice_txrx.c
··· 644 644 * Update the offset within page so that Rx buf will be ready to be reused. 645 645 * For systems with PAGE_SIZE < 8192 this function will flip the page offset 646 646 * so the second half of page assigned to Rx buffer will be used, otherwise 647 - * the offset is moved by the @size bytes 647 + * the offset is moved by "size" bytes 648 648 */ 649 649 static void 650 650 ice_rx_buf_adjust_pg_offset(struct ice_rx_buf *rx_buf, unsigned int size) ··· 1078 1078 skb = ice_build_skb(rx_ring, rx_buf, &xdp); 1079 1079 else 1080 1080 skb = ice_construct_skb(rx_ring, rx_buf, &xdp); 1081 - } else { 1082 - skb = ice_construct_skb(rx_ring, rx_buf, &xdp); 1083 1081 } 1084 1082 /* exit if we failed to retrieve a buffer */ 1085 1083 if (!skb) { ··· 1619 1621 { 1620 1622 u64 td_offset, td_tag, td_cmd; 1621 1623 u16 i = tx_ring->next_to_use; 1622 - skb_frag_t *frag; 1623 1624 unsigned int data_len, size; 1624 1625 struct ice_tx_desc *tx_desc; 1625 1626 struct ice_tx_buf *tx_buf; 1626 1627 struct sk_buff *skb; 1628 + skb_frag_t *frag; 1627 1629 dma_addr_t dma; 1628 1630 1629 1631 td_tag = off->td_l2tag1; ··· 1736 1738 ice_maybe_stop_tx(tx_ring, DESC_NEEDED); 1737 1739 1738 1740 /* notify HW of packet */ 1739 - if (netif_xmit_stopped(txring_txq(tx_ring)) || !netdev_xmit_more()) { 1741 + if (netif_xmit_stopped(txring_txq(tx_ring)) || !netdev_xmit_more()) 1740 1742 writel(i, tx_ring->tail); 1741 - } 1742 1743 1743 1744 return; 1744 1745 ··· 2075 2078 frag = &skb_shinfo(skb)->frags[0]; 2076 2079 2077 2080 /* Initialize size to the negative value of gso_size minus 1. We 2078 - * use this as the worst case scenerio in which the frag ahead 2081 + * use this as the worst case scenario in which the frag ahead 2079 2082 * of us only provides one byte which is why we are limited to 6 2080 2083 * descriptors for a single transmit as the header and previous 2081 2084 * fragment are already consuming 2 descriptors.
+2 -2
drivers/net/ethernet/intel/ice/ice_txrx.h
··· 33 33 * frame. 34 34 * 35 35 * Note: For cache line sizes 256 or larger this value is going to end 36 - * up negative. In these cases we should fall back to the legacy 37 - * receive path. 36 + * up negative. In these cases we should fall back to the legacy 37 + * receive path. 38 38 */ 39 39 #if (PAGE_SIZE < 8192) 40 40 #define ICE_2K_TOO_SMALL_WITH_PADDING \
+1 -1
drivers/net/ethernet/intel/ice/ice_txrx_lib.c
··· 10 10 */ 11 11 void ice_release_rx_desc(struct ice_ring *rx_ring, u32 val) 12 12 { 13 - u16 prev_ntu = rx_ring->next_to_use; 13 + u16 prev_ntu = rx_ring->next_to_use & ~0x7; 14 14 15 15 rx_ring->next_to_use = val; 16 16
+1 -1
drivers/net/ethernet/intel/ice/ice_type.h
··· 517 517 struct ice_fw_log_cfg fw_log; 518 518 519 519 /* Device max aggregate bandwidths corresponding to the GL_PWR_MODE_CTL 520 - * register. Used for determining the ITR/intrl granularity during 520 + * register. Used for determining the ITR/INTRL granularity during 521 521 * initialization. 522 522 */ 523 523 #define ICE_MAX_AGG_BW_200G 0x0
+23 -44
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
··· 199 199 if (vsi->rx_mapping_mode == ICE_VSI_MAP_CONTIG) 200 200 wr32(hw, VPLAN_RX_QBASE(vf->vf_id), 0); 201 201 else 202 - dev_err(dev, 203 - "Scattered mode for VF Rx queues is not yet implemented\n"); 202 + dev_err(dev, "Scattered mode for VF Rx queues is not yet implemented\n"); 204 203 } 205 204 206 205 /** ··· 401 402 if ((reg & VF_TRANS_PENDING_M) == 0) 402 403 break; 403 404 404 - dev_err(dev, 405 - "VF %d PCI transactions stuck\n", vf->vf_id); 405 + dev_err(dev, "VF %d PCI transactions stuck\n", vf->vf_id); 406 406 udelay(ICE_PCI_CIAD_WAIT_DELAY_US); 407 407 } 408 408 } ··· 460 462 461 463 status = ice_update_vsi(hw, vsi->idx, ctxt, NULL); 462 464 if (status) { 463 - dev_info(&vsi->back->pdev->dev, "update VSI for port VLAN failed, err %d aq_err %d\n", 465 + dev_info(ice_pf_to_dev(vsi->back), "update VSI for port VLAN failed, err %d aq_err %d\n", 464 466 status, hw->adminq.sq_last_status); 465 467 ret = -EIO; 466 468 goto out; ··· 1093 1095 * finished resetting. 1094 1096 */ 1095 1097 for (i = 0, v = 0; i < 10 && v < pf->num_alloc_vfs; i++) { 1096 - 1097 1098 /* Check each VF in sequence */ 1098 1099 while (v < pf->num_alloc_vfs) { 1099 1100 u32 reg; ··· 1550 1553 dev_info(dev, "VF %d failed opcode %d, retval: %d\n", vf->vf_id, 1551 1554 v_opcode, v_retval); 1552 1555 if (vf->num_inval_msgs > ICE_DFLT_NUM_INVAL_MSGS_ALLOWED) { 1553 - dev_err(dev, 1554 - "Number of invalid messages exceeded for VF %d\n", 1556 + dev_err(dev, "Number of invalid messages exceeded for VF %d\n", 1555 1557 vf->vf_id); 1556 1558 dev_err(dev, "Use PF Control I/F to enable the VF\n"); 1557 1559 set_bit(ICE_VF_STATE_DIS, vf->vf_states); ··· 1565 1569 aq_ret = ice_aq_send_msg_to_vf(&pf->hw, vf->vf_id, v_opcode, v_retval, 1566 1570 msg, msglen, NULL); 1567 1571 if (aq_ret && pf->hw.mailboxq.sq_last_status != ICE_AQ_RC_ENOSYS) { 1568 - dev_info(dev, 1569 - "Unable to send the message to VF %d ret %d aq_err %d\n", 1572 + dev_info(dev, "Unable to send the message to VF %d ret %d aq_err %d\n", 1570 1573 vf->vf_id, aq_ret, pf->hw.mailboxq.sq_last_status); 1571 1574 return -EIO; 1572 1575 } ··· 1909 1914 } 1910 1915 1911 1916 if (vf_vsi->type != ICE_VSI_VF) { 1912 - netdev_err(netdev, 1913 - "Type %d of VSI %d for VF %d is no ICE_VSI_VF\n", 1917 + netdev_err(netdev, "Type %d of VSI %d for VF %d is no ICE_VSI_VF\n", 1914 1918 vf_vsi->type, vf_vsi->vsi_num, vf->vf_id); 1915 1919 return -ENODEV; 1916 1920 } ··· 1939 1945 1940 1946 status = ice_update_vsi(&pf->hw, vf_vsi->idx, ctx, NULL); 1941 1947 if (status) { 1942 - dev_err(dev, 1943 - "Failed to %sable spoofchk on VF %d VSI %d\n error %d", 1948 + dev_err(dev, "Failed to %sable spoofchk on VF %d VSI %d\n error %d", 1944 1949 ena ? "en" : "dis", vf->vf_id, vf_vsi->vsi_num, status); 1945 1950 ret = -EIO; 1946 1951 goto out; ··· 2056 2063 continue; 2057 2064 2058 2065 if (ice_vsi_ctrl_rx_ring(vsi, true, vf_q_id)) { 2059 - dev_err(&vsi->back->pdev->dev, 2060 - "Failed to enable Rx ring %d on VSI %d\n", 2066 + dev_err(ice_pf_to_dev(vsi->back), "Failed to enable Rx ring %d on VSI %d\n", 2061 2067 vf_q_id, vsi->vsi_num); 2062 2068 v_ret = VIRTCHNL_STATUS_ERR_PARAM; 2063 2069 goto error_param; ··· 2158 2166 2159 2167 if (ice_vsi_stop_tx_ring(vsi, ICE_NO_RESET, vf->vf_id, 2160 2168 ring, &txq_meta)) { 2161 - dev_err(&vsi->back->pdev->dev, 2162 - "Failed to stop Tx ring %d on VSI %d\n", 2169 + dev_err(ice_pf_to_dev(vsi->back), "Failed to stop Tx ring %d on VSI %d\n", 2163 2170 vf_q_id, vsi->vsi_num); 2164 2171 v_ret = VIRTCHNL_STATUS_ERR_PARAM; 2165 2172 goto error_param; ··· 2184 2193 continue; 2185 2194 2186 2195 if (ice_vsi_ctrl_rx_ring(vsi, false, vf_q_id)) { 2187 - dev_err(&vsi->back->pdev->dev, 2188 - "Failed to stop Rx ring %d on VSI %d\n", 2196 + dev_err(ice_pf_to_dev(vsi->back), "Failed to stop Rx ring %d on VSI %d\n", 2189 2197 vf_q_id, vsi->vsi_num); 2190 2198 v_ret = VIRTCHNL_STATUS_ERR_PARAM; 2191 2199 goto error_param; ··· 2347 2357 2348 2358 if (qci->num_queue_pairs > ICE_MAX_BASE_QS_PER_VF || 2349 2359 qci->num_queue_pairs > min_t(u16, vsi->alloc_txq, vsi->alloc_rxq)) { 2350 - dev_err(ice_pf_to_dev(pf), 2351 - "VF-%d requesting more than supported number of queues: %d\n", 2360 + dev_err(ice_pf_to_dev(pf), "VF-%d requesting more than supported number of queues: %d\n", 2352 2361 vf->vf_id, min_t(u16, vsi->alloc_txq, vsi->alloc_rxq)); 2353 2362 v_ret = VIRTCHNL_STATUS_ERR_PARAM; 2354 2363 goto error_param; ··· 2559 2570 */ 2560 2571 if (set && !ice_is_vf_trusted(vf) && 2561 2572 (vf->num_mac + al->num_elements) > ICE_MAX_MACADDR_PER_VF) { 2562 - dev_err(ice_pf_to_dev(pf), 2563 - "Can't add more MAC addresses, because VF-%d is not trusted, switch the VF to trusted mode in order to add more functionalities\n", 2573 + dev_err(ice_pf_to_dev(pf), "Can't add more MAC addresses, because VF-%d is not trusted, switch the VF to trusted mode in order to add more functionalities\n", 2564 2574 vf->vf_id); 2565 2575 v_ret = VIRTCHNL_STATUS_ERR_PARAM; 2566 2576 goto handle_mac_exit; ··· 2636 2648 struct ice_pf *pf = vf->pf; 2637 2649 u16 max_allowed_vf_queues; 2638 2650 u16 tx_rx_queue_left; 2639 - u16 cur_queues; 2640 2651 struct device *dev; 2652 + u16 cur_queues; 2641 2653 2642 2654 dev = ice_pf_to_dev(pf); 2643 2655 if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { ··· 2658 2670 vfres->num_queue_pairs = ICE_MAX_BASE_QS_PER_VF; 2659 2671 } else if (req_queues > cur_queues && 2660 2672 req_queues - cur_queues > tx_rx_queue_left) { 2661 - dev_warn(dev, 2662 - "VF %d requested %u more queues, but only %u left.\n", 2673 + dev_warn(dev, "VF %d requested %u more queues, but only %u left.\n", 2663 2674 vf->vf_id, req_queues - cur_queues, tx_rx_queue_left); 2664 2675 vfres->num_queue_pairs = min_t(u16, max_allowed_vf_queues, 2665 2676 ICE_MAX_BASE_QS_PER_VF); ··· 2808 2821 for (i = 0; i < vfl->num_elements; i++) { 2809 2822 if (vfl->vlan_id[i] > ICE_MAX_VLANID) { 2810 2823 v_ret = VIRTCHNL_STATUS_ERR_PARAM; 2811 - dev_err(dev, 2812 - "invalid VF VLAN id %d\n", vfl->vlan_id[i]); 2824 + dev_err(dev, "invalid VF VLAN id %d\n", 2825 + vfl->vlan_id[i]); 2813 2826 goto error_param; 2814 2827 } 2815 2828 } ··· 2823 2836 2824 2837 if (add_v && !ice_is_vf_trusted(vf) && 2825 2838 vsi->num_vlan >= ICE_MAX_VLAN_PER_VF) { 2826 - dev_info(dev, 2827 - "VF-%d is not trusted, switch the VF to trusted mode, in order to add more VLAN addresses\n", 2839 + dev_info(dev, "VF-%d is not trusted, switch the VF to trusted mode, in order to add more VLAN addresses\n", 2828 2840 vf->vf_id); 2829 2841 /* There is no need to let VF know about being not trusted, 2830 2842 * so we can just return success message here ··· 2846 2860 2847 2861 if (!ice_is_vf_trusted(vf) && 2848 2862 vsi->num_vlan >= ICE_MAX_VLAN_PER_VF) { 2849 - dev_info(dev, 2850 - "VF-%d is not trusted, switch the VF to trusted mode, in order to add more VLAN addresses\n", 2863 + dev_info(dev, "VF-%d is not trusted, switch the VF to trusted mode, in order to add more VLAN addresses\n", 2851 2864 vf->vf_id); 2852 2865 /* There is no need to let VF know about being 2853 2866 * not trusted, so we can just return success ··· 2874 2889 status = ice_cfg_vlan_pruning(vsi, true, false); 2875 2890 if (status) { 2876 2891 v_ret = VIRTCHNL_STATUS_ERR_PARAM; 2877 - dev_err(dev, 2878 - "Enable VLAN pruning on VLAN ID: %d failed error-%d\n", 2892 + dev_err(dev, "Enable VLAN pruning on VLAN ID: %d failed error-%d\n", 2879 2893 vid, status); 2880 2894 goto error_param; 2881 2895 } ··· 2887 2903 promisc_m, vid); 2888 2904 if (status) { 2889 2905 v_ret = VIRTCHNL_STATUS_ERR_PARAM; 2890 - dev_err(dev, 2891 - "Enable Unicast/multicast promiscuous mode on VLAN ID:%d failed error-%d\n", 2906 + dev_err(dev, "Enable Unicast/multicast promiscuous mode on VLAN ID:%d failed error-%d\n", 2892 2907 vid, status); 2893 2908 } 2894 2909 } ··· 3123 3140 case VIRTCHNL_OP_GET_VF_RESOURCES: 3124 3141 err = ice_vc_get_vf_res_msg(vf, msg); 3125 3142 if (ice_vf_init_vlan_stripping(vf)) 3126 - dev_err(dev, 3127 - "Failed to initialize VLAN stripping for VF %d\n", 3143 + dev_err(dev, "Failed to initialize VLAN stripping for VF %d\n", 3128 3144 vf->vf_id); 3129 3145 ice_vc_notify_vf_link_state(vf); 3130 3146 break; ··· 3295 3313 */ 3296 3314 ether_addr_copy(vf->dflt_lan_addr.addr, mac); 3297 3315 vf->pf_set_mac = true; 3298 - netdev_info(netdev, 3299 - "MAC on VF %d set to %pM. VF driver will be reinitialized\n", 3316 + netdev_info(netdev, "MAC on VF %d set to %pM. VF driver will be reinitialized\n", 3300 3317 vf_id, mac); 3301 3318 3302 3319 ice_vc_reset_vf(vf); ··· 3313 3332 int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted) 3314 3333 { 3315 3334 struct ice_pf *pf = ice_netdev_to_pf(netdev); 3316 - struct device *dev; 3317 3335 struct ice_vf *vf; 3318 3336 3319 - dev = ice_pf_to_dev(pf); 3320 3337 if (ice_validate_vf_id(pf, vf_id)) 3321 3338 return -EINVAL; 3322 3339 ··· 3337 3358 3338 3359 vf->trusted = trusted; 3339 3360 ice_vc_reset_vf(vf); 3340 - dev_info(dev, "VF %u is now %strusted\n", 3361 + dev_info(ice_pf_to_dev(pf), "VF %u is now %strusted\n", 3341 3362 vf_id, trusted ? "" : "un"); 3342 3363 3343 3364 return 0;
+2 -2
drivers/net/ethernet/intel/ice/ice_xsk.c
··· 338 338 DMA_BIDIRECTIONAL, 339 339 ICE_RX_DMA_ATTR); 340 340 if (dma_mapping_error(dev, dma)) { 341 - dev_dbg(dev, 342 - "XSK UMEM DMA mapping error on page num %d", i); 341 + dev_dbg(dev, "XSK UMEM DMA mapping error on page num %d\n", 342 + i); 343 343 goto out_unmap; 344 344 } 345 345
+9
drivers/net/ethernet/socionext/sni_ave.c
··· 1810 1810 break; 1811 1811 case PHY_INTERFACE_MODE_MII: 1812 1812 case PHY_INTERFACE_MODE_RGMII: 1813 + case PHY_INTERFACE_MODE_RGMII_ID: 1814 + case PHY_INTERFACE_MODE_RGMII_RXID: 1815 + case PHY_INTERFACE_MODE_RGMII_TXID: 1813 1816 priv->pinmode_val = 0; 1814 1817 break; 1815 1818 default: ··· 1857 1854 priv->pinmode_val = SG_ETPINMODE_RMII(0); 1858 1855 break; 1859 1856 case PHY_INTERFACE_MODE_RGMII: 1857 + case PHY_INTERFACE_MODE_RGMII_ID: 1858 + case PHY_INTERFACE_MODE_RGMII_RXID: 1859 + case PHY_INTERFACE_MODE_RGMII_TXID: 1860 1860 priv->pinmode_val = 0; 1861 1861 break; 1862 1862 default: ··· 1882 1876 priv->pinmode_val = SG_ETPINMODE_RMII(arg); 1883 1877 break; 1884 1878 case PHY_INTERFACE_MODE_RGMII: 1879 + case PHY_INTERFACE_MODE_RGMII_ID: 1880 + case PHY_INTERFACE_MODE_RGMII_RXID: 1881 + case PHY_INTERFACE_MODE_RGMII_TXID: 1885 1882 priv->pinmode_val = 0; 1886 1883 break; 1887 1884 default:
+4 -19
drivers/net/ethernet/sun/sunvnet_common.c
··· 1350 1350 if (vio_version_after_eq(&port->vio, 1, 3)) 1351 1351 localmtu -= VLAN_HLEN; 1352 1352 1353 - if (skb->protocol == htons(ETH_P_IP)) { 1354 - struct flowi4 fl4; 1355 - struct rtable *rt = NULL; 1356 - 1357 - memset(&fl4, 0, sizeof(fl4)); 1358 - fl4.flowi4_oif = dev->ifindex; 1359 - fl4.flowi4_tos = RT_TOS(ip_hdr(skb)->tos); 1360 - fl4.daddr = ip_hdr(skb)->daddr; 1361 - fl4.saddr = ip_hdr(skb)->saddr; 1362 - 1363 - rt = ip_route_output_key(dev_net(dev), &fl4); 1364 - if (!IS_ERR(rt)) { 1365 - skb_dst_set(skb, &rt->dst); 1366 - icmp_send(skb, ICMP_DEST_UNREACH, 1367 - ICMP_FRAG_NEEDED, 1368 - htonl(localmtu)); 1369 - } 1370 - } 1353 + if (skb->protocol == htons(ETH_P_IP)) 1354 + icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, 1355 + htonl(localmtu)); 1371 1356 #if IS_ENABLED(CONFIG_IPV6) 1372 1357 else if (skb->protocol == htons(ETH_P_IPV6)) 1373 - icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, localmtu); 1358 + icmpv6_ndo_send(skb, ICMPV6_PKT_TOOBIG, 0, localmtu); 1374 1359 #endif 1375 1360 goto out_dropped; 1376 1361 }
+2 -2
drivers/net/gtp.c
··· 546 546 mtu < ntohs(iph->tot_len)) { 547 547 netdev_dbg(dev, "packet too big, fragmentation needed\n"); 548 548 memset(IPCB(skb), 0, sizeof(*IPCB(skb))); 549 - icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, 550 - htonl(mtu)); 549 + icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, 550 + htonl(mtu)); 551 551 goto err_rt; 552 552 } 553 553
+16 -27
drivers/net/usb/qmi_wwan.c
··· 61 61 62 62 enum qmi_wwan_quirks { 63 63 QMI_WWAN_QUIRK_DTR = 1 << 0, /* needs "set DTR" request */ 64 - QMI_WWAN_QUIRK_QUECTEL_DYNCFG = 1 << 1, /* check num. endpoints */ 65 64 }; 66 65 67 66 struct qmimux_hdr { ··· 915 916 .data = QMI_WWAN_QUIRK_DTR, 916 917 }; 917 918 918 - static const struct driver_info qmi_wwan_info_quirk_quectel_dyncfg = { 919 - .description = "WWAN/QMI device", 920 - .flags = FLAG_WWAN | FLAG_SEND_ZLP, 921 - .bind = qmi_wwan_bind, 922 - .unbind = qmi_wwan_unbind, 923 - .manage_power = qmi_wwan_manage_power, 924 - .rx_fixup = qmi_wwan_rx_fixup, 925 - .data = QMI_WWAN_QUIRK_DTR | QMI_WWAN_QUIRK_QUECTEL_DYNCFG, 926 - }; 927 - 928 919 #define HUAWEI_VENDOR_ID 0x12D1 929 920 930 921 /* map QMI/wwan function by a fixed interface number */ ··· 935 946 #define QMI_GOBI_DEVICE(vend, prod) \ 936 947 QMI_FIXED_INTF(vend, prod, 0) 937 948 938 - /* Quectel does not use fixed interface numbers on at least some of their 939 - * devices. We need to check the number of endpoints to ensure that we bind to 940 - * the correct interface. 949 + /* Many devices have QMI and DIAG functions which are distinguishable 950 + * from other vendor specific functions by class, subclass and 951 + * protocol all being 0xff. The DIAG function has exactly 2 endpoints 952 + * and is silently rejected when probed. 953 + * 954 + * This makes it possible to match dynamically numbered QMI functions 955 + * as seen on e.g. many Quectel modems. 941 956 */ 942 - #define QMI_QUIRK_QUECTEL_DYNCFG(vend, prod) \ 957 + #define QMI_MATCH_FF_FF_FF(vend, prod) \ 943 958 USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_VENDOR_SPEC, \ 944 959 USB_SUBCLASS_VENDOR_SPEC, 0xff), \ 945 - .driver_info = (unsigned long)&qmi_wwan_info_quirk_quectel_dyncfg 960 + .driver_info = (unsigned long)&qmi_wwan_info_quirk_dtr 946 961 947 962 static const struct usb_device_id products[] = { 948 963 /* 1. CDC ECM like devices match on the control interface */ ··· 1052 1059 USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7), 1053 1060 .driver_info = (unsigned long)&qmi_wwan_info, 1054 1061 }, 1055 - {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ 1056 - {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */ 1057 - {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ 1058 - {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */ 1062 + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ 1063 + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */ 1064 + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ 1065 + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */ 1059 1066 1060 1067 /* 3. Combined interface devices matching on interface number */ 1061 1068 {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */ ··· 1356 1363 {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */ 1357 1364 {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */ 1358 1365 {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */ 1366 + {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */ 1359 1367 {QMI_FIXED_INTF(0x413c, 0x81e0, 0)}, /* Dell Wireless 5821e with eSIM support*/ 1360 1368 {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */ 1361 1369 {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */ ··· 1448 1454 { 1449 1455 struct usb_device_id *id = (struct usb_device_id *)prod; 1450 1456 struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc; 1451 - const struct driver_info *info; 1452 1457 1453 1458 /* Workaround to enable dynamic IDs. This disables usbnet 1454 1459 * blacklisting functionality. Which, if required, can be ··· 1483 1490 * different. Ignore the current interface if the number of endpoints 1484 1491 * equals the number for the diag interface (two). 1485 1492 */ 1486 - info = (void *)id->driver_info; 1487 - 1488 - if (info->data & QMI_WWAN_QUIRK_QUECTEL_DYNCFG) { 1489 - if (desc->bNumEndpoints == 2) 1490 - return -ENODEV; 1491 - } 1493 + if (desc->bNumEndpoints == 2) 1494 + return -ENODEV; 1492 1495 1493 1496 return usbnet_probe(intf, id); 1494 1497 }
+2 -2
drivers/net/wireguard/device.c
··· 203 203 err: 204 204 ++dev->stats.tx_errors; 205 205 if (skb->protocol == htons(ETH_P_IP)) 206 - icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0); 206 + icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0); 207 207 else if (skb->protocol == htons(ETH_P_IPV6)) 208 - icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0); 208 + icmpv6_ndo_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0); 209 209 kfree_skb(skb); 210 210 return ret; 211 211 }
+6
include/linux/icmpv6.h
··· 31 31 } 32 32 #endif 33 33 34 + #if IS_ENABLED(CONFIG_NF_NAT) 35 + void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info); 36 + #else 37 + #define icmpv6_ndo_send icmpv6_send 38 + #endif 39 + 34 40 extern int icmpv6_init(void); 35 41 extern int icmpv6_err_convert(u8 type, u8 code, 36 42 int *err);
+15 -1
include/linux/netdevice.h
··· 1616 1616 * and drivers will need to set them appropriately. 1617 1617 * 1618 1618 * @mpls_features: Mask of features inheritable by MPLS 1619 + * @gso_partial_features: value(s) from NETIF_F_GSO\* 1619 1620 * 1620 1621 * @ifindex: interface index 1621 1622 * @group: The group the device belongs to ··· 1641 1640 * @netdev_ops: Includes several pointers to callbacks, 1642 1641 * if one wants to override the ndo_*() functions 1643 1642 * @ethtool_ops: Management operations 1643 + * @l3mdev_ops: Layer 3 master device operations 1644 1644 * @ndisc_ops: Includes callbacks for different IPv6 neighbour 1645 1645 * discovery handling. Necessary for e.g. 6LoWPAN. 1646 + * @xfrmdev_ops: Transformation offload operations 1647 + * @tlsdev_ops: Transport Layer Security offload operations 1646 1648 * @header_ops: Includes callbacks for creating,parsing,caching,etc 1647 1649 * of Layer 2 headers. 1648 1650 * ··· 1684 1680 * @dev_port: Used to differentiate devices that share 1685 1681 * the same function 1686 1682 * @addr_list_lock: XXX: need comments on this one 1683 + * @name_assign_type: network interface name assignment type 1687 1684 * @uc_promisc: Counter that indicates promiscuous mode 1688 1685 * has been enabled due to the need to listen to 1689 1686 * additional unicast addresses in a device that ··· 1707 1702 * @ip6_ptr: IPv6 specific data 1708 1703 * @ax25_ptr: AX.25 specific data 1709 1704 * @ieee80211_ptr: IEEE 802.11 specific data, assign before registering 1705 + * @ieee802154_ptr: IEEE 802.15.4 low-rate Wireless Personal Area Network 1706 + * device struct 1707 + * @mpls_ptr: mpls_dev struct pointer 1710 1708 * 1711 1709 * @dev_addr: Hw address (before bcast, 1712 1710 * because most packets are unicast) ··· 1718 1710 * @num_rx_queues: Number of RX queues 1719 1711 * allocated at register_netdev() time 1720 1712 * @real_num_rx_queues: Number of RX queues currently active in device 1713 + * @xdp_prog: XDP sockets filter program pointer 1714 + * @gro_flush_timeout: timeout for GRO layer in NAPI 1721 1715 * 1722 1716 * @rx_handler: handler for received packets 1723 1717 * @rx_handler_data: XXX: need comments on this one ··· 1741 1731 * @qdisc: Root qdisc from userspace point of view 1742 1732 * @tx_queue_len: Max frames per queue allowed 1743 1733 * @tx_global_lock: XXX: need comments on this one 1734 + * @xdp_bulkq: XDP device bulk queue 1735 + * @xps_cpus_map: all CPUs map for XPS device 1736 + * @xps_rxqs_map: all RXQs map for XPS device 1744 1737 * 1745 1738 * @xps_maps: XXX: need comments on this one 1746 1739 * @miniq_egress: clsact qdisc specific data for 1747 1740 * egress processing 1741 + * @qdisc_hash: qdisc hash table 1748 1742 * @watchdog_timeo: Represents the timeout that is used by 1749 1743 * the watchdog (see dev_watchdog()) 1750 1744 * @watchdog_timer: List of timers ··· 3562 3548 } 3563 3549 3564 3550 /** 3565 - * netif_attrmask_next_and - get the next CPU/Rx queue in *src1p & *src2p 3551 + * netif_attrmask_next_and - get the next CPU/Rx queue in \*src1p & \*src2p 3566 3552 * @n: CPU/Rx queue index 3567 3553 * @src1p: the first CPUs/Rx queues mask pointer 3568 3554 * @src2p: the second CPUs/Rx queues mask pointer
-1
include/net/flow_dissector.h
··· 33 33 34 34 /** 35 35 * struct flow_dissector_key_basic: 36 - * @thoff: Transport header offset 37 36 * @n_proto: Network header protocol (eg. IPv4/IPv6) 38 37 * @ip_proto: Transport header protocol (eg. TCP/UDP) 39 38 */
+6
include/net/icmp.h
··· 43 43 __icmp_send(skb_in, type, code, info, &IPCB(skb_in)->opt); 44 44 } 45 45 46 + #if IS_ENABLED(CONFIG_NF_NAT) 47 + void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info); 48 + #else 49 + #define icmp_ndo_send icmp_send 50 + #endif 51 + 46 52 int icmp_rcv(struct sk_buff *skb); 47 53 int icmp_err(struct sk_buff *skb, u32 info); 48 54 int icmp_init(void);
+5 -6
include/net/mac80211.h
··· 1004 1004 struct ieee80211_tx_info { 1005 1005 /* common information */ 1006 1006 u32 flags; 1007 - u8 band; 1008 - 1009 - u8 hw_queue; 1010 - 1011 - u16 ack_frame_id:6; 1012 - u16 tx_time_est:10; 1007 + u32 band:3, 1008 + ack_frame_id:13, 1009 + hw_queue:4, 1010 + tx_time_est:10; 1011 + /* 2 free bits */ 1013 1012 1014 1013 union { 1015 1014 struct {
+2 -2
net/core/dev.c
··· 4527 4527 /* Reinjected packets coming from act_mirred or similar should 4528 4528 * not get XDP generic processing. 4529 4529 */ 4530 - if (skb_cloned(skb) || skb_is_tc_redirected(skb)) 4530 + if (skb_is_tc_redirected(skb)) 4531 4531 return XDP_PASS; 4532 4532 4533 4533 /* XDP packets must be linear and must have sufficient headroom 4534 4534 * of XDP_PACKET_HEADROOM bytes. This is the guarantee that also 4535 4535 * native XDP provides, thus we need to do it here as well. 4536 4536 */ 4537 - if (skb_is_nonlinear(skb) || 4537 + if (skb_cloned(skb) || skb_is_nonlinear(skb) || 4538 4538 skb_headroom(skb) < XDP_PACKET_HEADROOM) { 4539 4539 int hroom = XDP_PACKET_HEADROOM - skb_headroom(skb); 4540 4540 int troom = skb->tail + skb->data_len - skb->end;
+8 -14
net/core/page_pool.c
··· 99 99 static void __page_pool_return_page(struct page_pool *pool, struct page *page); 100 100 101 101 noinline 102 - static struct page *page_pool_refill_alloc_cache(struct page_pool *pool, 103 - bool refill) 102 + static struct page *page_pool_refill_alloc_cache(struct page_pool *pool) 104 103 { 105 104 struct ptr_ring *r = &pool->ring; 106 105 struct page *page; ··· 140 141 page = NULL; 141 142 break; 142 143 } 143 - } while (pool->alloc.count < PP_ALLOC_CACHE_REFILL && 144 - refill); 144 + } while (pool->alloc.count < PP_ALLOC_CACHE_REFILL); 145 145 146 146 /* Return last page */ 147 147 if (likely(pool->alloc.count > 0)) ··· 153 155 /* fast path */ 154 156 static struct page *__page_pool_get_cached(struct page_pool *pool) 155 157 { 156 - bool refill = false; 157 158 struct page *page; 158 159 159 - /* Test for safe-context, caller should provide this guarantee */ 160 - if (likely(in_serving_softirq())) { 161 - if (likely(pool->alloc.count)) { 162 - /* Fast-path */ 163 - page = pool->alloc.cache[--pool->alloc.count]; 164 - return page; 165 - } 166 - refill = true; 160 + /* Caller MUST guarantee safe non-concurrent access, e.g. softirq */ 161 + if (likely(pool->alloc.count)) { 162 + /* Fast-path */ 163 + page = pool->alloc.cache[--pool->alloc.count]; 164 + } else { 165 + page = page_pool_refill_alloc_cache(pool); 167 166 } 168 167 169 - page = page_pool_refill_alloc_cache(pool, refill); 170 168 return page; 171 169 } 172 170
+1 -1
net/dsa/tag_ar9331.c
··· 31 31 __le16 *phdr; 32 32 u16 hdr; 33 33 34 - if (skb_cow_head(skb, 0) < 0) 34 + if (skb_cow_head(skb, AR9331_HDR_LEN) < 0) 35 35 return NULL; 36 36 37 37 phdr = skb_push(skb, AR9331_HDR_LEN);
+1 -1
net/dsa/tag_qca.c
··· 33 33 struct dsa_port *dp = dsa_slave_to_port(dev); 34 34 u16 *phdr, hdr; 35 35 36 - if (skb_cow_head(skb, 0) < 0) 36 + if (skb_cow_head(skb, QCA_HDR_LEN) < 0) 37 37 return NULL; 38 38 39 39 skb_push(skb, QCA_HDR_LEN);
+33
net/ipv4/icmp.c
··· 748 748 } 749 749 EXPORT_SYMBOL(__icmp_send); 750 750 751 + #if IS_ENABLED(CONFIG_NF_NAT) 752 + #include <net/netfilter/nf_conntrack.h> 753 + void icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info) 754 + { 755 + struct sk_buff *cloned_skb = NULL; 756 + enum ip_conntrack_info ctinfo; 757 + struct nf_conn *ct; 758 + __be32 orig_ip; 759 + 760 + ct = nf_ct_get(skb_in, &ctinfo); 761 + if (!ct || !(ct->status & IPS_SRC_NAT)) { 762 + icmp_send(skb_in, type, code, info); 763 + return; 764 + } 765 + 766 + if (skb_shared(skb_in)) 767 + skb_in = cloned_skb = skb_clone(skb_in, GFP_ATOMIC); 768 + 769 + if (unlikely(!skb_in || skb_network_header(skb_in) < skb_in->head || 770 + (skb_network_header(skb_in) + sizeof(struct iphdr)) > 771 + skb_tail_pointer(skb_in) || skb_ensure_writable(skb_in, 772 + skb_network_offset(skb_in) + sizeof(struct iphdr)))) 773 + goto out; 774 + 775 + orig_ip = ip_hdr(skb_in)->saddr; 776 + ip_hdr(skb_in)->saddr = ct->tuplehash[0].tuple.src.u3.ip; 777 + icmp_send(skb_in, type, code, info); 778 + ip_hdr(skb_in)->saddr = orig_ip; 779 + out: 780 + consume_skb(cloned_skb); 781 + } 782 + EXPORT_SYMBOL(icmp_ndo_send); 783 + #endif 751 784 752 785 static void icmp_socket_deliver(struct sk_buff *skb, u32 info) 753 786 {
+34
net/ipv6/ip6_icmp.c
··· 45 45 rcu_read_unlock(); 46 46 } 47 47 EXPORT_SYMBOL(icmpv6_send); 48 + 49 + #if IS_ENABLED(CONFIG_NF_NAT) 50 + #include <net/netfilter/nf_conntrack.h> 51 + void icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8 code, __u32 info) 52 + { 53 + struct sk_buff *cloned_skb = NULL; 54 + enum ip_conntrack_info ctinfo; 55 + struct in6_addr orig_ip; 56 + struct nf_conn *ct; 57 + 58 + ct = nf_ct_get(skb_in, &ctinfo); 59 + if (!ct || !(ct->status & IPS_SRC_NAT)) { 60 + icmpv6_send(skb_in, type, code, info); 61 + return; 62 + } 63 + 64 + if (skb_shared(skb_in)) 65 + skb_in = cloned_skb = skb_clone(skb_in, GFP_ATOMIC); 66 + 67 + if (unlikely(!skb_in || skb_network_header(skb_in) < skb_in->head || 68 + (skb_network_header(skb_in) + sizeof(struct ipv6hdr)) > 69 + skb_tail_pointer(skb_in) || skb_ensure_writable(skb_in, 70 + skb_network_offset(skb_in) + sizeof(struct ipv6hdr)))) 71 + goto out; 72 + 73 + orig_ip = ipv6_hdr(skb_in)->saddr; 74 + ipv6_hdr(skb_in)->saddr = ct->tuplehash[0].tuple.src.u3.in6; 75 + icmpv6_send(skb_in, type, code, info); 76 + ipv6_hdr(skb_in)->saddr = orig_ip; 77 + out: 78 + consume_skb(cloned_skb); 79 + } 80 + EXPORT_SYMBOL(icmpv6_ndo_send); 81 + #endif 48 82 #endif
+47 -21
net/ipv6/ip6_tunnel.c
··· 121 121 122 122 /** 123 123 * ip6_tnl_lookup - fetch tunnel matching the end-point addresses 124 + * @link: ifindex of underlying interface 124 125 * @remote: the address of the tunnel exit-point 125 126 * @local: the address of the tunnel entry-point 126 127 * ··· 135 134 for (t = rcu_dereference(start); t; t = rcu_dereference(t->next)) 136 135 137 136 static struct ip6_tnl * 138 - ip6_tnl_lookup(struct net *net, const struct in6_addr *remote, const struct in6_addr *local) 137 + ip6_tnl_lookup(struct net *net, int link, 138 + const struct in6_addr *remote, const struct in6_addr *local) 139 139 { 140 140 unsigned int hash = HASH(remote, local); 141 - struct ip6_tnl *t; 141 + struct ip6_tnl *t, *cand = NULL; 142 142 struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); 143 143 struct in6_addr any; 144 144 145 145 for_each_ip6_tunnel_rcu(ip6n->tnls_r_l[hash]) { 146 - if (ipv6_addr_equal(local, &t->parms.laddr) && 147 - ipv6_addr_equal(remote, &t->parms.raddr) && 148 - (t->dev->flags & IFF_UP)) 146 + if (!ipv6_addr_equal(local, &t->parms.laddr) || 147 + !ipv6_addr_equal(remote, &t->parms.raddr) || 148 + !(t->dev->flags & IFF_UP)) 149 + continue; 150 + 151 + if (link == t->parms.link) 149 152 return t; 153 + else 154 + cand = t; 150 155 } 151 156 152 157 memset(&any, 0, sizeof(any)); 153 158 hash = HASH(&any, local); 154 159 for_each_ip6_tunnel_rcu(ip6n->tnls_r_l[hash]) { 155 - if (ipv6_addr_equal(local, &t->parms.laddr) && 156 - ipv6_addr_any(&t->parms.raddr) && 157 - (t->dev->flags & IFF_UP)) 160 + if (!ipv6_addr_equal(local, &t->parms.laddr) || 161 + !ipv6_addr_any(&t->parms.raddr) || 162 + !(t->dev->flags & IFF_UP)) 163 + continue; 164 + 165 + if (link == t->parms.link) 158 166 return t; 167 + else if (!cand) 168 + cand = t; 159 169 } 160 170 161 171 hash = HASH(remote, &any); 162 172 for_each_ip6_tunnel_rcu(ip6n->tnls_r_l[hash]) { 163 - if (ipv6_addr_equal(remote, &t->parms.raddr) && 164 - ipv6_addr_any(&t->parms.laddr) && 165 - (t->dev->flags & IFF_UP)) 173 + if (!ipv6_addr_equal(remote, &t->parms.raddr) || 174 + !ipv6_addr_any(&t->parms.laddr) || 175 + !(t->dev->flags & IFF_UP)) 176 + continue; 177 + 178 + if (link == t->parms.link) 166 179 return t; 180 + else if (!cand) 181 + cand = t; 167 182 } 183 + 184 + if (cand) 185 + return cand; 168 186 169 187 t = rcu_dereference(ip6n->collect_md_tun); 170 188 if (t && t->dev->flags & IFF_UP) ··· 371 351 (t = rtnl_dereference(*tp)) != NULL; 372 352 tp = &t->next) { 373 353 if (ipv6_addr_equal(local, &t->parms.laddr) && 374 - ipv6_addr_equal(remote, &t->parms.raddr)) { 354 + ipv6_addr_equal(remote, &t->parms.raddr) && 355 + p->link == t->parms.link) { 375 356 if (create) 376 357 return ERR_PTR(-EEXIST); 377 358 ··· 506 485 processing of the error. */ 507 486 508 487 rcu_read_lock(); 509 - t = ip6_tnl_lookup(dev_net(skb->dev), &ipv6h->daddr, &ipv6h->saddr); 488 + t = ip6_tnl_lookup(dev_net(skb->dev), skb->dev->ifindex, &ipv6h->daddr, &ipv6h->saddr); 510 489 if (!t) 511 490 goto out; 512 491 ··· 908 887 int ret = -1; 909 888 910 889 rcu_read_lock(); 911 - t = ip6_tnl_lookup(dev_net(skb->dev), &ipv6h->saddr, &ipv6h->daddr); 890 + t = ip6_tnl_lookup(dev_net(skb->dev), skb->dev->ifindex, &ipv6h->saddr, &ipv6h->daddr); 912 891 913 892 if (t) { 914 893 u8 tproto = READ_ONCE(t->parms.proto); ··· 1441 1420 static void ip6_tnl_link_config(struct ip6_tnl *t) 1442 1421 { 1443 1422 struct net_device *dev = t->dev; 1423 + struct net_device *tdev = NULL; 1444 1424 struct __ip6_tnl_parm *p = &t->parms; 1445 1425 struct flowi6 *fl6 = &t->fl.u.ip6; 1426 + unsigned int mtu; 1446 1427 int t_hlen; 1447 1428 1448 1429 memcpy(dev->dev_addr, &p->laddr, sizeof(struct in6_addr)); ··· 1480 1457 struct rt6_info *rt = rt6_lookup(t->net, 1481 1458 &p->raddr, &p->laddr, 1482 1459 p->link, NULL, strict); 1460 + if (rt) { 1461 + tdev = rt->dst.dev; 1462 + ip6_rt_put(rt); 1463 + } 1483 1464 1484 - if (!rt) 1485 - return; 1465 + if (!tdev && p->link) 1466 + tdev = __dev_get_by_index(t->net, p->link); 1486 1467 1487 - if (rt->dst.dev) { 1488 - dev->hard_header_len = rt->dst.dev->hard_header_len + 1489 - t_hlen; 1468 + if (tdev) { 1469 + dev->hard_header_len = tdev->hard_header_len + t_hlen; 1470 + mtu = min_t(unsigned int, tdev->mtu, IP6_MAX_MTU); 1490 1471 1491 - dev->mtu = rt->dst.dev->mtu - t_hlen; 1472 + dev->mtu = mtu - t_hlen; 1492 1473 if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) 1493 1474 dev->mtu -= 8; 1494 1475 1495 1476 if (dev->mtu < IPV6_MIN_MTU) 1496 1477 dev->mtu = IPV6_MIN_MTU; 1497 1478 } 1498 - ip6_rt_put(rt); 1499 1479 } 1500 1480 } 1501 1481
+1 -1
net/mac80211/cfg.c
··· 3450 3450 3451 3451 spin_lock_irqsave(&local->ack_status_lock, spin_flags); 3452 3452 id = idr_alloc(&local->ack_status_frames, ack_skb, 3453 - 1, 0x40, GFP_ATOMIC); 3453 + 1, 0x2000, GFP_ATOMIC); 3454 3454 spin_unlock_irqrestore(&local->ack_status_lock, spin_flags); 3455 3455 3456 3456 if (id < 0) {
+4 -4
net/mac80211/mlme.c
··· 8 8 * Copyright 2007, Michael Wu <flamingice@sourmilk.net> 9 9 * Copyright 2013-2014 Intel Mobile Communications GmbH 10 10 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH 11 - * Copyright (C) 2018 - 2019 Intel Corporation 11 + * Copyright (C) 2018 - 2020 Intel Corporation 12 12 */ 13 13 14 14 #include <linux/delay.h> ··· 1311 1311 if (!res) { 1312 1312 ch_switch.timestamp = timestamp; 1313 1313 ch_switch.device_timestamp = device_timestamp; 1314 - ch_switch.block_tx = beacon ? csa_ie.mode : 0; 1314 + ch_switch.block_tx = csa_ie.mode; 1315 1315 ch_switch.chandef = csa_ie.chandef; 1316 1316 ch_switch.count = csa_ie.count; 1317 1317 ch_switch.delay = csa_ie.max_switch_time; ··· 1404 1404 1405 1405 sdata->vif.csa_active = true; 1406 1406 sdata->csa_chandef = csa_ie.chandef; 1407 - sdata->csa_block_tx = ch_switch.block_tx; 1407 + sdata->csa_block_tx = csa_ie.mode; 1408 1408 ifmgd->csa_ignored_same_chan = false; 1409 1409 1410 1410 if (sdata->csa_block_tx) ··· 1438 1438 * reset when the disconnection worker runs. 1439 1439 */ 1440 1440 sdata->vif.csa_active = true; 1441 - sdata->csa_block_tx = ch_switch.block_tx; 1441 + sdata->csa_block_tx = csa_ie.mode; 1442 1442 1443 1443 ieee80211_queue_work(&local->hw, &ifmgd->csa_connection_drop_work); 1444 1444 mutex_unlock(&local->chanctx_mtx);
+1 -1
net/mac80211/tx.c
··· 2442 2442 2443 2443 spin_lock_irqsave(&local->ack_status_lock, flags); 2444 2444 id = idr_alloc(&local->ack_status_frames, ack_skb, 2445 - 1, 0x40, GFP_ATOMIC); 2445 + 1, 0x2000, GFP_ATOMIC); 2446 2446 spin_unlock_irqrestore(&local->ack_status_lock, flags); 2447 2447 2448 2448 if (id >= 0) {
+26 -8
net/mac80211/util.c
··· 1063 1063 elem_parse_failed = true; 1064 1064 break; 1065 1065 case WLAN_EID_VHT_OPERATION: 1066 - if (elen >= sizeof(struct ieee80211_vht_operation)) 1066 + if (elen >= sizeof(struct ieee80211_vht_operation)) { 1067 1067 elems->vht_operation = (void *)pos; 1068 - else 1069 - elem_parse_failed = true; 1068 + if (calc_crc) 1069 + crc = crc32_be(crc, pos - 2, elen + 2); 1070 + break; 1071 + } 1072 + elem_parse_failed = true; 1070 1073 break; 1071 1074 case WLAN_EID_OPMODE_NOTIF: 1072 - if (elen > 0) 1075 + if (elen > 0) { 1073 1076 elems->opmode_notif = pos; 1074 - else 1075 - elem_parse_failed = true; 1077 + if (calc_crc) 1078 + crc = crc32_be(crc, pos - 2, elen + 2); 1079 + break; 1080 + } 1081 + elem_parse_failed = true; 1076 1082 break; 1077 1083 case WLAN_EID_MESH_ID: 1078 1084 elems->mesh_id = pos; ··· 2993 2987 int cf0, cf1; 2994 2988 int ccfs0, ccfs1, ccfs2; 2995 2989 int ccf0, ccf1; 2990 + u32 vht_cap; 2991 + bool support_80_80 = false; 2992 + bool support_160 = false; 2996 2993 2997 2994 if (!oper || !htop) 2998 2995 return false; 2999 2996 2997 + vht_cap = hw->wiphy->bands[chandef->chan->band]->vht_cap.cap; 2998 + support_160 = (vht_cap & (IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK | 2999 + IEEE80211_VHT_CAP_EXT_NSS_BW_MASK)); 3000 + support_80_80 = ((vht_cap & 3001 + IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) || 3002 + (vht_cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ && 3003 + vht_cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) || 3004 + ((vht_cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) >> 3005 + IEEE80211_VHT_CAP_EXT_NSS_BW_SHIFT > 1)); 3000 3006 ccfs0 = oper->center_freq_seg0_idx; 3001 3007 ccfs1 = oper->center_freq_seg1_idx; 3002 3008 ccfs2 = (le16_to_cpu(htop->operation_mode) & ··· 3036 3018 unsigned int diff; 3037 3019 3038 3020 diff = abs(ccf1 - ccf0); 3039 - if (diff == 8) { 3021 + if ((diff == 8) && support_160) { 3040 3022 new.width = NL80211_CHAN_WIDTH_160; 3041 3023 new.center_freq1 = cf1; 3042 - } else if (diff > 8) { 3024 + } else if ((diff > 8) && support_80_80) { 3043 3025 new.width = NL80211_CHAN_WIDTH_80P80; 3044 3026 new.center_freq2 = cf1; 3045 3027 }
+1 -1
net/mptcp/protocol.c
··· 643 643 } 644 644 #endif 645 645 646 - struct sock *mptcp_sk_clone_lock(const struct sock *sk) 646 + static struct sock *mptcp_sk_clone_lock(const struct sock *sk) 647 647 { 648 648 struct sock *nsk = sk_clone_lock(sk, GFP_ATOMIC); 649 649
+1
net/sched/cls_flower.c
··· 691 691 .len = 128 / BITS_PER_BYTE }, 692 692 [TCA_FLOWER_KEY_CT_LABELS_MASK] = { .type = NLA_BINARY, 693 693 .len = 128 / BITS_PER_BYTE }, 694 + [TCA_FLOWER_FLAGS] = { .type = NLA_U32 }, 694 695 }; 695 696 696 697 static const struct nla_policy
+1
net/sched/cls_matchall.c
··· 157 157 static const struct nla_policy mall_policy[TCA_MATCHALL_MAX + 1] = { 158 158 [TCA_MATCHALL_UNSPEC] = { .type = NLA_UNSPEC }, 159 159 [TCA_MATCHALL_CLASSID] = { .type = NLA_U32 }, 160 + [TCA_MATCHALL_FLAGS] = { .type = NLA_U32 }, 160 161 }; 161 162 162 163 static int mall_set_parms(struct net *net, struct tcf_proto *tp,
+2
net/smc/af_smc.c
··· 470 470 if (smc->sk.sk_socket && smc->sk.sk_socket->file) { 471 471 smc->clcsock->file = smc->sk.sk_socket->file; 472 472 smc->clcsock->file->private_data = smc->clcsock; 473 + smc->clcsock->wq.fasync_list = 474 + smc->sk.sk_socket->wq.fasync_list; 473 475 } 474 476 } 475 477
+3 -1
net/smc/smc_clc.c
··· 372 372 dclc.hdr.length = htons(sizeof(struct smc_clc_msg_decline)); 373 373 dclc.hdr.version = SMC_CLC_V1; 374 374 dclc.hdr.flag = (peer_diag_info == SMC_CLC_DECL_SYNCERR) ? 1 : 0; 375 - memcpy(dclc.id_for_peer, local_systemid, sizeof(local_systemid)); 375 + if (smc->conn.lgr && !smc->conn.lgr->is_smcd) 376 + memcpy(dclc.id_for_peer, local_systemid, 377 + sizeof(local_systemid)); 376 378 dclc.peer_diagnosis = htonl(peer_diag_info); 377 379 memcpy(dclc.trl.eyecatcher, SMC_EYECATCHER, sizeof(SMC_EYECATCHER)); 378 380
+2 -3
net/smc/smc_diag.c
··· 39 39 { 40 40 struct smc_sock *smc = smc_sk(sk); 41 41 42 + memset(r, 0, sizeof(*r)); 42 43 r->diag_family = sk->sk_family; 44 + sock_diag_save_cookie(sk, r->id.idiag_cookie); 43 45 if (!smc->clcsock) 44 46 return; 45 47 r->id.idiag_sport = htons(smc->clcsock->sk->sk_num); 46 48 r->id.idiag_dport = smc->clcsock->sk->sk_dport; 47 49 r->id.idiag_if = smc->clcsock->sk->sk_bound_dev_if; 48 - sock_diag_save_cookie(sk, r->id.idiag_cookie); 49 50 if (sk->sk_protocol == SMCPROTO_SMC) { 50 - memset(&r->id.idiag_src, 0, sizeof(r->id.idiag_src)); 51 - memset(&r->id.idiag_dst, 0, sizeof(r->id.idiag_dst)); 52 51 r->id.idiag_src[0] = smc->clcsock->sk->sk_rcv_saddr; 53 52 r->id.idiag_dst[0] = smc->clcsock->sk->sk_daddr; 54 53 #if IS_ENABLED(CONFIG_IPV6)
+4 -3
net/tipc/node.c
··· 278 278 } 279 279 #endif 280 280 281 - void tipc_node_free(struct rcu_head *rp) 281 + static void tipc_node_free(struct rcu_head *rp) 282 282 { 283 283 struct tipc_node *n = container_of(rp, struct tipc_node, rcu); 284 284 ··· 2798 2798 return 0; 2799 2799 } 2800 2800 2801 - int __tipc_nl_node_set_key(struct sk_buff *skb, struct genl_info *info) 2801 + static int __tipc_nl_node_set_key(struct sk_buff *skb, struct genl_info *info) 2802 2802 { 2803 2803 struct nlattr *attrs[TIPC_NLA_NODE_MAX + 1]; 2804 2804 struct net *net = sock_net(skb->sk); ··· 2875 2875 return err; 2876 2876 } 2877 2877 2878 - int __tipc_nl_node_flush_key(struct sk_buff *skb, struct genl_info *info) 2878 + static int __tipc_nl_node_flush_key(struct sk_buff *skb, 2879 + struct genl_info *info) 2879 2880 { 2880 2881 struct net *net = sock_net(skb->sk); 2881 2882 struct tipc_net *tn = tipc_net(net);
+2
net/tipc/socket.c
··· 2441 2441 return -ETIMEDOUT; 2442 2442 if (signal_pending(current)) 2443 2443 return sock_intr_errno(*timeo_p); 2444 + if (sk->sk_state == TIPC_DISCONNECTING) 2445 + break; 2444 2446 2445 2447 add_wait_queue(sk_sleep(sk), &wait); 2446 2448 done = sk_wait_event(sk, timeo_p, tipc_sk_connected(sk),
+6 -2
net/wireless/ethtool.c
··· 7 7 void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 8 8 { 9 9 struct wireless_dev *wdev = dev->ieee80211_ptr; 10 + struct device *pdev = wiphy_dev(wdev->wiphy); 10 11 11 - strlcpy(info->driver, wiphy_dev(wdev->wiphy)->driver->name, 12 - sizeof(info->driver)); 12 + if (pdev->driver) 13 + strlcpy(info->driver, pdev->driver->name, 14 + sizeof(info->driver)); 15 + else 16 + strlcpy(info->driver, "N/A", sizeof(info->driver)); 13 17 14 18 strlcpy(info->version, init_utsname()->release, sizeof(info->version)); 15 19
+1
net/wireless/nl80211.c
··· 437 437 [NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT] = { .type = NLA_FLAG }, 438 438 [NL80211_ATTR_CONTROL_PORT_OVER_NL80211] = { .type = NLA_FLAG }, 439 439 [NL80211_ATTR_PRIVACY] = { .type = NLA_FLAG }, 440 + [NL80211_ATTR_STATUS_CODE] = { .type = NLA_U16 }, 440 441 [NL80211_ATTR_CIPHER_SUITE_GROUP] = { .type = NLA_U32 }, 441 442 [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 }, 442 443 [NL80211_ATTR_PID] = { .type = NLA_U32 },
+3 -3
net/xfrm/xfrm_interface.c
··· 300 300 if (mtu < IPV6_MIN_MTU) 301 301 mtu = IPV6_MIN_MTU; 302 302 303 - icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); 303 + icmpv6_ndo_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); 304 304 } else { 305 - icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, 306 - htonl(mtu)); 305 + icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, 306 + htonl(mtu)); 307 307 } 308 308 309 309 dst_release(dst);
+11
tools/testing/selftests/wireguard/netns.sh
··· 24 24 set -e 25 25 26 26 exec 3>&1 27 + export LANG=C 27 28 export WG_HIDE_KEYS=never 28 29 netns0="wg-test-$$-0" 29 30 netns1="wg-test-$$-1" ··· 298 297 n1 ping -W 1 -c 100 -f 192.168.99.7 299 298 n1 ping -W 1 -c 100 -f abab::1111 300 299 300 + # Have ns2 NAT into wg0 packets from ns0, but return an icmp error along the right route. 301 + n2 iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -d 192.168.241.0/24 -j SNAT --to 192.168.241.2 302 + n0 iptables -t filter -A INPUT \! -s 10.0.0.0/24 -i vethrs -j DROP # Manual rpfilter just to be explicit. 303 + n2 bash -c 'printf 1 > /proc/sys/net/ipv4/ip_forward' 304 + ip0 -4 route add 192.168.241.1 via 10.0.0.100 305 + n2 wg set wg0 peer "$pub1" remove 306 + [[ $(! n0 ping -W 1 -c 1 192.168.241.1 || false) == *"From 10.0.0.100 icmp_seq=1 Destination Host Unreachable"* ]] 307 + 301 308 n0 iptables -t nat -F 309 + n0 iptables -t filter -F 310 + n2 iptables -t nat -F 302 311 ip0 link del vethrc 303 312 ip0 link del vethrs 304 313 ip1 link del wg0