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

Commit 064d5e6f authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'u32-hwoffload-fixes'



Jakub Kicinski says:

====================
cls_u32 hardware offload fixes

This set fixes two small issues with error codes I noticed
in cls_u32.  Second patch could be viewed as user space API
change but that portion of API is not part of any release,
yet.

Compile tested only.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 7b01b8e8 d47a0f38
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -457,10 +457,12 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp,
	struct tc_to_netdev offload;
	int err;

	if (!tc_should_offload(dev, flags))
		return tc_skip_sw(flags) ? -EINVAL : 0;

	offload.type = TC_SETUP_CLSU32;
	offload.cls_u32 = &u32_offload;

	if (tc_should_offload(dev, flags)) {
	offload.cls_u32->command = TC_CLSU32_NEW_HNODE;
	offload.cls_u32->hnode.divisor = h->divisor;
	offload.cls_u32->hnode.handle = h->handle;
@@ -470,7 +472,6 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp,
					    tp->protocol, &offload);
	if (tc_skip_sw(flags))
		return err;
	}

	return 0;
}
@@ -863,7 +864,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
	if (tb[TCA_U32_FLAGS]) {
		flags = nla_get_u32(tb[TCA_U32_FLAGS]);
		if (!tc_flags_valid(flags))
			return err;
			return -EINVAL;
	}

	n = (struct tc_u_knode *)*arg;