|
|
@@ -96,6 +96,7 @@ nfp_devlink_port_split(struct devlink *devlink, unsigned int port_index,
|
|
|
{
|
|
|
struct nfp_pf *pf = devlink_priv(devlink);
|
|
|
struct nfp_eth_table_port eth_port;
|
|
|
+ unsigned int lanes;
|
|
|
int ret;
|
|
|
|
|
|
if (count < 2)
|
|
|
@@ -114,8 +115,12 @@ nfp_devlink_port_split(struct devlink *devlink, unsigned int port_index,
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
- ret = nfp_devlink_set_lanes(pf, eth_port.index,
|
|
|
- eth_port.port_lanes / count);
|
|
|
+ /* Special case the 100G CXP -> 2x40G split */
|
|
|
+ lanes = eth_port.port_lanes / count;
|
|
|
+ if (eth_port.lanes == 10 && count == 2)
|
|
|
+ lanes = 8 / count;
|
|
|
+
|
|
|
+ ret = nfp_devlink_set_lanes(pf, eth_port.index, lanes);
|
|
|
out:
|
|
|
mutex_unlock(&pf->lock);
|
|
|
|
|
|
@@ -128,6 +133,7 @@ nfp_devlink_port_unsplit(struct devlink *devlink, unsigned int port_index,
|
|
|
{
|
|
|
struct nfp_pf *pf = devlink_priv(devlink);
|
|
|
struct nfp_eth_table_port eth_port;
|
|
|
+ unsigned int lanes;
|
|
|
int ret;
|
|
|
|
|
|
mutex_lock(&pf->lock);
|
|
|
@@ -143,7 +149,12 @@ nfp_devlink_port_unsplit(struct devlink *devlink, unsigned int port_index,
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
- ret = nfp_devlink_set_lanes(pf, eth_port.index, eth_port.port_lanes);
|
|
|
+ /* Special case the 100G CXP -> 2x40G unsplit */
|
|
|
+ lanes = eth_port.port_lanes;
|
|
|
+ if (eth_port.port_lanes == 8)
|
|
|
+ lanes = 10;
|
|
|
+
|
|
|
+ ret = nfp_devlink_set_lanes(pf, eth_port.index, lanes);
|
|
|
out:
|
|
|
mutex_unlock(&pf->lock);
|
|
|
|