| 3056 | } |
| 3057 | |
| 3058 | int ena_com_rss_init(struct ena_com_dev *ena_dev, u16 indr_tbl_log_size) |
| 3059 | { |
| 3060 | int rc; |
| 3061 | |
| 3062 | memset(&ena_dev->rss, 0x0, sizeof(ena_dev->rss)); |
| 3063 | |
| 3064 | rc = ena_com_indirect_table_allocate(ena_dev, indr_tbl_log_size); |
| 3065 | if (unlikely(rc)) |
| 3066 | goto err_indr_tbl; |
| 3067 | |
| 3068 | /* The following function might return unsupported in case the |
| 3069 | * device doesn't support setting the key / hash function. We can safely |
| 3070 | * ignore this error and have indirection table support only. |
| 3071 | */ |
| 3072 | rc = ena_com_hash_key_allocate(ena_dev); |
| 3073 | if (likely(!rc)) |
| 3074 | ena_com_hash_key_fill_default_key(ena_dev); |
| 3075 | else if (rc != ENA_COM_UNSUPPORTED) |
| 3076 | goto err_hash_key; |
| 3077 | |
| 3078 | rc = ena_com_hash_ctrl_init(ena_dev); |
| 3079 | if (unlikely(rc)) |
| 3080 | goto err_hash_ctrl; |
| 3081 | |
| 3082 | return 0; |
| 3083 | |
| 3084 | err_hash_ctrl: |
| 3085 | ena_com_hash_key_destroy(ena_dev); |
| 3086 | err_hash_key: |
| 3087 | ena_com_indirect_table_destroy(ena_dev); |
| 3088 | err_indr_tbl: |
| 3089 | |
| 3090 | return rc; |
| 3091 | } |
| 3092 | |
| 3093 | void ena_com_rss_destroy(struct ena_com_dev *ena_dev) |
| 3094 | { |
no test coverage detected