[PATCH net] team: fix deadlock during setting of MTU

2021-01-14 Thread Ivan Vecera
e port list traversal in team_change_mtu() can be protected by RCU read lock. In case of failure the failing port is marked and unwind code-path is done also under RCU read lock protection (but not in reverse order). Fixes: 3d249d4ca7d0 ("net: introduce ethernet teaming device") Cc: Jiri Pirko

Re: [PATCH net] team: fix deadlock during setting of MTU

2021-01-15 Thread Ivan Vecera
On Thu, 14 Jan 2021 16:34:24 -0800 Saeed Mahameed wrote: > On Thu, 2021-01-14 at 12:55 +0100, Ivan Vecera wrote: > > Team driver protects port list traversal in team_change_mtu() > > by its team->lock mutex. This causes a deadlock with certain > > devices that call

[PATCH net] team: postpone features update to avoid deadlock

2021-01-20 Thread Ivan Vecera
net teaming device") Cc: Jiri Pirko Signed-off-by: Ivan Vecera --- drivers/net/team/team.c | 36 +++- include/linux/if_team.h | 1 + 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index c19dac21c4

Re: [PATCH net] team: fix deadlock during setting of MTU

2021-01-20 Thread Ivan Vecera
On Fri, 15 Jan 2021 09:24:05 +0100 Ivan Vecera wrote: > > according to your explanation in the commit message the team->lock > > mutex will be also taken under this rcu lock, so this is bad even > > if dev_set_mtu does not sleep. > > > Hmm, you are right... btw

Re: [PATCH net] team: postpone features update to avoid deadlock

2021-01-21 Thread Ivan Vecera
On Wed, 20 Jan 2021 15:18:20 -0800 Cong Wang wrote: > On Wed, Jan 20, 2021 at 4:56 AM Ivan Vecera wrote: > > > > To fix the problem __team_compute_features() needs to be postponed > > for these cases. > > Is there any user-visible effect after deferring this featur

Re: [PATCH net] team: postpone features update to avoid deadlock

2021-01-22 Thread Ivan Vecera
On Thu, 21 Jan 2021 18:34:52 -0800 Jakub Kicinski wrote: > On Thu, 21 Jan 2021 11:29:37 +0100 Ivan Vecera wrote: > > On Wed, 20 Jan 2021 15:18:20 -0800 > > Cong Wang wrote: > > > On Wed, Jan 20, 2021 at 4:56 AM Ivan Vecera wrote: > > > > > > >

[PATCH net] ethtool: fix error paths in ethnl_set_channels()

2020-12-15 Thread Ivan Vecera
Fix two error paths in ethnl_set_channels() to avoid lock-up caused but unreleased RTNL. Fixes: e19c591eafad ("ethtool: set device channel counts with CHANNELS_SET request") Cc: Michal Kubecek Reported-by: LiLiang Signed-off-by: Ivan Vecera --- net/ethtool/channels.c | 6

Re: [PATCH net-next 7/9] bridge: switchdev: Notify about VLAN protocol changes

2020-11-30 Thread Ivan Vecera
dr(br); > @@ -889,6 +898,9 @@ int __br_vlan_set_proto(struct net_bridge *br, __be16 > proto) > return 0; > > err_filt: > + attr.u.vlan_protocol = ntohs(oldproto); > + switchdev_port_attr_set(br->dev, &attr); > + > list_for_each_entry_continue_reverse(vlan, &vg->vlan_list, vlist) > vlan_vid_del(p->dev, proto, vlan->vid); > Reviewed-by: Ivan Vecera

Re: [PATCH net v2] bonding: fix feature flag setting at init time

2020-12-02 Thread Ivan Vecera
work based on further testing and suggestions from ivecera > > Fixes: a3b658cfb664 ("bonding: allow xfrm offload setup post-module-load") > Reported-by: Ivan Vecera > Suggested-by: Ivan Vecera > Cc: Jay Vosburgh > Cc: Veaceslav Falico > Cc: Andy Gospodarek >

Re: [PATCH net] bonding: fix feature flag setting at init time

2020-11-23 Thread Ivan Vecera
On Sun, 22 Nov 2020 22:17:16 -0500 Jarod Wilson wrote: > Have run into a case where bond_option_mode_set() gets called before > hw_features has been filled in, and very bad things happen when > netdev_change_features() then gets called, because the empty hw_features > wipes out almost all feature

[PATCH net] team: protect features update by RCU to avoid deadlock

2021-01-24 Thread Ivan Vecera
: 3d249d4ca7d0 ("net: introduce ethernet teaming device") Cc: Jiri Pirko Cc: David S. Miller Cc: Cong Wang Cc: Jakub Kicinski Cc: Saeed Mahameed Signed-off-by: Ivan Vecera --- drivers/net/team/team.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/n

Re: [PATCH net] team: protect features update by RCU to avoid deadlock

2021-01-26 Thread Ivan Vecera
On Mon, 25 Jan 2021 12:53:22 -0800 Cong Wang wrote: > On Sun, Jan 24, 2021 at 11:44 PM Ivan Vecera wrote: > > > > Function __team_compute_features() is protected by team->lock > > mutex when it is called from team_compute_features() used when > > features of a

Re: [PATCH net-next mlxsw v2 1/2] switchdev: Add fdb.added_by_user to switchdev notifications

2018-05-03 Thread Ivan Vecera
ruct dsa_switchdev_event_work *switchdev_work; > > if (!dsa_slave_dev_check(dev)) > @@ -1458,8 +1459,10 @@ static int dsa_slave_switchdev_event(struct > notifier_block *unused, > switch (event) { > case SWITCHDEV_FDB_ADD_TO_DEVICE: /* fall through */ > case SWITCHDEV_FDB_DEL_TO_DEVICE: > + if (!fdb_info->added_by_user) > + break; > if (dsa_slave_switchdev_fdb_work_init(switchdev_work, > - ptr)) > + fdb_info)) > goto err_fdb_work_init; > dev_hold(dev); > break; > LGTM Acked-by: Ivan Vecera

Re: [PATCH net-next mlxsw v2 2/2] net: bridge: Notify about !added_by_user FDB entries

2018-05-03 Thread Ivan Vecera
char *addr, u16 vid, > + bool swdev_notify); > int br_fdb_external_learn_del(struct net_bridge *br, struct net_bridge_port > *p, > - const unsigned char *addr, u16 vid); > + const unsigned char *addr, u16 vid, > + bool swdev_notify); > void br_fdb_offloaded_set(struct net_bridge *br, struct net_bridge_port *p, > const unsigned char *addr, u16 vid); > > diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c > index 71a03c4..35474d4 100644 > --- a/net/bridge/br_switchdev.c > +++ b/net/bridge/br_switchdev.c > @@ -118,7 +118,7 @@ br_switchdev_fdb_call_notifiers(bool adding, const > unsigned char *mac, > void > br_switchdev_fdb_notify(const struct net_bridge_fdb_entry *fdb, int type) > { > - if (!fdb->added_by_user || !fdb->dst) > + if (!fdb->dst) > return; > > switch (type) { > Acked-by: Ivan Vecera

[PATCH net-next] ipv6: addrconf: don't evaluate keep_addr_on_down twice

2018-04-24 Thread Ivan Vecera
The addrconf_ifdown() evaluates keep_addr_on_down state twice. There is no need to do it. Cc: David Ahern Signed-off-by: Ivan Vecera --- net/ipv6/addrconf.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c

[PATCH net-next v2] ipv6: addrconf: don't evaluate keep_addr_on_down twice

2018-04-24 Thread Ivan Vecera
The addrconf_ifdown() evaluates keep_addr_on_down state twice. There is no need to do it. Cc: David Ahern Signed-off-by: Ivan Vecera --- net/ipv6/addrconf.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c

[PATCH] be2net: eliminate enable field from be_aic_obj

2019-08-16 Thread Ivan Vecera
Adaptive coalescing is managed per adapter not per event queue so it does not needed to store 'enable' flag for each event queue. Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet/be.h | 2 +- drivers/net/ethernet/emulex/benet/be_ethtool.c | 7 --- d

Re: [PATCH net-next v2 0/2] net: dev: BYPASS for lockless qdisc

2019-03-22 Thread Ivan Vecera
+++ net/core/dev.c| 9 + net/sched/sch_generic.c | 3 +++ 3 files changed, 23 insertions(+) Reviewed-by: Ivan Vecera

Re: [PATCH net-next v3 1/2] net: sched: add empty status flag for NOLOCK qdisc

2019-03-22 Thread Ivan Vecera
return skb; @@ -880,6 +882,7 @@ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, sch->enqueue = ops->enqueue; sch->dequeue = ops->dequeue; sch->dev_queue = dev_queue; + sch->empty = true; dev_hold(dev); refcount_set(&sch->refcnt, 1); Reviewed-by: Ivan Vecera

Re: [patch net-next v2 1/5] net: bridge: Notify on bridge device mrouter state changes

2017-10-09 Thread Ivan Vecera
@ int br_multicast_set_router(struct net_bridge *br, > unsigned long val) > switch (val) { > case MDB_RTR_TYPE_DISABLED: > case MDB_RTR_TYPE_PERM: > + br_mc_router_state_change(br, val == MDB_RTR_TYPE_PERM); > del_timer(&br->multicast_ro

Re: [patch net-next v2 2/5] net: bridge: Export bridge multicast router state

2017-10-09 Thread Ivan Vecera
mp;br->multicast_lock); > + is_router = br_multicast_is_router(br); > + spin_unlock_bh(&br->multicast_lock); > + return is_router; > +} > +EXPORT_SYMBOL_GPL(br_multicast_router); > + > int br_multicast_set_querier(struct net_bridge *br, unsigned long val) > { > unsigned long max_delay; > Reviewed by: Ivan Vecera

Re: [RFC v2, net-next, PATCH 4/4] net/cpsw_switchdev: add switchdev mode of operation on cpsw driver

2018-06-20 Thread Ivan Vecera
On 20.6.2018 09:08, Jiri Pirko wrote: > Tue, Jun 19, 2018 at 01:19:00AM CEST, grygorii.stras...@ti.com wrote: >> >> >> On 06/14/2018 06:43 AM, Ilias Apalodimas wrote: >>> On Thu, Jun 14, 2018 at 01:39:58PM +0200, Jiri Pirko wrote: Thu, Jun 14, 2018 at 01:34:04PM CEST, ilias.apalodi...@linaro.o

Re: [RFC v2, net-next, PATCH 4/4] net/cpsw_switchdev: add switchdev mode of operation on cpsw driver

2018-06-20 Thread Ivan Vecera
On 18.6.2018 22:19, Ilias Apalodimas wrote: > Jiri proposed using devlink, which makes sense, but i am not sure it's > applicable on this patchset. This will change the driver completely and will > totally break backwards compatibility. Another good reason for a new driver. I.

Re: [RFC v2, net-next, PATCH 4/4] net/cpsw_switchdev: add switchdev mode of operation on cpsw driver

2018-06-20 Thread Ivan Vecera
On 20.6.2018 14:59, Ilias Apalodimas wrote: > On Wed, Jun 20, 2018 at 02:53:47PM +0200, Ivan Vecera wrote: >> On 20.6.2018 09:08, Jiri Pirko wrote: >>> Tue, Jun 19, 2018 at 01:19:00AM CEST, grygorii.stras...@ti.com wrote: >>>> >>>> >>>> On 06/

Re: [RFC v2, net-next, PATCH 4/4] net/cpsw_switchdev: add switchdev mode of operation on cpsw driver

2018-06-21 Thread Ivan Vecera
On 20.6.2018 20:03, Ilias Apalodimas wrote: > Hi Florian, > > On Wed, Jun 20, 2018 at 10:58:26AM -0700, Florian Fainelli wrote: >> On 06/20/2018 10:51 AM, Ilias Apalodimas wrote: >>> Hello Ivan, >>> On Wed, Jun 20, 2018 at 02:56:48PM +0200, Ivan Vecera wrot

[PATCH net-next 0/8] be2net: small structures clean-up

2018-06-21 Thread Ivan Vecera
The series: - removes unused / unneccessary fields in several be2net structures - re-order fields in some structures to eliminate holes, cache-lines crosses - as result reduces size of main struct be_adapter by 4kB Ivan Vecera (8): be2net: remove unused old AIC info be2net: remove unused

[PATCH net-next 6/8] be2net: remove unused tx_jiffies field from be_tx_stats

2018-06-21 Thread Ivan Vecera
Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet/be.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index 91ca8d132e87..d521364e17cf 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b

[PATCH net-next 3/8] be2net: remove desc field from be_eq_obj

2018-06-21 Thread Ivan Vecera
The event queue description (be_eq_obj.desc) field is used only to format string for IRQ name and it is not really needed to hold this value. Remove it and use local variable to format string for IRQ name. Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet/be.h | 1 - drivers

[PATCH net-next 8/8] be2net: move rss_flags field in rss_info to ensure proper alignment

2018-06-21 Thread Ivan Vecera
]; /* 128 128 */ /* --- cacheline 4 boundary (256 bytes) --- */ u8 rss_hkey[40]; /* 25640 */ u64rss_flags;/* 296 8 */ }; Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet

[PATCH net-next 1/8] be2net: remove unused old AIC info

2018-06-21 Thread Ivan Vecera
The commit 2632bafd74ae ("be2net: fix adaptive interrupt coalescing") introduced a separate struct be_aic_obj to hold AIC information but unfortunately left the old stuff in be_eq_obj. So remove it. Fixes: 2632bafd74ae ("be2net: fix adaptive interrupt coalescing") Signed

[PATCH net-next 7/8] be2net: re-order fields in be_error_recovert to avoid hole

2018-06-21 Thread Ivan Vecera
- Unionize two u8 fields where only one of them is used depending on NIC chipset. - Move recovery_supported field after that union These changes eliminate 7-bytes hole in the struct and makes it smaller by 8 bytes. Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet/be.h | 9

[PATCH net-next 5/8] be2net: move txcp field in be_tx_obj to eliminate holes in the struct

2018-06-21 Thread Ivan Vecera
*/ /* --- cacheline 1 boundary (64 bytes) --- */ struct be_queue_info cq; /*6456 */ struct sk_buff * sent_skb_list[2048]; /* 120 16384 */ ... }; Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet/be.h | 2 +- 1 file changed

[PATCH net-next 4/8] be2net: reorder fields in be_eq_obj structure

2018-06-21 Thread Ivan Vecera
Re-order fields in struct be_eq_obj to ensure that .napi field begins at start of cache-line. Also the .adapter field is moved to the first cache-line next to .q field and 3 fields (idx,msi_idx,spurious_intr) and the 4-bytes hole to 3rd cache-line. Signed-off-by: Ivan Vecera --- drivers/net

[PATCH net-next 2/8] be2net: remove unused old custom busy-poll fields

2018-06-21 Thread Ivan Vecera
de") Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet/be.h | 13 - 1 file changed, 13 deletions(-) diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index 6cf9d106c989..a4604dea4560 100644 --- a/drivers/net/ethernet/emu

[PATCH net-next v2 1/8] be2net: remove unused old AIC info

2018-07-10 Thread Ivan Vecera
The commit 2632bafd74ae ("be2net: fix adaptive interrupt coalescing") introduced a separate struct be_aic_obj to hold AIC information but unfortunately left the old stuff in be_eq_obj. So remove it. Fixes: 2632bafd74ae ("be2net: fix adaptive interrupt coalescing") Signed

[PATCH net-next v2 7/8] be2net: re-order fields in be_error_recovert to avoid hole

2018-07-10 Thread Ivan Vecera
- Unionize two u8 fields where only one of them is used depending on NIC chipset. - Move recovery_supported field after that union These changes eliminate 7-bytes hole in the struct and makes it smaller by 8 bytes. Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet/be.h | 9

[PATCH net-next v2 4/8] be2net: reorder fields in be_eq_obj structure

2018-07-10 Thread Ivan Vecera
Re-order fields in struct be_eq_obj to ensure that .napi field begins at start of cache-line. Also the .adapter field is moved to the first cache-line next to .q field and 3 fields (idx,msi_idx,spurious_intr) and the 4-bytes hole to 3rd cache-line. Signed-off-by: Ivan Vecera --- drivers/net

[PATCH net-next v2 8/8] be2net: move rss_flags field in rss_info to ensure proper alignment

2018-07-10 Thread Ivan Vecera
]; /* 128 128 */ /* --- cacheline 4 boundary (256 bytes) --- */ u8 rss_hkey[40]; /* 25640 */ u64rss_flags;/* 296 8 */ }; Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet

[PATCH net-next v2 2/8] be2net: remove unused old custom busy-poll fields

2018-07-10 Thread Ivan Vecera
de") Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet/be.h | 13 - 1 file changed, 13 deletions(-) diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index 6cf9d106c989..a4604dea4560 100644 --- a/drivers/net/ethernet/emu

[PATCH net-next v2 5/8] be2net: move txcp field in be_tx_obj to eliminate holes in the struct

2018-07-10 Thread Ivan Vecera
*/ /* --- cacheline 1 boundary (64 bytes) --- */ struct be_queue_info cq; /*6456 */ struct sk_buff * sent_skb_list[2048]; /* 120 16384 */ ... }; Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet/be.h | 2 +- 1 file changed

[PATCH net-next v2 6/8] be2net: remove unused tx_jiffies field from be_tx_stats

2018-07-10 Thread Ivan Vecera
Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet/be.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index 91ca8d132e87..d521364e17cf 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b

[PATCH net-next v2 3/8] be2net: remove desc field from be_eq_obj

2018-07-10 Thread Ivan Vecera
The event queue description (be_eq_obj.desc) field is used only to format string for IRQ name and it is not really needed to hold this value. Remove it and use local variable to format string for IRQ name. Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet/be.h | 1 - drivers

[PATCH net-next v2 0/8] be2net: small structures clean-up

2018-07-10 Thread Ivan Vecera
The series: - removes unused / unneccessary fields in several be2net structures - re-order fields in some structures to eliminate holes, cache-lines crosses - as result reduces size of main struct be_adapter by 4kB Ivan Vecera (8): be2net: remove unused old AIC info be2net: remove unused

Re: [PATCH 0/4] RFC CPSW switchdev mode

2018-05-24 Thread Ivan Vecera
On 24.5.2018 14:54, Andrew Lunn wrote: > On Thu, May 24, 2018 at 11:48:31AM +0300, Ilias Apalodimas wrote: >> On Thu, May 24, 2018 at 10:05:28AM +0200, Jiri Pirko wrote: >>> Thu, May 24, 2018 at 08:56:20AM CEST, ilias.apalodi...@linaro.org wrote: >>> Any reason you need cpu port? We don't need it i

[PATCH iproute2] devlink: don't enforce NETLINK_{CAP,EXT}_ACK sock opts

2018-06-01 Thread Ivan Vecera
39f5d ("devlink: mnlg: Add support for extended ack") Cc: Arkadi Sharshevsky Cc: Stephen Hemminger Signed-off-by: Ivan Vecera --- devlink/mnlg.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/devlink/mnlg.c b/devlink/mnlg.c index 3d28453a..c33c90be 10

[PATCH ethtool 5/6] ethtool: correctly free hkey when get_stringset() fails

2018-06-08 Thread Ivan Vecera
Memory allocated for 'hkey' is not freed when get_stringset(..., ETH_SS_RSS_HASH_FUNCS...) fails. Fixes: b888f35 ("ethtool: Support for configurable RSS hash function") Cc: Gal Pressman Signed-off-by: Ivan Vecera --- ethtool.c | 13 ++--- 1 file changed, 6 insert

[PATCH ethtool 2/6] ethtool: fix RING_VF assignment

2018-06-08 Thread Ivan Vecera
Fixes: 36ee712 ("ethtool: support queue and VF fields for rxclass filters") Cc: Jacob Keller Signed-off-by: Ivan Vecera --- rxclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rxclass.c b/rxclass.c index ce4b382..42d122d 100644 --- a/rxclass.c +++ b

[PATCH ethtool 3/6] ethtool: remove unused global variable

2018-06-08 Thread Ivan Vecera
Fixes: 2c2ee7a ("ethtool: Add support for sfc register dumps") Signed-off-by: Ivan Vecera --- sfc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sfc.c b/sfc.c index 9478b38..b4c590f 100644 --- a/sfc.c +++ b/sfc.c @@ -3083,9 +3083,6 @@ static const struct efx_nic

[PATCH ethtool 4/6] ethtool: several fixes in do_gregs()

2018-06-08 Thread Ivan Vecera
- correctly close gregs_dump_file in case of fstat() failure - check for error from realloc Fixes: be4c2d0 ("ethtool.c: fix dump_regs heap corruption") Cc: David Decotigny Signed-off-by: Ivan Vecera --- ethtool.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) di

[PATCH ethtool 6/6] ethtool: remove unreachable code

2018-06-08 Thread Ivan Vecera
The default switch case is unreachable as the MAX_CHANNEL_NUM == 4. Fixes: a5e73bb ("ethtool:QSFP Plus/QSFP28 Diagnostics Information Support") Cc: Vidya Sagar Ravipati Signed-off-by: Ivan Vecera --- qsfp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/qsfp.c b/qsfp.c ind

[PATCH ethtool 1/6] ethtool: fix uninitialized return value

2018-06-08 Thread Ivan Vecera
Fixes: b0fe96d ("Ethtool: Implements ETHTOOL_PHY_GTUNABLE/ETHTOOL_PHY_STUNABLE and PHY downshift") Signed-off-by: Ivan Vecera --- ethtool.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ethtool.c b/ethtool.c index 2e87384..e7495fe 100644 --- a/ethto

Re: [PATCH net-next 5/8] bridge: Add SWITCHDEV_FDB_FLUSH_TO_BRIDGE notifier

2020-09-15 Thread Ivan Vecera
dgeport are not deleted. > > Note that this has the same effect as the IFLA_BRPORT_FLUSH attribute. > > CC: Jiri Pirko > CC: Ivan Vecera > CC: Roopa Prabhu > CC: Nikolay Aleksandrov > Signed-off-by: Alexandra Winter > Signed-off-by: Julian Wiedmann > --- >

Re: [PATCH] net: switchdev: Fixed kerneldoc warning

2020-09-22 Thread Ivan Vecera
otifier blocks. > */ > int call_switchdev_notifiers(unsigned long val, struct net_device *dev, Acked-by: Ivan Vecera

[PATCH ethtool 1/2] netlink: return -ENOMEM when calloc fails

2020-09-24 Thread Ivan Vecera
Fixes: f2c17e107900 ("netlink: add netlink handler for gfeatures (-k)") Cc: Michal Kubecek Signed-off-by: Ivan Vecera --- netlink/features.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/netlink/features.c b/netlink/features.c index 3f1240437350..b2

[PATCH ethtool 2/2] netlink: fix memory leak

2020-09-24 Thread Ivan Vecera
Potentially allocated memory allocated for mask is not freed when the allocation for value fails. Fixes: 81a30f416ec7 ("netlink: add bitset command line parser handlers") Cc: Michal Kubecek Signed-off-by: Ivan Vecera --- netlink/parser.c | 4 +++- 1 file changed, 3 insertions(+),

[PATCH ethtool 2/2] netlink: fix copy-paste error in rtm_link_summary()

2020-09-25 Thread Ivan Vecera
Fixes: bdfffab54933 ("netlink: message format descriptions for rtnetlink") Cc: Michal Kubecek Signed-off-by: Ivan Vecera --- netlink/prettymsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlink/prettymsg.c b/netlink/prettymsg.c index 9e62bebe615e..f992dcaf0

[PATCH ethtool 1/2] fix memory leaks in do_sfeatures()

2020-09-25 Thread Ivan Vecera
Memory blocks referenced by new_state and old_state are never freed. For efeatures there is no need to check pointer as free() can be called with NULL parameter. Fixes: 6042804cf6ec ("Change -k/-K options to use ETHTOOL_{G,S}FEATURES") Cc: Michal Kubecek Signed-off-by: I

Re: [PATCH ethtool 1/2] netlink: return -ENOMEM when calloc fails

2020-09-28 Thread Ivan Vecera
On Mon, 28 Sep 2020 17:44:55 +0200 Michal Kubecek wrote: > On Thu, Sep 24, 2020 at 09:27:57PM +0200, Ivan Vecera wrote: > > Fixes: f2c17e107900 ("netlink: add netlink handler for gfeatures (-k)") > > > > Cc: Michal Kubecek > > Signed-off-by: Ivan Vecera

Re: [RESEND PATCH iproute2-next 0/2] Implement filter terse dump mode support

2020-09-30 Thread Ivan Vecera
m_skbedit.c| 2 +- > tc/m_skbmod.c | 2 +- > tc/m_tunnel_key.c | 2 +- > tc/m_vlan.c | 2 +- > tc/m_xt.c | 2 +- > tc/m_xt_old.c | 2 +- > tc/tc_filter.c | 12 > 21 files changed, 32 insertions(+), 20 deletions(-) > Tested-by: Ivan Vecera

Re: [PATCH net] be2net: Fix NULL pointer dereference in be_tx_timeout()

2018-11-28 Thread Ivan Vecera
On 27. 11. 18 23:51, David Miller wrote: From: Petr Oros Date: Thu, 22 Nov 2018 15:24:07 +0100 @@ -4700,8 +4700,11 @@ int be_update_queues(struct be_adapter *adapter) struct net_device *netdev = adapter->netdev; int status; - if (netif_running(netdev)) + if (netif_run

Re: [PATCH net] be2net: Fix NULL pointer dereference in be_tx_timeout()

2018-11-28 Thread Ivan Vecera
On 28. 11. 18 20:00, David Miller wrote: From: Ivan Vecera Date: Wed, 28 Nov 2018 11:12:22 +0100 On 27. 11. 18 23:51, David Miller wrote: From: Petr Oros Date: Thu, 22 Nov 2018 15:24:07 +0100 @@ -4700,8 +4700,11 @@ int be_update_queues(struct be_adapter *adapter) struct net_device

[PATCH ethtool] ethtool: don't report UFO on kernels v4.14 and above

2018-11-29 Thread Ivan Vecera
in struct off_flag_def'. Cc: John W. Linville Signed-off-by: Ivan Vecera --- ethtool.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ethtool.c b/ethtool.c index 2f7e96b..6121979 100644 --- a/ethtool.c +++ b/ethtool.c @@ -1465,8 +1465,10 @@ static void dump_featur

[PATCH net] net/sched: cls_flower: allocate mask dynamically in fl_change()

2019-01-16 Thread Ivan Vecera
ze was 176 bytes (using defconfig on x86_64). With regard to this fact it's reasonable to allocate this structure dynamically in fl_change() to reduce its stack size. Fixes: 05cd271fd61a ("cls_flower: Support multiple masks per priority") Cc: Jiri Pirko Cc: Paul Blakey Signed-off-

Re: [PATCH net] net/sched: cls_flower: allocate mask dynamically in fl_change()

2019-01-16 Thread Ivan Vecera
1a ("cls_flower: Support multiple masks per priority") Not sure this is -net material. But I don't mind. Cc: Jiri Pirko Cc: Paul Blakey Signed-off-by: Ivan Vecera --- net/sched/cls_flower.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/net/

[PATCH net v2] net/sched: cls_flower: allocate mask dynamically in fl_change()

2019-01-16 Thread Ivan Vecera
Cc: Jiri Pirko Cc: Paul Blakey Acked-by: Jiri Pirko Signed-off-by: Ivan Vecera --- net/sched/cls_flower.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index dad04e710493..f6aa57fbbbaf 100644 --- a/net/sch

Re: [PATCH] Revert "be2net: remove desc field from be_eq_obj"

2018-10-23 Thread Ivan Vecera
On 23.10.2018 20:03, David Miller wrote: > From: Ivan Vecera > Date: Tue, 23 Oct 2018 16:40:26 +0200 > >> The mentioned commit needs to be reverted because we cannot pass >> string allocated on stack to request_irq(). This function stores >> uses this pointer for later

Re: [PATCH iproute2-master] bridge: fdb: Fix FDB dump with strict checking disabled

2019-01-25 Thread Ivan Vecera
lmsg_type = RTM_GETNEIGH, > + .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST, > + .nlh.nlmsg_seq = rth->dump = ++rth->seq, > + .ifm.ifi_family = PF_BRIDGE, > + }; > + int err; > + > + err = filter_fn(&req.nlh, sizeof(req)); > + if (err) > + return err; > + > + return send(rth->fd, &req, sizeof(req), 0); > +} > + > int rtnl_statsdump_req_filter(struct rtnl_handle *rth, int fam, __u32 > filt_mask) > { > struct { > -- > 2.20.1 > Acked-by: Ivan Vecera

Re: [PATCH net-next 2/9] net: bridge: Propagate extack to switchdev

2018-12-12 Thread Ivan Vecera
;& ret != -EOPNOTSUPP) return ret; *changed = __vlan_add_flags(vlan, flags); @@ -1147,7 +1154,7 @@ int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags, vlan->vid = vid; vlan->port = port; - ret = __vlan_add(vlan, flags); + ret = __vlan_add(vlan, flags, extack); if (ret) kfree(vlan); else Acked-by: Ivan Vecera

Re: [PATCH net-next 3/9] net: switchdev: Add extack argument to switchdev_port_obj_add()

2018-12-12 Thread Ivan Vecera
dev_port_obj_del_now(struct net_device *dev, const struct switchdev_obj *obj) { return switchdev_port_obj_notify(SWITCHDEV_PORT_OBJ_DEL, -dev, obj, NULL); + dev, obj, NULL, NULL); } static void switchdev_port_obj_del_deferred(struct net_device *dev, Acked-by: Ivan Vecera

Re: [PATCH net-next 4/9] net: switchdev: Add extack to struct switchdev_notifier_info

2018-12-12 Thread Ivan Vecera
_notif_chain, val, info); } Acked-by: Ivan Vecera

Re: [PATCH net-next 5/9] net: switchdev: Add extack to switchdev_handle_port_obj_add() callback

2018-12-12 Thread Ivan Vecera
struct netlink_ext_ack *extack)) { int err; Acked-by: Ivan Vecera

Re: [PATCH net-next v2 1/9] net: ndo_bridge_setlink: Add extack

2018-12-12 Thread Ivan Vecera
->ndo_bridge_setlink(dev, nlh, - flags); + flags, + extack); if (!err) { flags &= ~BRI

[PATCH net-next] net: sched: sch_api: set an error msg when qdisc_alloc_handle() fails

2019-02-15 Thread Ivan Vecera
This patch sets an error message in extack when the number of qdisc handles exceeds the maximum. Also the error-code ENOSPC is more appropriate than ENOMEM in this situation. Signed-off-by: Ivan Vecera --- net/sched/sch_api.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

Re: [patch net resend] net: sched: cbq: create block for q->link.block

2017-11-28 Thread Ivan Vecera
rate 1000Mbit bandwidth > 1000Mbit > $ tc filter add dev eth0 parent 1: protocol ip prio 100 u32 match ip protocol > 0 0x00 flowid 1:1 > > Reported-by: Jaroslav Aster > Reported-by: Ivan Vecera > Fixes: 6529eaba33f0 ("net: sched: introduce tcf block infractructure

Re: [PATCH net] net/sched: fix infinite loop in sch_fq_pie

2020-05-27 Thread Ivan Vecera
will never end. The extack message is correct, but > it doesn't say that 0 is not a valid number for 'flows': while at it, fix > this also. Add a tdc selftest to check correct validation of 'flows'. > > CC: Ivan Vecera > Fixes: ec97ecf1ebe4 ("net: sche

Re: [PATCH 2/3] switchdev: mrp: Remove the variable mrp_ring_state

2020-05-20 Thread Ivan Vecera
mrp_ring_state; /* MRP_RING_STATE */ > #endif > } u; > }; Acked-by: Ivan Vecera

Re: [PATCH iproute2 net-next v2 0/2] support for bridge fdb and neigh get

2019-09-30 Thread Ivan Vecera
s changed, 240 insertions(+), 5 deletions(-) > Works great. Thanks, Roopa. Tested-by: Ivan Vecera

[PATCH iproute2] iplink: report drop stats for VFs

2018-07-25 Thread Ivan Vecera
Kernel commit c5a9f6f0ab40 ("net/core: Add drop counters to VF statistics") added support for Rx/Tx packet drops but these stats are not reported by 'ip link'. Cc: Eugenia Emantayev Cc: Saeed Mahameed Signed-off-by: Ivan Vecera --- ip/ipaddress.c | 11 +-

Re: [PATCH iproute2] iplink: report drop stats for VFs

2018-07-25 Thread Ivan Vecera
On 25.7.2018 19:04, David Ahern wrote: > On 7/25/18 10:22 AM, Ivan Vecera wrote: >> Kernel commit c5a9f6f0ab40 ("net/core: Add drop counters to VF >> statistics") added support for Rx/Tx packet drops but these stats are >> not reported by 'ip link'.

[PATCH iproute2 1/2] lib: make resolve_hosts variable common

2017-11-09 Thread Ivan Vecera
solve_hosts directly in utils.c so the existing ones can be removed (the same approach that is used for timestamp_short). Cc: Jiri Pirko Cc: Arkadi Sharshevsky Signed-off-by: Ivan Vecera --- bridge/bridge.c | 1 - genl/genl.c | 1 - ip/ip.c | 1 - ip/rtmon.c | 1 - lib/uti

[PATCH iproute2 0/2] add batch command support to devlink

2017-11-09 Thread Ivan Vecera
This patch series adds support for devlink commands batching. The first just removes a requirement to have declared 'resolve_hosts' variable in any command that use any function implemented in utils.c (it is really confusing to see this declaration in utils like bridge or devlink). Ivan

[PATCH iproute2 2/2] devlink: add batch command support

2017-11-09 Thread Ivan Vecera
The patch adds support to batch devlink commands. Cc: Jiri Pirko Cc: Arkadi Sharshevsky Signed-off-by: Ivan Vecera --- devlink/devlink.c | 70 +++--- man/man8/devlink.8 | 16 + 2 files changed, 78 insertions(+), 8 deletions(-) diff

Re: [PATCH iproute2 2/2] devlink: add batch command support

2017-11-09 Thread Ivan Vecera
On 10.11.2017 07:57, Leon Romanovsky wrote: > On Fri, Nov 10, 2017 at 07:20:14AM +0100, Ivan Vecera wrote: >> The patch adds support to batch devlink commands. >> >> Cc: Jiri Pirko >> Cc: Arkadi Sharshevsky >> Signed-off-by: Ivan Vecera &

Re: [PATCH net-next v3 1/9] net: switchdev: add SET_SWITCHDEV_OPS helper

2017-06-30 Thread Ivan Vecera
tatic inline void switchdev_deferred_process(void) > @@ -322,6 +324,8 @@ static inline bool switchdev_port_same_parent_id(struct > net_device *a, > return false; > } > > +#define SWITCHDEV_SET_OPS(netdev, ops) do {} while (0) > + > #endif > > #endif /* _LINUX_SWITCHDEV_H_ */ > Acked-by: Ivan Vecera

[PATCH net] net/sched: cls_u32: fix cls_u32 on filter replace

2018-02-08 Thread Ivan Vecera
d status") Signed-off-by: Ivan Vecera --- net/sched/cls_u32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 6311a548046b..c75e68e839c7 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -955,7 +955,8 @@ static i

[PATCH net] be2net: restore properly promisc mode after queues reconfiguration

2018-01-19 Thread Ivan Vecera
nath Kotur Fixes: 622190669403 ("be2net: Request RSS capability of Rx interface depending on number of Rx rings") Signed-off-by: Ivan Vecera --- drivers/net/ethernet/emulex/benet/be_main.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/emulex/benet/

Re: [PATCH net v2] cls_u32: fix use after free in u32_destroy_key()

2018-02-02 Thread Ivan Vecera
0; > } > } > @@ -667,7 +674,11 @@ static void u32_destroy(struct tcf_proto *tp, struct > netlink_ext_ack *extack) > > while ((ht = rtnl_dereference(tp_c->hlist)) != NULL) { > RCU_INIT_POINTER(tp_c->hlist, ht->next); > - kfree_rcu(ht, rcu); > + /* u32_destroy_key() will will later free ht for us, if > + * it's still referenced by some knode > + */ > + if (ht->refcnt == 0) > + kfree_rcu(ht, rcu); > } > > idr_destroy(&tp_c->handle_idr); > Good catch, Paolo. Tested-by: Ivan Vecera

Re: [PATCH net-next v3 12/13] net: bridge: Remove FDB deletion through switchdev object

2017-08-07 Thread Ivan Vecera
.obj); > -} > - > static void fdb_delete(struct net_bridge *br, struct net_bridge_fdb_entry *f) > { > if (f->is_static) > fdb_del_hw_addr(br, f->addr.addr); > > - if (f->added_by_external_learn) > - fdb_del_external_learn(f); > - > hlist_del_init_rcu(&f->hlist); > fdb_notify(br, f, RTM_DELNEIGH); > call_rcu(&f->rcu, fdb_rcu_free); > Reviewed-by: Ivan Vecera

Re: [PATCH net-next v3 13/13] net: switchdev: Remove bridge bypass support from switchdev

2017-08-07 Thread Ivan Vecera
lattr *afspec; > - > - if (!netif_is_bridge_port(dev)) > - return -EOPNOTSUPP; > - > - afspec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), > - IFLA_AF_SPEC); > - if (afspec) > - return switchdev_port_br_afspec(dev, afspec, > - switchdev_port_obj_del); > - > - return 0; > -} > -EXPORT_SYMBOL_GPL(switchdev_port_bridge_dellink); > - > -/** > - * switchdev_port_fdb_add - Add FDB (MAC/VLAN) entry to port > - * > - * @ndmsg: netlink hdr > - * @nlattr: netlink attributes > - * @dev: port device > - * @addr: MAC address to add > - * @vid: VLAN to add > - * > - * Add FDB entry to switch device. > - */ > -int switchdev_port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], > -struct net_device *dev, const unsigned char *addr, > -u16 vid, u16 nlm_flags) > -{ > - struct switchdev_obj_port_fdb fdb = { > - .obj.orig_dev = dev, > - .obj.id = SWITCHDEV_OBJ_ID_PORT_FDB, > - .vid = vid, > - }; > - > - ether_addr_copy(fdb.addr, addr); > - return switchdev_port_obj_add(dev, &fdb.obj); > -} > -EXPORT_SYMBOL_GPL(switchdev_port_fdb_add); > - > -/** > - * switchdev_port_fdb_del - Delete FDB (MAC/VLAN) entry from port > - * > - * @ndmsg: netlink hdr > - * @nlattr: netlink attributes > - * @dev: port device > - * @addr: MAC address to delete > - * @vid: VLAN to delete > - * > - * Delete FDB entry from switch device. > - */ > -int switchdev_port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], > -struct net_device *dev, const unsigned char *addr, > -u16 vid) > -{ > - struct switchdev_obj_port_fdb fdb = { > - .obj.orig_dev = dev, > - .obj.id = SWITCHDEV_OBJ_ID_PORT_FDB, > - .vid = vid, > - }; > - > - ether_addr_copy(fdb.addr, addr); > - return switchdev_port_obj_del(dev, &fdb.obj); > -} > -EXPORT_SYMBOL_GPL(switchdev_port_fdb_del); > - > bool switchdev_port_same_parent_id(struct net_device *a, > struct net_device *b) > { > Reviewed-by: Ivan Vecera

Re: [PATCH net] bridge: start hello_timer when enabling KERNEL_STP in br_stp_start

2017-05-19 Thread Ivan Vecera
2017-05-19 16:45 GMT+02:00 Nikolay Aleksandrov : > On 5/19/17 5:20 PM, Xin Long wrote: >> >> Since commit 76b91c32dd86 ("bridge: stp: when using userspace stp stop >> kernel hello and hold timers"), bridge would not start hello_timer if >> stp_enabled is not KERNEL_STP when br_dev_open. >> >> The p

Re: [PATCH net] bridge: start hello_timer when enabling KERNEL_STP in br_stp_start

2017-05-19 Thread Ivan Vecera
2017-05-19 16:57 GMT+02:00 Nikolay Aleksandrov : > On 5/19/17 5:51 PM, Ivan Vecera wrote: >> >> 2017-05-19 16:45 GMT+02:00 Nikolay Aleksandrov >> : >>> >>> On 5/19/17 5:20 PM, Xin Long wrote: >>>> >>>> >>>> Since commit

Re: [PATCH net] bridge: start hello_timer when enabling KERNEL_STP in br_stp_start

2017-05-19 Thread Ivan Vecera
2017-05-19 17:05 GMT+02:00 Nikolay Aleksandrov : > On 5/19/17 6:03 PM, Ivan Vecera wrote: >> >> 2017-05-19 16:57 GMT+02:00 Nikolay Aleksandrov >> : >>> >>> On 5/19/17 5:51 PM, Ivan Vecera wrote: >>>> >>>> >>>> 2017-05-19 1

[PATCH net] bridge: fix hello and hold timers starting/stopping

2017-05-19 Thread Ivan Vecera
cumulusnetworks.com Signed-off-by: Ivan Vecera --- net/bridge/br_stp_if.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c index 0db8102995a5..f137ebf27755 100644 --- a/net/bridge/br_stp_if.c +++ b/net/bridge/br

Re: [PATCH net] bridge: start hello_timer when enabling KERNEL_STP in br_stp_start

2017-05-19 Thread Ivan Vecera
led != BR_USER_STP) > + if (br->stp_enabled == BR_KERNEL_STP) > mod_timer(&br->hello_timer, > round_jiffies(jiffies + br->hello_time)); > } > -- > 2.1.0 > Reviewed-by: Ivan Vecera

Re: [PATCH net] bridge: fix hello and hold timers starting/stopping

2017-05-19 Thread Ivan Vecera
2017-05-19 18:51 GMT+02:00 Xin Long : > On Sat, May 20, 2017 at 12:25 AM, Ivan Vecera wrote: >> Current bridge code incorrectly handles starting/stopping of hello and >> hold timers during STP enable/disable. >> >> 1. Timers are stopped in br_stp_start() during NO_STP

Re: [PATCH net] bridge: fix hello and hold timers starting/stopping

2017-05-19 Thread Ivan Vecera
2017-05-19 18:55 GMT+02:00 Nikolay Aleksandrov : > On 5/19/17 7:25 PM, Ivan Vecera wrote: >> >> Current bridge code incorrectly handles starting/stopping of hello and >> hold timers during STP enable/disable. >> >> 1. Timers are stopped in br_stp_start() during N

[PATCH net-next v2] bridge: fix hello and hold timers starting/stopping

2017-05-19 Thread Ivan Vecera
: niko...@cumulusnetworks.com Signed-off-by: Ivan Vecera --- net/bridge/br_stp_if.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c index 08341d2aa9c9..a05027027513 100644 --- a/net/bridge/br_stp_if.c +++ b/net/bridge/br_stp_if.c @@

Re: [PATCH net-next v2] bridge: fix hello and hold timers starting/stopping

2017-05-20 Thread Ivan Vecera
2017-05-20 7:57 GMT+02:00 Hangbin Liu : > On Fri, May 19, 2017 at 07:30:43PM +0200, Ivan Vecera wrote: >> Current bridge code incorrectly handles starting/stopping of hello and >> hold timers during STP enable/disable. >> >> 1. Timers are stopped in br_stp_star

Re: [patch net-next 04/19] net: switchdev: Change notifier chain to be atomic

2017-06-05 Thread Ivan Vecera
truct switchdev_notifier_info *info) > { > - ASSERT_RTNL(); > - > info->dev = dev; > - return raw_notifier_call_chain(&switchdev_notif_chain, val, info); > + return atomic_notifier_call_chain(&switchdev_notif_chain, val, info); > } > EXPORT_SYMBOL_GPL(call_switchdev_notifiers); > > Reviewed-by: Ivan Vecera

Re: [patch net-next 01/19] net: switchdev: Add support for querying supported bridge flags by hardware

2017-06-05 Thread Ivan Vecera
clock_t ageing_time;/* BRIDGE_AGEING_TIME */ > bool vlan_filtering;/* > BRIDGE_VLAN_FILTERING */ > Reviewed-by: Ivan Vecera

  1   2   3   >