Re: [PATCH net-next] net: hns: add support of pause frame ctrl for HNS V2
From: Andy Shevchenko
Date: Wed Mar 30 2016 - 06:50:30 EST
On Tue, 2016-03-29 at 15:04 +0800, Yisen Zhuang wrote:
> From: Lisheng <lisheng011@xxxxxxxxxx>
>
> The patch adds support of pause ctrl for HNS V2, and this feature is
> lost
> by HNS V1:
> ÂÂÂÂÂÂÂ1) service ports can disable rx pause frame,
> ÂÂÂÂÂÂÂ2) debug ports can open tx/rx pause frame.
>
> And this patch updates the REGs about the pause ctrl when updated
> status function called by upper layer routine.
> --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
> +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
>
> +void hns_dsaf_get_rx_mac_pause_en(struct dsaf_device *dsaf_dev, int
> mac_id,
> + ÂÂu32 *en)
> +{
> + if (AE_IS_VER1(dsaf_dev->dsaf_ver))
> + *en = 1;
> Â else
> Â dsaf_write_dev(dsaf_dev, DSAF_PFC_EN_0_REG + mac_id
> * 4, 0xff);
> + *en = dsaf_get_dev_bit(dsaf_dev,
> + ÂÂÂÂÂÂÂDSAF_PAUSE_CFG_REG + mac_id *
> 4,
> + ÂÂÂÂÂÂÂDSAF_MAC_PAUSE_RX_EN_B);
And what the point of if branch then? I think it's an obvious misfix,
you must replace else to } else { and add }.
How did you test this part?
> Â}
--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy