@@ -3939,6 +3939,7 @@ static int dpaa2_eth_setup_rx_flow(struct dpaa2_eth_priv *priv,
3939
3939
MEM_TYPE_PAGE_ORDER0 , NULL );
3940
3940
if (err ) {
3941
3941
dev_err (dev , "xdp_rxq_info_reg_mem_model failed\n" );
3942
+ xdp_rxq_info_unreg (& fq -> channel -> xdp_rxq );
3942
3943
return err ;
3943
3944
}
3944
3945
@@ -4432,17 +4433,25 @@ static int dpaa2_eth_bind_dpni(struct dpaa2_eth_priv *priv)
4432
4433
return - EINVAL ;
4433
4434
}
4434
4435
if (err )
4435
- return err ;
4436
+ goto out ;
4436
4437
}
4437
4438
4438
4439
err = dpni_get_qdid (priv -> mc_io , 0 , priv -> mc_token ,
4439
4440
DPNI_QUEUE_TX , & priv -> tx_qdid );
4440
4441
if (err ) {
4441
4442
dev_err (dev , "dpni_get_qdid() failed\n" );
4442
- return err ;
4443
+ goto out ;
4443
4444
}
4444
4445
4445
4446
return 0 ;
4447
+
4448
+ out :
4449
+ while (i -- ) {
4450
+ if (priv -> fq [i ].type == DPAA2_RX_FQ &&
4451
+ xdp_rxq_info_is_reg (& priv -> fq [i ].channel -> xdp_rxq ))
4452
+ xdp_rxq_info_unreg (& priv -> fq [i ].channel -> xdp_rxq );
4453
+ }
4454
+ return err ;
4446
4455
}
4447
4456
4448
4457
/* Allocate rings for storing incoming frame descriptors */
@@ -4825,6 +4834,17 @@ static void dpaa2_eth_del_ch_napi(struct dpaa2_eth_priv *priv)
4825
4834
}
4826
4835
}
4827
4836
4837
+ static void dpaa2_eth_free_rx_xdp_rxq (struct dpaa2_eth_priv * priv )
4838
+ {
4839
+ int i ;
4840
+
4841
+ for (i = 0 ; i < priv -> num_fqs ; i ++ ) {
4842
+ if (priv -> fq [i ].type == DPAA2_RX_FQ &&
4843
+ xdp_rxq_info_is_reg (& priv -> fq [i ].channel -> xdp_rxq ))
4844
+ xdp_rxq_info_unreg (& priv -> fq [i ].channel -> xdp_rxq );
4845
+ }
4846
+ }
4847
+
4828
4848
static int dpaa2_eth_probe (struct fsl_mc_device * dpni_dev )
4829
4849
{
4830
4850
struct device * dev ;
@@ -5028,6 +5048,7 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
5028
5048
free_percpu (priv -> percpu_stats );
5029
5049
err_alloc_percpu_stats :
5030
5050
dpaa2_eth_del_ch_napi (priv );
5051
+ dpaa2_eth_free_rx_xdp_rxq (priv );
5031
5052
err_bind :
5032
5053
dpaa2_eth_free_dpbps (priv );
5033
5054
err_dpbp_setup :
@@ -5080,6 +5101,7 @@ static void dpaa2_eth_remove(struct fsl_mc_device *ls_dev)
5080
5101
free_percpu (priv -> percpu_extras );
5081
5102
5082
5103
dpaa2_eth_del_ch_napi (priv );
5104
+ dpaa2_eth_free_rx_xdp_rxq (priv );
5083
5105
dpaa2_eth_free_dpbps (priv );
5084
5106
dpaa2_eth_free_dpio (priv );
5085
5107
dpaa2_eth_free_dpni (priv );
0 commit comments