| 3080 | } |
| 3081 | |
| 3082 | int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) |
| 3083 | { |
| 3084 | struct bnxt *bp = eth_dev->data->dev_private; |
| 3085 | uint32_t rc = 0; |
| 3086 | |
| 3087 | rc = is_bnxt_in_error(bp); |
| 3088 | if (rc) |
| 3089 | return rc; |
| 3090 | |
| 3091 | /* Return if port is active */ |
| 3092 | if (eth_dev->data->dev_started) { |
| 3093 | PMD_DRV_LOG(ERR, "Stop port before changing MTU\n"); |
| 3094 | return -EBUSY; |
| 3095 | } |
| 3096 | |
| 3097 | /* Exit if receive queues are not configured yet */ |
| 3098 | if (!eth_dev->data->nb_rx_queues) |
| 3099 | return -ENOTSUP; |
| 3100 | |
| 3101 | /* Is there a change in mtu setting? */ |
| 3102 | if (eth_dev->data->mtu == new_mtu) |
| 3103 | return rc; |
| 3104 | |
| 3105 | if (new_mtu > RTE_ETHER_MTU) |
| 3106 | bp->flags |= BNXT_FLAG_JUMBO; |
| 3107 | else |
| 3108 | bp->flags &= ~BNXT_FLAG_JUMBO; |
| 3109 | |
| 3110 | rc = bnxt_vnic_mru_config(bp, new_mtu); |
| 3111 | if (rc) { |
| 3112 | PMD_DRV_LOG(ERR, "failed to update mtu in vnic context\n"); |
| 3113 | return rc; |
| 3114 | } |
| 3115 | |
| 3116 | if (bnxt_hwrm_config_host_mtu(bp)) |
| 3117 | PMD_DRV_LOG(WARNING, "Failed to configure host MTU\n"); |
| 3118 | |
| 3119 | PMD_DRV_LOG(INFO, "New MTU is %d\n", new_mtu); |
| 3120 | |
| 3121 | return rc; |
| 3122 | } |
| 3123 | |
| 3124 | static int |
| 3125 | bnxt_vlan_pvid_set_op(struct rte_eth_dev *dev, uint16_t pvid, int on) |
no test coverage detected