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

Commit a5fcf8a6 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

net: propagate tc filter chain index down the ndo_setup_tc call



We need to push the chain index down to the drivers, so they have the
information to which chain the rule belongs. For now, no driver supports
multichain offload, so only chain 0 is supported. This is needed to
prevent chain squashes during offload for now. Later this will be used
to implement multichain offload.

Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 50dffe7f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1846,7 +1846,8 @@ static void xgbe_poll_controller(struct net_device *netdev)
}
#endif /* End CONFIG_NET_POLL_CONTROLLER */

static int xgbe_setup_tc(struct net_device *netdev, u32 handle, __be16 proto,
static int xgbe_setup_tc(struct net_device *netdev, u32 handle, u32 chain_index,
			 __be16 proto,
			 struct tc_to_netdev *tc_to_netdev)
{
	struct xgbe_prv_data *pdata = netdev_priv(netdev);
+2 −2
Original line number Diff line number Diff line
@@ -4273,8 +4273,8 @@ int bnx2x_setup_tc(struct net_device *dev, u8 num_tc)
	return 0;
}

int __bnx2x_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
		     struct tc_to_netdev *tc)
int __bnx2x_setup_tc(struct net_device *dev, u32 handle, u32 chain_index,
		     __be16 proto, struct tc_to_netdev *tc)
{
	if (tc->type != TC_SETUP_MQPRIO)
		return -EINVAL;
+2 −2
Original line number Diff line number Diff line
@@ -486,8 +486,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev);

/* setup_tc callback */
int bnx2x_setup_tc(struct net_device *dev, u8 num_tc);
int __bnx2x_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
		     struct tc_to_netdev *tc);
int __bnx2x_setup_tc(struct net_device *dev, u32 handle, u32 chain_index,
		     __be16 proto, struct tc_to_netdev *tc);

int bnx2x_get_vf_config(struct net_device *dev, int vf,
			struct ifla_vf_info *ivi);
+2 −2
Original line number Diff line number Diff line
@@ -7103,8 +7103,8 @@ int bnxt_setup_mq_tc(struct net_device *dev, u8 tc)
	return 0;
}

static int bnxt_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
			 struct tc_to_netdev *ntc)
static int bnxt_setup_tc(struct net_device *dev, u32 handle, u32 chain_index,
			 __be16 proto, struct tc_to_netdev *ntc)
{
	if (ntc->type != TC_SETUP_MQPRIO)
		return -EINVAL;
+5 −2
Original line number Diff line number Diff line
@@ -2823,12 +2823,15 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate)
	return err;
}

static int cxgb_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
			 struct tc_to_netdev *tc)
static int cxgb_setup_tc(struct net_device *dev, u32 handle, u32 chain_index,
			 __be16 proto, struct tc_to_netdev *tc)
{
	struct port_info *pi = netdev2pinfo(dev);
	struct adapter *adap = netdev2adap(dev);

	if (chain_index)
		return -EOPNOTSUPP;

	if (!(adap->flags & FULL_INIT_DONE)) {
		dev_err(adap->pdev_dev,
			"Failed to setup tc on port %d. Link Down?\n",
Loading