* [PATCH 3/3] drivers: isdn: isdnloop: isdnloop.c: Remove parenthesis around return values, as specified in CodingStyle.
From: Bas Peters @ 2015-02-04 22:33 UTC (permalink / raw)
To: isdn; +Cc: netdev, linux-kernel, Bas Peters
In-Reply-To: <1423089181-15850-1-git-send-email-baspeters93@gmail.com>
Signed-off-by: Bas Peters <baspeters93@gmail.com>
---
drivers/isdn/isdnloop/isdnloop.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c
index e4d3620..ef9c8e4 100644
--- a/drivers/isdn/isdnloop/isdnloop.c
+++ b/drivers/isdn/isdnloop/isdnloop.c
@@ -552,9 +552,9 @@ isdnloop_unicause(isdnloop_card *card, int loc, int cau)
sprintf(buf, "%02X44", ctable_1t[cau]);
break;
default:
- return ("0000");
+ return "0000";
}
- return (buf);
+ return buf;
}
/*
@@ -750,17 +750,17 @@ isdnloop_vstphone(isdnloop_card *card, char *phone, int caller)
if (caller) {
for (i = 0; i < 2; i++)
if (!(strcmp(card->s0num[i], phone)))
- return (phone);
- return (card->s0num[0]);
+ return phone;
+ return card->s0num[0];
}
- return (phone);
+ return phone;
break;
case ISDN_PTYPE_1TR6:
if (caller) {
sprintf(nphone, "%s%c", card->s0num[0], phone[0]);
- return (nphone);
+ return nphone;
} else
- return (&phone[strlen(phone) - 1]);
+ return &phone[strlen(phone) - 1];
break;
}
return "";
@@ -1144,14 +1144,14 @@ isdnloop_command(isdn_ctrl *c, isdnloop_card *card)
case ISDNLOOP_IOCTL_STARTUP:
if (!access_ok(VERIFY_READ, (void *) a, sizeof(isdnloop_sdef)))
return -EFAULT;
- return (isdnloop_start(card, (isdnloop_sdef *) a));
+ return isdnloop_start(card, (isdnloop_sdef *) a);
break;
case ISDNLOOP_IOCTL_ADDCARD:
if (copy_from_user((char *)&cdef,
(char *)a,
sizeof(cdef)))
return -EFAULT;
- return (isdnloop_addcard(cdef.id1));
+ return isdnloop_addcard(cdef.id1);
break;
case ISDNLOOP_IOCTL_LEASEDCFG:
if (a) {
@@ -1373,7 +1373,7 @@ if_command(isdn_ctrl *c)
isdnloop_card *card = isdnloop_findcard(c->driver);
if (card)
- return (isdnloop_command(c, card));
+ return isdnloop_command(c, card);
printk(KERN_ERR
"isdnloop: if_command called with invalid driverId!\n");
return -ENODEV;
@@ -1387,7 +1387,7 @@ if_writecmd(const u_char __user *buf, int len, int id, int channel)
if (card) {
if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
return -ENODEV;
- return (isdnloop_writecmd(buf, len, 1, card));
+ return isdnloop_writecmd(buf, len, 1, card);
}
printk(KERN_ERR
"isdnloop: if_writecmd called with invalid driverId!\n");
@@ -1402,7 +1402,7 @@ if_readstatus(u_char __user *buf, int len, int id, int channel)
if (card) {
if (!(card->flags & ISDNLOOP_FLAGS_RUNNING))
return -ENODEV;
- return (isdnloop_readstatus(buf, len, card));
+ return isdnloop_readstatus(buf, len, card);
}
printk(KERN_ERR
"isdnloop: if_readstatus called with invalid driverId!\n");
@@ -1419,7 +1419,7 @@ if_sendbuf(int id, int channel, int ack, struct sk_buff *skb)
return -ENODEV;
/* ack request stored in skb scratch area */
*(skb->head) = ack;
- return (isdnloop_sendbuf(channel, skb, card));
+ return isdnloop_sendbuf(channel, skb, card);
}
printk(KERN_ERR
"isdnloop: if_sendbuf called with invalid driverId!\n");
@@ -1499,7 +1499,7 @@ static int __init
isdnloop_init(void)
{
if (isdnloop_id)
- return (isdnloop_addcard(isdnloop_id));
+ return isdnloop_addcard(isdnloop_id);
return 0;
}
--
2.1.0
^ permalink raw reply related
* [PATCH 2/3] drivers: isdn: isdnloop: isdnloop.c: Fix brace positions according to CodingStyle specifications.
From: Bas Peters @ 2015-02-04 22:33 UTC (permalink / raw)
To: isdn; +Cc: netdev, linux-kernel, Bas Peters
In-Reply-To: <1423089181-15850-1-git-send-email-baspeters93@gmail.com>
Signed-off-by: Bas Peters <baspeters93@gmail.com>
---
drivers/isdn/isdnloop/isdnloop.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c
index af96317..e4d3620 100644
--- a/drivers/isdn/isdnloop/isdnloop.c
+++ b/drivers/isdn/isdnloop/isdnloop.c
@@ -150,8 +150,7 @@ typedef struct isdnloop_stat {
int action;
} isdnloop_stat;
/* *INDENT-OFF* */
-static isdnloop_stat isdnloop_stat_table[] =
-{
+static isdnloop_stat isdnloop_stat_table[] = {
{"BCON_", ISDN_STAT_BCONN, 1}, /* B-Channel connected */
{"BDIS_", ISDN_STAT_BHUP, 2}, /* B-Channel disconnected */
{"DCON_", ISDN_STAT_DCONN, 0}, /* D-Channel connected */
@@ -485,8 +484,7 @@ isdnloop_fake(isdnloop_card *card, char *s, int ch)
return 0;
}
/* *INDENT-OFF* */
-static isdnloop_stat isdnloop_cmd_table[] =
-{
+static isdnloop_stat isdnloop_cmd_table[] = {
{"BCON_R", 0, 1}, /* B-Channel connect */
{"BCON_I", 0, 17}, /* B-Channel connect ind */
{"BDIS_R", 0, 2}, /* B-Channel disconnect */
@@ -527,10 +525,8 @@ isdnloop_fake_err(isdnloop_card *card)
isdnloop_fake(card, "NAK", -1);
}
-static u_char ctable_eu[] =
-{0x00, 0x11, 0x01, 0x12};
-static u_char ctable_1t[] =
-{0x00, 0x3b, 0x01, 0x3a};
+static u_char ctable_eu[] = {0x00, 0x11, 0x01, 0x12};
+static u_char ctable_1t[] = {0x00, 0x3b, 0x01, 0x3a};
/*
* Assemble a simplified cause message depending on the
@@ -649,10 +645,8 @@ isdnloop_kill_ctimer(isdnloop_card *card, int ch)
spin_unlock_irqrestore(&card->isdnloop_lock, flags);
}
-static u_char si2bit[] =
-{0, 1, 0, 0, 0, 2, 0, 4, 0, 0};
-static u_char bit2si[] =
-{1, 5, 7};
+static u_char si2bit[] = {0, 1, 0, 0, 0, 2, 0, 4, 0, 0};
+static u_char bit2si[] = {1, 5, 7};
/*
* Try finding a listener for an outgoing call.
--
2.1.0
^ permalink raw reply related
* [PATCH 1/3] drivers: isdn: isdnloop: isdnloop.c: remove assignment of variables in if conditions, in accordance with the CodingStyle.
From: Bas Peters @ 2015-02-04 22:32 UTC (permalink / raw)
To: isdn; +Cc: netdev, linux-kernel, Bas Peters
In-Reply-To: <1423089181-15850-1-git-send-email-baspeters93@gmail.com>
Signed-off-by: Bas Peters <baspeters93@gmail.com>
---
drivers/isdn/isdnloop/isdnloop.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c
index 5a4da94..af96317 100644
--- a/drivers/isdn/isdnloop/isdnloop.c
+++ b/drivers/isdn/isdnloop/isdnloop.c
@@ -59,7 +59,8 @@ isdnloop_bchan_send(isdnloop_card *card, int ch)
isdn_ctrl cmd;
while (card->sndcount[ch]) {
- if ((skb = skb_dequeue(&card->bqueue[ch]))) {
+ skb = skb_dequeue(&card->bqueue[ch]);
+ if (skb) {
len = skb->len;
card->sndcount[ch] -= len;
ack = *(skb->head); /* used as scratch area */
@@ -317,7 +318,8 @@ isdnloop_polldchan(unsigned long data)
u_char *p;
isdn_ctrl cmd;
- if ((skb = skb_dequeue(&card->dqueue)))
+ skb = skb_dequeue(&card->dqueue);
+ if (skb)
avail = skb->len;
else
avail = 0;
@@ -471,8 +473,8 @@ isdnloop_fake(isdnloop_card *card, char *s, int ch)
{
struct sk_buff *skb;
int len = strlen(s) + ((ch >= 0) ? 3 : 0);
-
- if (!(skb = dev_alloc_skb(len))) {
+ skb = dev_alloc_skb(len);
+ if (!skb) {
printk(KERN_WARNING "isdnloop: Out of memory in isdnloop_fake\n");
return 1;
}
@@ -1439,8 +1441,8 @@ isdnloop_initcard(char *id)
{
isdnloop_card *card;
int i;
-
- if (!(card = kzalloc(sizeof(isdnloop_card), GFP_KERNEL))) {
+ card = kzalloc(sizeof(isdnloop_card), GFP_KERNEL);
+ if (!card) {
printk(KERN_WARNING
"isdnloop: (%s) Could not allocate card-struct.\n", id);
return (isdnloop_card *) 0;
@@ -1489,8 +1491,8 @@ static int
isdnloop_addcard(char *id1)
{
isdnloop_card *card;
-
- if (!(card = isdnloop_initcard(id1))) {
+ card = isdnloop_initcard(id1);
+ if (!card) {
return -EIO;
}
printk(KERN_INFO
--
2.1.0
^ permalink raw reply related
* [PATCH 0/3] Fix checkpatch errors in drivers/isdn/isdnloop
From: Bas Peters @ 2015-02-04 22:32 UTC (permalink / raw)
To: isdn; +Cc: netdev, linux-kernel, Bas Peters
This patchset adresses various checkpatch errors in the abovementioned driver.
Bas Peters (3):
drivers: isdn: isdnloop: isdnloop.c: remove assignment of variables in
if conditions, in accordance with the CodingStyle.
drivers: isdn: isdnloop: isdnloop.c: Fix brace positions according to
CodingStyle specifications.
drivers: isdn: isdnloop: isdnloop.c: Remove parenthesis around return
values, as specified in CodingStyle.
drivers/isdn/isdnloop/isdnloop.c | 64 +++++++++++++++++++---------------------
1 file changed, 30 insertions(+), 34 deletions(-)
--
2.1.0
^ permalink raw reply
* RE: [PATCH net] hyperv: Fix the error processing in netvsc_send()
From: Haiyang Zhang @ 2015-02-04 22:26 UTC (permalink / raw)
To: Jason Wang
Cc: olaf@aepfle.de, netdev@vger.kernel.org,
driverdev-devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org, davem@davemloft.net
In-Reply-To: <1423034952.10558.3@smtp.corp.redhat.com>
> -----Original Message-----
> From: Jason Wang [mailto:jasowang@redhat.com]
> Sent: Wednesday, February 4, 2015 2:29 AM
> > The EAGAIN error doesn't normally happen, because we set the hi water
> > mark
> > to stop send queue.
>
> This is not true since only txq was stopped which means only network
> stack stop sending packets but not for control path e.g
> rndis_filter_send_request() or other callers who call
> vmbus_sendpacket() directly (e.g recv completion).
>
> For control path, user may meet several errors when they want to change
> mac address under heavy load.
>
> What's more serious is netvsc_send_recv_completion(), it can not even
> recover from more than 3 times of EAGAIN.
>
> I must say mixing data packets with control packets with the same
> channel sounds really scary. Since control packets could be blocked or
> even dropped because of data packets already queued during heavy load,
> and you need to synchronize two paths carefully (e.g I didn't see any
> tx lock were held if rndis_filter_send_request() call netsc_send()
> which may stop or start a queue).
The RING_AVAIL_PERCENT_HIWATER is defined to be 20, so the data traffic
can only occupy 20% of the ring buffer before stopping the txq. So, this
mechanism ensures the control messages are not blocked by data traffic.
> > If in really rare case, the ring buffer is full and there
> > is no outstanding sends, we can't stop queue here because there will
> > be no
> > send-completion msg to wake it up.
>
> Confused, I believe only txq is stopped but we may still get completion
> interrupt in this case.
If there is no outstanding sends in this queue (queue_sends[q_idx]), we
won't receive any more send-completion msg.
>
> > And, the ring buffer is likely to be
> > occupied by other special msg, e.g. receive-completion msg (not a
> > normal case),
> > so we can't assume there are available slots.
>
> Then why not checking hv_ringbuf_avail_percent() instead? And there's
> no need to check queue_sends since it does not count recv completion.
When ret == -EAGAIN, which means the ring is full, we don't need to check
hv_ringbuf_avail_percent().
> > We don't request retry from
> > the upper layer in this case to avoid possible busy retry.
>
> Can't we just do this by stopping txq and depending on tx interrupt to
> wake it?
There is no tx interrupt. Do you mean rx interrupt for the send-completion?
In usual cases, when we hit the high water mark, the stopped queue depends on
the send-completion msg to wake up. But, not in some special cases.
As said above, we won't receive any more send-completion msg when there is
no outstanding sends in this queue.
Thanks,
- Haiyang
^ permalink raw reply
* [PATCH net] pktgen: fix UDP checksum computation
From: Sabrina Dubroca @ 2015-02-04 22:08 UTC (permalink / raw)
To: davem; +Cc: netdev, tgraf, Sabrina Dubroca
This patch fixes two issues in UDP checksum computation in pktgen.
First, the pseudo-header uses the source and destination IP
addresses. Currently, the ports are used for IPv4.
Second, the UDP checksum covers both header and data. So we need to
generate the data earlier (move pktgen_finalize_skb up), and compute
the checksum for UDP header + data.
Fixes: c26bf4a51308c ("pktgen: Add UDPCSUM flag to support UDP checksums")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
---
net/core/pktgen.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index da934fc3faa8..9fa25b0ea145 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2842,25 +2842,25 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
skb->dev = odev;
skb->pkt_type = PACKET_HOST;
+ pktgen_finalize_skb(pkt_dev, skb, datalen);
+
if (!(pkt_dev->flags & F_UDPCSUM)) {
skb->ip_summed = CHECKSUM_NONE;
} else if (odev->features & NETIF_F_V4_CSUM) {
skb->ip_summed = CHECKSUM_PARTIAL;
skb->csum = 0;
- udp4_hwcsum(skb, udph->source, udph->dest);
+ udp4_hwcsum(skb, iph->saddr, iph->daddr);
} else {
- __wsum csum = udp_csum(skb);
+ __wsum csum = skb_checksum(skb, skb_transport_offset(skb), datalen + 8, 0);
/* add protocol-dependent pseudo-header */
- udph->check = csum_tcpudp_magic(udph->source, udph->dest,
+ udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr,
datalen + 8, IPPROTO_UDP, csum);
if (udph->check == 0)
udph->check = CSUM_MANGLED_0;
}
- pktgen_finalize_skb(pkt_dev, skb, datalen);
-
#ifdef CONFIG_XFRM
if (!process_ipsec(pkt_dev, skb, protocol))
return NULL;
@@ -2976,6 +2976,8 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
skb->dev = odev;
skb->pkt_type = PACKET_HOST;
+ pktgen_finalize_skb(pkt_dev, skb, datalen);
+
if (!(pkt_dev->flags & F_UDPCSUM)) {
skb->ip_summed = CHECKSUM_NONE;
} else if (odev->features & NETIF_F_V6_CSUM) {
@@ -2984,7 +2986,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
skb->csum_offset = offsetof(struct udphdr, check);
udph->check = ~csum_ipv6_magic(&iph->saddr, &iph->daddr, udplen, IPPROTO_UDP, 0);
} else {
- __wsum csum = udp_csum(skb);
+ __wsum csum = skb_checksum(skb, skb_transport_offset(skb), udplen, 0);
/* add protocol-dependent pseudo-header */
udph->check = csum_ipv6_magic(&iph->saddr, &iph->daddr, udplen, IPPROTO_UDP, csum);
@@ -2993,8 +2995,6 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
udph->check = CSUM_MANGLED_0;
}
- pktgen_finalize_skb(pkt_dev, skb, datalen);
-
return skb;
}
--
2.2.2
^ permalink raw reply related
* Re: [PATCH] csiostor:Use firmware version from cxgb4/t4fw_version.h
From: David Miller @ 2015-02-04 22:00 UTC (permalink / raw)
To: praveenm; +Cc: netdev, linux-scsi, JBottomley, hch, hariprasad
In-Reply-To: <1422964106-4033-1-git-send-email-praveenm@chelsio.com>
From: Praveen Madhavan <praveenm@chelsio.com>
Date: Tue, 3 Feb 2015 17:18:26 +0530
> This patch is to use firmware version macros from t4fw_version.h
> and also enables 40g T5 adapter.
>
> Signed-off-by: Praveen Madhavan <praveenm@chelsio.com>
Applied.
^ permalink raw reply
* Re: [PATCH for-3.19] vhost/net: fix up num_buffers endian-ness
From: David Miller @ 2015-02-04 21:59 UTC (permalink / raw)
To: mst; +Cc: kvm, netdev, linux-kernel, virtualization, viro
In-Reply-To: <1422896842-19186-1-git-send-email-mst@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Tue, 3 Feb 2015 11:07:06 +0200
> In virtio 1.0 mode, when mergeable buffers are enabled on a big-endian
> host, num_buffers wasn't byte-swapped correctly, so large incoming
> packets got corrupted.
>
> To fix, fill it in within hdr - this also makes sure it gets
> the correct type.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Applied.
^ permalink raw reply
* Re: [PATCH 2/2] tlan: msecs_to_jiffies convrsion
From: David Miller @ 2015-02-04 21:58 UTC (permalink / raw)
To: hofrat; +Cc: chessman, netdev, linux-kernel
In-Reply-To: <1422953111-19840-1-git-send-email-hofrat@osadl.org>
From: Nicholas Mc Guire <hofrat@osadl.org>
Date: Tue, 3 Feb 2015 03:45:11 -0500
> This is only an API consolidation and should make things more readable
> it replaces var * HZ / 1000 by msecs_to_jiffies(var).
>
> As there is a discrepancy between the code and the comments this is in
> a separate patch.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Applied.
^ permalink raw reply
* Re: [PATCH 1/2] tlan: use msecs_to_jiffies for conversion
From: David Miller @ 2015-02-04 21:58 UTC (permalink / raw)
To: hofrat; +Cc: chessman, netdev, linux-kernel
In-Reply-To: <1422953085-19797-1-git-send-email-hofrat@osadl.org>
From: Nicholas Mc Guire <hofrat@osadl.org>
Date: Tue, 3 Feb 2015 03:44:45 -0500
> This is only an API consolidation and should make things more readable
> it replaces var * HZ / 1000 by msecs_to_jiffies(var).
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Applied.
^ permalink raw reply
* Re: pull request: bluetooth-next 2015-02-03
From: David Miller @ 2015-02-04 21:56 UTC (permalink / raw)
To: johan.hedberg; +Cc: netdev, linux-bluetooth
In-Reply-To: <20150203082123.GA13130@t440s.lan>
From: Johan Hedberg <johan.hedberg@gmail.com>
Date: Tue, 3 Feb 2015 10:21:23 +0200
> Here's what's likely the last bluetooth-next pull request for 3.20.
> Notable changes include:
>
> - xHCI workaround + a new id for the ath3k driver
> - Several new ids for the btusb driver
> - Support for new Intel Bluetooth controllers
> - Minor cleanups to ieee802154 code
> - Nested sleep warning fix in socket accept() code path
> - Fixes for Out of Band pairing handling
> - Support for LE scan restarting for HCI_QUIRK_STRICT_DUPLICATE_FILTER
> - Improvements to data we expose through debugfs
> - Proper handling of Hardware Error HCI events
>
> Please let me know if there are any issues pulling. Thanks.
Pulled, thanks Johan.
^ permalink raw reply
* Re: [PATCH v3] gianfar: correct the bad expression while writing bit-pattern
From: David Miller @ 2015-02-04 21:55 UTC (permalink / raw)
To: sanjeev_sharma; +Cc: claudiu.manoil, matei.pavaluca, netdev, linux-kernel
In-Reply-To: <1422948722-16864-1-git-send-email-sanjeev_sharma@mentor.com>
From: Sanjeev Sharma <sanjeev_sharma@mentor.com>
Date: Tue, 3 Feb 2015 13:02:02 +0530
> This patch correct the bad expression while writing the
> bit-pattern from software's buffer to hardware registers.
>
> Signed-off-by: Sanjeev Sharma <Sanjeev_Sharma@mentor.com>
> ---
> Changes in v3:
> - corrected the expression by introducing tab->fe[i].prop.
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next] net: add skb functions to process remote checksum offload
From: David Miller @ 2015-02-04 21:54 UTC (permalink / raw)
To: therbert; +Cc: netdev
In-Reply-To: <1422922054-22996-1-git-send-email-therbert@google.com>
From: Tom Herbert <therbert@google.com>
Date: Mon, 2 Feb 2015 16:07:34 -0800
> This patch adds skb_remcsum_process and skb_gro_remcsum_process to
> perform the appropriate adjustments to the skb when receiving
> remote checksum offload.
>
> Updated vxlan and gue to use these functions.
>
> Tested: Ran TCP_RR and TCP_STREAM netperf for VXLAN and GUE, did
> not see any change in performance.
>
> Signed-off-by: Tom Herbert <therbert@google.com>
Applied.
^ permalink raw reply
* Re: [PATCH] net: usb: sr9700: Use 'SR_' prefix for the common register macros
From: David Miller @ 2015-02-04 21:53 UTC (permalink / raw)
To: gang.chen; +Cc: linux-usb, netdev, linux-kernel
In-Reply-To: <54CFE578.7030207@sunrus.com.cn>
From: Chen Gang S <gang.chen@sunrus.com.cn>
Date: Tue, 03 Feb 2015 05:00:40 +0800
> The commone register macors (e.g. RSR) is too commont to drivers, it may
> be conflict with the architectures (e.g. xtensa, sh).
>
> The related warnings (with allmodconfig under xtensa):
>
> CC [M] drivers/net/usb/sr9700.o
> In file included from drivers/net/usb/sr9700.c:24:0:
> drivers/net/usb/sr9700.h:65:0: warning: "RSR" redefined
> #define RSR 0x06
> ^
> In file included from ./arch/xtensa/include/asm/bitops.h:22:0,
> from include/linux/bitops.h:36,
> from include/linux/kernel.h:10,
> from include/linux/list.h:8,
> from include/linux/module.h:9,
> from drivers/net/usb/sr9700.c:13:
> ./arch/xtensa/include/asm/processor.h:190:0: note: this is the location of the previous definition
> #define RSR(v,sr) __asm__ __volatile__ ("rsr %0,"__stringify(sr) : "=a"(v));
> ^
>
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next] bridge: Let bridge not age 'externally' learnt FDB entries, they are removed when 'external' entity notifies the aging
From: David Miller @ 2015-02-04 21:51 UTC (permalink / raw)
To: siva.mannem.lnx; +Cc: netdev
In-Reply-To: <1422897714-5956-1-git-send-email-siva.mannem.lnx@gmail.com>
From: Siva Mannem <siva.mannem.lnx@gmail.com>
Date: Mon, 2 Feb 2015 22:51:54 +0530
> When 'learned_sync' flag is turned on, the offloaded switch
> port syncs learned MAC addresses to bridge's FDB via switchdev notifier
> (NETDEV_SWITCH_FDB_ADD). Currently, FDB entries learnt via this mechanism are
> wrongly being deleted by bridge aging logic. This patch ensures that FDB
> entries synced from offloaded switch ports are not deleted by bridging logic.
> Such entries can only be deleted via switchdev notifier
> (NETDEV_SWITCH_FDB_DEL).
>
> Signed-off-by: Siva Mannem <siva.mannem.lnx@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()
From: Chen Gang S @ 2015-02-04 21:47 UTC (permalink / raw)
To: Marcel Holtmann, Sergei Shtylyov
Cc: David Laight, Gustavo F. Padovan, Johan Hedberg, David S. Miller,
linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
In-Reply-To: <0AB99BEA-C379-439C-AD80-5F2122AE37E5@holtmann.org>
On 2/5/15 05:09, Marcel Holtmann wrote:
> Hi Sergei,
>
>>>> -static inline int hci_test_bit(int nr, void *addr)
>>>> +static inline int hci_test_bit(int nr, const void *addr)
>>>> {
>>>> return *((__u32 *) addr + (nr >> 5)) & ((__u32) 1 << (nr & 31));
>>>> }
>>
>>> Is there a 'standard' function lurking that will do the above.
>>> On x86 the cpus 'bit test' instruction will handle bit numbers
>>> greater than the word size - so it can be a single instruction.
>>
>> Of course, there's test_bit().
>
> we did leave hci_test_bit in the code since there are some userspace facing API that we can not change. Remember that the origin of this code is from 2.4.6 kernel.
>
> So we can only change this if you can ensure not to break the userspace API. So might want to write unit tests to ensure working HCI filter before even considering touching this.
>
For me, we have to remain hci_test_bit(), it is for "__u32 *" (which we
can not change). The common test_bit() is for "unsigned long *", in this
case, I guess it may cause issue under 64-bit environments.
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
^ permalink raw reply
* [PATCH net] net: remove some sparse warnings
From: Eric Dumazet @ 2015-02-04 21:37 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
netdev_adjacent_add_links() and netdev_adjacent_del_links()
are static.
queue->qdisc has __rcu annotation, need to use RCU_INIT_POINTER()
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/core/dev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index c87a2264a02b..7fe82929f509 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5294,7 +5294,7 @@ void netdev_upper_dev_unlink(struct net_device *dev,
}
EXPORT_SYMBOL(netdev_upper_dev_unlink);
-void netdev_adjacent_add_links(struct net_device *dev)
+static void netdev_adjacent_add_links(struct net_device *dev)
{
struct netdev_adjacent *iter;
@@ -5319,7 +5319,7 @@ void netdev_adjacent_add_links(struct net_device *dev)
}
}
-void netdev_adjacent_del_links(struct net_device *dev)
+static void netdev_adjacent_del_links(struct net_device *dev)
{
struct netdev_adjacent *iter;
@@ -6627,7 +6627,7 @@ struct netdev_queue *dev_ingress_queue_create(struct net_device *dev)
if (!queue)
return NULL;
netdev_init_one_queue(dev, queue, NULL);
- queue->qdisc = &noop_qdisc;
+ RCU_INIT_POINTER(queue->qdisc, &noop_qdisc);
queue->qdisc_sleeping = &noop_qdisc;
rcu_assign_pointer(dev->ingress_queue, queue);
#endif
^ permalink raw reply related
* [PATCH net] flow_keys: n_proto type should be __be16
From: Eric Dumazet @ 2015-02-04 21:31 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Govindarajulu Varadarajan
From: Eric Dumazet <edumazet@google.com>
(struct flow_keys)->n_proto is in network order, use
proper type for this.
Fixes following sparse errors :
net/core/flow_dissector.c:139:39: warning: incorrect type in assignment (different base types)
net/core/flow_dissector.c:139:39: expected unsigned short [unsigned] [usertype] n_proto
net/core/flow_dissector.c:139:39: got restricted __be16 [assigned] [usertype] proto
net/core/flow_dissector.c:237:23: warning: incorrect type in assignment (different base types)
net/core/flow_dissector.c:237:23: expected unsigned short [unsigned] [usertype] n_proto
net/core/flow_dissector.c:237:23: got restricted __be16 [assigned] [usertype] proto
Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: e0f31d849867 ("flow_keys: Record IP layer protocol in skb_flow_dissect()")
---
include/net/flow_keys.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/net/flow_keys.h b/include/net/flow_keys.h
index 7ee2df083542..dc8fd81412bf 100644
--- a/include/net/flow_keys.h
+++ b/include/net/flow_keys.h
@@ -22,9 +22,9 @@ struct flow_keys {
__be32 ports;
__be16 port16[2];
};
- u16 thoff;
- u16 n_proto;
- u8 ip_proto;
+ u16 thoff;
+ __be16 n_proto;
+ u8 ip_proto;
};
bool __skb_flow_dissect(const struct sk_buff *skb, struct flow_keys *flow,
^ permalink raw reply related
* Re: [PATCH] net: fs_enet: Implement NETIF_F_SG feature
From: David Miller @ 2015-02-04 21:13 UTC (permalink / raw)
To: christophe.leroy
Cc: pantelis.antoniou, vbordug, linux-kernel, linuxppc-dev, netdev
In-Reply-To: <20150202170654.D5EE21A5E90@localhost.localdomain>
From: Christophe Leroy <christophe.leroy@c-s.fr>
Date: Mon, 2 Feb 2015 18:06:54 +0100 (CET)
> Freescale ethernet controllers have the capability to re-assemble fragmented
> data into a single ethernet frame. This patch uses this capability and
> implements NETIP_F_SG feature into the fs_enet ethernet driver.
>
> On a MPC885, I get 53% performance improvement on a ftp transfer of a 15Mb file:
> * Without the patch : 2,8 Mbps
> * With the patch : 4,3 Mbps
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Applied, thanks.
^ permalink raw reply
* Re: Throughput regression with `tcp: refine TSO autosizing`
From: Eric Dumazet @ 2015-02-04 21:11 UTC (permalink / raw)
To: Michal Kazior
Cc: Neal Cardwell, linux-wireless, Network Development,
eyalpe-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb
In-Reply-To: <1423056591.907.130.camel-XN9IlZ5yJG9HTL0Zs8A6p/gx64E7kk8eUsxypvmhUTTZJqsBc5GL+g@public.gmane.org>
I do not see how a TSO patch could hurt a flow not using TSO/GSO.
This makes no sense.
ath10k tx completions being batched/deferred to a tasklet might increase
probability to hit this condition in tcp_wfree() :
/* If this softirq is serviced by ksoftirqd, we are likely under stress.
* Wait until our queues (qdisc + devices) are drained.
* This gives :
* - less callbacks to tcp_write_xmit(), reducing stress (batches)
* - chance for incoming ACK (processed by another cpu maybe)
* to migrate this flow (skb->ooo_okay will be eventually set)
*/
if (wmem >= SKB_TRUESIZE(1) && this_cpu_ksoftirqd() == current)
goto out;
Meaning tcp stack waits all skbs left qdisc/NIC queues before queuing
additional packets.
I would try to call skb_orphan() in ath10k if you really want to keep
these batches.
I have hard time to understand why tx completed packets go through
ath10k_htc_rx_completion_handler().. anyway...
Most conservative patch would be :
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 9c782a42665e1aaf43bfbca441631ee58da50c09..6a36317d6bb0447202dee15528130bd5e21248c4 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -1642,6 +1642,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
break;
}
case HTT_T2H_MSG_TYPE_TX_COMPL_IND:
+ skb_orphan(skb);
spin_lock_bh(&htt->tx_lock);
__skb_queue_tail(&htt->tx_compl_q, skb);
spin_unlock_bh(&htt->tx_lock);
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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 related
* Re: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()
From: Marcel Holtmann @ 2015-02-04 21:09 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: David Laight, Chen Gang S, Gustavo F. Padovan, Johan Hedberg,
David S. Miller,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <54D27D68.7040501-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
Hi Sergei,
>>> -static inline int hci_test_bit(int nr, void *addr)
>>> +static inline int hci_test_bit(int nr, const void *addr)
>>> {
>>> return *((__u32 *) addr + (nr >> 5)) & ((__u32) 1 << (nr & 31));
>>> }
>
>> Is there a 'standard' function lurking that will do the above.
>> On x86 the cpus 'bit test' instruction will handle bit numbers
>> greater than the word size - so it can be a single instruction.
>
> Of course, there's test_bit().
we did leave hci_test_bit in the code since there are some userspace facing API that we can not change. Remember that the origin of this code is from 2.4.6 kernel.
So we can only change this if you can ensure not to break the userspace API. So might want to write unit tests to ensure working HCI filter before even considering touching this.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH net-next] xps: fix xps for stacked devices
From: David Miller @ 2015-02-04 21:03 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, willemb, nanditad, ycheng
In-Reply-To: <1423036104.907.99.camel@edumazet-glaptop2.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 03 Feb 2015 23:48:24 -0800
> From: Eric Dumazet <edumazet@google.com>
>
> A typical qdisc setup is the following :
>
> bond0 : bonding device, using HTB hierarchy
> eth1/eth2 : slaves, multiqueue NIC, using MQ + FQ qdisc
>
> XPS allows to spread packets on specific tx queues, based on the cpu
> doing the send.
>
> Problem is that dequeues from bond0 qdisc can happen on random cpus,
> due to the fact that qdisc_run() can dequeue a batch of packets.
>
> CPUA -> queue packet P1 on bond0 qdisc, P1->ooo_okay=1
> CPUA -> queue packet P2 on bond0 qdisc, P2->ooo_okay=0
>
> CPUB -> dequeue packet P1 from bond0
> enqueue packet on eth1/eth2
> CPUC -> dequeue packet P2 from bond0
> enqueue packet on eth1/eth2 using sk cache (ooo_okay is 0)
>
> get_xps_queue() then might select wrong queue for P1, since current cpu
> might be different than CPUA.
>
> P2 might be sent on the old queue (stored in sk->sk_tx_queue_mapping),
> if CPUC runs a bit faster (or CPUB spins a bit on qdisc lock)
>
> Effect of this bug is TCP reorders, and more generally not optimal
> TX queue placement. (A victim bulk flow can be migrated to the wrong TX
> queue for a while)
>
> To fix this, we have to record sender cpu number the first time
> dev_queue_xmit() is called for one tx skb.
>
> We can union napi_id (used on receive path) and sender_cpu,
> granted we clear sender_cpu in skb_scrub_packet() (credit to Willem for
> this union idea)
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks everyone.
^ permalink raw reply
* Re: [PATCH net 0/2] netns: audit netdevice creation with IFLA_NET_NS_[PID|FD]
From: Arvid Brodin @ 2015-02-04 20:33 UTC (permalink / raw)
To: nicolas.dichtel, netdev; +Cc: davem, dmitry.tarnyagin, alex.aring, linux-wpan
In-Reply-To: <54CF9EA8.4080207@6wind.com>
On 2015-02-02 16:58, Nicolas Dichtel wrote:
> Le 30/01/2015 21:00, Arvid Brodin a écrit :
>> On 2015-01-26 22:28, Nicolas Dichtel wrote:
>> *snip*
>>> - HSR subsystem uses src_net to parse IFLA_HSR_SLAVE[1|2], but the netdevice has
>>> the flag NETIF_F_NETNS_LOCAL, so the question is: does this netdevice really
>>> supports x-netns? If not, the newlink handler should use the dest_net instead
>>> of src_net, I can provide the patch.
>> *snip*
>>
>> As the author of the HSR driver, I'd like to answer this question, but unfortunately
>> I don't know what x-netns is. Neither Google nor Documentation/ has been particularly
>> helpful.
>>
>> Care to elaborate? (Maybe this is a moot point now that the patch has been accepted,
>> but I'd still like to understand, if you have the time to explain.)
> Basically, network namespaces (netns) allow you to run several independant
> instances of the linux networking stack.
> Network interfaces are bound to one netns. By default, only one netns exists
> (named init_net) when you boot your kernel.
> For logical interfaces, they are usually bound to a link layer. For example, if
> I understand well, hsr network interfaces receive and send their packets from
> two physical interfaces (IFLA_HSR_SLAVE[1|2]).
> Now imagine that these slaves are in a netns foo and the logical hsr interfaces
> in netns bar. You have a x-netns interface, the link layer part of the interface
> is not in the same netns than the upper part. A user will see the hsr interface
> in netns bar, but this interface will send a receive packet in netns foo.
Ok, so x-netns simply means cross-netns?
> Usually, to configure an interface like this, you create it in netns foo and you
> move it later to netns bar (ip link set hsr1 netns bar). The flag
> NETIF_F_NETNS_LOCAL forbids this operation, you cannot move it to another netns.
> But you still can create a x-netns interface:
> ip netns add foo
> ip link add hsr1 netns foo type hsr slave1 eth0 slave2 eth1
> ip netns exec foo ip link ls hsr1
>
> => eth0 and eth1 are took from the current netns (because in the code, src_net
> is the current netns) but hsr1 is built in netns foo.
>
> Now, the question is: does HSR really work across netns? Why is the flag
> NETIF_F_NETNS_LOCAL set?
> dev_forward_skb() may be used to forward an skbuff to another netns.
Here is the code snippet that sets NETIF_F_NETNS_LOCAL:
/* Not sure about this. Taken from bridge code. netdev_features.h says
* it means "Does not change network namespaces".
*/
dev->features |= NETIF_F_NETNS_LOCAL;
HSR is a bit like a bridge since it forwards packets between interfaces on the
same Ethernet network, and the bridge code sets NETIF_F_NETNS_LOCAL. And that's
really all the reason for the inclusion of the flag - i.e. it should be removed
if it doesn't make sense.
So, does it make sense? I'm not sure exactly, but I don't think it makes sense
to have slaves that are in different namespaces - they are supposed to be part
of the same ethernet network after all. But maybe having the HSR interface in a
different namespace than the two slaves could make sense - this way you could
force an application to only communicate using the HSR protocol, and not use any
of the slave interfaces directly.
If you agree with the above, then I guess that means NETIF_F_NETNS_LOCAL should
not be set?
> Note, that I got a panic when playing with hsr:
> ip link add hsr1 type hsr slave1 eth1 slave2 eth0
> ip link del hsr1
> => panic
>
> I dig a bit:
> 1/ hsr_netdev_notify() supposes that the port will always be available when the
> notification is for an hsr interface. It's wrong. For example,
> netdev_wait_allrefs() may resend NETDEV_UNREGISTER.
> 2/ with a patch that ignores the notification when the port is NULL, I got a
> refcnt problem:
> [ 327.372099] unregister_netdevice: waiting for hsr1 to become free. Usage count = -1
Thanks for the bug report! I'll take a look at it ASAP.
--
Arvid Brodin | Consultant (Linux)
ALTEN | Knarrarnäsgatan 7 | SE-164 40 Kista | Sweden
arvid.brodin@alten.se | www.alten.se/en/
^ permalink raw reply
* 3.19-rc7 netconsole locking bug.
From: Dave Jones @ 2015-02-04 19:39 UTC (permalink / raw)
To: netdev
I set up netconsole this morning, and noticed when I rebooted the machine
that this happens when it initializes..
netpoll: netconsole: local port 6666
netpoll: netconsole: local IPv4 address 192.168.42.1
netpoll: netconsole: interface 'eth1'
netpoll: netconsole: remote port 6666
netpoll: netconsole: remote IPv4 address 192.168.42.35
netpoll: netconsole: remote ethernet address 80:ee:73:83:57:4c
netpoll: netconsole: device eth1 not up yet, forcing it
IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
BUG: sleeping function called from invalid context at kernel/irq/manage.c:104
in_atomic(): 1, irqs_disabled(): 1, pid: 157, name: exe
2 locks held by exe/157:
#0: (console_lock){+.+.+.}, at: [<ffffffff9510f516>] register_console+0x2a6/0x640
#1: (target_list_lock){......}, at: [<ffffffffc017e1c5>] write_msg+0x65/0x1b0 [netconsole]
irq event stamp: 13456
hardirqs last enabled at (13455): [<ffffffff9510ee3d>] console_unlock+0x57d/0x740
hardirqs last disabled at (13456): [<ffffffff959b242a>] _raw_spin_lock_irqsave+0x3a/0x110
softirqs last enabled at (10536): [<ffffffff957d7975>] __dev_mc_add+0x95/0xb0
softirqs last disabled at (10522): [<ffffffff957d7913>] __dev_mc_add+0x33/0xb0
CPU: 1 PID: 157 Comm: exe Not tainted 3.19.0-rc7+ #13
ffffffff95d3d363 0000000049b1ff09 ffff88007707f978 ffffffff959a5efa
0000000000000000 0000000000000000 ffff88007707f9a8 ffffffff950ca277
ffff88007707f9a8 ffffffff95d3d363 0000000000000068 0000000000000000
Call Trace:
[<ffffffff959a5efa>] dump_stack+0x84/0xb9
[<ffffffff950ca277>] ___might_sleep+0x2d7/0x390
[<ffffffff950ca3b0>] __might_sleep+0x80/0x100
[<ffffffff951123f7>] synchronize_irq+0x67/0x120
[<ffffffff951125a9>] ? __disable_irq_nosync+0x69/0xc0
[<ffffffff95112634>] disable_irq+0x34/0x50
[<ffffffff956c93f5>] e1000_netpoll+0x55/0x1d0
[<ffffffff957fc3f9>] netpoll_poll_dev+0x99/0x300
[<ffffffff957fc83f>] netpoll_send_skb_on_dev+0x1df/0x470
[<ffffffff957fcddc>] netpoll_send_udp+0x30c/0x5a0
[<ffffffffc017e1c5>] ? write_msg+0x65/0x1b0 [netconsole]
[<ffffffffc017e267>] write_msg+0x107/0x1b0 [netconsole]
[<ffffffff9510dad9>] call_console_drivers.constprop.10+0x129/0x190
[<ffffffff9510edf4>] console_unlock+0x534/0x740
[<ffffffff9510f5c8>] register_console+0x358/0x640
[<ffffffffc0186000>] ? 0xffffffffc0186000
[<ffffffffc01862ea>] init_netconsole+0x2ea/0x1000 [netconsole]
[<ffffffff9500038d>] do_one_initcall+0x13d/0x310
[<ffffffff95103d4e>] ? trace_hardirqs_on+0x1e/0x30
[<ffffffff95153895>] load_module+0x22f5/0x28d0
[<ffffffff9514dcb0>] ? store_uevent+0x90/0x90
[<ffffffff95153fc9>] SyS_init_module+0x159/0x200
[<ffffffff959b3912>] system_call_fastpath+0x12/0x17
console [netcon0] enabled
netconsole: network logging started
Despite the positive sounding last two lines, nothing actually gets logged
over the netconsole.
Dave
^ permalink raw reply
* Re: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()
From: Sergei Shtylyov @ 2015-02-04 20:13 UTC (permalink / raw)
To: David Laight, 'Chen Gang S', marcel@holtmann.org,
gustavo@padovan.org, johan.hedberg@gmail.com
Cc: David S. Miller, linux-bluetooth@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CADA5E1@AcuExch.aculab.com>
Hello.
On 02/04/2015 02:59 PM, David Laight wrote:
>> -static inline int hci_test_bit(int nr, void *addr)
>> +static inline int hci_test_bit(int nr, const void *addr)
>> {
>> return *((__u32 *) addr + (nr >> 5)) & ((__u32) 1 << (nr & 31));
>> }
> Is there a 'standard' function lurking that will do the above.
> On x86 the cpus 'bit test' instruction will handle bit numbers
> greater than the word size - so it can be a single instruction.
Of course, there's test_bit().
> David
WBR, Sergei
^ 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