* [net-next 1/2] tipc: some clarifying name changes
From: Jon Maloy @ 2018-01-04 14:20 UTC (permalink / raw)
To: davem, netdev
Cc: tipc-discussion, hoang.h.le, mohan.krishna.ghanta.krishnamurthy
In-Reply-To: <1515075645-19480-1-git-send-email-jon.maloy@ericsson.com>
We rename some functions and variables, to make their purpose clearer.
- tipc_group::congested -> tipc_group::small_win. Members in this list
are not necessarily (and typically) congested. Instead, they may
*potentially* be subject to congestion because their send window is
less than ADV_IDLE, and therefore need to be checked during message
transmission.
- tipc_group_is_receiver() -> tipc_group_is_sender(). This socket will
accept messages coming from members fulfilling this condition, i.e.,
they are senders from this member's viewpoint.
- tipc_group_is_enabled() -> tipc_group_is_receiver(). Members
fulfilling this condition will accept messages sent from the current
socket, i.e., they are receivers from its viewpoint.
There are no functional changes in this commit.
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
---
net/tipc/group.c | 46 +++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/net/tipc/group.c b/net/tipc/group.c
index 5f4ffae..6c99511 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -64,7 +64,7 @@ enum mbr_state {
struct tipc_member {
struct rb_node tree_node;
struct list_head list;
- struct list_head congested;
+ struct list_head small_win;
struct sk_buff *event_msg;
struct sk_buff_head deferredq;
struct tipc_group *group;
@@ -82,7 +82,7 @@ struct tipc_member {
struct tipc_group {
struct rb_root members;
- struct list_head congested;
+ struct list_head small_win;
struct list_head pending;
struct list_head active;
struct list_head reclaiming;
@@ -137,12 +137,12 @@ u16 tipc_group_bc_snd_nxt(struct tipc_group *grp)
return grp->bc_snd_nxt;
}
-static bool tipc_group_is_enabled(struct tipc_member *m)
+static bool tipc_group_is_receiver(struct tipc_member *m)
{
return m->state != MBR_QUARANTINED && m->state != MBR_LEAVING;
}
-static bool tipc_group_is_receiver(struct tipc_member *m)
+static bool tipc_group_is_sender(struct tipc_member *m)
{
return m && m->state >= MBR_JOINED;
}
@@ -169,7 +169,7 @@ struct tipc_group *tipc_group_create(struct net *net, u32 portid,
if (!grp)
return NULL;
tipc_nlist_init(&grp->dests, tipc_own_addr(net));
- INIT_LIST_HEAD(&grp->congested);
+ INIT_LIST_HEAD(&grp->small_win);
INIT_LIST_HEAD(&grp->active);
INIT_LIST_HEAD(&grp->pending);
INIT_LIST_HEAD(&grp->reclaiming);
@@ -233,7 +233,7 @@ static struct tipc_member *tipc_group_find_dest(struct tipc_group *grp,
struct tipc_member *m;
m = tipc_group_find_member(grp, node, port);
- if (m && tipc_group_is_enabled(m))
+ if (m && tipc_group_is_receiver(m))
return m;
return NULL;
}
@@ -286,7 +286,7 @@ static struct tipc_member *tipc_group_create_member(struct tipc_group *grp,
if (!m)
return NULL;
INIT_LIST_HEAD(&m->list);
- INIT_LIST_HEAD(&m->congested);
+ INIT_LIST_HEAD(&m->small_win);
__skb_queue_head_init(&m->deferredq);
m->group = grp;
m->node = node;
@@ -315,7 +315,7 @@ static void tipc_group_delete_member(struct tipc_group *grp,
grp->bc_ackers--;
list_del_init(&m->list);
- list_del_init(&m->congested);
+ list_del_init(&m->small_win);
tipc_group_decr_active(grp, m);
/* If last member on a node, remove node from dest list */
@@ -344,7 +344,7 @@ void tipc_group_update_member(struct tipc_member *m, int len)
struct tipc_group *grp = m->group;
struct tipc_member *_m, *tmp;
- if (!tipc_group_is_enabled(m))
+ if (!tipc_group_is_receiver(m))
return;
m->window -= len;
@@ -352,16 +352,16 @@ void tipc_group_update_member(struct tipc_member *m, int len)
if (m->window >= ADV_IDLE)
return;
- list_del_init(&m->congested);
+ list_del_init(&m->small_win);
- /* Sort member into congested members' list */
- list_for_each_entry_safe(_m, tmp, &grp->congested, congested) {
+ /* Sort member into small_window members' list */
+ list_for_each_entry_safe(_m, tmp, &grp->small_win, small_win) {
if (m->window > _m->window)
continue;
- list_add_tail(&m->congested, &_m->congested);
+ list_add_tail(&m->small_win, &_m->small_win);
return;
}
- list_add_tail(&m->congested, &grp->congested);
+ list_add_tail(&m->small_win, &grp->small_win);
}
void tipc_group_update_bc_members(struct tipc_group *grp, int len, bool ack)
@@ -373,7 +373,7 @@ void tipc_group_update_bc_members(struct tipc_group *grp, int len, bool ack)
for (n = rb_first(&grp->members); n; n = rb_next(n)) {
m = container_of(n, struct tipc_member, tree_node);
- if (tipc_group_is_enabled(m)) {
+ if (tipc_group_is_receiver(m)) {
tipc_group_update_member(m, len);
m->bc_acked = prev;
ackers++;
@@ -428,10 +428,10 @@ bool tipc_group_bc_cong(struct tipc_group *grp, int len)
if (grp->bc_ackers)
return true;
- if (list_empty(&grp->congested))
+ if (list_empty(&grp->small_win))
return false;
- m = list_first_entry(&grp->congested, struct tipc_member, congested);
+ m = list_first_entry(&grp->small_win, struct tipc_member, small_win);
if (m->window >= len)
return false;
@@ -486,7 +486,7 @@ void tipc_group_filter_msg(struct tipc_group *grp, struct sk_buff_head *inputq,
goto drop;
m = tipc_group_find_member(grp, node, port);
- if (!tipc_group_is_receiver(m))
+ if (!tipc_group_is_sender(m))
goto drop;
if (less(msg_grp_bc_seqno(hdr), m->bc_rcv_nxt))
@@ -703,7 +703,7 @@ void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup,
msg_set_grp_bc_seqno(ehdr, m->bc_syncpt);
__skb_queue_tail(inputq, m->event_msg);
}
- list_del_init(&m->congested);
+ list_del_init(&m->small_win);
tipc_group_update_member(m, 0);
return;
case GRP_LEAVE_MSG:
@@ -711,7 +711,7 @@ void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup,
return;
m->bc_syncpt = msg_grp_bc_syncpt(hdr);
list_del_init(&m->list);
- list_del_init(&m->congested);
+ list_del_init(&m->small_win);
*usr_wakeup = true;
/* Wait until WITHDRAW event is received */
@@ -731,7 +731,7 @@ void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup,
m->window += msg_adv_win(hdr);
*usr_wakeup = m->usr_pending;
m->usr_pending = false;
- list_del_init(&m->congested);
+ list_del_init(&m->small_win);
return;
case GRP_ACK_MSG:
if (!m)
@@ -854,7 +854,7 @@ void tipc_group_member_evt(struct tipc_group *grp,
if (m->window < ADV_IDLE)
tipc_group_update_member(m, 0);
else
- list_del_init(&m->congested);
+ list_del_init(&m->small_win);
} else if (event == TIPC_WITHDRAWN) {
if (!m)
goto drop;
@@ -887,7 +887,7 @@ void tipc_group_member_evt(struct tipc_group *grp,
__skb_queue_tail(inputq, skb);
}
list_del_init(&m->list);
- list_del_init(&m->congested);
+ list_del_init(&m->small_win);
}
*sk_rcvbuf = tipc_group_rcvbuf_limit(grp);
return;
--
2.1.4
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply related
* [net-next 2/2] tipc: simplify small window members' sorting algorithm
From: Jon Maloy @ 2018-01-04 14:20 UTC (permalink / raw)
To: davem, netdev
Cc: tipc-discussion, hoang.h.le, mohan.krishna.ghanta.krishnamurthy
In-Reply-To: <1515075645-19480-1-git-send-email-jon.maloy@ericsson.com>
We simplify the sorting algorithm in tipc_update_member(). We also make
the remaining conditional call to this function unconditional, since the
same condition now is tested for inside the said function.
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
---
net/tipc/group.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/net/tipc/group.c b/net/tipc/group.c
index 6c99511..3e8268d 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -356,12 +356,10 @@ void tipc_group_update_member(struct tipc_member *m, int len)
/* Sort member into small_window members' list */
list_for_each_entry_safe(_m, tmp, &grp->small_win, small_win) {
- if (m->window > _m->window)
- continue;
- list_add_tail(&m->small_win, &_m->small_win);
- return;
+ if (_m->window > m->window)
+ break;
}
- list_add_tail(&m->small_win, &grp->small_win);
+ list_add_tail(&m->small_win, &_m->small_win);
}
void tipc_group_update_bc_members(struct tipc_group *grp, int len, bool ack)
@@ -851,10 +849,7 @@ void tipc_group_member_evt(struct tipc_group *grp,
m->instance = instance;
TIPC_SKB_CB(skb)->orig_member = m->instance;
tipc_group_proto_xmit(grp, m, GRP_JOIN_MSG, xmitq);
- if (m->window < ADV_IDLE)
- tipc_group_update_member(m, 0);
- else
- list_del_init(&m->small_win);
+ tipc_group_update_member(m, 0);
} else if (event == TIPC_WITHDRAWN) {
if (!m)
goto drop;
--
2.1.4
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply related
* [net-next 0/2] tipc: two small cleanups
From: Jon Maloy @ 2018-01-04 14:20 UTC (permalink / raw)
To: davem, netdev
Cc: mohan.krishna.ghanta.krishnamurthy, tung.q.nguyen, hoang.h.le,
jon.maloy, canh.d.luu, ying.xue, tipc-discussion
These two commits are based on commit f9c935db8086 ("tipc: fix
problems with multipoint-to-point flow control") which has been
applied to 'net' but not yet to 'net-next'.
Jon Maloy (2):
tipc: some clarifying name changes
tipc: simplify small window members' sorting algorithm
net/tipc/group.c | 53 ++++++++++++++++++++++++-----------------------------
1 file changed, 24 insertions(+), 29 deletions(-)
--
2.1.4
^ permalink raw reply
* Re: [PATCH v3 00/27] kill devm_ioremap_nocache
From: David Howells @ 2018-01-04 14:52 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Yisheng Xie, linux-mips, Ulf Hansson, Jakub Kicinski,
Platform Driver, David Airlie, linux-wireless, alsa-devel,
dri-devel, Liam Girdwood, dhowells, IDE-ML, Wim Van Sebroeck,
Networking, linux-mtd, Daniel Vetter, Dan Williams, Jason Cooper,
linux-rtc, Boris Brezillon, Mauro Carvalho Chehab, dmaengine,
Vinod Koul, Richar
In-Reply-To: <CAK8P3a3i0bKvG56ha9_hzO=z80sVxCQhaeFn6QW3AwbwZs3HPg@mail.gmail.com>
Arnd Bergmann <arnd@arndb.de> wrote:
> - mn10300 appears to be wrong, broken by David Howells in
> commit 83c2dc15ce82 ("MN10300: Handle cacheable PCI regions
> in pci_iomap()") for any driver calling ioremap() by to get uncached
> memory,
It's not clear what the right thing to do was, given that there's an ioremap()
and an ioremap_uncached().
But the asb2305's pci_iomap() will use ioremap() (the cacheable window) if
IORESOURCE_CACHEABLE is set, but IORESOURCE_IO is not and ioremap_uncached()
otherwise.
The other supported units don't have PCI buses.
> if I understand the comment for commit 34f1bdee1910 ("mn10300: switch to
> GENERIC_PCI_IOMAP") correctly: it seems that PCI addresses include the
> 'uncached' bit by default to get the right behavior, but dropping that bit
> breaks it.
Not exactly. The CPU has a window in the range 0xa0000000-0xbfffffff which is
an uncached view of its hardware buses. It has another window in the range
0x80000000-0x9fffffff which is a cached view of that region. These windows
cannot be changed and addresses above 0x80000000 are statically mapped and are
only accessible by the kernel (this is hardwired in the MMU).
So the arch has two subwindows to the PCI bus, one cached and one uncached.
These subwindows are further subdivided into ioport and iomem spaces, an SRAM
and some control registers for the CPU-PCI bridge.
David
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* [PATCH net-next 0/6] Replace WARN_ONCE usages with netdev_WARN_ONCE
From: Gal Pressman @ 2018-01-04 14:55 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Tariq Toukan, Saeed Mahameed, Gal Pressman
Hi,
This series will fix an issue in netdev_WARN_ONCE, improve its formatting and
replace drivers' usage of WARN_ONCE to netdev_WARN_ONCE.
Driver specific patches were compilation tested, in addition, functional tested
on Mellanox NIC.
Gal Pressman (6):
net: Fix netdev_WARN_ONCE macro
net: No line break on netdev_WARN* formatting
net/mlx5e: Replace WARN_ONCE with netdev_WARN_ONCE
e1000: Replace WARN_ONCE with netdev_WARN_ONCE
bnx2x: Replace WARN_ONCE with netdev_WARN_ONCE
8139cp: Replace WARN_ONCE with netdev_WARN_ONCE
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 5 +++--
drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 4 ++--
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 9 ++++-----
drivers/net/ethernet/realtek/8139cp.c | 4 ++--
include/linux/netdevice.h | 6 +++---
5 files changed, 14 insertions(+), 14 deletions(-)
--
2.7.4
^ permalink raw reply
* pull-request: mac80211 2018-01-04
From: Johannes Berg @ 2018-01-04 14:56 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-wireless
Hi Dave,
It's probably getting quite late for the current cycle, but
these fixes seemed important enough to send them to you
separately anyway.
Please pull and let me know if there's any problem.
Thanks,
johannes
The following changes since commit 820d1d5eba5e0db88432f4b19149d87523ee193c:
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue (2018-01-03 13:49:24 -0500)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git tags/mac80211-for-davem-2018-01-04
for you to fetch changes up to 736a80bbfda709fb3631f5f62056f250a38e5804:
mac80211: mesh: drop frames appearing to be from us (2018-01-04 15:51:53 +0100)
----------------------------------------------------------------
Two fixes:
* drop mesh frames appearing to be from ourselves
* check another netlink attribute for existence
----------------------------------------------------------------
Hao Chen (1):
nl80211: Check for the required netlink attribute presence
Johannes Berg (1):
mac80211: mesh: drop frames appearing to be from us
net/mac80211/rx.c | 2 ++
net/wireless/nl80211.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
^ permalink raw reply
* [PATCH net-next 1/6] net: Fix netdev_WARN_ONCE macro
From: Gal Pressman @ 2018-01-04 14:55 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Tariq Toukan, Saeed Mahameed, Gal Pressman
In-Reply-To: <1515077763-27991-1-git-send-email-galp@mellanox.com>
netdev_WARN_ONCE is broken (whoops..), fix it.
Fixes: 375ef2b1f0d0 ("net: Introduce netdev_*_once functions")
Signed-off-by: Gal Pressman <galp@mellanox.com>
Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
---
include/linux/netdevice.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 352066e..5ff1ef9 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -4407,8 +4407,8 @@ do { \
WARN(1, "netdevice: %s%s\n" format, netdev_name(dev), \
netdev_reg_state(dev), ##args)
-#define netdev_WARN_ONCE(dev, condition, format, arg...) \
- WARN_ONCE(1, "netdevice: %s%s\n" format, netdev_name(dev) \
+#define netdev_WARN_ONCE(dev, format, args...) \
+ WARN_ONCE(1, "netdevice: %s%s\n" format, netdev_name(dev), \
netdev_reg_state(dev), ##args)
/* netif printk helpers, similar to netdev_printk */
--
2.7.4
^ permalink raw reply related
* [PATCH net-next 2/6] net: No line break on netdev_WARN* formatting
From: Gal Pressman @ 2018-01-04 14:55 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Tariq Toukan, Saeed Mahameed, Gal Pressman
In-Reply-To: <1515077763-27991-1-git-send-email-galp@mellanox.com>
Remove the unnecessary line break between the netdev name and reg state
to the actual message that should be printed.
For example, this:
[86730.307236] ------------[ cut here ]------------
[86730.313496] netdevice: enp27s0f0
Message from the driver
[...]
Will be replaced with:
[86770.259289] ------------[ cut here ]------------
[86770.265191] netdevice: enp27s0f0: Message from the driver
[...]
Signed-off-by: Gal Pressman <galp@mellanox.com>
Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
---
include/linux/netdevice.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5ff1ef9..87211c4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -4404,11 +4404,11 @@ do { \
* file/line information and a backtrace.
*/
#define netdev_WARN(dev, format, args...) \
- WARN(1, "netdevice: %s%s\n" format, netdev_name(dev), \
+ WARN(1, "netdevice: %s%s: " format, netdev_name(dev), \
netdev_reg_state(dev), ##args)
#define netdev_WARN_ONCE(dev, format, args...) \
- WARN_ONCE(1, "netdevice: %s%s\n" format, netdev_name(dev), \
+ WARN_ONCE(1, "netdevice: %s%s: " format, netdev_name(dev), \
netdev_reg_state(dev), ##args)
/* netif printk helpers, similar to netdev_printk */
--
2.7.4
^ permalink raw reply related
* [PATCH net-next 3/6] net/mlx5e: Replace WARN_ONCE with netdev_WARN_ONCE
From: Gal Pressman @ 2018-01-04 14:56 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Tariq Toukan, Saeed Mahameed, Gal Pressman
In-Reply-To: <1515077763-27991-1-git-send-email-galp@mellanox.com>
Use the more appropriate netdev_WARN_ONCE instead of WARN_ONCE macro.
Signed-off-by: Gal Pressman <galp@mellanox.com>
Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 5334b2d..38803e3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -495,8 +495,8 @@ static inline void mlx5e_poll_ico_single_cqe(struct mlx5e_cq *cq,
mlx5_cqwq_pop(&cq->wq);
if (unlikely((cqe->op_own >> 4) != MLX5_CQE_REQ)) {
- WARN_ONCE(true, "mlx5e: Bad OP in ICOSQ CQE: 0x%x\n",
- cqe->op_own);
+ netdev_WARN_ONCE(cq->channel->netdev,
+ "Bad OP in ICOSQ CQE: 0x%x\n", cqe->op_own);
return;
}
@@ -506,9 +506,8 @@ static inline void mlx5e_poll_ico_single_cqe(struct mlx5e_cq *cq,
}
if (unlikely(icowi->opcode != MLX5_OPCODE_NOP))
- WARN_ONCE(true,
- "mlx5e: Bad OPCODE in ICOSQ WQE info: 0x%x\n",
- icowi->opcode);
+ netdev_WARN_ONCE(cq->channel->netdev,
+ "Bad OPCODE in ICOSQ WQE info: 0x%x\n", icowi->opcode);
}
static void mlx5e_poll_ico_cq(struct mlx5e_cq *cq, struct mlx5e_rq *rq)
--
2.7.4
^ permalink raw reply related
* [PATCH net-next 4/6] e1000: Replace WARN_ONCE with netdev_WARN_ONCE
From: Gal Pressman @ 2018-01-04 14:56 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Tariq Toukan, Saeed Mahameed, Gal Pressman, Jeff Kirsher
In-Reply-To: <1515077763-27991-1-git-send-email-galp@mellanox.com>
Use the more appropriate netdev_WARN_ONCE instead of WARN_ONCE macro.
Signed-off-by: Gal Pressman <galp@mellanox.com>
Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
index 3b3983a..dc71e87 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
@@ -1838,8 +1838,8 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,
p = (char *)adapter + stat->stat_offset;
break;
default:
- WARN_ONCE(1, "Invalid E1000 stat type: %u index %d\n",
- stat->type, i);
+ netdev_WARN_ONCE(netdev, "Invalid E1000 stat type: %u index %d\n",
+ stat->type, i);
continue;
}
--
2.7.4
^ permalink raw reply related
* [PATCH net-next 5/6] bnx2x: Replace WARN_ONCE with netdev_WARN_ONCE
From: Gal Pressman @ 2018-01-04 14:56 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Tariq Toukan, Saeed Mahameed, Gal Pressman, Ariel Elior
In-Reply-To: <1515077763-27991-1-git-send-email-galp@mellanox.com>
Use the more appropriate netdev_WARN_ONCE instead of WARN_ONCE macro.
Signed-off-by: Gal Pressman <galp@mellanox.com>
Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
Cc: Ariel Elior <ariel.elior@cavium.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 57eb26d..d7c98e8 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -738,8 +738,9 @@ static void bnx2x_gro_receive(struct bnx2x *bp, struct bnx2x_fastpath *fp,
bnx2x_gro_csum(bp, skb, bnx2x_gro_ipv6_csum);
break;
default:
- WARN_ONCE(1, "Error: FW GRO supports only IPv4/IPv6, not 0x%04x\n",
- be16_to_cpu(skb->protocol));
+ netdev_WARN_ONCE(bp->dev,
+ "Error: FW GRO supports only IPv4/IPv6, not 0x%04x\n",
+ be16_to_cpu(skb->protocol));
}
}
#endif
--
2.7.4
^ permalink raw reply related
* [PATCH net-next 6/6] 8139cp: Replace WARN_ONCE with netdev_WARN_ONCE
From: Gal Pressman @ 2018-01-04 14:56 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Tariq Toukan, Saeed Mahameed, Gal Pressman,
Realtek linux nic maintainers
In-Reply-To: <1515077763-27991-1-git-send-email-galp@mellanox.com>
Use the more appropriate netdev_WARN_ONCE instead of WARN_ONCE macro.
Signed-off-by: Gal Pressman <galp@mellanox.com>
Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
---
drivers/net/ethernet/realtek/8139cp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index e7ab23e..81045df 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -748,8 +748,8 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb,
mss = skb_shinfo(skb)->gso_size;
if (mss > MSSMask) {
- WARN_ONCE(1, "Net bug: GSO size %d too large for 8139CP\n",
- mss);
+ netdev_WARN_ONCE(dev, "Net bug: GSO size %d too large for 8139CP\n",
+ mss);
goto out_dma_error;
}
--
2.7.4
^ permalink raw reply related
* Re: [PATCH net] net: dsa: b53: Turn off Broadcom tags for more switches
From: David Miller @ 2018-01-04 14:58 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev, jochen, andrew, vivien.didelot, linux-kernel
In-Reply-To: <20180104060229.23073-1-f.fainelli@gmail.com>
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Wed, 3 Jan 2018 22:02:29 -0800
> Models such as BCM5395/97/98 and BCM53125/24/53115 and compatible require that
> we turn on managed mode to actually act on Broadcom tags, otherwise they just
> pass them through on ingress (host -> switch) and don't insert them in egress
> (switch -> host). Turning on managed mode is simple, but requires us to
> properly support ARL misses on multicast addresses which is a much more
> involved set of changes not suitable for a bug fix for this release.
>
> Reported-by: Jochen Friedrich <jochen@scram.de>
> Fixes: 7edc58d614d4 ("net: dsa: b53: Turn on Broadcom tags")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Applied.
^ permalink raw reply
* pull-request: mac80211-next 2018-01-04
From: Johannes Berg @ 2018-01-04 15:02 UTC (permalink / raw)
To: David Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA
Hi Dave,
And here's a set for -next. It's not really big, and things
are all over the place. I'm thinking that Luca hasn't flushed
his queue out, but perhaps that'll then wait for the next
release, unless there are fixes that he still has.
Please pull and let me know if there's any problem.
Thanks,
johannes
The following changes since commit 51e18a453f5f59a40c721d4aeab082b4e2e9fac6:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2017-12-09 22:09:55 -0500)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git tags/mac80211-next-for-davem-2018-01-04
for you to fetch changes up to 3a3713ec360138f806c6fc368d1de570f692b347:
mac80211: Fix setting TX power on monitor interfaces (2018-01-04 15:27:48 +0100)
----------------------------------------------------------------
We have things all over the place, no point listing them.
One thing is notable: I applied two patches and later
reverted them - we'll get back to that once all the driver
situation is sorted out.
----------------------------------------------------------------
Adiel Aloni (1):
mac80211_hwsim: enforce PS_MANUAL_POLL to be set after PS_ENABLED
David Spinadel (2):
mac80211: Add MIC space only for TX key option
nl80211: send deauth reason if locally generated
Emmanuel Grumbach (1):
mac80211: always update the PM state of a peer on MGMT / DATA frames
Gustavo A. R. Silva (1):
mac80211: mark expected switch fall-throughs
Johannes Berg (6):
mac80211: avoid looking up tid_tx/tid_rx from timers
mac80211: make __ieee80211_start_rx_ba_session static
nl80211: add a few extended error strings to key parsing
mac80211: don't warn on AID field without top two MSBs set
Revert "mac80211: Add airtime account and scheduling to TXQs"
Revert "mac80211: Add TXQ scheduling API"
Luca Coelho (1):
mac80211: remove BUG() when interface type is invalid
Peter Große (1):
mac80211: Fix setting TX power on monitor interfaces
Sara Sharon (1):
mac80211: call synchronize_net once in the restart flow
Sergey Matyukevich (1):
cfg80211: cleanup signal strength units notation
Sunil Dutt (1):
cfg80211: Scan results to also report the per chain signal strength
Toke Høiland-Jørgensen (2):
mac80211: Add TXQ scheduling API
mac80211: Add airtime account and scheduling to TXQs
Tova Mussai (1):
cfg80211: IBSS: Add support for static WEP in driver for IBSS
Yingying Tang (1):
mac80211: enable TDLS peer buffer STA feature
drivers/net/wireless/mac80211_hwsim.c | 17 +++++----
include/net/cfg80211.h | 17 +++++++--
include/net/mac80211.h | 10 +++++-
include/uapi/linux/nl80211.h | 4 +++
net/mac80211/agg-rx.c | 26 +++++---------
net/mac80211/agg-tx.c | 34 ++++++------------
net/mac80211/cfg.c | 31 +++++++++++++++-
net/mac80211/debugfs.c | 1 +
net/mac80211/driver-ops.h | 3 +-
net/mac80211/ht.c | 1 +
net/mac80211/ieee80211_i.h | 4 ---
net/mac80211/iface.c | 4 +--
net/mac80211/key.c | 12 +++++--
net/mac80211/main.c | 3 ++
net/mac80211/mesh.c | 2 ++
net/mac80211/mesh_hwmp.c | 1 +
net/mac80211/mesh_plink.c | 2 +-
net/mac80211/mlme.c | 10 +++---
net/mac80211/offchannel.c | 4 +--
net/mac80211/rx.c | 17 +++------
net/mac80211/tdls.c | 6 +++-
net/mac80211/tx.c | 4 ++-
net/mac80211/util.c | 19 +++++-----
net/mac80211/wme.c | 1 +
net/mac80211/wpa.c | 16 ++++++---
net/wireless/ibss.c | 5 +++
net/wireless/mlme.c | 6 ++--
net/wireless/nl80211.c | 68 ++++++++++++++++++++++++-----------
net/wireless/scan.c | 5 +++
net/wireless/trace.h | 12 +++----
30 files changed, 219 insertions(+), 126 deletions(-)
^ permalink raw reply
* Re: [PATCH net-next 2/2] tun: allow to attach ebpf socket filter
From: Willem de Bruijn @ 2018-01-04 15:06 UTC (permalink / raw)
To: Jason Wang
Cc: Network Development, LKML, Michael S. Tsirkin, Willem de Bruijn
In-Reply-To: <9ef537b6-fe41-639b-671f-8104461db765@redhat.com>
On Thu, Jan 4, 2018 at 8:28 AM, Jason Wang <jasowang@redhat.com> wrote:
>
>
> On 2018年01月02日 17:19, Willem de Bruijn wrote:
>>>>
>>>> More importantly, should this program just return a boolean pass or
>>>> drop. Taking a length and trimming may introduce bugs later on if the
>>>> stack parses the packet unconditionally, expecting a minimum size
>>>> to be present.
>>>>
>>>> This was the reason for introducing sk_filter_trim_cap and using that
>>>> in other sk_filter sites.
>>>>
>>>> A quick scan shows that tun_put_user expects a full vlan tag to exist
>>>> if skb_vlan_tag_present(skb), for instance. If trimmed to below this
>>>> length the final call to skb_copy_datagram_iter may have negative
>>>> length.
>>>>
>>>> This is an issue with the existing sk_filter call as much as with the
>>>> new run_ebpf_filter call.
>>>
>>> Good point, so consider it was used by sk_filter too, we need to fix it
>>> anyway. Actually, I've considered the boolean return value but finally I
>>> decide to obey the style of sk filter. Maybe the trimming has real user.
>>> e.g
>>> high speed header recoding/analysis? Consider it's not hard to fix, how
>>> about just keep that?
>>
>> I don't see an obvious use case, but sure. We'll just need to look
>> at what the minimum trim length needs to be.
>
>
> Try to reproduce the possible issue, but looks like we are safe since we may
> hit -EFAULT which is returned by skb_copy_datagram_iter() before.
Ah, indeed, it can handle short lengths. Great, thanks for checking.
> So in V2,
> I will keep the code as is except trim 4 more bytes if vlan tag is present.
This is do not follow. Perhaps the patch will make it clear.
^ permalink raw reply
* Re: [PATCH] nl80211: Check for the required netlink attribute presence
From: Johannes Berg @ 2018-01-04 15:09 UTC (permalink / raw)
To: Hao Chen; +Cc: David S. Miller, linux-wireless, netdev, linux-kernel
In-Reply-To: <1514948431-20893-1-git-send-email-flank3rsky@gmail.com>
On Wed, 2018-01-03 at 11:00 +0800, Hao Chen wrote:
> nl80211_nan_add_func() does not check if the required attribute
> NL80211_NAN_FUNC_FOLLOW_UP_DEST is present when processing
> NL80211_CMD_ADD_NAN_FUNCTION request. This request can be issued
> by users with CAP_NET_ADMIN privilege and may result in NULL dereference
> and a system crash. Add a check for the required attribute presence.
Applied, thanks.
johannes
^ permalink raw reply
* [PATCH net-next 0/2] rds: use RCU between work-enqueue and connection teardown
From: Sowmini Varadhan @ 2018-01-04 14:52 UTC (permalink / raw)
To: netdev; +Cc: davem, rds-devel, sowmini.varadhan, santosh.shilimkar
This patchset follows up on the root-cause mentioned in
https://www.spinics.net/lists/netdev/msg472849.html
Patch1 implements some code refactoring that was suggeseted
as an enhancement in http://patchwork.ozlabs.org/patch/843157/
It replaces the c_destroy_in_prog bit in rds_connection with
an atomically managed flag in rds_conn_path.
Patch2 builds on Patch1 and uses RCU to make sure that
work is only enqueued if the connection destroy is not already
in progress: the test-flag-and-enqueue is done under rcu_read_lock,
while destroy first sets the flag, uses synchronize_rcu to
wait for existing reader threads to complete, and then starts
all the work-cancellation.
Since I have not been able to reproduce the original stack traces
reported by syszbot, and these are fixes for a race condition that
are based on code-inspection I am not marking these as reported-by
at this time.
Sowmini Varadhan (2):
rds: Use atomic flag to track connections being destroyed
rds: Ensure that send/recv/reconnect work cannot be requeued from
softirq or proc context
net/rds/cong.c | 10 +++++++---
net/rds/connection.c | 24 +++++++++++++++++++-----
net/rds/rds.h | 4 ++--
net/rds/send.c | 37 ++++++++++++++++++++++++++++++++-----
net/rds/tcp_connect.c | 2 +-
net/rds/tcp_recv.c | 8 ++++++--
net/rds/tcp_send.c | 5 ++++-
net/rds/threads.c | 20 +++++++++++++++-----
8 files changed, 86 insertions(+), 24 deletions(-)
^ permalink raw reply
* [PATCH net-next 1/2] rds: Use atomic flag to track connections being destroyed
From: Sowmini Varadhan @ 2018-01-04 14:52 UTC (permalink / raw)
To: netdev; +Cc: davem, rds-devel, sowmini.varadhan, santosh.shilimkar
In-Reply-To: <cover.1515068006.git.sowmini.varadhan@oracle.com>
Replace c_destroy_in_prog by using a bit in cp_flags that
can set/tested atomically.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
---
net/rds/connection.c | 7 ++++---
net/rds/rds.h | 4 ++--
net/rds/tcp_connect.c | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/net/rds/connection.c b/net/rds/connection.c
index 6492c0b..1eed197 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -366,7 +366,7 @@ void rds_conn_shutdown(struct rds_conn_path *cp)
* to the conn hash, so we never trigger a reconnect on this
* conn - the reconnect is always triggered by the active peer. */
cancel_delayed_work_sync(&cp->cp_conn_w);
- if (conn->c_destroy_in_prog)
+ if (test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
return;
rcu_read_lock();
if (!hlist_unhashed(&conn->c_hash_node)) {
@@ -384,6 +384,8 @@ static void rds_conn_path_destroy(struct rds_conn_path *cp)
{
struct rds_message *rm, *rtmp;
+ set_bit(RDS_DESTROY_PENDING, &cp->cp_flags);
+
if (!cp->cp_transport_data)
return;
@@ -426,7 +428,6 @@ void rds_conn_destroy(struct rds_connection *conn)
"%pI4\n", conn, &conn->c_laddr,
&conn->c_faddr);
- conn->c_destroy_in_prog = 1;
/* Ensure conn will not be scheduled for reconnect */
spin_lock_irq(&rds_conn_lock);
hlist_del_init_rcu(&conn->c_hash_node);
@@ -685,7 +686,7 @@ void rds_conn_path_drop(struct rds_conn_path *cp, bool destroy)
{
atomic_set(&cp->cp_state, RDS_CONN_ERROR);
- if (!destroy && cp->cp_conn->c_destroy_in_prog)
+ if (!destroy && test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
return;
queue_work(rds_wq, &cp->cp_down_w);
diff --git a/net/rds/rds.h b/net/rds/rds.h
index d09f6c1..374ae83 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -88,6 +88,7 @@ enum {
#define RDS_RECONNECT_PENDING 1
#define RDS_IN_XMIT 2
#define RDS_RECV_REFILL 3
+#define RDS_DESTROY_PENDING 4
/* Max number of multipaths per RDS connection. Must be a power of 2 */
#define RDS_MPATH_WORKERS 8
@@ -139,8 +140,7 @@ struct rds_connection {
__be32 c_faddr;
unsigned int c_loopback:1,
c_ping_triggered:1,
- c_destroy_in_prog:1,
- c_pad_to_32:29;
+ c_pad_to_32:30;
int c_npaths;
struct rds_connection *c_passive;
struct rds_transport *c_trans;
diff --git a/net/rds/tcp_connect.c b/net/rds/tcp_connect.c
index 46f74da..534c67a 100644
--- a/net/rds/tcp_connect.c
+++ b/net/rds/tcp_connect.c
@@ -170,7 +170,7 @@ void rds_tcp_conn_path_shutdown(struct rds_conn_path *cp)
cp->cp_conn, tc, sock);
if (sock) {
- if (cp->cp_conn->c_destroy_in_prog)
+ if (test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
rds_tcp_set_linger(sock);
sock->ops->shutdown(sock, RCV_SHUTDOWN | SEND_SHUTDOWN);
lock_sock(sock->sk);
--
1.7.1
^ permalink raw reply related
* [PATCH] nfp: add basic multicast filtering
From: Simon Horman @ 2018-01-04 15:10 UTC (permalink / raw)
To: David Miller, Jakub Kicinski; +Cc: netdev, oss-drivers, Simon Horman
From: Jakub Kicinski <jakub.kicinski@netronome.com>
We currently always pass all multicast traffic through.
Only set L2MC when actually needed. Since the driver
was not making use of the capability to filter out mcast
frames, some FW projects don't implement it any more.
Don't warn users if capability is not present (like we
do for promisc flag). The lack of L2MC capability is
assumed to mean all multicast traffic goes through.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 0add4870ce2e..29c0947f6d70 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -2850,6 +2850,11 @@ static void nfp_net_set_rx_mode(struct net_device *netdev)
new_ctrl = nn->dp.ctrl;
+ if (!netdev_mc_empty(netdev) || netdev->flags & IFF_ALLMULTI)
+ new_ctrl |= nn->cap & NFP_NET_CFG_CTRL_L2MC;
+ else
+ new_ctrl &= ~NFP_NET_CFG_CTRL_L2MC;
+
if (netdev->flags & IFF_PROMISC) {
if (nn->cap & NFP_NET_CFG_CTRL_PROMISC)
new_ctrl |= NFP_NET_CFG_CTRL_PROMISC;
@@ -3787,8 +3792,6 @@ int nfp_net_init(struct nfp_net *nn)
/* Allow L2 Broadcast and Multicast through by default, if supported */
if (nn->cap & NFP_NET_CFG_CTRL_L2BC)
nn->dp.ctrl |= NFP_NET_CFG_CTRL_L2BC;
- if (nn->cap & NFP_NET_CFG_CTRL_L2MC)
- nn->dp.ctrl |= NFP_NET_CFG_CTRL_L2MC;
/* Allow IRQ moderation, if supported */
if (nn->cap & NFP_NET_CFG_CTRL_IRQMOD) {
--
2.11.0
^ permalink raw reply related
* [PATCH net-next 2/2] rds: use RCU to synchronize work-enqueue with connection teardown
From: Sowmini Varadhan @ 2018-01-04 14:53 UTC (permalink / raw)
To: netdev; +Cc: davem, rds-devel, sowmini.varadhan, santosh.shilimkar
In-Reply-To: <cover.1515068006.git.sowmini.varadhan@oracle.com>
rds_sendmsg() can enqueue work on cp_send_w from process context, but
it should not enqueue this work if connection teardown has commenced
(else we risk enquing work after rds_conn_path_destroy() has assumed that
all work has been cancelled/flushed).
Similarly some other functions like rds_cong_queue_updates
and rds_tcp_data_ready are called in softirq context, and may end
up enqueuing work on rds_wq after rds_conn_path_destroy() has assumed
that all workqs are quiesced.
Check the RDS_DESTROY_PENDING bit and use rcu synchronization to avoid
all these races.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
---
net/rds/cong.c | 10 +++++++---
net/rds/connection.c | 21 +++++++++++++++++----
net/rds/send.c | 37 ++++++++++++++++++++++++++++++++-----
net/rds/tcp_recv.c | 8 ++++++--
net/rds/tcp_send.c | 5 ++++-
net/rds/threads.c | 20 +++++++++++++++-----
6 files changed, 81 insertions(+), 20 deletions(-)
diff --git a/net/rds/cong.c b/net/rds/cong.c
index 8398fee..8d19fd2 100644
--- a/net/rds/cong.c
+++ b/net/rds/cong.c
@@ -219,7 +219,11 @@ void rds_cong_queue_updates(struct rds_cong_map *map)
spin_lock_irqsave(&rds_cong_lock, flags);
list_for_each_entry(conn, &map->m_conn_list, c_map_item) {
- if (!test_and_set_bit(0, &conn->c_map_queued)) {
+ struct rds_conn_path *cp = &conn->c_path[0];
+
+ rcu_read_lock();
+ if (!test_and_set_bit(0, &conn->c_map_queued) &&
+ !test_bit(RDS_DESTROY_PENDING, &cp->cp_flags)) {
rds_stats_inc(s_cong_update_queued);
/* We cannot inline the call to rds_send_xmit() here
* for two reasons (both pertaining to a TCP transport):
@@ -235,9 +239,9 @@ void rds_cong_queue_updates(struct rds_cong_map *map)
* therefore trigger warnings.
* Defer the xmit to rds_send_worker() instead.
*/
- queue_delayed_work(rds_wq,
- &conn->c_path[0].cp_send_w, 0);
+ queue_delayed_work(rds_wq, &cp->cp_send_w, 0);
}
+ rcu_read_unlock();
}
spin_unlock_irqrestore(&rds_cong_lock, flags);
diff --git a/net/rds/connection.c b/net/rds/connection.c
index 1eed197..b10c0ef 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -366,8 +366,6 @@ void rds_conn_shutdown(struct rds_conn_path *cp)
* to the conn hash, so we never trigger a reconnect on this
* conn - the reconnect is always triggered by the active peer. */
cancel_delayed_work_sync(&cp->cp_conn_w);
- if (test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
- return;
rcu_read_lock();
if (!hlist_unhashed(&conn->c_hash_node)) {
rcu_read_unlock();
@@ -390,6 +388,7 @@ static void rds_conn_path_destroy(struct rds_conn_path *cp)
return;
/* make sure lingering queued work won't try to ref the conn */
+ synchronize_rcu();
cancel_delayed_work_sync(&cp->cp_send_w);
cancel_delayed_work_sync(&cp->cp_recv_w);
@@ -407,6 +406,11 @@ static void rds_conn_path_destroy(struct rds_conn_path *cp)
if (cp->cp_xmit_rm)
rds_message_put(cp->cp_xmit_rm);
+ WARN_ON(delayed_work_pending(&cp->cp_send_w));
+ WARN_ON(delayed_work_pending(&cp->cp_recv_w));
+ WARN_ON(delayed_work_pending(&cp->cp_conn_w));
+ WARN_ON(work_pending(&cp->cp_down_w));
+
cp->cp_conn->c_trans->conn_free(cp->cp_transport_data);
}
@@ -686,10 +690,13 @@ void rds_conn_path_drop(struct rds_conn_path *cp, bool destroy)
{
atomic_set(&cp->cp_state, RDS_CONN_ERROR);
- if (!destroy && test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
+ rcu_read_lock();
+ if (!destroy && test_bit(RDS_DESTROY_PENDING, &cp->cp_flags)) {
+ rcu_read_unlock();
return;
-
+ }
queue_work(rds_wq, &cp->cp_down_w);
+ rcu_read_unlock();
}
EXPORT_SYMBOL_GPL(rds_conn_path_drop);
@@ -706,9 +713,15 @@ void rds_conn_drop(struct rds_connection *conn)
*/
void rds_conn_path_connect_if_down(struct rds_conn_path *cp)
{
+ rcu_read_lock();
+ if (test_bit(RDS_DESTROY_PENDING, &cp->cp_flags)) {
+ rcu_read_unlock();
+ return;
+ }
if (rds_conn_path_state(cp) == RDS_CONN_DOWN &&
!test_and_set_bit(RDS_RECONNECT_PENDING, &cp->cp_flags))
queue_delayed_work(rds_wq, &cp->cp_conn_w, 0);
+ rcu_read_unlock();
}
EXPORT_SYMBOL_GPL(rds_conn_path_connect_if_down);
diff --git a/net/rds/send.c b/net/rds/send.c
index f72466c..d3e32d1 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -162,6 +162,12 @@ int rds_send_xmit(struct rds_conn_path *cp)
goto out;
}
+ if (test_bit(RDS_DESTROY_PENDING, &cp->cp_flags)) {
+ release_in_xmit(cp);
+ ret = -ENETUNREACH; /* dont requeue send work */
+ goto out;
+ }
+
/*
* we record the send generation after doing the xmit acquire.
* if someone else manages to jump in and do some work, we'll use
@@ -437,7 +443,12 @@ int rds_send_xmit(struct rds_conn_path *cp)
!list_empty(&cp->cp_send_queue)) && !raced) {
if (batch_count < send_batch_count)
goto restart;
- queue_delayed_work(rds_wq, &cp->cp_send_w, 1);
+ rcu_read_lock();
+ if (test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
+ ret = -ENETUNREACH;
+ else
+ queue_delayed_work(rds_wq, &cp->cp_send_w, 1);
+ rcu_read_unlock();
} else if (raced) {
rds_stats_inc(s_send_lock_queue_raced);
}
@@ -1151,6 +1162,11 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
else
cpath = &conn->c_path[0];
+ if (test_bit(RDS_DESTROY_PENDING, &cpath->cp_flags)) {
+ ret = -EAGAIN;
+ goto out;
+ }
+
rds_conn_path_connect_if_down(cpath);
ret = rds_cong_wait(conn->c_fcong, dport, nonblock, rs);
@@ -1190,9 +1206,17 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
rds_stats_inc(s_send_queued);
ret = rds_send_xmit(cpath);
- if (ret == -ENOMEM || ret == -EAGAIN)
- queue_delayed_work(rds_wq, &cpath->cp_send_w, 1);
-
+ if (ret == -ENOMEM || ret == -EAGAIN) {
+ ret = 0;
+ rcu_read_lock();
+ if (test_bit(RDS_DESTROY_PENDING, &cpath->cp_flags))
+ ret = -ENETUNREACH;
+ else
+ queue_delayed_work(rds_wq, &cpath->cp_send_w, 1);
+ rcu_read_unlock();
+ }
+ if (ret)
+ goto out;
rds_message_put(rm);
return payload_len;
@@ -1270,7 +1294,10 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
rds_stats_inc(s_send_pong);
/* schedule the send work on rds_wq */
- queue_delayed_work(rds_wq, &cp->cp_send_w, 1);
+ rcu_read_lock();
+ if (!test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
+ queue_delayed_work(rds_wq, &cp->cp_send_w, 1);
+ rcu_read_unlock();
rds_message_put(rm);
return 0;
diff --git a/net/rds/tcp_recv.c b/net/rds/tcp_recv.c
index e006ef8..dd707b9 100644
--- a/net/rds/tcp_recv.c
+++ b/net/rds/tcp_recv.c
@@ -321,8 +321,12 @@ void rds_tcp_data_ready(struct sock *sk)
ready = tc->t_orig_data_ready;
rds_tcp_stats_inc(s_tcp_data_ready_calls);
- if (rds_tcp_read_sock(cp, GFP_ATOMIC) == -ENOMEM)
- queue_delayed_work(rds_wq, &cp->cp_recv_w, 0);
+ if (rds_tcp_read_sock(cp, GFP_ATOMIC) == -ENOMEM) {
+ rcu_read_lock();
+ if (!test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
+ queue_delayed_work(rds_wq, &cp->cp_recv_w, 0);
+ rcu_read_unlock();
+ }
out:
read_unlock_bh(&sk->sk_callback_lock);
ready(sk);
diff --git a/net/rds/tcp_send.c b/net/rds/tcp_send.c
index dc860d1..73c7476 100644
--- a/net/rds/tcp_send.c
+++ b/net/rds/tcp_send.c
@@ -202,8 +202,11 @@ void rds_tcp_write_space(struct sock *sk)
tc->t_last_seen_una = rds_tcp_snd_una(tc);
rds_send_path_drop_acked(cp, rds_tcp_snd_una(tc), rds_tcp_is_acked);
- if ((refcount_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf)
+ rcu_read_lock();
+ if ((refcount_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf &&
+ !test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
queue_delayed_work(rds_wq, &cp->cp_send_w, 0);
+ rcu_read_unlock();
out:
read_unlock_bh(&sk->sk_callback_lock);
diff --git a/net/rds/threads.c b/net/rds/threads.c
index f121daa..eb76db1 100644
--- a/net/rds/threads.c
+++ b/net/rds/threads.c
@@ -87,8 +87,12 @@ void rds_connect_path_complete(struct rds_conn_path *cp, int curr)
cp->cp_reconnect_jiffies = 0;
set_bit(0, &cp->cp_conn->c_map_queued);
- queue_delayed_work(rds_wq, &cp->cp_send_w, 0);
- queue_delayed_work(rds_wq, &cp->cp_recv_w, 0);
+ rcu_read_lock();
+ if (!test_bit(RDS_DESTROY_PENDING, &cp->cp_flags)) {
+ queue_delayed_work(rds_wq, &cp->cp_send_w, 0);
+ queue_delayed_work(rds_wq, &cp->cp_recv_w, 0);
+ }
+ rcu_read_unlock();
}
EXPORT_SYMBOL_GPL(rds_connect_path_complete);
@@ -133,7 +137,10 @@ void rds_queue_reconnect(struct rds_conn_path *cp)
set_bit(RDS_RECONNECT_PENDING, &cp->cp_flags);
if (cp->cp_reconnect_jiffies == 0) {
cp->cp_reconnect_jiffies = rds_sysctl_reconnect_min_jiffies;
- queue_delayed_work(rds_wq, &cp->cp_conn_w, 0);
+ rcu_read_lock();
+ if (!test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
+ queue_delayed_work(rds_wq, &cp->cp_conn_w, 0);
+ rcu_read_unlock();
return;
}
@@ -141,8 +148,11 @@ void rds_queue_reconnect(struct rds_conn_path *cp)
rdsdebug("%lu delay %lu ceil conn %p for %pI4 -> %pI4\n",
rand % cp->cp_reconnect_jiffies, cp->cp_reconnect_jiffies,
conn, &conn->c_laddr, &conn->c_faddr);
- queue_delayed_work(rds_wq, &cp->cp_conn_w,
- rand % cp->cp_reconnect_jiffies);
+ rcu_read_lock();
+ if (!test_bit(RDS_DESTROY_PENDING, &cp->cp_flags))
+ queue_delayed_work(rds_wq, &cp->cp_conn_w,
+ rand % cp->cp_reconnect_jiffies);
+ rcu_read_unlock();
cp->cp_reconnect_jiffies = min(cp->cp_reconnect_jiffies * 2,
rds_sysctl_reconnect_max_jiffies);
--
1.7.1
^ permalink raw reply related
* Re: [net-next 00/15][pull request] 40GbE Intel Wired LAN Driver Updates 2018-01-03
From: David Miller @ 2018-01-04 15:11 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene
In-Reply-To: <20180103212222.17378-1-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 3 Jan 2018 13:22:07 -0800
> This series contains updates to i40e and i40evf only.
Please address Sergei's feedback wherein a change is mentioned in a commit
log entry but is not actually present in the patch itself.
^ permalink raw reply
* Re: [PATCH v6 3/6] can: m_can: Add PM Runtime
From: Faiz Abbas @ 2018-01-04 15:17 UTC (permalink / raw)
To: Marc Kleine-Budde, wg-5Yr1BZd7O62+XT7JhA+gdA,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8
Cc: linux-can-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, nsekhar-l0cyMroinI0,
fcooper-l0cyMroinI0, robh-DgEjT+Ai2ygdnm+yROfE0A,
Wenyou.Yang-UWL1GkI3JZL3oGB3hsPCZA,
sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8
In-Reply-To: <cb306ae5-87c5-f6ef-0c40-3b47e208d256-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Hi,
On Wednesday 03 January 2018 08:47 PM, Marc Kleine-Budde wrote:
> On 01/03/2018 04:06 PM, Faiz Abbas wrote:
>> Hi,
>>
>> On Wednesday 03 January 2018 07:55 PM, Marc Kleine-Budde wrote:
>>> On 01/03/2018 01:39 PM, Faiz Abbas wrote:
>>>> On Tuesday 02 January 2018 09:37 PM, Marc Kleine-Budde wrote:
>>>>> On 12/22/2017 02:31 PM, Faiz Abbas wrote:
>>>>>> From: Franklin S Cooper Jr <fcooper-l0cyMroinI0@public.gmane.org>
>>>>>>
>>>>>> Add support for PM Runtime which is the new way to handle managing clocks.
>>>>>> However, to avoid breaking SoCs not using PM_RUNTIME leave the old clk
>>>>>> management approach in place.
>>>>>
>>>>> There is no PM_RUNTIME anymore since 464ed18ebdb6 ("PM: Eliminate
>>>>> CONFIG_PM_RUNTIME")
>>>>
>>>> Ok. Will change the commit message.
>>>>
>>>>>
>>>>> Have a look at the discussion: https://patchwork.kernel.org/patch/9436507/ :
>>>>>
>>>>>>> Well, I admit it would be nicer if drivers didn't have to worry about
>>>>>>> whether or not CONFIG_PM was enabled. A slightly cleaner approach
>>>>>>> from the one outlined above would have the probe routine do this:
>>>>>>>
>>>>>>> my_power_up(dev);
>>>>>>> pm_runtime_set_active(dev);
>>>>>>> pm_runtime_get_noresume(dev);
>>>>>>> pm_runtime_enable(dev);
>>>>
>>>> This discussion seems to be about cases in which CONFIG_PM is not
>>>> enabled. CONFIG_PM is always selected in the case of omap devices.
>>>
>>> Yes, but in the commit message you state that you need to support
>>> systems that don't have PM_RUNTIME enabled. The only mainline SoCs I see
>>> is "arch/arm/boot/dts/sama5d2.dtsi" so far. Please check if they select
>>> CONFIG_PM, then we can make the driver much simpler.
>>
>> Actually the old clock management (for hclk which is the interface
>> clock) is still required as mentioned in the cover letter. Will change
>> the rather misleading description.
>
> Ok. So you can use the code as discussed on
> https://patchwork.kernel.org/patch/9436507/ ?
Looking at the kernel configuration, it seems like SAMA5D2 platform
selects CONFIG_PM (Wenyou, please confirm). So, it seems like the only
users of this driver always have CONFIG_PM enabled.
So I guess the best way is to maintain the current code for pm_runtime_*
and move the clock enable/disable to pm_runtime callbacks.
Something like this:
m_can_runtime_resume()
{
clk_prepare_enable(cclk);
clk_prepare_enable(hclk);
}
m_can_runtime_suspend()
{
clk_disable_unprepare(cclk);
clk_disable_unprepare(hclk);
}
SET_RUNTIME_PM_OPS(m_can_runtime_suspend, m_can_runtime_resume, NULL)
static void m_can_start(struct net_device *dev)
{
pm_runtime_get_sync(dev)
...
}
static void m_can_stop(struct net_device *dev)
{
...
pm_runtime_put_sync(dev)
}
Does that sound okay? If yes, I will go work on the implementation.
Thanks,
Faiz
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next 3/4] l2tp: remove configurable payload offset
From: Guillaume Nault @ 2018-01-04 15:17 UTC (permalink / raw)
To: James Chapman; +Cc: netdev, lorenzo.bianconi, liuhangbin
In-Reply-To: <2f985bb7-da3b-7792-a83f-cdbd3061a368@katalix.com>
On Thu, Jan 04, 2018 at 12:36:26PM +0000, James Chapman wrote:
> On 04/01/18 10:25, Guillaume Nault wrote:
> >> diff --git a/net/l2tp/l2tp_debugfs.c b/net/l2tp/l2tp_debugfs.c
> >> index eb69411..2c30587 100644
> >> --- a/net/l2tp/l2tp_debugfs.c
> >> +++ b/net/l2tp/l2tp_debugfs.c
> >> @@ -180,8 +180,8 @@ static void l2tp_dfs_seq_session_show(struct seq_file *m, void *v)
> >> session->lns_mode ? "LNS" : "LAC",
> >> session->debug,
> >> jiffies_to_msecs(session->reorder_timeout));
> >> - seq_printf(m, " offset %hu l2specific %hu/%hu\n",
> >> - session->offset, session->l2specific_type, session->l2specific_len);
> >> + seq_printf(m, " offset 0 l2specific %hu/%hu\n",
> >> + session->l2specific_type, session->l2specific_len);
> >>
> > Can't we drop "offset" completely?
>
> That would change the debugfs file layout. If we remove it, we should
> also update the header line which is in the debugs output and is
> intended to indicate the layout of data.
>
Yes, of course we'd have to keep them in sync.
Anyway, I don't really mind whether we keep offset in debugfs output or
not.
^ permalink raw reply
* Re: [PATCH v6 3/6] can: m_can: Add PM Runtime
From: Marc Kleine-Budde @ 2018-01-04 15:18 UTC (permalink / raw)
To: Faiz Abbas, wg-5Yr1BZd7O62+XT7JhA+gdA,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8
Cc: linux-can-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, nsekhar-l0cyMroinI0,
fcooper-l0cyMroinI0, robh-DgEjT+Ai2ygdnm+yROfE0A,
Wenyou.Yang-UWL1GkI3JZL3oGB3hsPCZA,
sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8
In-Reply-To: <6bdaab16-cb16-e039-473c-52dd295bd4ba-l0cyMroinI0@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 3350 bytes --]
On 01/04/2018 04:17 PM, Faiz Abbas wrote:
> Hi,
>
> On Wednesday 03 January 2018 08:47 PM, Marc Kleine-Budde wrote:
>> On 01/03/2018 04:06 PM, Faiz Abbas wrote:
>>> Hi,
>>>
>>> On Wednesday 03 January 2018 07:55 PM, Marc Kleine-Budde wrote:
>>>> On 01/03/2018 01:39 PM, Faiz Abbas wrote:
>>>>> On Tuesday 02 January 2018 09:37 PM, Marc Kleine-Budde wrote:
>>>>>> On 12/22/2017 02:31 PM, Faiz Abbas wrote:
>>>>>>> From: Franklin S Cooper Jr <fcooper-l0cyMroinI0@public.gmane.org>
>>>>>>>
>>>>>>> Add support for PM Runtime which is the new way to handle managing clocks.
>>>>>>> However, to avoid breaking SoCs not using PM_RUNTIME leave the old clk
>>>>>>> management approach in place.
>>>>>>
>>>>>> There is no PM_RUNTIME anymore since 464ed18ebdb6 ("PM: Eliminate
>>>>>> CONFIG_PM_RUNTIME")
>>>>>
>>>>> Ok. Will change the commit message.
>>>>>
>>>>>>
>>>>>> Have a look at the discussion: https://patchwork.kernel.org/patch/9436507/ :
>>>>>>
>>>>>>>> Well, I admit it would be nicer if drivers didn't have to worry about
>>>>>>>> whether or not CONFIG_PM was enabled. A slightly cleaner approach
>>>>>>>> from the one outlined above would have the probe routine do this:
>>>>>>>>
>>>>>>>> my_power_up(dev);
>>>>>>>> pm_runtime_set_active(dev);
>>>>>>>> pm_runtime_get_noresume(dev);
>>>>>>>> pm_runtime_enable(dev);
>>>>>
>>>>> This discussion seems to be about cases in which CONFIG_PM is not
>>>>> enabled. CONFIG_PM is always selected in the case of omap devices.
>>>>
>>>> Yes, but in the commit message you state that you need to support
>>>> systems that don't have PM_RUNTIME enabled. The only mainline SoCs I see
>>>> is "arch/arm/boot/dts/sama5d2.dtsi" so far. Please check if they select
>>>> CONFIG_PM, then we can make the driver much simpler.
>>>
>>> Actually the old clock management (for hclk which is the interface
>>> clock) is still required as mentioned in the cover letter. Will change
>>> the rather misleading description.
>>
>> Ok. So you can use the code as discussed on
>> https://patchwork.kernel.org/patch/9436507/ ?
>
> Looking at the kernel configuration, it seems like SAMA5D2 platform
> selects CONFIG_PM (Wenyou, please confirm). So, it seems like the only
> users of this driver always have CONFIG_PM enabled.
>
> So I guess the best way is to maintain the current code for pm_runtime_*
> and move the clock enable/disable to pm_runtime callbacks.
>
> Something like this:
>
> m_can_runtime_resume()
> {
> clk_prepare_enable(cclk);
> clk_prepare_enable(hclk);
> }
>
> m_can_runtime_suspend()
> {
> clk_disable_unprepare(cclk);
> clk_disable_unprepare(hclk);
> }
>
> SET_RUNTIME_PM_OPS(m_can_runtime_suspend, m_can_runtime_resume, NULL)
>
> static void m_can_start(struct net_device *dev)
> {
> pm_runtime_get_sync(dev)
> ...
> }
>
> static void m_can_stop(struct net_device *dev)
> {
> ...
> pm_runtime_put_sync(dev)
> }
>
> Does that sound okay? If yes, I will go work on the implementation.
ACK + error checking.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH net] tipc: fix missing rtnl lock protection during setting link properties
From: David Miller @ 2018-01-04 15:22 UTC (permalink / raw)
To: ying.xue; +Cc: netdev, jon.maloy, syzkaller-bugs, tipc-discussion
In-Reply-To: <b6ec84e9-b791-c953-a61b-edc125a81add@windriver.com>
From: Ying Xue <ying.xue@windriver.com>
Date: Thu, 4 Jan 2018 15:30:52 +0800
> On 01/03/2018 11:48 PM, David Miller wrote:
>> As soon as you drop the RTNL lock, the media or bearer entry can be
>> removed from the tables.
>>
>
> Thanks for the review. Yes, you are right. But even if we temporarily
> release RTNL lock, it's still safe for us because when we set
> media/bearer properties in __tipc_nl_compat_doit(), tipc_nl_media_set()
> and tipc_nl_bearer_set() will probe media or bearer again within RTNL
> lock protection.
>
>> This invalidates what you do next, whether it's
>> tipc_nl_compat_media_set(), tipc_nl_compat_bearer_set(), etc.
>
> In fact tipc_nl_compat_media_set() and tipc_nl_compat_bearer_set() don't
> really change media or bearer's properties, instead they only format the
> contents pointed by their "msg" parameter.
However, those values are only valid to place into the netlink message if
in fact we successfully found a media or bearer entry.
You have to hold RTNL across this whole construct, from the discovery of
the media or bearer entry all the way to the completion of filling in
the netlink message, one way or another.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox