* Configures the minimal amount of data to inline into WQE * while sending packets. * * - the txq_inline_min has the maximal priority, if this * key is specified in devargs * - if DevX is enabled the inline mode is queried from the * device (HCA attributes and NIC vport context if needed). * - otherwise L2 mode (18 bytes) is assumed for ConnectX-4/4 Lx * and none (0 bytes) for other
| 3058 | * Pointer to the private device data structure. |
| 3059 | */ |
| 3060 | void |
| 3061 | mlx5_set_min_inline(struct mlx5_priv *priv) |
| 3062 | { |
| 3063 | struct mlx5_hca_attr *hca_attr = &priv->sh->cdev->config.hca_attr; |
| 3064 | struct mlx5_port_config *config = &priv->config; |
| 3065 | |
| 3066 | if (config->txq_inline_min != MLX5_ARG_UNSET) { |
| 3067 | /* Application defines size of inlined data explicitly. */ |
| 3068 | if (priv->pci_dev != NULL) { |
| 3069 | switch (priv->pci_dev->id.device_id) { |
| 3070 | case PCI_DEVICE_ID_MELLANOX_CONNECTX4: |
| 3071 | case PCI_DEVICE_ID_MELLANOX_CONNECTX4VF: |
| 3072 | if (config->txq_inline_min < |
| 3073 | (int)MLX5_INLINE_HSIZE_L2) { |
| 3074 | DRV_LOG(DEBUG, |
| 3075 | "txq_inline_mix aligned to minimal ConnectX-4 required value %d", |
| 3076 | (int)MLX5_INLINE_HSIZE_L2); |
| 3077 | config->txq_inline_min = |
| 3078 | MLX5_INLINE_HSIZE_L2; |
| 3079 | } |
| 3080 | break; |
| 3081 | } |
| 3082 | } |
| 3083 | goto exit; |
| 3084 | } |
| 3085 | if (hca_attr->eth_net_offloads) { |
| 3086 | /* We have DevX enabled, inline mode queried successfully. */ |
| 3087 | switch (hca_attr->wqe_inline_mode) { |
| 3088 | case MLX5_CAP_INLINE_MODE_L2: |
| 3089 | /* outer L2 header must be inlined. */ |
| 3090 | config->txq_inline_min = MLX5_INLINE_HSIZE_L2; |
| 3091 | goto exit; |
| 3092 | case MLX5_CAP_INLINE_MODE_NOT_REQUIRED: |
| 3093 | /* No inline data are required by NIC. */ |
| 3094 | config->txq_inline_min = MLX5_INLINE_HSIZE_NONE; |
| 3095 | config->hw_vlan_insert = |
| 3096 | hca_attr->wqe_vlan_insert; |
| 3097 | DRV_LOG(DEBUG, "Tx VLAN insertion is supported"); |
| 3098 | goto exit; |
| 3099 | case MLX5_CAP_INLINE_MODE_VPORT_CONTEXT: |
| 3100 | /* inline mode is defined by NIC vport context. */ |
| 3101 | if (!hca_attr->eth_virt) |
| 3102 | break; |
| 3103 | switch (hca_attr->vport_inline_mode) { |
| 3104 | case MLX5_INLINE_MODE_NONE: |
| 3105 | config->txq_inline_min = |
| 3106 | MLX5_INLINE_HSIZE_NONE; |
| 3107 | goto exit; |
| 3108 | case MLX5_INLINE_MODE_L2: |
| 3109 | config->txq_inline_min = |
| 3110 | MLX5_INLINE_HSIZE_L2; |
| 3111 | goto exit; |
| 3112 | case MLX5_INLINE_MODE_IP: |
| 3113 | config->txq_inline_min = |
| 3114 | MLX5_INLINE_HSIZE_L3; |
| 3115 | goto exit; |
| 3116 | case MLX5_INLINE_MODE_TCP_UDP: |
| 3117 | config->txq_inline_min = |
no outgoing calls
no test coverage detected