@@ -6944,6 +6944,28 @@ static void bnxt_hwrm_ring_grp_free(struct bnxt *bp)
6944
6944
hwrm_req_drop (bp , req );
6945
6945
}
6946
6946
6947
+ static void bnxt_set_rx_ring_params_p5 (struct bnxt * bp , u32 ring_type ,
6948
+ struct hwrm_ring_alloc_input * req ,
6949
+ struct bnxt_ring_struct * ring )
6950
+ {
6951
+ struct bnxt_ring_grp_info * grp_info = & bp -> grp_info [ring -> grp_idx ];
6952
+ u32 enables = RING_ALLOC_REQ_ENABLES_RX_BUF_SIZE_VALID ;
6953
+
6954
+ if (ring_type == HWRM_RING_ALLOC_AGG ) {
6955
+ req -> ring_type = RING_ALLOC_REQ_RING_TYPE_RX_AGG ;
6956
+ req -> rx_ring_id = cpu_to_le16 (grp_info -> rx_fw_ring_id );
6957
+ req -> rx_buf_size = cpu_to_le16 (BNXT_RX_PAGE_SIZE );
6958
+ enables |= RING_ALLOC_REQ_ENABLES_RX_RING_ID_VALID ;
6959
+ } else {
6960
+ req -> rx_buf_size = cpu_to_le16 (bp -> rx_buf_use_size );
6961
+ if (NET_IP_ALIGN == 2 )
6962
+ req -> flags =
6963
+ cpu_to_le16 (RING_ALLOC_REQ_FLAGS_RX_SOP_PAD );
6964
+ }
6965
+ req -> stat_ctx_id = cpu_to_le32 (grp_info -> fw_stats_ctx );
6966
+ req -> enables |= cpu_to_le32 (enables );
6967
+ }
6968
+
6947
6969
static int hwrm_ring_alloc_send_msg (struct bnxt * bp ,
6948
6970
struct bnxt_ring_struct * ring ,
6949
6971
u32 ring_type , u32 map_index )
@@ -6995,37 +7017,13 @@ static int hwrm_ring_alloc_send_msg(struct bnxt *bp,
6995
7017
break ;
6996
7018
}
6997
7019
case HWRM_RING_ALLOC_RX :
6998
- req -> ring_type = RING_ALLOC_REQ_RING_TYPE_RX ;
6999
- req -> length = cpu_to_le32 (bp -> rx_ring_mask + 1 );
7000
- if (bp -> flags & BNXT_FLAG_CHIP_P5_PLUS ) {
7001
- u16 flags = 0 ;
7002
-
7003
- /* Association of rx ring with stats context */
7004
- grp_info = & bp -> grp_info [ring -> grp_idx ];
7005
- req -> rx_buf_size = cpu_to_le16 (bp -> rx_buf_use_size );
7006
- req -> stat_ctx_id = cpu_to_le32 (grp_info -> fw_stats_ctx );
7007
- req -> enables |= cpu_to_le32 (
7008
- RING_ALLOC_REQ_ENABLES_RX_BUF_SIZE_VALID );
7009
- if (NET_IP_ALIGN == 2 )
7010
- flags = RING_ALLOC_REQ_FLAGS_RX_SOP_PAD ;
7011
- req -> flags = cpu_to_le16 (flags );
7012
- }
7013
- break ;
7014
7020
case HWRM_RING_ALLOC_AGG :
7015
- if (bp -> flags & BNXT_FLAG_CHIP_P5_PLUS ) {
7016
- req -> ring_type = RING_ALLOC_REQ_RING_TYPE_RX_AGG ;
7017
- /* Association of agg ring with rx ring */
7018
- grp_info = & bp -> grp_info [ring -> grp_idx ];
7019
- req -> rx_ring_id = cpu_to_le16 (grp_info -> rx_fw_ring_id );
7020
- req -> rx_buf_size = cpu_to_le16 (BNXT_RX_PAGE_SIZE );
7021
- req -> stat_ctx_id = cpu_to_le32 (grp_info -> fw_stats_ctx );
7022
- req -> enables |= cpu_to_le32 (
7023
- RING_ALLOC_REQ_ENABLES_RX_RING_ID_VALID |
7024
- RING_ALLOC_REQ_ENABLES_RX_BUF_SIZE_VALID );
7025
- } else {
7026
- req -> ring_type = RING_ALLOC_REQ_RING_TYPE_RX ;
7027
- }
7028
- req -> length = cpu_to_le32 (bp -> rx_agg_ring_mask + 1 );
7021
+ req -> ring_type = RING_ALLOC_REQ_RING_TYPE_RX ;
7022
+ req -> length = (ring_type == HWRM_RING_ALLOC_RX ) ?
7023
+ cpu_to_le32 (bp -> rx_ring_mask + 1 ) :
7024
+ cpu_to_le32 (bp -> rx_agg_ring_mask + 1 );
7025
+ if (bp -> flags & BNXT_FLAG_CHIP_P5_PLUS )
7026
+ bnxt_set_rx_ring_params_p5 (bp , ring_type , req , ring );
7029
7027
break ;
7030
7028
case HWRM_RING_ALLOC_CMPL :
7031
7029
req -> ring_type = RING_ALLOC_REQ_RING_TYPE_L2_CMPL ;
0 commit comments