Skip to content

Commit a99c683

Browse files
Hariprasad Shenaidavem330
authored andcommitted
cxgb4: Get TID calculation right for IPv6 mode
CLIP is always enabled and hardware uses 2 TID entries instead of 4 for IPv6 in CLIP mode. Signed-off-by: Hariprasad Shenai <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6a29a42 commit a99c683

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ int cxgb4_alloc_stid(struct tid_info *t, int family, void *data)
15061506
else
15071507
stid = -1;
15081508
} else {
1509-
stid = bitmap_find_free_region(t->stid_bmap, t->nstids, 2);
1509+
stid = bitmap_find_free_region(t->stid_bmap, t->nstids, 1);
15101510
if (stid < 0)
15111511
stid = -1;
15121512
}
@@ -1520,7 +1520,7 @@ int cxgb4_alloc_stid(struct tid_info *t, int family, void *data)
15201520
if (family == PF_INET)
15211521
t->stids_in_use++;
15221522
else
1523-
t->stids_in_use += 4;
1523+
t->stids_in_use += 2;
15241524
}
15251525
spin_unlock_bh(&t->stid_lock);
15261526
return stid;
@@ -1571,13 +1571,13 @@ void cxgb4_free_stid(struct tid_info *t, unsigned int stid, int family)
15711571
if (family == PF_INET)
15721572
__clear_bit(stid, t->stid_bmap);
15731573
else
1574-
bitmap_release_region(t->stid_bmap, stid, 2);
1574+
bitmap_release_region(t->stid_bmap, stid, 1);
15751575
t->stid_tab[stid].data = NULL;
15761576
if (stid < t->nstids) {
15771577
if (family == PF_INET)
15781578
t->stids_in_use--;
15791579
else
1580-
t->stids_in_use -= 4;
1580+
t->stids_in_use -= 2;
15811581
} else {
15821582
t->sftids_in_use--;
15831583
}

0 commit comments

Comments
 (0)