Re: [PATCH net v2] net: mvpp2: Add TCAM entry to drop flow control pause frames

From: Jakub Kicinski
Date: Sat Dec 19 2020 - 13:16:40 EST


On Thu, 17 Dec 2020 20:30:17 +0200 stefanc@xxxxxxxxxxx wrote:
> From: Stefan Chulski <stefanc@xxxxxxxxxxx>
>
> Issue:
> Flow control frame used to pause GoP(MAC) was delivered to the CPU
> and created a load on the CPU. Since XOFF/XON frames are used only
> by MAC, these frames should be dropped inside MAC.
>
> Fix:
> According to 802.3-2012 - IEEE Standard for Ethernet pause frame
> has unique destination MAC address 01-80-C2-00-00-01.
> Add TCAM parser entry to track and drop pause frames by destination MAC.
>
> Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit")
> Signed-off-by: Stefan Chulski <stefanc@xxxxxxxxxxx>

Applied, thanks..

> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c
> index 1a272c2..3a9c747 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_prs.c
> @@ -405,6 +405,39 @@ static int mvpp2_prs_tcam_first_free(struct mvpp2 *priv, unsigned char start,
> return -EINVAL;
> }
>
> +/* Drop flow control pause frames */
> +static void mvpp2_prs_drop_fc(struct mvpp2 *priv)
> +{
> + struct mvpp2_prs_entry pe;
> + unsigned int len;
> + unsigned char da[ETH_ALEN] = {
> + 0x01, 0x80, 0xC2, 0x00, 0x00, 0x01 };

but I reordered these so they follow the reverse xmas tree ordering
netdev prefers.