1 From c9afdcdd2642485a6476906be9da2e811090fc7a Mon Sep 17 00:00:00 2001
2 From: Robert Marko <robimarko@gmail.com>
3 Date: Fri, 18 Mar 2022 18:06:03 +0100
4 Subject: [PATCH] switchdev: remove the transaction structure
6 Since 5.12 there is no transaction structure anymore, so drop it for
9 Signed-off-by: Robert Marko <robimarko@gmail.com>
11 nss_dp_switchdev.c | 10 ++++++++++
12 1 file changed, 10 insertions(+)
14 --- a/nss_dp_switchdev.c
15 +++ b/nss_dp_switchdev.c
16 @@ -279,13 +279,19 @@ void nss_dp_switchdev_setup(struct net_d
19 static int nss_dp_port_attr_set(struct net_device *dev,
20 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
21 const struct switchdev_attr *attr,
22 struct switchdev_trans *trans)
24 + const struct switchdev_attr *attr)
27 struct nss_dp_dev *dp_priv = (struct nss_dp_dev *)netdev_priv(dev);
29 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
30 if (switchdev_trans_ph_prepare(trans))
35 case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS:
36 @@ -309,8 +315,12 @@ static int nss_dp_switchdev_port_attr_se
40 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
41 err = nss_dp_port_attr_set(netdev, port_attr_info->attr,
42 port_attr_info->trans);
44 + err = nss_dp_port_attr_set(netdev, port_attr_info->attr);
47 port_attr_info->handled = true;
48 return notifier_from_errno(err);