| .. | .. |
|---|
| 39 | 39 | static int bnxt_hwrm_queue_pri2cos_cfg(struct bnxt *bp, struct ieee_ets *ets) |
|---|
| 40 | 40 | { |
|---|
| 41 | 41 | struct hwrm_queue_pri2cos_cfg_input req = {0}; |
|---|
| 42 | | - int rc = 0, i; |
|---|
| 43 | 42 | u8 *pri2cos; |
|---|
| 43 | + int i; |
|---|
| 44 | 44 | |
|---|
| 45 | 45 | bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_QUEUE_PRI2COS_CFG, -1, -1); |
|---|
| 46 | 46 | req.flags = cpu_to_le32(QUEUE_PRI2COS_CFG_REQ_FLAGS_PATH_BIDIR | |
|---|
| .. | .. |
|---|
| 56 | 56 | qidx = bp->tc_to_qidx[ets->prio_tc[i]]; |
|---|
| 57 | 57 | pri2cos[i] = bp->q_info[qidx].queue_id; |
|---|
| 58 | 58 | } |
|---|
| 59 | | - rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); |
|---|
| 60 | | - return rc; |
|---|
| 59 | + return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); |
|---|
| 61 | 60 | } |
|---|
| 62 | 61 | |
|---|
| 63 | 62 | static int bnxt_hwrm_queue_pri2cos_qcfg(struct bnxt *bp, struct ieee_ets *ets) |
|---|
| .. | .. |
|---|
| 93 | 92 | { |
|---|
| 94 | 93 | struct hwrm_queue_cos2bw_cfg_input req = {0}; |
|---|
| 95 | 94 | struct bnxt_cos2bw_cfg cos2bw; |
|---|
| 96 | | - int rc = 0, i; |
|---|
| 97 | 95 | void *data; |
|---|
| 96 | + int i; |
|---|
| 98 | 97 | |
|---|
| 99 | 98 | bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_QUEUE_COS2BW_CFG, -1, -1); |
|---|
| 100 | 99 | for (i = 0; i < max_tc; i++) { |
|---|
| .. | .. |
|---|
| 128 | 127 | req.unused_0 = 0; |
|---|
| 129 | 128 | } |
|---|
| 130 | 129 | } |
|---|
| 131 | | - rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); |
|---|
| 132 | | - return rc; |
|---|
| 130 | + return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); |
|---|
| 133 | 131 | } |
|---|
| 134 | 132 | |
|---|
| 135 | 133 | static int bnxt_hwrm_queue_cos2bw_qcfg(struct bnxt *bp, struct ieee_ets *ets) |
|---|
| .. | .. |
|---|
| 236 | 234 | unsigned int tc_mask = 0, pri_mask = 0; |
|---|
| 237 | 235 | u8 i, pri, lltc_count = 0; |
|---|
| 238 | 236 | bool need_q_remap = false; |
|---|
| 239 | | - int rc; |
|---|
| 240 | 237 | |
|---|
| 241 | 238 | if (!my_ets) |
|---|
| 242 | 239 | return -EINVAL; |
|---|
| .. | .. |
|---|
| 267 | 264 | } |
|---|
| 268 | 265 | |
|---|
| 269 | 266 | if (need_q_remap) |
|---|
| 270 | | - rc = bnxt_queue_remap(bp, tc_mask); |
|---|
| 267 | + bnxt_queue_remap(bp, tc_mask); |
|---|
| 271 | 268 | |
|---|
| 272 | 269 | bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_QUEUE_PFCENABLE_CFG, -1, -1); |
|---|
| 273 | 270 | req.flags = cpu_to_le32(pri_mask); |
|---|
| 274 | | - rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); |
|---|
| 275 | | - if (rc) |
|---|
| 276 | | - return rc; |
|---|
| 277 | | - |
|---|
| 278 | | - return rc; |
|---|
| 271 | + return hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); |
|---|
| 279 | 272 | } |
|---|
| 280 | 273 | |
|---|
| 281 | 274 | static int bnxt_hwrm_queue_pfc_qcfg(struct bnxt *bp, struct ieee_pfc *pfc) |
|---|
| .. | .. |
|---|
| 316 | 309 | |
|---|
| 317 | 310 | n = IEEE_8021QAZ_MAX_TCS; |
|---|
| 318 | 311 | data_len = sizeof(*data) + sizeof(*fw_app) * n; |
|---|
| 319 | | - data = dma_zalloc_coherent(&bp->pdev->dev, data_len, &mapping, |
|---|
| 320 | | - GFP_KERNEL); |
|---|
| 312 | + data = dma_alloc_coherent(&bp->pdev->dev, data_len, &mapping, |
|---|
| 313 | + GFP_KERNEL); |
|---|
| 321 | 314 | if (!data) |
|---|
| 322 | 315 | return -ENOMEM; |
|---|
| 323 | 316 | |
|---|
| .. | .. |
|---|
| 377 | 370 | set.data_len = cpu_to_le16(sizeof(*data) + sizeof(*fw_app) * n); |
|---|
| 378 | 371 | set.hdr_cnt = 1; |
|---|
| 379 | 372 | rc = hwrm_send_message(bp, &set, sizeof(set), HWRM_CMD_TIMEOUT); |
|---|
| 380 | | - if (rc) |
|---|
| 381 | | - rc = -EIO; |
|---|
| 382 | 373 | |
|---|
| 383 | 374 | set_app_exit: |
|---|
| 384 | 375 | dma_free_coherent(&bp->pdev->dev, data_len, data, mapping); |
|---|
| .. | .. |
|---|
| 391 | 382 | struct hwrm_queue_dscp_qcaps_input req = {0}; |
|---|
| 392 | 383 | int rc; |
|---|
| 393 | 384 | |
|---|
| 385 | + bp->max_dscp_value = 0; |
|---|
| 394 | 386 | if (bp->hwrm_spec_code < 0x10800 || BNXT_VF(bp)) |
|---|
| 395 | 387 | return 0; |
|---|
| 396 | 388 | |
|---|
| .. | .. |
|---|
| 433 | 425 | dscp2pri->pri = app->priority; |
|---|
| 434 | 426 | req.entry_cnt = cpu_to_le16(1); |
|---|
| 435 | 427 | rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT); |
|---|
| 436 | | - if (rc) |
|---|
| 437 | | - rc = -EIO; |
|---|
| 438 | 428 | dma_free_coherent(&bp->pdev->dev, sizeof(*dscp2pri), dscp2pri, |
|---|
| 439 | 429 | mapping); |
|---|
| 440 | 430 | return rc; |
|---|
| .. | .. |
|---|
| 471 | 461 | if (total_ets_bw > 100) |
|---|
| 472 | 462 | return -EINVAL; |
|---|
| 473 | 463 | |
|---|
| 474 | | - *tc = max_tc + 1; |
|---|
| 464 | + if (max_tc >= bp->max_tc) |
|---|
| 465 | + *tc = bp->max_tc; |
|---|
| 466 | + else |
|---|
| 467 | + *tc = max_tc + 1; |
|---|
| 475 | 468 | return 0; |
|---|
| 476 | 469 | } |
|---|
| 477 | 470 | |
|---|
| .. | .. |
|---|
| 551 | 544 | static int bnxt_dcbnl_ieee_getpfc(struct net_device *dev, struct ieee_pfc *pfc) |
|---|
| 552 | 545 | { |
|---|
| 553 | 546 | struct bnxt *bp = netdev_priv(dev); |
|---|
| 554 | | - __le64 *stats = (__le64 *)bp->hw_rx_port_stats; |
|---|
| 547 | + __le64 *stats = bp->port_stats.hw_stats; |
|---|
| 555 | 548 | struct ieee_pfc *my_pfc = bp->ieee_pfc; |
|---|
| 556 | 549 | long rx_off, tx_off; |
|---|
| 557 | 550 | int i, rc; |
|---|
| .. | .. |
|---|
| 724 | 717 | |
|---|
| 725 | 718 | void bnxt_dcb_init(struct bnxt *bp) |
|---|
| 726 | 719 | { |
|---|
| 720 | + bp->dcbx_cap = 0; |
|---|
| 727 | 721 | if (bp->hwrm_spec_code < 0x10501) |
|---|
| 728 | 722 | return; |
|---|
| 729 | 723 | |
|---|