search for: nl_set_err_msg_mod

Displaying 20 results from an estimated 42 matches for "nl_set_err_msg_mod".

2023 Jan 26
1
[Bridge] [PATCH net-next] netlink: provide an ability to set default extack message
...br_switchdev.c b/net/bridge/br_switchdev.c index 7eb6fd5bb917..9f7ff63ef853 100644 --- a/net/bridge/br_switchdev.c +++ b/net/bridge/br_switchdev.c @@ -104,9 +104,8 @@ int br_switchdev_set_port_flag(struct net_bridge_port *p, return 0; if (err) { - if (extack && !extack->_msg) - NL_SET_ERR_MSG_MOD(extack, - "bridge flag offload is not supported"); + NL_SET_ERR_MSG_MOD(extack, + "bridge flag offload is not supported"); return -EOPNOTSUPP; } @@ -115,9 +114,8 @@ int br_switchdev_set_port_flag(struct net_bridge_port *p, err = switchdev_port_attr_set(p...
2023 Jan 26
2
[Bridge] [PATCH net-next] netlink: provide an ability to set default extack message
...is, and instead introducing a new NL_SET_ERR_MSG_WEAK() of sorts. The reason has to do with the fact that an extack is sometimes also used to convey warnings rather than hard errors, for example right here in net/dsa/slave.c: if (err == -EOPNOTSUPP) { if (extack && !extack->_msg) NL_SET_ERR_MSG_MOD(extack, "Offloading not supported"); NL_SET_ERR_MSG_MOD(extack, "Offloading not supported"); err = 0; } Imagine (not the case here) that below such a "warning extack" lies something like this: if (arg > range) { NL_SET_ERR_MSG_MOD(extack, &q...
2023 May 09
1
[Bridge] [RFC PATCH net-next 3/5] flow_offload: Reject matching on layer 2 miss
...ethernet/marvell/prestera/prestera_flower.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_flower.c @@ -148,6 +148,12 @@ static int prestera_flower_parse_meta(struct prestera_acl_rule *rule, __be16 key, mask; flow_rule_match_meta(f_rule, &match); + + if (match.mask->l2_miss) { + NL_SET_ERR_MSG_MOD(f->common.extack, "Can't match on \"l2_miss\""); + return -EOPNOTSUPP; + } + if (match.mask->ingress_ifindex != 0xFFFFFFFF) { NL_SET_ERR_MSG_MOD(f->common.extack, "Unsupported ingress ifindex mask"); diff --git a/drivers/net/ethernet/mellanox...
2023 Jan 27
1
[Bridge] [PATCH net-next] netlink: provide an ability to set default extack message
...nvidia.com> > > --- > > I would somewhat prefer not doing this, and instead introducing a new > NL_SET_ERR_MSG_WEAK() of sorts. It means changing ALL error unwind places where extack was forwarded before to subfunctions. Places like this: ret = func(..., extack) if (ret) { NL_SET_ERR_MSG_MOD... return ret; } will need to be changed to something like this: ret = func(..., extack) if (ret) { NL_SET_ERR_MSG_WEAK... return ret; } > > The reason has to do with the fact that an extack is sometimes also > used to convey warnings rather than hard errors, for example ri...
2023 Jan 29
3
[Bridge] [PATCH net-next v2] netlink: provide an ability to set default extack message
...eon Romanovsky <leonro at nvidia.com> --- Changelog: v2: * Removed () brackets around msg to fix compilation error. v1: https://lore.kernel.org/all/d4843760219f20367c27472f084bd8aa729cf321.1674995155.git.leon at kernel.org * Added special *_WEAK() macro instead of embedding same check in NL_SET_ERR_MSG_MOD/NL_SET_ERR_MSG_FMT. * Reuse same macro for XFRM code which triggered this patch. v0: https://lore.kernel.org/all/2919eb55e2e9b92265a3ba600afc8137a901ae5f.1674760340.git.leon at kernel.org --- include/linux/netlink.h | 10 ++++++++++ net/bridge/br_switchdev.c | 10 ++++------ net/dsa/master.c...
2023 Jul 11
3
[Bridge] [PATCH v1 net] bridge: Return an error when enabling STP in netns.
.../br_stp_if.c b/net/bridge/br_stp_if.c index 75204d36d7f9..a807996ac56b 100644 --- a/net/bridge/br_stp_if.c +++ b/net/bridge/br_stp_if.c @@ -201,6 +201,11 @@ int br_stp_set_enabled(struct net_bridge *br, unsigned long val, { ASSERT_RTNL(); + if (!net_eq(dev_net(br->dev), &init_net)) { + NL_SET_ERR_MSG_MOD(extack, "STP can't be enabled in non-root netns"); + return -EINVAL; + } + if (br_mrp_enabled(br)) { NL_SET_ERR_MSG_MOD(extack, "STP can't be enabled if MRP is already enabled"); -- 2.30.2
2023 Jul 12
2
[Bridge] [PATCH v1 net] bridge: Return an error when enabling STP in netns.
...bridge/br_stp_if.c > @@ -201,10 +201,8 @@ int br_stp_set_enabled(struct net_bridge *br, unsigned long val, > { > ASSERT_RTNL(); > > - if (!net_eq(dev_net(br->dev), &init_net)) { > + if (!net_eq(dev_net(br->dev), &init_net)) > NL_SET_ERR_MSG_MOD(extack, "STP can't be enabled in non-root netns"); > - return -EINVAL; > - } > > if (br_mrp_enabled(br)) { > NL_SET_ERR_MSG_MOD(extack, > I'd prefer this approach to changing user-visible behaviour and potential reg...
2019 Oct 25
2
[PATCH v2] vhost: introduce mdev based hardware backend
...tio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6) || virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) || virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) || virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_CSUM))) { NL_SET_ERR_MSG_MOD(extack, "Can't set XDP while host is implementing LRO/CSUM, disable LRO/CSUM first"); return -EOPNOTSUPP; } neither is very attractive. So yes ok just for development but we do need to figure out how it will work down the road in production. So really this s...
2019 Oct 25
2
[PATCH v2] vhost: introduce mdev based hardware backend
...tio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6) || virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) || virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) || virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_CSUM))) { NL_SET_ERR_MSG_MOD(extack, "Can't set XDP while host is implementing LRO/CSUM, disable LRO/CSUM first"); return -EOPNOTSUPP; } neither is very attractive. So yes ok just for development but we do need to figure out how it will work down the road in production. So really this s...
2018 Nov 22
0
[PATCH net 2/2] virtio-net: fail XDP set if guest csum is negotiated
...bpf_prog *prog, && (virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO4) || virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6) || virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) || - virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO))) { - NL_SET_ERR_MSG_MOD(extack, "Can't set XDP while host is implementing LRO, disable LRO first"); + virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) || + virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_CSUM))) { + NL_SET_ERR_MSG_MOD(extack, "Can't set XDP while host is implementing LR...
2023 May 09
5
[Bridge] [RFC PATCH net-next 0/5] Add layer 2 miss indication and filtering
tl;dr ===== This patchset adds a single bit to the skb to indicate that a packet encountered a layer 2 miss in the bridge and extends flower to match on this metadata. This is required for non-DF (Designated Forwarder) filtering in EVPN multi-homing which prevents decapsulated BUM packets from being forwarded multiple times to the same multi-homed host. Background ========== In a typical EVPN
2023 Jul 12
0
[Bridge] [PATCH v1 net] bridge: Return an error when enabling STP in netns.
...dex 75204d36d7f9..a807996ac56b 100644 > --- a/net/bridge/br_stp_if.c > +++ b/net/bridge/br_stp_if.c > @@ -201,6 +201,11 @@ int br_stp_set_enabled(struct net_bridge *br, unsigned long val, > { > ASSERT_RTNL(); > > + if (!net_eq(dev_net(br->dev), &init_net)) { > + NL_SET_ERR_MSG_MOD(extack, "STP can't be enabled in non-root netns"); > + return -EINVAL; > + } > + > if (br_mrp_enabled(br)) { > NL_SET_ERR_MSG_MOD(extack, > "STP can't be enabled if MRP is already enabled"); Oh well, I guess this should do for now. Hopefu...
2023 May 18
5
[Bridge] [PATCH net-next 0/5] Add layer 2 miss indication and filtering
tl;dr ===== This patchset adds a single bit to the skb to indicate that a packet encountered a layer 2 miss in the bridge and extends flower to match on this metadata. This is required for non-DF (Designated Forwarder) filtering in EVPN multi-homing which prevents decapsulated BUM packets from being forwarded multiple times to the same multi-homed host. Background ========== In a typical EVPN
2023 Jan 31
1
[PATCH v2 1/7] vdpa: fix improper error message when adding vdpa dev
...ndex 8ef7aa1..3a82ca78 100644 --- a/drivers/vdpa/vdpa.c +++ b/drivers/vdpa/vdpa.c @@ -622,9 +622,11 @@ static int vdpa_nl_cmd_dev_add_set_doit(struct sk_buff *skb, struct genl_info *i err = PTR_ERR(mdev); goto err; } + if ((config.mask & mdev->config_attr_mask) != config.mask) { - NL_SET_ERR_MSG_MOD(info->extack, - "All provided attributes are not supported"); + NL_SET_ERR_MSG_FMT_MOD(info->extack, + "Some provided attributes are not supported: 0x%llx", + config.mask & ~mdev->config_attr_mask); err = -EOPNOTSUPP; goto err; } -...
2023 Jan 26
2
[Bridge] [PATCH net-next] netlink: provide an ability to set default extack message
...39;m not completely useless :) > The reason has to do with the fact that an extack is sometimes also > used to convey warnings rather than hard errors, for example right here > in net/dsa/slave.c: > > if (err == -EOPNOTSUPP) { > if (extack && !extack->_msg) > NL_SET_ERR_MSG_MOD(extack, > "Offloading not supported"); > NL_SET_ERR_MSG_MOD(extack, > "Offloading not supported"); > err = 0; > }
2023 Jul 12
0
[Bridge] llc needs namespace awareness asap, was Re: Patch fixing STP if bridge in non-default namespace.
...dex 75204d36d7f9..a807996ac56b 100644 > --- a/net/bridge/br_stp_if.c > +++ b/net/bridge/br_stp_if.c > @@ -201,6 +201,11 @@ int br_stp_set_enabled(struct net_bridge *br, unsigned long val, > { > ASSERT_RTNL(); > > + if (!net_eq(dev_net(br->dev), &init_net)) { > + NL_SET_ERR_MSG_MOD(extack, "STP can't be enabled in non-root netns"); > + return -EINVAL; > + } > + > if (br_mrp_enabled(br)) { > NL_SET_ERR_MSG_MOD(extack, > "STP can't be enabled if MRP is already enabled"); > ---8<---
2023 Jan 30
6
[PATCH 0/6] features provisioning fixes and mlx5_vdpa support
This patchset is pre-requisite to export and provision device config attributes and features for vdpa live migration, in a way backward and forward compatibility can be retained. The follow up work [1] will need to be built around the new feature provisioning uAPI, with which it's easier to formalize migration compatibility support at the driver level. Thanks, -Siwei [1] [PATCH v3 0/4] vDPA:
2019 Oct 28
2
[PATCH v2] vhost: introduce mdev based hardware backend
...F_GUEST_TSO6) || >> virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) || >> virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) || >> virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_CSUM))) { >> NL_SET_ERR_MSG_MOD(extack, "Can't set XDP while host is implementing LRO/CSUM, disable LRO/CSUM first"); >> return -EOPNOTSUPP; >> } >> >> neither is very attractive. >> >> So yes ok just for development but we do need to figure out how it wi...
2019 Oct 28
2
[PATCH v2] vhost: introduce mdev based hardware backend
...F_GUEST_TSO6) || >> virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ECN) || >> virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_UFO) || >> virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_CSUM))) { >> NL_SET_ERR_MSG_MOD(extack, "Can't set XDP while host is implementing LRO/CSUM, disable LRO/CSUM first"); >> return -EOPNOTSUPP; >> } >> >> neither is very attractive. >> >> So yes ok just for development but we do need to figure out how it wi...
2018 Nov 22
4
[PATCH net 1/2] virtio-net: disable guest csum during XDP set
We don't disable VIRTIO_NET_F_GUEST_CSUM if XDP was set. This means we can receive partial csumed packets with metadata kept in the vnet_hdr. This may have several side effects: - It could be overridden by header adjustment, thus is might be not correct after XDP processing. - There's no way to pass such metadata information through XDP_REDIRECT to another driver. - XDP does not