diff options
Diffstat (limited to 'drivers/scsi/bnx2i/bnx2i_init.c')
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_init.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c index 8b6816706ee5..7729a5223b33 100644 --- a/drivers/scsi/bnx2i/bnx2i_init.c +++ b/drivers/scsi/bnx2i/bnx2i_init.c | |||
@@ -381,6 +381,46 @@ void bnx2i_ulp_exit(struct cnic_dev *dev) | |||
381 | 381 | ||
382 | 382 | ||
383 | /** | 383 | /** |
384 | * bnx2i_get_stats - Retrieve various statistic from iSCSI offload | ||
385 | * @handle: bnx2i_hba | ||
386 | * | ||
387 | * function callback exported via bnx2i - cnic driver interface to | ||
388 | * retrieve various iSCSI offload related statistics. | ||
389 | */ | ||
390 | int bnx2i_get_stats(void *handle) | ||
391 | { | ||
392 | struct bnx2i_hba *hba = handle; | ||
393 | struct iscsi_stats_info *stats; | ||
394 | |||
395 | if (!hba) | ||
396 | return -EINVAL; | ||
397 | |||
398 | stats = (struct iscsi_stats_info *)hba->cnic->stats_addr; | ||
399 | |||
400 | if (!stats) | ||
401 | return -ENOMEM; | ||
402 | |||
403 | memcpy(stats->version, DRV_MODULE_VERSION, sizeof(stats->version)); | ||
404 | memcpy(stats->mac_add1 + 2, hba->cnic->mac_addr, ETH_ALEN); | ||
405 | |||
406 | stats->max_frame_size = hba->netdev->mtu; | ||
407 | stats->txq_size = hba->max_sqes; | ||
408 | stats->rxq_size = hba->max_cqes; | ||
409 | |||
410 | stats->txq_avg_depth = 0; | ||
411 | stats->rxq_avg_depth = 0; | ||
412 | |||
413 | GET_STATS_64(hba, stats, rx_pdus); | ||
414 | GET_STATS_64(hba, stats, rx_bytes); | ||
415 | |||
416 | GET_STATS_64(hba, stats, tx_pdus); | ||
417 | GET_STATS_64(hba, stats, tx_bytes); | ||
418 | |||
419 | return 0; | ||
420 | } | ||
421 | |||
422 | |||
423 | /** | ||
384 | * bnx2i_percpu_thread_create - Create a receive thread for an | 424 | * bnx2i_percpu_thread_create - Create a receive thread for an |
385 | * online CPU | 425 | * online CPU |
386 | * | 426 | * |