Skip to content

Commit

Permalink
team: fix port list dump for big number of ports
Browse files Browse the repository at this point in the history
In case the port list dump does not fit into one skb currently the
dump would start over again. Fix this by continue from the last dumped
port.

Introduced by commit d90f889 (team: handle sending port list in the
same way option list is sent)

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Jun 1, 2013
1 parent 6d7581e commit 3f3e7ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/team/team.c
Original file line number Diff line number Diff line change
Expand Up @@ -2374,7 +2374,8 @@ static int team_nl_send_port_list_get(struct team *team, u32 portid, u32 seq,
bool incomplete;
int i;

port = list_first_entry(&team->port_list, struct team_port, list);
port = list_first_entry_or_null(&team->port_list,
struct team_port, list);

start_again:
err = __send_and_alloc_skb(&skb, team, portid, send_func);
Expand Down Expand Up @@ -2402,8 +2403,8 @@ static int team_nl_send_port_list_get(struct team *team, u32 portid, u32 seq,
err = team_nl_fill_one_port_get(skb, one_port);
if (err)
goto errout;
} else {
list_for_each_entry(port, &team->port_list, list) {
} else if (port) {
list_for_each_entry_from(port, &team->port_list, list) {
err = team_nl_fill_one_port_get(skb, port);
if (err) {
if (err == -EMSGSIZE) {
Expand Down

0 comments on commit 3f3e7ce

Please sign in to comment.