Re: bonding: don't increase rx_dropped after processing LACPDUs

From: Geert Uytterhoeven
Date: Sun May 13 2012 - 08:08:29 EST


On Sat, May 12, 2012 at 10:09 PM, Linux Kernel Mailing List
<linux-kernel@xxxxxxxxxxxxxxx> wrote:
> Author: Â Â Jiri Bohac <jbohac@xxxxxxx>

> Â Âbonding: don't increase rx_dropped after processing LACPDUs
>
> Â ÂSince commit 3aba891d, bonding processes LACP frames (802.3ad
> Â Âmode) with bond_handle_frame(). Currently a copy of the skb is
> Â Âmade and the original is left to be processed by other
> Â Ârx_handlers and the rest of the network stack by returning
> Â ÂRX_HANDLER_ANOTHER. ÂAs there is no protocol handler for
> Â ÂPKT_TYPE_LACPDU, the frame is dropped and dev->rx_dropped
> Â Âincreased.
>
> Â ÂFix this by making bond_handle_frame() return RX_HANDLER_CONSUMED
> Â Âif bonding has processed the LACP frame.
>
> Â ÂSigned-off-by: Jiri Bohac <jbohac@xxxxxxx>
> Â ÂSigned-off-by: David S. Miller <davem@xxxxxxxxxxxxx>

> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1444,8 +1444,9 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
> Â Â Â Âstruct sk_buff *skb = *pskb;
> Â Â Â Âstruct slave *slave;
> Â Â Â Âstruct bonding *bond;
> - Â Â Â void (*recv_probe)(struct sk_buff *, struct bonding *,
> + Â Â Â int (*recv_probe)(struct sk_buff *, struct bonding *,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âstruct slave *);

drivers/net/bonding/bonding.h:struct bonding still has a version that
returns void:

void (*recv_probe)(struct sk_buff *, struct bonding *,
struct slave *);

drivers/net/bonding/bond_main.c: In function âbond_handle_frameâ:
drivers/net/bonding/bond_main.c:1463: warning: assignment from
incompatible pointer type
drivers/net/bonding/bond_main.c: In function âbond_openâ:
drivers/net/bonding/bond_main.c:3441: warning: assignment from
incompatible pointer type
drivers/net/bonding/bond_main.c:3448: warning: assignment from
incompatible pointer type

Can this cause crashes on architectures where the caller needs to
preserve space for the return value?

Don't know why I only start seeing this in -rc7, as the prototypes for the
functions related to the latter 2 warnings haven't changed recently.

Gr{oetje,eeting}s,

            Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
             Â Â -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/