Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210585
b: refs/heads/master
c: ee9c5cf
h: refs/heads/master
i:
  210583: e45766c
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Sep 8, 2010
1 parent 1f09dad commit 3b57b20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6523ce1525e88c598c75a1a6b8c4edddfa9defe8
refs/heads/master: ee9c5cfad29c8a13199962614b9b16f1c4137ac9
16 changes: 6 additions & 10 deletions trunk/drivers/net/niu.c
Original file line number Diff line number Diff line change
Expand Up @@ -7272,32 +7272,28 @@ static int niu_get_ethtool_tcam_all(struct niu *np,
struct niu_parent *parent = np->parent;
struct niu_tcam_entry *tp;
int i, idx, cnt;
u16 n_entries;
unsigned long flags;

int ret = 0;

/* put the tcam size here */
nfc->data = tcam_get_size(np);

niu_lock_parent(np, flags);
n_entries = nfc->rule_cnt;
for (cnt = 0, i = 0; i < nfc->data; i++) {
idx = tcam_get_index(np, i);
tp = &parent->tcam[idx];
if (!tp->valid)
continue;
if (cnt == nfc->rule_cnt) {
ret = -EMSGSIZE;
break;
}
rule_locs[cnt] = i;
cnt++;
}
niu_unlock_parent(np, flags);

if (n_entries != cnt) {
/* print warning, this should not happen */
netdev_info(np->dev, "niu%d: In %s(): n_entries[%d] != cnt[%d]!!!\n",
np->parent->index, __func__, n_entries, cnt);
}

return 0;
return ret;
}

static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
Expand Down

0 comments on commit 3b57b20

Please sign in to comment.