| .. | .. |
|---|
| 10 | 10 | |
|---|
| 11 | 11 | static struct dentry *i40e_dbg_root; |
|---|
| 12 | 12 | |
|---|
| 13 | +enum ring_type { |
|---|
| 14 | + RING_TYPE_RX, |
|---|
| 15 | + RING_TYPE_TX, |
|---|
| 16 | + RING_TYPE_XDP |
|---|
| 17 | +}; |
|---|
| 18 | + |
|---|
| 13 | 19 | /** |
|---|
| 14 | 20 | * i40e_dbg_find_vsi - searches for the vsi with the given seid |
|---|
| 15 | 21 | * @pf: the PF structure to search for the vsi |
|---|
| .. | .. |
|---|
| 132 | 138 | dev_info(&pf->pdev->dev, " vlan_features = 0x%08lx\n", |
|---|
| 133 | 139 | (unsigned long int)nd->vlan_features); |
|---|
| 134 | 140 | } |
|---|
| 135 | | - dev_info(&pf->pdev->dev, " active_vlans is %s\n", |
|---|
| 136 | | - vsi->active_vlans ? "<valid>" : "<null>"); |
|---|
| 137 | 141 | dev_info(&pf->pdev->dev, |
|---|
| 138 | 142 | " flags = 0x%08lx, netdev_registered = %i, current_netdev_flags = 0x%04x\n", |
|---|
| 139 | 143 | vsi->flags, vsi->netdev_registered, vsi->current_netdev_flags); |
|---|
| .. | .. |
|---|
| 321 | 325 | i, tx_ring->itr_setting, |
|---|
| 322 | 326 | ITR_IS_DYNAMIC(tx_ring->itr_setting) ? "dynamic" : "fixed"); |
|---|
| 323 | 327 | } |
|---|
| 328 | + if (i40e_enabled_xdp_vsi(vsi)) { |
|---|
| 329 | + for (i = 0; i < vsi->num_queue_pairs; i++) { |
|---|
| 330 | + struct i40e_ring *xdp_ring = READ_ONCE(vsi->xdp_rings[i]); |
|---|
| 331 | + |
|---|
| 332 | + if (!xdp_ring) |
|---|
| 333 | + continue; |
|---|
| 334 | + |
|---|
| 335 | + dev_info(&pf->pdev->dev, |
|---|
| 336 | + " xdp_rings[%i]: state = %lu, queue_index = %d, reg_idx = %d\n", |
|---|
| 337 | + i, *xdp_ring->state, |
|---|
| 338 | + xdp_ring->queue_index, |
|---|
| 339 | + xdp_ring->reg_idx); |
|---|
| 340 | + dev_info(&pf->pdev->dev, |
|---|
| 341 | + " xdp_rings[%i]: next_to_use = %d, next_to_clean = %d, ring_active = %i\n", |
|---|
| 342 | + i, |
|---|
| 343 | + xdp_ring->next_to_use, |
|---|
| 344 | + xdp_ring->next_to_clean, |
|---|
| 345 | + xdp_ring->ring_active); |
|---|
| 346 | + dev_info(&pf->pdev->dev, |
|---|
| 347 | + " xdp_rings[%i]: tx_stats: packets = %lld, bytes = %lld, restart_queue = %lld\n", |
|---|
| 348 | + i, xdp_ring->stats.packets, |
|---|
| 349 | + xdp_ring->stats.bytes, |
|---|
| 350 | + xdp_ring->tx_stats.restart_queue); |
|---|
| 351 | + dev_info(&pf->pdev->dev, |
|---|
| 352 | + " xdp_rings[%i]: tx_stats: tx_busy = %lld, tx_done_old = %lld\n", |
|---|
| 353 | + i, |
|---|
| 354 | + xdp_ring->tx_stats.tx_busy, |
|---|
| 355 | + xdp_ring->tx_stats.tx_done_old); |
|---|
| 356 | + dev_info(&pf->pdev->dev, |
|---|
| 357 | + " xdp_rings[%i]: size = %i\n", |
|---|
| 358 | + i, xdp_ring->size); |
|---|
| 359 | + dev_info(&pf->pdev->dev, |
|---|
| 360 | + " xdp_rings[%i]: DCB tc = %d\n", |
|---|
| 361 | + i, xdp_ring->dcb_tc); |
|---|
| 362 | + dev_info(&pf->pdev->dev, |
|---|
| 363 | + " xdp_rings[%i]: itr_setting = %d (%s)\n", |
|---|
| 364 | + i, xdp_ring->itr_setting, |
|---|
| 365 | + ITR_IS_DYNAMIC(xdp_ring->itr_setting) ? |
|---|
| 366 | + "dynamic" : "fixed"); |
|---|
| 367 | + } |
|---|
| 368 | + } |
|---|
| 324 | 369 | rcu_read_unlock(); |
|---|
| 325 | 370 | dev_info(&pf->pdev->dev, |
|---|
| 326 | 371 | " work_limit = %d\n", |
|---|
| .. | .. |
|---|
| 335 | 380 | " seid = %d, id = %d, uplink_seid = %d\n", |
|---|
| 336 | 381 | vsi->seid, vsi->id, vsi->uplink_seid); |
|---|
| 337 | 382 | dev_info(&pf->pdev->dev, |
|---|
| 338 | | - " base_queue = %d, num_queue_pairs = %d, num_desc = %d\n", |
|---|
| 339 | | - vsi->base_queue, vsi->num_queue_pairs, vsi->num_desc); |
|---|
| 383 | + " base_queue = %d, num_queue_pairs = %d, num_tx_desc = %d, num_rx_desc = %d\n", |
|---|
| 384 | + vsi->base_queue, vsi->num_queue_pairs, vsi->num_tx_desc, |
|---|
| 385 | + vsi->num_rx_desc); |
|---|
| 340 | 386 | dev_info(&pf->pdev->dev, " type = %i\n", vsi->type); |
|---|
| 341 | 387 | if (vsi->type == I40E_VSI_SRIOV) |
|---|
| 342 | 388 | dev_info(&pf->pdev->dev, " VF ID = %i\n", vsi->vf_id); |
|---|
| .. | .. |
|---|
| 490 | 536 | * @ring_id: ring id entered by user |
|---|
| 491 | 537 | * @desc_n: descriptor number entered by user |
|---|
| 492 | 538 | * @pf: the i40e_pf created in command write |
|---|
| 493 | | - * @is_rx_ring: true if rx, false if tx |
|---|
| 539 | + * @type: enum describing whether ring is RX, TX or XDP |
|---|
| 494 | 540 | **/ |
|---|
| 495 | 541 | static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n, |
|---|
| 496 | | - struct i40e_pf *pf, bool is_rx_ring) |
|---|
| 542 | + struct i40e_pf *pf, enum ring_type type) |
|---|
| 497 | 543 | { |
|---|
| 544 | + bool is_rx_ring = type == RING_TYPE_RX; |
|---|
| 498 | 545 | struct i40e_tx_desc *txd; |
|---|
| 499 | 546 | union i40e_rx_desc *rxd; |
|---|
| 500 | 547 | struct i40e_ring *ring; |
|---|
| .. | .. |
|---|
| 504 | 551 | vsi = i40e_dbg_find_vsi(pf, vsi_seid); |
|---|
| 505 | 552 | if (!vsi) { |
|---|
| 506 | 553 | dev_info(&pf->pdev->dev, "vsi %d not found\n", vsi_seid); |
|---|
| 554 | + return; |
|---|
| 555 | + } |
|---|
| 556 | + if (vsi->type != I40E_VSI_MAIN && |
|---|
| 557 | + vsi->type != I40E_VSI_FDIR && |
|---|
| 558 | + vsi->type != I40E_VSI_VMDQ2) { |
|---|
| 559 | + dev_info(&pf->pdev->dev, |
|---|
| 560 | + "vsi %d type %d descriptor rings not available\n", |
|---|
| 561 | + vsi_seid, vsi->type); |
|---|
| 562 | + return; |
|---|
| 563 | + } |
|---|
| 564 | + if (type == RING_TYPE_XDP && !i40e_enabled_xdp_vsi(vsi)) { |
|---|
| 565 | + dev_info(&pf->pdev->dev, "XDP not enabled on VSI %d\n", vsi_seid); |
|---|
| 507 | 566 | return; |
|---|
| 508 | 567 | } |
|---|
| 509 | 568 | if (ring_id >= vsi->num_queue_pairs || ring_id < 0) { |
|---|
| .. | .. |
|---|
| 517 | 576 | return; |
|---|
| 518 | 577 | } |
|---|
| 519 | 578 | |
|---|
| 520 | | - ring = kmemdup(is_rx_ring |
|---|
| 521 | | - ? vsi->rx_rings[ring_id] : vsi->tx_rings[ring_id], |
|---|
| 522 | | - sizeof(*ring), GFP_KERNEL); |
|---|
| 579 | + switch (type) { |
|---|
| 580 | + case RING_TYPE_RX: |
|---|
| 581 | + ring = kmemdup(vsi->rx_rings[ring_id], sizeof(*ring), GFP_KERNEL); |
|---|
| 582 | + break; |
|---|
| 583 | + case RING_TYPE_TX: |
|---|
| 584 | + ring = kmemdup(vsi->tx_rings[ring_id], sizeof(*ring), GFP_KERNEL); |
|---|
| 585 | + break; |
|---|
| 586 | + case RING_TYPE_XDP: |
|---|
| 587 | + ring = kmemdup(vsi->xdp_rings[ring_id], sizeof(*ring), GFP_KERNEL); |
|---|
| 588 | + break; |
|---|
| 589 | + default: |
|---|
| 590 | + ring = NULL; |
|---|
| 591 | + break; |
|---|
| 592 | + } |
|---|
| 523 | 593 | if (!ring) |
|---|
| 524 | 594 | return; |
|---|
| 525 | 595 | |
|---|
| 526 | 596 | if (cnt == 2) { |
|---|
| 527 | | - dev_info(&pf->pdev->dev, "vsi = %02i %s ring = %02i\n", |
|---|
| 528 | | - vsi_seid, is_rx_ring ? "rx" : "tx", ring_id); |
|---|
| 597 | + switch (type) { |
|---|
| 598 | + case RING_TYPE_RX: |
|---|
| 599 | + dev_info(&pf->pdev->dev, "VSI = %02i Rx ring = %02i\n", vsi_seid, ring_id); |
|---|
| 600 | + break; |
|---|
| 601 | + case RING_TYPE_TX: |
|---|
| 602 | + dev_info(&pf->pdev->dev, "VSI = %02i Tx ring = %02i\n", vsi_seid, ring_id); |
|---|
| 603 | + break; |
|---|
| 604 | + case RING_TYPE_XDP: |
|---|
| 605 | + dev_info(&pf->pdev->dev, "VSI = %02i XDP ring = %02i\n", vsi_seid, ring_id); |
|---|
| 606 | + break; |
|---|
| 607 | + } |
|---|
| 529 | 608 | for (i = 0; i < ring->count; i++) { |
|---|
| 530 | 609 | if (!is_rx_ring) { |
|---|
| 531 | 610 | txd = I40E_TX_DESC(ring, i); |
|---|
| .. | .. |
|---|
| 536 | 615 | } else { |
|---|
| 537 | 616 | rxd = I40E_RX_DESC(ring, i); |
|---|
| 538 | 617 | dev_info(&pf->pdev->dev, |
|---|
| 539 | | - " d[%03x] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n", |
|---|
| 618 | + " d[%03x] = 0x%016llx 0x%016llx\n", |
|---|
| 540 | 619 | i, rxd->read.pkt_addr, |
|---|
| 541 | | - rxd->read.hdr_addr, |
|---|
| 542 | | - rxd->read.rsvd1, rxd->read.rsvd2); |
|---|
| 620 | + rxd->read.hdr_addr); |
|---|
| 543 | 621 | } |
|---|
| 544 | 622 | } |
|---|
| 545 | 623 | } else if (cnt == 3) { |
|---|
| .. | .. |
|---|
| 557 | 635 | } else { |
|---|
| 558 | 636 | rxd = I40E_RX_DESC(ring, desc_n); |
|---|
| 559 | 637 | dev_info(&pf->pdev->dev, |
|---|
| 560 | | - "vsi = %02i rx ring = %02i d[%03x] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n", |
|---|
| 638 | + "vsi = %02i rx ring = %02i d[%03x] = 0x%016llx 0x%016llx\n", |
|---|
| 561 | 639 | vsi_seid, ring_id, desc_n, |
|---|
| 562 | | - rxd->read.pkt_addr, rxd->read.hdr_addr, |
|---|
| 563 | | - rxd->read.rsvd1, rxd->read.rsvd2); |
|---|
| 640 | + rxd->read.pkt_addr, rxd->read.hdr_addr); |
|---|
| 564 | 641 | } |
|---|
| 565 | 642 | } else { |
|---|
| 566 | | - dev_info(&pf->pdev->dev, "dump desc rx/tx <vsi_seid> <ring_id> [<desc_n>]\n"); |
|---|
| 643 | + dev_info(&pf->pdev->dev, "dump desc rx/tx/xdp <vsi_seid> <ring_id> [<desc_n>]\n"); |
|---|
| 567 | 644 | } |
|---|
| 568 | 645 | |
|---|
| 569 | 646 | out: |
|---|
| .. | .. |
|---|
| 665 | 742 | vsi = pf->vsi[vf->lan_vsi_idx]; |
|---|
| 666 | 743 | dev_info(&pf->pdev->dev, "vf %2d: VSI id=%d, seid=%d, qps=%d\n", |
|---|
| 667 | 744 | vf_id, vf->lan_vsi_id, vsi->seid, vf->num_queue_pairs); |
|---|
| 668 | | - dev_info(&pf->pdev->dev, " num MDD=%lld, invalid msg=%lld, valid msg=%lld\n", |
|---|
| 669 | | - vf->num_mdd_events, |
|---|
| 670 | | - vf->num_invalid_msgs, |
|---|
| 671 | | - vf->num_valid_msgs); |
|---|
| 745 | + dev_info(&pf->pdev->dev, " num MDD=%lld\n", |
|---|
| 746 | + vf->num_mdd_events); |
|---|
| 672 | 747 | } else { |
|---|
| 673 | 748 | dev_info(&pf->pdev->dev, "invalid VF id %d\n", vf_id); |
|---|
| 674 | 749 | } |
|---|
| .. | .. |
|---|
| 689 | 764 | i40e_dbg_dump_vf(pf, i); |
|---|
| 690 | 765 | } |
|---|
| 691 | 766 | |
|---|
| 692 | | -#define I40E_MAX_DEBUG_OUT_BUFFER (4096*4) |
|---|
| 693 | 767 | /** |
|---|
| 694 | 768 | * i40e_dbg_command_write - write into command datum |
|---|
| 695 | 769 | * @filp: the opened file |
|---|
| .. | .. |
|---|
| 921 | 995 | cnt = sscanf(&cmd_buf[12], "%i %i %i", |
|---|
| 922 | 996 | &vsi_seid, &ring_id, &desc_n); |
|---|
| 923 | 997 | i40e_dbg_dump_desc(cnt, vsi_seid, ring_id, |
|---|
| 924 | | - desc_n, pf, true); |
|---|
| 998 | + desc_n, pf, RING_TYPE_RX); |
|---|
| 925 | 999 | } else if (strncmp(&cmd_buf[10], "tx", 2) |
|---|
| 926 | 1000 | == 0) { |
|---|
| 927 | 1001 | cnt = sscanf(&cmd_buf[12], "%i %i %i", |
|---|
| 928 | 1002 | &vsi_seid, &ring_id, &desc_n); |
|---|
| 929 | 1003 | i40e_dbg_dump_desc(cnt, vsi_seid, ring_id, |
|---|
| 930 | | - desc_n, pf, false); |
|---|
| 1004 | + desc_n, pf, RING_TYPE_TX); |
|---|
| 1005 | + } else if (strncmp(&cmd_buf[10], "xdp", 3) |
|---|
| 1006 | + == 0) { |
|---|
| 1007 | + cnt = sscanf(&cmd_buf[13], "%i %i %i", |
|---|
| 1008 | + &vsi_seid, &ring_id, &desc_n); |
|---|
| 1009 | + i40e_dbg_dump_desc(cnt, vsi_seid, ring_id, |
|---|
| 1010 | + desc_n, pf, RING_TYPE_XDP); |
|---|
| 931 | 1011 | } else if (strncmp(&cmd_buf[10], "aq", 2) == 0) { |
|---|
| 932 | 1012 | i40e_dbg_dump_aq_desc(pf); |
|---|
| 933 | 1013 | } else { |
|---|
| .. | .. |
|---|
| 935 | 1015 | "dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n"); |
|---|
| 936 | 1016 | dev_info(&pf->pdev->dev, |
|---|
| 937 | 1017 | "dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n"); |
|---|
| 1018 | + dev_info(&pf->pdev->dev, |
|---|
| 1019 | + "dump desc xdp <vsi_seid> <ring_id> [<desc_n>]\n"); |
|---|
| 938 | 1020 | dev_info(&pf->pdev->dev, "dump desc aq\n"); |
|---|
| 939 | 1021 | } |
|---|
| 940 | 1022 | } else if (strncmp(&cmd_buf[5], "reset stats", 11) == 0) { |
|---|
| .. | .. |
|---|
| 1105 | 1187 | buff = NULL; |
|---|
| 1106 | 1188 | } else { |
|---|
| 1107 | 1189 | dev_info(&pf->pdev->dev, |
|---|
| 1108 | | - "dump desc tx <vsi_seid> <ring_id> [<desc_n>], dump desc rx <vsi_seid> <ring_id> [<desc_n>],\n"); |
|---|
| 1190 | + "dump desc tx <vsi_seid> <ring_id> [<desc_n>], dump desc rx <vsi_seid> <ring_id> [<desc_n>], dump desc xdp <vsi_seid> <ring_id> [<desc_n>],\n"); |
|---|
| 1109 | 1191 | dev_info(&pf->pdev->dev, "dump switch\n"); |
|---|
| 1110 | 1192 | dev_info(&pf->pdev->dev, "dump vsi [seid]\n"); |
|---|
| 1111 | 1193 | dev_info(&pf->pdev->dev, "dump reset stats\n"); |
|---|
| .. | .. |
|---|
| 1125 | 1207 | } else if (strncmp(cmd_buf, "globr", 5) == 0) { |
|---|
| 1126 | 1208 | dev_info(&pf->pdev->dev, "debugfs: forcing GlobR\n"); |
|---|
| 1127 | 1209 | i40e_do_reset_safe(pf, BIT(__I40E_GLOBAL_RESET_REQUESTED)); |
|---|
| 1128 | | - |
|---|
| 1129 | | - } else if (strncmp(cmd_buf, "empr", 4) == 0) { |
|---|
| 1130 | | - dev_info(&pf->pdev->dev, "debugfs: forcing EMPR\n"); |
|---|
| 1131 | | - i40e_do_reset_safe(pf, BIT(__I40E_EMP_RESET_REQUESTED)); |
|---|
| 1132 | 1210 | |
|---|
| 1133 | 1211 | } else if (strncmp(cmd_buf, "read", 4) == 0) { |
|---|
| 1134 | 1212 | u32 address; |
|---|
| .. | .. |
|---|
| 1323 | 1401 | if (strncmp(&cmd_buf[5], "stop", 4) == 0) { |
|---|
| 1324 | 1402 | int ret; |
|---|
| 1325 | 1403 | |
|---|
| 1326 | | - ret = i40e_aq_stop_lldp(&pf->hw, false, NULL); |
|---|
| 1404 | + ret = i40e_aq_stop_lldp(&pf->hw, false, false, NULL); |
|---|
| 1327 | 1405 | if (ret) { |
|---|
| 1328 | 1406 | dev_info(&pf->pdev->dev, |
|---|
| 1329 | 1407 | "Stop LLDP AQ command failed =0x%x\n", |
|---|
| .. | .. |
|---|
| 1332 | 1410 | } |
|---|
| 1333 | 1411 | ret = i40e_aq_add_rem_control_packet_filter(&pf->hw, |
|---|
| 1334 | 1412 | pf->hw.mac.addr, |
|---|
| 1335 | | - I40E_ETH_P_LLDP, 0, |
|---|
| 1413 | + ETH_P_LLDP, 0, |
|---|
| 1336 | 1414 | pf->vsi[pf->lan_vsi]->seid, |
|---|
| 1337 | 1415 | 0, true, NULL, NULL); |
|---|
| 1338 | 1416 | if (ret) { |
|---|
| .. | .. |
|---|
| 1350 | 1428 | |
|---|
| 1351 | 1429 | ret = i40e_aq_add_rem_control_packet_filter(&pf->hw, |
|---|
| 1352 | 1430 | pf->hw.mac.addr, |
|---|
| 1353 | | - I40E_ETH_P_LLDP, 0, |
|---|
| 1431 | + ETH_P_LLDP, 0, |
|---|
| 1354 | 1432 | pf->vsi[pf->lan_vsi]->seid, |
|---|
| 1355 | 1433 | 0, false, NULL, NULL); |
|---|
| 1356 | 1434 | if (ret) { |
|---|
| .. | .. |
|---|
| 1360 | 1438 | /* Continue and start FW LLDP anyways */ |
|---|
| 1361 | 1439 | } |
|---|
| 1362 | 1440 | |
|---|
| 1363 | | - ret = i40e_aq_start_lldp(&pf->hw, NULL); |
|---|
| 1441 | + ret = i40e_aq_start_lldp(&pf->hw, false, NULL); |
|---|
| 1364 | 1442 | if (ret) { |
|---|
| 1365 | 1443 | dev_info(&pf->pdev->dev, |
|---|
| 1366 | 1444 | "Start LLDP AQ command failed =0x%x\n", |
|---|
| .. | .. |
|---|
| 1525 | 1603 | dev_info(&pf->pdev->dev, " dump vsi [seid]\n"); |
|---|
| 1526 | 1604 | dev_info(&pf->pdev->dev, " dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n"); |
|---|
| 1527 | 1605 | dev_info(&pf->pdev->dev, " dump desc rx <vsi_seid> <ring_id> [<desc_n>]\n"); |
|---|
| 1606 | + dev_info(&pf->pdev->dev, " dump desc xdp <vsi_seid> <ring_id> [<desc_n>]\n"); |
|---|
| 1528 | 1607 | dev_info(&pf->pdev->dev, " dump desc aq\n"); |
|---|
| 1529 | 1608 | dev_info(&pf->pdev->dev, " dump reset stats\n"); |
|---|
| 1530 | 1609 | dev_info(&pf->pdev->dev, " dump debug fwdata <cluster_id> <table_id> <index>\n"); |
|---|
| .. | .. |
|---|
| 1644 | 1723 | count = buf_tmp - i40e_dbg_netdev_ops_buf + 1; |
|---|
| 1645 | 1724 | } |
|---|
| 1646 | 1725 | |
|---|
| 1647 | | - if (strncmp(i40e_dbg_netdev_ops_buf, "tx_timeout", 10) == 0) { |
|---|
| 1648 | | - cnt = sscanf(&i40e_dbg_netdev_ops_buf[11], "%i", &vsi_seid); |
|---|
| 1649 | | - if (cnt != 1) { |
|---|
| 1650 | | - dev_info(&pf->pdev->dev, "tx_timeout <vsi_seid>\n"); |
|---|
| 1651 | | - goto netdev_ops_write_done; |
|---|
| 1652 | | - } |
|---|
| 1653 | | - vsi = i40e_dbg_find_vsi(pf, vsi_seid); |
|---|
| 1654 | | - if (!vsi) { |
|---|
| 1655 | | - dev_info(&pf->pdev->dev, |
|---|
| 1656 | | - "tx_timeout: VSI %d not found\n", vsi_seid); |
|---|
| 1657 | | - } else if (!vsi->netdev) { |
|---|
| 1658 | | - dev_info(&pf->pdev->dev, "tx_timeout: no netdev for VSI %d\n", |
|---|
| 1659 | | - vsi_seid); |
|---|
| 1660 | | - } else if (test_bit(__I40E_VSI_DOWN, vsi->state)) { |
|---|
| 1661 | | - dev_info(&pf->pdev->dev, "tx_timeout: VSI %d not UP\n", |
|---|
| 1662 | | - vsi_seid); |
|---|
| 1663 | | - } else if (rtnl_trylock()) { |
|---|
| 1664 | | - vsi->netdev->netdev_ops->ndo_tx_timeout(vsi->netdev); |
|---|
| 1665 | | - rtnl_unlock(); |
|---|
| 1666 | | - dev_info(&pf->pdev->dev, "tx_timeout called\n"); |
|---|
| 1667 | | - } else { |
|---|
| 1668 | | - dev_info(&pf->pdev->dev, "Could not acquire RTNL - please try again\n"); |
|---|
| 1669 | | - } |
|---|
| 1670 | | - } else if (strncmp(i40e_dbg_netdev_ops_buf, "change_mtu", 10) == 0) { |
|---|
| 1726 | + if (strncmp(i40e_dbg_netdev_ops_buf, "change_mtu", 10) == 0) { |
|---|
| 1671 | 1727 | int mtu; |
|---|
| 1672 | 1728 | |
|---|
| 1673 | 1729 | cnt = sscanf(&i40e_dbg_netdev_ops_buf[11], "%i %i", |
|---|
| .. | .. |
|---|
| 1735 | 1791 | dev_info(&pf->pdev->dev, "unknown command '%s'\n", |
|---|
| 1736 | 1792 | i40e_dbg_netdev_ops_buf); |
|---|
| 1737 | 1793 | dev_info(&pf->pdev->dev, "available commands\n"); |
|---|
| 1738 | | - dev_info(&pf->pdev->dev, " tx_timeout <vsi_seid>\n"); |
|---|
| 1739 | 1794 | dev_info(&pf->pdev->dev, " change_mtu <vsi_seid> <mtu>\n"); |
|---|
| 1740 | 1795 | dev_info(&pf->pdev->dev, " set_rx_mode <vsi_seid>\n"); |
|---|
| 1741 | 1796 | dev_info(&pf->pdev->dev, " napi <vsi_seid>\n"); |
|---|
| .. | .. |
|---|
| 1757 | 1812 | **/ |
|---|
| 1758 | 1813 | void i40e_dbg_pf_init(struct i40e_pf *pf) |
|---|
| 1759 | 1814 | { |
|---|
| 1760 | | - struct dentry *pfile; |
|---|
| 1761 | 1815 | const char *name = pci_name(pf->pdev); |
|---|
| 1762 | | - const struct device *dev = &pf->pdev->dev; |
|---|
| 1763 | 1816 | |
|---|
| 1764 | 1817 | pf->i40e_dbg_pf = debugfs_create_dir(name, i40e_dbg_root); |
|---|
| 1765 | | - if (!pf->i40e_dbg_pf) |
|---|
| 1766 | | - return; |
|---|
| 1767 | 1818 | |
|---|
| 1768 | | - pfile = debugfs_create_file("command", 0600, pf->i40e_dbg_pf, pf, |
|---|
| 1769 | | - &i40e_dbg_command_fops); |
|---|
| 1770 | | - if (!pfile) |
|---|
| 1771 | | - goto create_failed; |
|---|
| 1819 | + debugfs_create_file("command", 0600, pf->i40e_dbg_pf, pf, |
|---|
| 1820 | + &i40e_dbg_command_fops); |
|---|
| 1772 | 1821 | |
|---|
| 1773 | | - pfile = debugfs_create_file("netdev_ops", 0600, pf->i40e_dbg_pf, pf, |
|---|
| 1774 | | - &i40e_dbg_netdev_ops_fops); |
|---|
| 1775 | | - if (!pfile) |
|---|
| 1776 | | - goto create_failed; |
|---|
| 1777 | | - |
|---|
| 1778 | | - return; |
|---|
| 1779 | | - |
|---|
| 1780 | | -create_failed: |
|---|
| 1781 | | - dev_info(dev, "debugfs dir/file for %s failed\n", name); |
|---|
| 1782 | | - debugfs_remove_recursive(pf->i40e_dbg_pf); |
|---|
| 1822 | + debugfs_create_file("netdev_ops", 0600, pf->i40e_dbg_pf, pf, |
|---|
| 1823 | + &i40e_dbg_netdev_ops_fops); |
|---|
| 1783 | 1824 | } |
|---|
| 1784 | 1825 | |
|---|
| 1785 | 1826 | /** |
|---|
| .. | .. |
|---|
| 1798 | 1839 | void i40e_dbg_init(void) |
|---|
| 1799 | 1840 | { |
|---|
| 1800 | 1841 | i40e_dbg_root = debugfs_create_dir(i40e_driver_name, NULL); |
|---|
| 1801 | | - if (!i40e_dbg_root) |
|---|
| 1842 | + if (IS_ERR(i40e_dbg_root)) |
|---|
| 1802 | 1843 | pr_info("init of debugfs failed\n"); |
|---|
| 1803 | 1844 | } |
|---|
| 1804 | 1845 | |
|---|