| 819 | } |
| 820 | |
| 821 | static void ena_config_debug_area(struct ena_adapter *adapter) |
| 822 | { |
| 823 | u32 debug_area_size; |
| 824 | int rc, ss_count; |
| 825 | |
| 826 | ss_count = ena_xstats_calc_num(adapter->edev_data); |
| 827 | |
| 828 | /* allocate 32 bytes for each string and 64bit for the value */ |
| 829 | debug_area_size = ss_count * ETH_GSTRING_LEN + sizeof(u64) * ss_count; |
| 830 | |
| 831 | rc = ena_com_allocate_debug_area(&adapter->ena_dev, debug_area_size); |
| 832 | if (rc) { |
| 833 | PMD_DRV_LOG(ERR, "Cannot allocate debug area\n"); |
| 834 | return; |
| 835 | } |
| 836 | |
| 837 | rc = ena_com_set_host_attributes(&adapter->ena_dev); |
| 838 | if (rc) { |
| 839 | if (rc == ENA_COM_UNSUPPORTED) |
| 840 | PMD_DRV_LOG(WARNING, "Cannot set host attributes\n"); |
| 841 | else |
| 842 | PMD_DRV_LOG(ERR, "Cannot set host attributes\n"); |
| 843 | |
| 844 | goto err; |
| 845 | } |
| 846 | |
| 847 | return; |
| 848 | err: |
| 849 | ena_com_delete_debug_area(&adapter->ena_dev); |
| 850 | } |
| 851 | |
| 852 | static int ena_close(struct rte_eth_dev *dev) |
| 853 | { |
no test coverage detected