Skip to contentSkip to conversation

linux-next: semantic conflict between the net and net-next trees

PATCH Sasha Levin 2 participants 2 messages Nov 24

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi Mark,

The current net tree has a semantic conflict with the net-next tree that breaks the build:

drivers/net/tun.c:1881:11: error: no member named 'ops' in 'struct ubuf_info'

3896ae4adf5f ("tun: complete the zerocopy buffer of packets consumed by XDP") in the net tree calls uarg->ops->complete() in tun_get_user(), and ecca9bb2c855 ("net: skbuff: replace ubuf_info ops ptr with type id") in the net-next tree removes ubuf_info::ops. The fix uses net_zcopy_complete(), as ecca9bb2c855 does for the same call later in tun_get_user():

drivers/net/tun.c +2 -5
@@ -1875,11 +1875,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
 			goto drop;
 		if (!skb) {
 			/* consumed by XDP, after copying */
-			if (msg_control) {
-				struct ubuf_info *uarg = msg_control;
-
-				uarg->ops->complete(NULL, uarg, false);
-			}
+			if (msg_control)
+				net_zcopy_complete(NULL, msg_control, false);
 			return total_len;
 		}
 	} else {
Signature · 2 lines
Thanks,
Sasha
#1 lore raw

Hi Sasha,

Quoted 19 lines · Sasha Levin

Hi Mark,

The current net tree has a semantic conflict with the net-next tree that breaks the build:

drivers/net/tun.c:1881:11: error: no member named 'ops' in 'struct ubuf_info'

3896ae4adf5f ("tun: complete the zerocopy buffer of packets consumed by XDP") in the net tree calls uarg->ops->complete() in tun_get_user(), and ecca9bb2c855 ("net: skbuff: replace ubuf_info ops ptr with type id") in the net-next tree removes ubuf_info::ops. The fix uses net_zcopy_complete(), as ecca9bb2c855 does for the same call later in tun_get_user():

drivers/net/tun.c +0 -0
@@ -1875,11 +1875,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
  			goto drop;

drivers/net/tun.c static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, · line 1880

Quoted 10 lines
drivers/net/tun.c +2 -5
  		if (!skb) {
  			/* consumed by XDP, after copying */
-			if (msg_control) {
-				struct ubuf_info *uarg = msg_control;
-
-				uarg->ops->complete(NULL, uarg, false);
-			}
+			if (msg_control)
+				net_zcopy_complete(NULL, msg_control, false);
  			return total_len;

The resolution looks good to me and it's the one I noted below the --- of my patch to net.
I build-tested net-next's tun.c with the fix and this resolution.

Thanks,

Signature · 5 lines
Antonio Quartulli

CEO and Co-Founder
Mandelbit Srl
https://www.mandelbit.com