Skip to contentSkip to conversation

bonding: don't increase rx_dropped after processing LACPDUs

DISCUSSION Geert Uytterhoeven 2 participants 3 messages May 13, 2012 – May 15, 2012 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 21 lines · Linux Kernel Mailing List

Author:     Jiri Bohac <[email protected]>

   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.

drivers/net/bonding/bond_main.c static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) · line 1448

Quoted 6 lines
drivers/net/bonding/bond_main.c +1 -1
@@ -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 -- [email protected]

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

maintainer
#3 lore raw

Re: [PATCH v3.4-rc7 regression] net/bond: return int from recv_probe()

From: Arnd Bergmann <[email protected]>
Date: Tue, 15 May 2012 10:56:53 +0000

Quoted 4 lines

13a8e0c8c "bonding: don't increase rx_dropped after processing LACPDUs" changed the prototype of the bonding recv_probe handler, but only in some places, as identified by this warning:

Quoted 8 lines

drivers/net/bonding/bond_main.c: In function 'bond_handle_frame':
drivers/net/bonding/bond_main.c:1463:13: error: assignment from incompatible pointer type [-Werror] drivers/net/bonding/bond_main.c: In function 'bond_open':
drivers/net/bonding/bond_main.c:3441:21: error: assignment from incompatible pointer type [-Werror] drivers/net/bonding/bond_main.c:3448:20: error: assignment from incompatible pointer type [-Werror]

To fix this, we can change the remaining prototypes to return an integer as well, and always return RX_HANDLER_ANOTHER from rlb_arp_recv.

This has been fixed in Linus's tree for almost 2 days.