[Question]Attach xdp program to bond driver with skb mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi:
	Now, as shown in commit 879af96ffd72("net, core: Add support for
XDP redirection to slave device"), if the master has been attached
program, the slave cannot be attached program. Similarly, if the slave
is already attached program, the master is not allowed to attach the
program. It does work for hw and driver mode. But in skb mode, if the
slave has been attached program, the master also can be attached
program. So I have two questions:
1. should skb mode work the same to hw/drv mode?
2. If other "master" drivers (team?) need to implement XDP feature, is
it more appropriate to place the restriction in dev_xdp_attach? As shown
in the following figure:

@@ -9194,6 +9194,14 @@ static int dev_xdp_attach(struct net_device *dev, struct netlink_ext_ack *extack
 		}
 	}

+	/* don't allow if a slave device already has a program */
+	netdev_for_each_lower_dev(dev, lower, iter) {
+		if (dev_xdp_prog_count(lower) > 0) {
+ NL_SET_ERR_MSG(extack, "Cannot attach when a slave device already has a program");
+			return -EEXIST;
+		}
+	}
+




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux