Unverified Commit 27f1e802 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!194 bonding: 3ad: add support for 200G speed

Merge Pull Request from: @CTC-XiboWang 
 
This PR is cherry-pick from upstream "bonding: 3ad: add support for 200G speed"

backport from upstream for OLK-5.10

Upstream patch:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/net/bonding?h=v6.1-rc2&id=ab73447c38e4f335279d56bd5e688ce601092f50 
 
Link:https://gitee.com/openeuler/kernel/pulls/194

 
Reviewed-by: default avatarYue Haibing <yuehaibing@huawei.com>
Signed-off-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parents f7990942 cb360039
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ enum ad_link_speed_type {
	AD_LINK_SPEED_50000MBPS,
	AD_LINK_SPEED_56000MBPS,
	AD_LINK_SPEED_100000MBPS,
	AD_LINK_SPEED_200000MBPS,
};

/* compare MAC addresses */
@@ -245,6 +246,7 @@ static inline int __check_agg_selection_timer(struct port *port)
 *     %AD_LINK_SPEED_50000MBPS
 *     %AD_LINK_SPEED_56000MBPS
 *     %AD_LINK_SPEED_100000MBPS
 *     %AD_LINK_SPEED_200000MBPS
 */
static u16 __get_link_speed(struct port *port)
{
@@ -312,6 +314,10 @@ static u16 __get_link_speed(struct port *port)
			speed = AD_LINK_SPEED_100000MBPS;
			break;

		case SPEED_200000:
			speed = AD_LINK_SPEED_200000MBPS;
			break;

		default:
			/* unknown speed value from ethtool. shouldn't happen */
			if (slave->speed != SPEED_UNKNOWN)
@@ -733,6 +739,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
		case AD_LINK_SPEED_100000MBPS:
			bandwidth = nports * 100000;
			break;
		case AD_LINK_SPEED_200000MBPS:
			bandwidth = nports * 200000;
			break;
		default:
			bandwidth = 0; /* to silence the compiler */
		}