summaryrefslogtreecommitdiff
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorJianhua Xie <jianhua.xie@freescale.com>2014-04-14 09:29:10 (GMT)
committerJose Rivera <German.Rivera@freescale.com>2014-04-15 14:23:06 (GMT)
commit857692491a0beed72330e5c13935675c0449b963 (patch)
tree3716a50b83a763c9edc0be7c4bd53b2f670adbec /drivers/net/bonding
parent7188e1a04ff61f57fc71593bfdc6862d23407a70 (diff)
downloadlinux-fsl-qoriq-857692491a0beed72330e5c13935675c0449b963.tar.xz
bonding: make pcd basefqid aligned in FSL LAG
Distribution may result in less than hashDistributionNumOfFqids queues if baseFqid unaligned. Signed-off-by: Jianhua Xie <jianhua.xie@freescale.com> Change-Id: I3bb9dd597d305759a81a0319957d92c096294c4c Reviewed-on: http://git.am.freescale.net:8181/10949 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Jiafei Pan <Jiafei.Pan@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/hw_distribution.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/bonding/hw_distribution.c b/drivers/net/bonding/hw_distribution.c
index 6eeb58a..1403659 100644
--- a/drivers/net/bonding/hw_distribution.c
+++ b/drivers/net/bonding/hw_distribution.c
@@ -1378,7 +1378,7 @@ int get_oh_info(void)
struct platform_device *oh_of_dev, *of_dev;
struct device *dpa_oh_dev, *oh_dev;
struct device_node *dpa_oh_node = NULL, *oh_node;
- int lenp, errno = BOND_OH_SUCCESS, i = 0;
+ int fqcount, lenp, errno = BOND_OH_SUCCESS, i = 0;
const phandle *p_oh_port_handle;
const unsigned int *p_port_id;
const unsigned int *p_channel_id;
@@ -1481,9 +1481,9 @@ int get_oh_info(void)
memcpy(poh[i].friendname,
dpa_oh_node->full_name + 14, 10);
+ fqcount = roundup_pow_of_two(FM_MAX_NUM_OF_MACS);
if (qman_alloc_fqid_range(&poh[i].pcd_fqids_base,
- FM_MAX_NUM_OF_MACS, true, 0)
- != FM_MAX_NUM_OF_MACS) {
+ fqcount, fqcount, 0) != fqcount) {
pr_err("error on alloc continuous pcd fqid\n");
return -EINVAL;
}