patches for DPDK stable branches
 help / color / mirror / Atom feed
* Re: [dpdk-stable] [PATCH] raw/ifpga/base: release eth group devices
       [not found] <1606288756-24705-1-git-send-email-tianfei.zhang@intel.com>
@ 2020-12-01  8:38 ` Xu, Rosen
  0 siblings, 0 replies; only message in thread
From: Xu, Rosen @ 2020-12-01  8:38 UTC (permalink / raw)
  To: Zhang, Tianfei, dev, Zhang, Qi Z; +Cc: stable

Hi,

> -----Original Message-----
> From: Zhang, Tianfei <tianfei.zhang@intel.com>
> Sent: Wednesday, November 25, 2020 15:19
> To: dev@dpdk.org; Xu, Rosen <rosen.xu@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Cc: Zhang, Tianfei <tianfei.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH] raw/ifpga/base: release eth group devices
> 
> From: Tianfei zhang <tianfei.zhang@intel.com>
> 
> Release the eth group resource in fme_eth_group_uinit().
> 
> Fixes: 8a256bef32 ("raw/ifpga/base: add eth group driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Tianfei zhang <tianfei.zhang@intel.com>
> ---
>  drivers/raw/ifpga/base/ifpga_fme.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/raw/ifpga/base/ifpga_fme.c
> b/drivers/raw/ifpga/base/ifpga_fme.c
> index f29ff31..0a7d3c2 100644
> --- a/drivers/raw/ifpga/base/ifpga_fme.c
> +++ b/drivers/raw/ifpga/base/ifpga_fme.c
> @@ -1288,9 +1288,27 @@ static int fme_eth_group_init(struct ifpga_feature
> *feature)
>  	return 0;
>  }
> 
> +static unsigned char fme_eth_group_get_gid(void *base) {
> +	struct eth_group_info_reg info;
> +
> +	info.info = opae_readq((u8 *)base + ETH_GROUP_INFO);
> +
> +	return info.group_id;
> +}
> +
>  static void fme_eth_group_uinit(struct ifpga_feature *feature)  {
> -	UNUSED(feature);
> +	struct ifpga_fme_hw *fme = (struct ifpga_fme_hw *)feature->parent;
> +	struct eth_group_device *dev;
> +	unsigned char group_id = fme_eth_group_get_gid(feature->addr);
> +
> +	if (group_id >= MAX_ETH_GROUP_DEVICES)
> +		return;
> +
> +	dev = fme->eth_dev[group_id];
> +	if (dev)
> +		eth_group_release(dev);
>  }
> 
>  struct ifpga_feature_ops fme_eth_group_ops = {
> --
> 1.8.3.1

Reviewed-by: Rosen Xu <rosen.xu@intel.com>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-01  8:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1606288756-24705-1-git-send-email-tianfei.zhang@intel.com>
2020-12-01  8:38 ` [dpdk-stable] [PATCH] raw/ifpga/base: release eth group devices Xu, Rosen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).