diff options
author | Barak Witkowski <barak@broadcom.com> | 2012-06-25 21:31:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-27 04:20:13 -0400 |
commit | 2e499d3cc13365a87815266dda59904dcb8c8d6c (patch) | |
tree | b9f0e8b8a4356d8beb112cf76b0b97789eb335c3 /drivers/scsi/bnx2i/bnx2i_init.c | |
parent | 747cf6ed3dbf6200af761f5384893c3b621a484c (diff) |
bnx2x, bnx2fc, bnx2i, cnic: Add statistics support and FCoE capabilities advertisement
1. When FCoE offload driver is registered, copy its capabilities to the chip
scratchpad.
2. Copy FCoE/iSCSI MAC addresses in aligned manner to chip scratchpad.
3. Add FCoE/iSCSI statistics collection support
Signed-off-by: Barak Witkowski <barak@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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 | * |