Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1aed1814 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'mqprio-offload-more-info'



Alexander Duyck says:

====================
Add support for passing more information in mqprio offload

This patch series lays the groundwork for future work to allow us to make
full use of the mqprio options when offloading them to hardware.

Currently when we specify the hardware offload for mqprio the queue
configuration is completely ignored and the hardware is only notified of
the total number of traffic classes.  The problem is this leads to multiple
issues, one specific issue being you can pass the queue configuration you
want and it is totally ignored by the hardware.

What I am planning to do is add support for "hw" values in the
configuration greater than 1.  So for example we might have one mode of
mqprio offload that uses 1 and only offloads the TC counts like we
currently do.  Then we might look at adding an option 2 which would factor
in the TCs and the queue count information. This way we can select between
the type of offload we actually want and existing drivers that don't
support this can just fall back to their legacy configuration.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 5b769649 56f36acd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1854,7 +1854,8 @@ static int xgbe_setup_tc(struct net_device *netdev, u32 handle, __be16 proto,
	if (tc_to_netdev->type != TC_SETUP_MQPRIO)
		return -EINVAL;

	tc = tc_to_netdev->tc;
	tc_to_netdev->mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
	tc = tc_to_netdev->mqprio->num_tc;

	if (tc > pdata->hw_feat.tc_cnt)
		return -EINVAL;
+4 −1
Original line number Diff line number Diff line
@@ -4277,7 +4277,10 @@ int __bnx2x_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
{
	if (tc->type != TC_SETUP_MQPRIO)
		return -EINVAL;
	return bnx2x_setup_tc(dev, tc->tc);

	tc->mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;

	return bnx2x_setup_tc(dev, tc->mqprio->num_tc);
}

/* called with rtnl_lock */
+3 −1
Original line number Diff line number Diff line
@@ -6905,7 +6905,9 @@ static int bnxt_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
	if (ntc->type != TC_SETUP_MQPRIO)
		return -EINVAL;

	return bnxt_setup_mq_tc(dev, ntc->tc);
	ntc->mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;

	return bnxt_setup_mq_tc(dev, ntc->mqprio->num_tc);
}

#ifdef CONFIG_RFS_ACCEL
+10 −6
Original line number Diff line number Diff line
@@ -346,33 +346,37 @@ static int dpaa_setup_tc(struct net_device *net_dev, u32 handle, __be16 proto,
			 struct tc_to_netdev *tc)
{
	struct dpaa_priv *priv = netdev_priv(net_dev);
	u8 num_tc;
	int i;

	if (tc->type != TC_SETUP_MQPRIO)
		return -EINVAL;

	if (tc->tc == priv->num_tc)
	tc->mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
	num_tc = tc->mqprio->num_tc;

	if (num_tc == priv->num_tc)
		return 0;

	if (!tc->tc) {
	if (!num_tc) {
		netdev_reset_tc(net_dev);
		goto out;
	}

	if (tc->tc > DPAA_TC_NUM) {
	if (num_tc > DPAA_TC_NUM) {
		netdev_err(net_dev, "Too many traffic classes: max %d supported.\n",
			   DPAA_TC_NUM);
		return -EINVAL;
	}

	netdev_set_num_tc(net_dev, tc->tc);
	netdev_set_num_tc(net_dev, num_tc);

	for (i = 0; i < tc->tc; i++)
	for (i = 0; i < num_tc; i++)
		netdev_set_tc_queue(net_dev, i, DPAA_TC_TXQ_NUM,
				    i * DPAA_TC_TXQ_NUM);

out:
	priv->num_tc = tc->tc ? tc->tc : 1;
	priv->num_tc = num_tc ? : 1;
	netif_set_real_num_tx_queues(net_dev, priv->num_tc * DPAA_TC_TXQ_NUM);
	return 0;
}
+3 −1
Original line number Diff line number Diff line
@@ -1226,7 +1226,9 @@ static int __fm10k_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
	if (tc->type != TC_SETUP_MQPRIO)
		return -EINVAL;

	return fm10k_setup_tc(dev, tc->tc);
	tc->mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;

	return fm10k_setup_tc(dev, tc->mqprio->num_tc);
}

static void fm10k_assign_l2_accel(struct fm10k_intfc *interface,
Loading