* [PATCHv2 net-next-2.6] rndis_host: Poll status before control channel where necessary
From: Ben Hutchings @ 2011-04-13 4:55 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Mark Glassberg, linux-usb-u79uwXL29TY76Z2rM5mHXA
Some RNDIS devices don't respond on the control channel until polled
on the status channel. In particular, this was reported to be the
case for the 2Wire HomePortal 1000SW and for some Windows Mobile
devices.
This is roughly based on a patch by John Carr <john.carr-3P/l8hQepEe9FHfhHBbuYA@public.gmane.org>
which is currently applied by Mandriva.
Reported-by: Mark Glassberg <vzeeaxwl-ubggFOsnOr3gwBMGfI3FeA@public.gmane.org>
Signed-off-by: Ben Hutchings <ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org>
---
The first version made this behaviour unconditional and had to be
reverted. This version adds a quirk flag instead.
Ben.
drivers/net/usb/rndis_host.c | 39 ++++++++++++++++++++++++++++++++-------
include/linux/usb/rndis_host.h | 2 ++
2 files changed, 34 insertions(+), 7 deletions(-)
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index 5994a25..6d6c1da 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -104,8 +104,10 @@ static void rndis_msg_indicate(struct usbnet *dev, struct rndis_indicate *msg,
int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
{
struct cdc_state *info = (void *) &dev->data;
+ struct usb_cdc_notification notification;
int master_ifnum;
int retval;
+ int partial;
unsigned count;
__le32 rsp;
u32 xid = 0, msg_len, request_id;
@@ -133,13 +135,20 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
if (unlikely(retval < 0 || xid == 0))
return retval;
- // FIXME Seems like some devices discard responses when
- // we time out and cancel our "get response" requests...
- // so, this is fragile. Probably need to poll for status.
+ /* Some devices don't respond on the control channel until
+ * polled on the status channel, so do that first. */
+ if (dev->driver_info->data & RNDIS_DRIVER_DATA_POLL_STATUS) {
+ retval = usb_interrupt_msg(
+ dev->udev,
+ usb_rcvintpipe(dev->udev,
+ dev->status->desc.bEndpointAddress),
+ ¬ification, sizeof(notification), &partial,
+ RNDIS_CONTROL_TIMEOUT_MS);
+ if (unlikely(retval < 0))
+ return retval;
+ }
- /* ignore status endpoint, just poll the control channel;
- * the request probably completed immediately
- */
+ /* Poll the control channel; the request probably completed immediately */
rsp = buf->msg_type | RNDIS_MSG_COMPLETION;
for (count = 0; count < 10; count++) {
memset(buf, 0, CONTROL_BUFFER_SIZE);
@@ -581,17 +590,33 @@ static const struct driver_info rndis_info = {
.tx_fixup = rndis_tx_fixup,
};
+static const struct driver_info rndis_poll_status_info = {
+ .description = "RNDIS device (poll status before control)",
+ .flags = FLAG_ETHER | FLAG_FRAMING_RN | FLAG_NO_SETINT,
+ .data = RNDIS_DRIVER_DATA_POLL_STATUS,
+ .bind = rndis_bind,
+ .unbind = rndis_unbind,
+ .status = rndis_status,
+ .rx_fixup = rndis_rx_fixup,
+ .tx_fixup = rndis_tx_fixup,
+};
+
/*-------------------------------------------------------------------------*/
static const struct usb_device_id products [] = {
{
+ /* 2Wire HomePortal 1000SW */
+ USB_DEVICE_AND_INTERFACE_INFO(0x1630, 0x0042,
+ USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
+ .driver_info = (unsigned long) &rndis_poll_status_info,
+}, {
/* RNDIS is MSFT's un-official variant of CDC ACM */
USB_INTERFACE_INFO(USB_CLASS_COMM, 2 /* ACM */, 0x0ff),
.driver_info = (unsigned long) &rndis_info,
}, {
/* "ActiveSync" is an undocumented variant of RNDIS, used in WM5 */
USB_INTERFACE_INFO(USB_CLASS_MISC, 1, 1),
- .driver_info = (unsigned long) &rndis_info,
+ .driver_info = (unsigned long) &rndis_poll_status_info,
}, {
/* RNDIS for tethering */
USB_INTERFACE_INFO(USB_CLASS_WIRELESS_CONTROLLER, 1, 3),
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h
index 05ef528..88fceb7 100644
--- a/include/linux/usb/rndis_host.h
+++ b/include/linux/usb/rndis_host.h
@@ -256,6 +256,8 @@ struct rndis_keepalive_c { /* IN (optionally OUT) */
#define FLAG_RNDIS_PHYM_NOT_WIRELESS 0x0001
#define FLAG_RNDIS_PHYM_WIRELESS 0x0002
+/* Flags for driver_info::data */
+#define RNDIS_DRIVER_DATA_POLL_STATUS 1 /* poll status before control */
extern void rndis_status(struct usbnet *dev, struct urb *urb);
extern int
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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: [stable] [PATCH NET-2.6 1/1] qlcnic: limit skb frags for non tso packet
From: Amit Salecha @ 2011-04-13 5:56 UTC (permalink / raw)
To: Greg KH
Cc: David Miller, netdev@vger.kernel.org, Anirban Chakraborty,
stable@kernel.org, Ameen Rahman
In-Reply-To: <20110413034228.GA852@kroah.com>
> On Tue, Apr 12, 2011 at 09:01:13PM -0500, Amit Salecha wrote:
> >
> > This message and any attached documents contain information from
> QLogic Corporation or its wholly-owned subsidiaries that may be
> confidential. If you are not the intended recipient, you may not read,
> copy, distribute, or use this information. If you have received this
> transmission in error, please notify the sender immediately by reply e-
> mail and then delete this message.
>
> I have received this transmission in error.
>
> Please remove this from your footer, otherwise we can not accept any
> emails sent from you as actually being allowed to contribute to the
> kernel properly :(
>
I have send version two of this patch, that doesn't have this footer.
Please discard this one.
This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
^ permalink raw reply
* Re: [PATCHv2 net-next-2.6] rndis_host: Poll status before control channel where necessary
From: huajun li @ 2011-04-13 6:04 UTC (permalink / raw)
To: Ben Hutchings; +Cc: David Miller, netdev, Mark Glassberg, linux-usb
In-Reply-To: <1302670523.5282.610.camel@localhost>
>
> +static const struct driver_info rndis_poll_status_info = {
> + .description = "RNDIS device (poll status before control)",
> + .flags = FLAG_ETHER | FLAG_FRAMING_RN | FLAG_NO_SETINT,
Hi,
How about add FLAG_POINTTOPOINT to flags if the device has no
globally assigned MAC? This new added mask code could make device
interface naming consistent.
Thanks,
--Huajun
^ permalink raw reply
* Testing IRDA device driver
From: Amit Virdi @ 2011-04-13 6:40 UTC (permalink / raw)
To: netdev
Hi All,
For the past few days I've been trying to test a driver that I've
written for DICE Fast IrDA controller. As per my requirements, I need to
use IrCOMM as the upper layer.
I'm using the same kernel image on the both the boards. When I run
irattach on either of the boards I can see discovery protocol being
initiated and completing successfully (cat /proc/net/irda/discovery
giving output with other ends's device's MAC address as the daddr) but
I'm struggling to test the driver further.
I've observed that the discovery request/response sequence goes on for 5
minutes. After this, the discovery process stops. On the master side, I
could see no IrLAP frame being sent/received and also the output of cat
/proc/net/irda/discovery is NULL. However, on the slave side, the cat
/proc/net/irda/discovery output shows the master side!!
If I run irattach on the slave side also, no DISCOVERY message is
exchanged and then, the output of slave side also doesn't show anything.
Sometimes, I start getting log "IrLAP, no activity on link!" and then
ircomm_close() API is called from within the stack.
If, I try to run getty on /dev/ircomm0, it does not work!
If I try to transfer data using
echo "1234567890" > /dev/ircomm0
on the master side, and
cat /dev/ircomm0
on the slave side, I can see SNRM command, UA response, RR command,
IrLMP connect/disconnect etc. However, the data transfer actually didn't
happen. I cannot see the string "1234567890" on the slave side.
Please suggest what I'm missing/doing wrong. I need to transfer data
from one device to another to complete the testing. I shall be very much
thankful for suggestions/advice.
Thanks n Regards
Amit Virdi
^ permalink raw reply
* Re: [Bugme-new] [Bug 32832] New: shutdown(2) does not fully shut down socket any more
From: Cyril Bonté @ 2011-04-13 7:06 UTC (permalink / raw)
To: Eric Dumazet
Cc: David Miller, akpm, netdev, bugzilla-daemon, bugme-daemon, kees
In-Reply-To: <1302663327.2811.55.camel@edumazet-laptop>
Le mercredi 13 avril 2011 04:55:27, Eric Dumazet a écrit :
> I worked on it this week end to discover FreeBSD 8.1 would not allow
> several CLOSE sockets bound to same port even with REUSEADDR.
Just to complete the information, yes it does, but only after a shutdown()
call. And this is the use case of haproxy, amavisd (quoted in the bugzilla bug
report), and others.
> So haproxy claim is a bit wrong (its trick doesnt work on FreeBSD), and
> used an undocumented linux feature.
Both test cases (the one I provided to explain the haproxy issue and the one
provided by Kees) are not about binding 2 sockets at the same time but binding
a new socket after the first one has been shutdown.
Sadly this also looks undocumented on FreeBSD (only saw a reference on it in a
code comment).
> Since SO_REUSEPORT is not a 'stable fix', I suggest we revert the patch,
> and eventually work on SO_REUSEPORT on net-next-2.6
>
> What do you think ?
Agree.
Many thanks for the time you already spent on that.
^ permalink raw reply
* [PATCH] stmmac: review Wol and enable the Unicast support
From: Giuseppe CAVALLARO @ 2011-04-13 7:27 UTC (permalink / raw)
To: netdev; +Cc: Giuseppe Cavallaro
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/net/stmmac/dwmac1000_core.c | 5 +++--
drivers/net/stmmac/stmmac_ethtool.c | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/stmmac/dwmac1000_core.c b/drivers/net/stmmac/dwmac1000_core.c
index 6ae4c3f..f20455c 100644
--- a/drivers/net/stmmac/dwmac1000_core.c
+++ b/drivers/net/stmmac/dwmac1000_core.c
@@ -178,10 +178,11 @@ static void dwmac1000_pmt(void __iomem *ioaddr, unsigned long mode)
{
unsigned int pmt = 0;
- if (mode == WAKE_MAGIC) {
+ if (mode & WAKE_MAGIC) {
CHIP_DBG(KERN_DEBUG "GMAC: WOL Magic frame\n");
pmt |= power_down | magic_pkt_en;
- } else if (mode == WAKE_UCAST) {
+ }
+ if (mode & WAKE_UCAST) {
CHIP_DBG(KERN_DEBUG "GMAC: WOL on global unicast\n");
pmt |= global_unicast;
}
diff --git a/drivers/net/stmmac/stmmac_ethtool.c b/drivers/net/stmmac/stmmac_ethtool.c
index 156a805..0e61ac8 100644
--- a/drivers/net/stmmac/stmmac_ethtool.c
+++ b/drivers/net/stmmac/stmmac_ethtool.c
@@ -308,7 +308,7 @@ static void stmmac_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
spin_lock_irq(&priv->lock);
if (device_can_wakeup(priv->device)) {
- wol->supported = WAKE_MAGIC;
+ wol->supported = WAKE_MAGIC | WAKE_UCAST;
wol->wolopts = priv->wolopts;
}
spin_unlock_irq(&priv->lock);
@@ -317,7 +317,7 @@ static void stmmac_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
static int stmmac_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct stmmac_priv *priv = netdev_priv(dev);
- u32 support = WAKE_MAGIC;
+ u32 support = WAKE_MAGIC | WAKE_UCAST;
if (!device_can_wakeup(priv->device))
return -EINVAL;
--
1.7.4.2
^ permalink raw reply related
* Re: [Bugme-new] [Bug 32832] New: shutdown(2) does not fully shut down socket any more
From: Eric Dumazet @ 2011-04-13 8:51 UTC (permalink / raw)
To: Cyril Bonté
Cc: David Miller, akpm, netdev, bugzilla-daemon, bugme-daemon, kees
In-Reply-To: <201104130906.19882.cyril.bonte@free.fr>
Le mercredi 13 avril 2011 à 09:06 +0200, Cyril Bonté a écrit :
> Le mercredi 13 avril 2011 04:55:27, Eric Dumazet a écrit :
> > I worked on it this week end to discover FreeBSD 8.1 would not allow
> > several CLOSE sockets bound to same port even with REUSEADDR.
>
> Just to complete the information, yes it does, but only after a shutdown()
> call. And this is the use case of haproxy, amavisd (quoted in the bugzilla bug
> report), and others.
Yes, but after a shutdown(), FreeBSD doesnt allow a reuse of the socket.
listen() is not available anymore. Its a bit like an unbind, or a full
close().
^ permalink raw reply
* [RFC] [PATCH net-next 1/1] Phonet: convert bound sockets hash list to RCU
From: Rémi Denis-Courmont @ 2011-04-13 9:27 UTC (permalink / raw)
To: netdev
This gets rid of the last spinlock in the Phonet stack proper.
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
net/phonet/socket.c | 45 +++++++++++++++++++++------------------------
1 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index b1adafa..8c5bfce 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -52,7 +52,7 @@ static int pn_socket_release(struct socket *sock)
static struct {
struct hlist_head hlist[PN_HASHSIZE];
- spinlock_t lock;
+ struct mutex lock;
} pnsocks;
void __init pn_sock_init(void)
@@ -61,7 +61,7 @@ void __init pn_sock_init(void)
for (i = 0; i < PN_HASHSIZE; i++)
INIT_HLIST_HEAD(pnsocks.hlist + i);
- spin_lock_init(&pnsocks.lock);
+ mutex_init(&pnsocks.lock);
}
static struct hlist_head *pn_hash_list(u16 obj)
@@ -82,9 +82,8 @@ struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *spn)
u8 res = spn->spn_resource;
struct hlist_head *hlist = pn_hash_list(obj);
- spin_lock_bh(&pnsocks.lock);
-
- sk_for_each(sknode, node, hlist) {
+ rcu_read_lock();
+ sk_for_each_rcu(sknode, node, hlist) {
struct pn_sock *pn = pn_sk(sknode);
BUG_ON(!pn->sobject); /* unbound socket */
@@ -107,8 +106,7 @@ struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *spn)
sock_hold(sknode);
break;
}
-
- spin_unlock_bh(&pnsocks.lock);
+ rcu_read_unlock();
return rval;
}
@@ -119,7 +117,7 @@ void pn_deliver_sock_broadcast(struct net *net, struct sk_buff *skb)
struct hlist_head *hlist = pnsocks.hlist;
unsigned h;
- spin_lock(&pnsocks.lock);
+ rcu_read_lock();
for (h = 0; h < PN_HASHSIZE; h++) {
struct hlist_node *node;
struct sock *sknode;
@@ -140,25 +138,26 @@ void pn_deliver_sock_broadcast(struct net *net, struct sk_buff *skb)
}
hlist++;
}
- spin_unlock(&pnsocks.lock);
+ rcu_read_unlock();
}
void pn_sock_hash(struct sock *sk)
{
struct hlist_head *hlist = pn_hash_list(pn_sk(sk)->sobject);
- spin_lock_bh(&pnsocks.lock);
- sk_add_node(sk, hlist);
- spin_unlock_bh(&pnsocks.lock);
+ mutex_lock(&pnsocks.lock);
+ sk_add_node_rcu(sk, hlist);
+ mutex_unlock(&pnsocks.lock);
}
EXPORT_SYMBOL(pn_sock_hash);
void pn_sock_unhash(struct sock *sk)
{
- spin_lock_bh(&pnsocks.lock);
- sk_del_node_init(sk);
- spin_unlock_bh(&pnsocks.lock);
+ mutex_lock(&pnsocks.lock);
+ sk_del_node_init_rcu(sk);
+ mutex_unlock(&pnsocks.lock);
pn_sock_unbind_all_res(sk);
+ synchronize_rcu();
}
EXPORT_SYMBOL(pn_sock_unhash);
@@ -548,7 +547,7 @@ static struct sock *pn_sock_get_idx(struct seq_file *seq, loff_t pos)
unsigned h;
for (h = 0; h < PN_HASHSIZE; h++) {
- sk_for_each(sknode, node, hlist) {
+ sk_for_each_rcu(sknode, node, hlist) {
if (!net_eq(net, sock_net(sknode)))
continue;
if (!pos)
@@ -572,9 +571,9 @@ static struct sock *pn_sock_get_next(struct seq_file *seq, struct sock *sk)
}
static void *pn_sock_seq_start(struct seq_file *seq, loff_t *pos)
- __acquires(pnsocks.lock)
+ __acquires(rcu)
{
- spin_lock_bh(&pnsocks.lock);
+ rcu_read_lock();
return *pos ? pn_sock_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
}
@@ -591,9 +590,9 @@ static void *pn_sock_seq_next(struct seq_file *seq, void *v, loff_t *pos)
}
static void pn_sock_seq_stop(struct seq_file *seq, void *v)
- __releases(pnsocks.lock)
+ __releases(rcu)
{
- spin_unlock_bh(&pnsocks.lock);
+ rcu_read_unlock();
}
static int pn_sock_seq_show(struct seq_file *seq, void *v)
@@ -721,13 +720,11 @@ void pn_sock_unbind_all_res(struct sock *sk)
}
mutex_unlock(&resource_mutex);
- if (match == 0)
- return;
- synchronize_rcu();
while (match > 0) {
- sock_put(sk);
+ __sock_put(sk);
match--;
}
+ /* Caller is responsible for RCU sync before final sock_put() */
}
#ifdef CONFIG_PROC_FS
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH v4] net: bnx2x: convert to hw_features
From: Vladislav Zolotarov @ 2011-04-13 9:36 UTC (permalink / raw)
To: Michał Mirosław; +Cc: netdev@vger.kernel.org, Eilon Greenstein
In-Reply-To: <20110412144940.GA26043@rere.qmqm.pl>
> Hmm. I thought one, and wrote another.
>
> Since bnx2x_parity_recover() runs with rtnl_lock(), as should
> netdev_update_features(), then in case the recovery is in progress
> it should be enough to not call bnx2x_reload_if_running() then
> and just change the flags --- changes will be picked up on bnx2x_nic_load()
> after recovery is complete. This removes the need for netdev_update_features()
> calls.
>
Ok. I see what u meant in v5... ;)
The patch is great. Thanks for your work. There are some enhancements
following your patch that I have in mind that I'll submit later.
thanks again, Michal.
^ permalink raw reply
* RE: [PATCHv4 NEXT 1/1] net: ethtool support to configure number of channels
From: Amit Salecha @ 2011-04-13 9:45 UTC (permalink / raw)
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Ameen Rahman, Sucheta Chakraborty,
Anirban Chakraborty
In-Reply-To: <1302177522-17815-1-git-send-email-amit.salecha@qlogic.com>
> Ethtool support to configure RX, TX and other channels. combined field
> in struct ethtool_channels to reflect set of channel (RX, TX or other).
> Other channel can be link interrupts, SR-IOV coordination etc.
>
> ETHTOOL_GCHANNELS will report max and current number of RX channels,
> max and current number of TX channels, max and current number of other
> channel
> or max and current number of combined channel.
>
> Number of channel can be modify upto max number of channel through
> ETHTOOL_SCHANNELS command.
>
> Ben Hutchings:
> o define 'combined' and 'other' types. Most multiqueue drivers pair up
> RX and TX
> queues so that most channels combine RX and TX work.
> o Please could you use a kernel-doc comment to describe the structure.
>
> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Neither I see this patch in http://patchwork.ozlabs.org/project/netdev/list/ nor any comment.
Just curious, is this patch discarded along with my other garbage patches ?
-Amit
This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
^ permalink raw reply
* [PATCH] net: can: mscan: fix build breakage in mpc5xxx_can
From: Anatolij Gustschin @ 2011-04-13 9:49 UTC (permalink / raw)
To: netdev; +Cc: David S. Miller, Grant Likely
Commit 74888760d40b3ac9054f9c5fa07b566c0676ba2d
"dt/net: Eliminate users of of_platform_{,un}register_driver"
broke building mscan driver. Fix it.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
---
drivers/net/can/mscan/mpc5xxx_can.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index c0a1bc5..bd1d811 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -260,7 +260,7 @@ static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
if (!ofdev->dev.of_match)
return -EINVAL;
- data = (struct mpc5xxx_can_data *)of_dev->dev.of_match->data;
+ data = (struct mpc5xxx_can_data *)ofdev->dev.of_match->data;
base = of_iomap(np, 0);
if (!base) {
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] net: can: mscan: fix build breakage in mpc5xxx_can
From: Wolfgang Grandegger @ 2011-04-13 10:17 UTC (permalink / raw)
To: Anatolij Gustschin; +Cc: netdev, David S. Miller, Grant Likely
In-Reply-To: <1302688168-26862-1-git-send-email-agust@denx.de>
On 04/13/2011 11:49 AM, Anatolij Gustschin wrote:
> Commit 74888760d40b3ac9054f9c5fa07b566c0676ba2d
> "dt/net: Eliminate users of of_platform_{,un}register_driver"
> broke building mscan driver. Fix it.
>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
^ permalink raw reply
* Re: [PATCH] net: ipv4: add IPPROTO_ICMP socket kind
From: Alexey Dobriyan @ 2011-04-13 10:29 UTC (permalink / raw)
To: Vasiliy Kulikov
Cc: linux-kernel, netdev, Pavel Kankovsky, Solar Designer, Kees Cook,
Dan Rosenberg, Eugene Teo, Nelson Elhage, David S. Miller,
Alexey Kuznetsov, Pekka Savola, James Morris, Hideaki YOSHIFUJI,
Patrick McHardy
In-Reply-To: <20110409101514.GA4262@albatros>
On Sat, Apr 9, 2011 at 1:15 PM, Vasiliy Kulikov <segoon@openwall.com> wrote:
> This patch adds IPPROTO_ICMP socket kind.
> + seq_printf(f, "%5d: %08X:%04X %08X:%04X"
> + " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d%n",
> + bucket, src, srcp, dest, destp, sp->sk_state,
> + sk_wmem_alloc_get(sp),
> + sk_rmem_alloc_get(sp),
> + 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
These zeroes can be embedded into format string for slightly faster printing.
> +static const struct file_operations ping_seq_fops = {
> + .owner = THIS_MODULE,
Unnecessary line.
->owner is unused for proc files, this is not documented anywhere, but
it's unused.
> + .open = ping_seq_open,
> + .read = seq_read,
> + .llseek = seq_lseek,
> + .release = seq_release_net,
> +};
> +
> +static const char ping_proc_name[] = "icmp";
Ewww :-)
Does not compiler create only one string?
> +static int ping_proc_register(struct net *net)
> +{
> + struct proc_dir_entry *p;
> + int rc = 0;
> +
> + p = proc_create_data(ping_proc_name, S_IRUGO, net->proc_net,
> + &ping_seq_fops, NULL);
There is proc_net_fops_create().
> + if (!p)
> + rc = -ENOMEM;
> + return rc;
> +}
> @@ -680,6 +747,15 @@ static struct ctl_table ipv4_net_table[] = {
> .mode = 0644,
> .proc_handler = proc_dointvec
> },
> +#ifdef CONFIG_IP_PING
> + {
> + .procname = "ping_group_range",
> + .data = &init_net.ipv4.sysctl_ping_group_range,
> + .maxlen = sizeof(init_net.ipv4.sysctl_ping_group_range),
> + .mode = 0644,
> + .proc_handler = ipv4_ping_group_range,
> + },
> +#endif
> { }
> };
>
> @@ -714,8 +790,22 @@ static __net_init int ipv4_sysctl_init_net(struct net *net)
> &net->ipv4.sysctl_icmp_ratemask;
> table[6].data =
> &net->ipv4.sysctl_rt_cache_rebuild_count;
> +#ifdef CONFIG_IP_PING
> + table[7].data =
> + &net->ipv4.sysctl_ping_group_range;
> +#endif
Now I understand it's not related, but next sysctl will have
"table[8].data = ..." line which is off-by-one if CONFIG_IP_PING=n.
^ permalink raw reply
* [net-next-2.6] if_vlan.h: fix compile errors
From: Jeff Kirsher @ 2011-04-13 10:32 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, jpirko
The following commit generates compile errors becuase vlan_untag was defined
multiple times.
commit bcc6d47903612c3861201cc3a866fb604f26b8b2
Author: Jiri Pirko <jpirko@redhat.com>
Date: Thu Apr 7 19:48:33 2011 +0000
net: vlan: make non-hw-accel rx path similar to hw-accel
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
include/linux/if_vlan.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 998b299..546d9d3 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -174,7 +174,7 @@ static inline bool vlan_do_receive(struct sk_buff **skb)
return false;
}
-inline struct sk_buff *vlan_untag(struct sk_buff *skb)
+static inline struct sk_buff *vlan_untag(struct sk_buff *skb)
{
return skb;
}
--
1.7.4.2
^ permalink raw reply related
* Re: [PATCH] net: can: mscan: fix build breakage in mpc5xxx_can
From: Marc Kleine-Budde @ 2011-04-13 10:47 UTC (permalink / raw)
To: Anatolij Gustschin; +Cc: netdev, David S. Miller, Grant Likely
In-Reply-To: <1302688168-26862-1-git-send-email-agust@denx.de>
[-- Attachment #1: Type: text/plain, Size: 658 bytes --]
On 04/13/2011 11:49 AM, Anatolij Gustschin wrote:
> Commit 74888760d40b3ac9054f9c5fa07b566c0676ba2d
> "dt/net: Eliminate users of of_platform_{,un}register_driver"
> broke building mscan driver. Fix it.
>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
regards, 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: 262 bytes --]
^ permalink raw reply
* Re: [net-next-2.6] if_vlan.h: fix compile errors
From: Jiri Pirko @ 2011-04-13 10:57 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: davem, netdev
In-Reply-To: <1302690737-14524-1-git-send-email-jeffrey.t.kirsher@intel.com>
Thanks Jeff, this fix was already submitted by DaveM
Wed, Apr 13, 2011 at 12:32:17PM CEST, jeffrey.t.kirsher@intel.com wrote:
>The following commit generates compile errors becuase vlan_untag was defined
>multiple times.
>
> commit bcc6d47903612c3861201cc3a866fb604f26b8b2
> Author: Jiri Pirko <jpirko@redhat.com>
> Date: Thu Apr 7 19:48:33 2011 +0000
>
> net: vlan: make non-hw-accel rx path similar to hw-accel
>
>Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>---
> include/linux/if_vlan.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
>index 998b299..546d9d3 100644
>--- a/include/linux/if_vlan.h
>+++ b/include/linux/if_vlan.h
>@@ -174,7 +174,7 @@ static inline bool vlan_do_receive(struct sk_buff **skb)
> return false;
> }
>
>-inline struct sk_buff *vlan_untag(struct sk_buff *skb)
>+static inline struct sk_buff *vlan_untag(struct sk_buff *skb)
> {
> return skb;
> }
>--
>1.7.4.2
>
^ permalink raw reply
* Re: [net-next-2.6] if_vlan.h: fix compile errors
From: Jeff Kirsher @ 2011-04-13 11:03 UTC (permalink / raw)
To: Jiri Pirko; +Cc: davem, netdev
In-Reply-To: <20110413105758.GA2910@psychotron.orion>
On Wed, Apr 13, 2011 at 03:57, Jiri Pirko <jpirko@redhat.com> wrote:
> Thanks Jeff, this fix was already submitted by DaveM
Ah, ok. I did not see anything in netdev patchworks and I did a
recent pull of Dave's net-next tree so I knew I had the latest.
Good to know it was caught, thanks Jiri.
>
> Wed, Apr 13, 2011 at 12:32:17PM CEST, jeffrey.t.kirsher@intel.com wrote:
>>The following commit generates compile errors becuase vlan_untag was defined
>>multiple times.
>>
>> commit bcc6d47903612c3861201cc3a866fb604f26b8b2
>> Author: Jiri Pirko <jpirko@redhat.com>
>> Date: Thu Apr 7 19:48:33 2011 +0000
>>
>> net: vlan: make non-hw-accel rx path similar to hw-accel
>>
>>Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>>---
>> include/linux/if_vlan.h | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>>diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
>>index 998b299..546d9d3 100644
>>--- a/include/linux/if_vlan.h
>>+++ b/include/linux/if_vlan.h
>>@@ -174,7 +174,7 @@ static inline bool vlan_do_receive(struct sk_buff **skb)
>> return false;
>> }
>>
>>-inline struct sk_buff *vlan_untag(struct sk_buff *skb)
>>+static inline struct sk_buff *vlan_untag(struct sk_buff *skb)
>> {
>> return skb;
>> }
^ permalink raw reply
* Re: [PATCH] net: ipv4: add IPPROTO_ICMP socket kind
From: Vasiliy Kulikov @ 2011-04-13 11:22 UTC (permalink / raw)
To: David Miller
Cc: solar, linux-kernel, netdev, peak, kees.cook, dan.j.rosenberg,
eugene, nelhage, kuznet, pekkas, jmorris, yoshfuji, kaber
In-Reply-To: <20110412.142534.183049889.davem@davemloft.net>
On Tue, Apr 12, 2011 at 14:25 -0700, David Miller wrote:
> I have no fundamental objections to this change and I'll be happy to
> apply it after we iron out a few details.
Great!
> First, please get rid of the debug option, we have pr_debug() which can
> be dynamically turned on and off at run time these days.
OK.
> Second, if this is a bonafide core facility we'd like everyone to use,
> let's make it so. I want it so that every ping binary can expect this
> facility to be there if the kernel is new enough.
>
> So let's get rid of the config option.
OK.
> Finally, longer term, I'd really like to see ipv6 support for this
> feature as well.
Definitely.
For ICMPv6 we should recognize what message types are OK to send by
non-root users and what types are privileged. We just didn't do this
yet.
Thank you for the review,
--
Vasiliy Kulikov
http://www.openwall.com - bringing security into open computing environments
^ permalink raw reply
* Re: [PATCH] net: ipv4: add IPPROTO_ICMP socket kind
From: Vasiliy Kulikov @ 2011-04-13 11:32 UTC (permalink / raw)
To: Alexey Dobriyan
Cc: linux-kernel, netdev, Pavel Kankovsky, Solar Designer, Kees Cook,
Dan Rosenberg, Eugene Teo, Nelson Elhage, David S. Miller,
Alexey Kuznetsov, Pekka Savola, James Morris, Hideaki YOSHIFUJI,
Patrick McHardy
In-Reply-To: <BANLkTi=ogJg_uJqsJFpnwnnr6LS+SFT3Vg@mail.gmail.com>
On Wed, Apr 13, 2011 at 13:29 +0300, Alexey Dobriyan wrote:
> On Sat, Apr 9, 2011 at 1:15 PM, Vasiliy Kulikov <segoon@openwall.com> wrote:
> > This patch adds IPPROTO_ICMP socket kind.
>
> > + seq_printf(f, "%5d: %08X:%04X %08X:%04X"
> > + " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d%n",
> > + bucket, src, srcp, dest, destp, sp->sk_state,
> > + sk_wmem_alloc_get(sp),
> > + sk_rmem_alloc_get(sp),
> > + 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
>
> These zeroes can be embedded into format string for slightly faster printing.
Is it really needed? I mean, it is not a fast path, so such a small
overhead is not very bad. But embedding them into the string makes it a
bit more difficult to read.
> > +static const struct file_operations ping_seq_fops = {
> > + .owner = THIS_MODULE,
>
> Unnecessary line.
> ->owner is unused for proc files, this is not documented anywhere, but
> it's unused.
OK.
> > +static const char ping_proc_name[] = "icmp";
>
> Ewww :-)
> Does not compiler create only one string?
I used it for better readability as it is used 2 times.
> > + p = proc_create_data(ping_proc_name, S_IRUGO, net->proc_net,
> > + &ping_seq_fops, NULL);
>
> There is proc_net_fops_create().
OK.
> > +#ifdef CONFIG_IP_PING
> > + table[7].data =
> > + &net->ipv4.sysctl_ping_group_range;
> > +#endif
>
> Now I understand it's not related, but next sysctl will have
> "table[8].data = ..." line which is off-by-one if CONFIG_IP_PING=n.
Agreed that hardcoded indexes look a bit ugly, especially with
configurable elements. But as Dave suggested to completely remove
CONFIG_IP_PING, it doesn't make sense now.
Thank you,
--
Vasiliy Kulikov
http://www.openwall.com - bringing security into open computing environments
^ permalink raw reply
* Re: [Patch] iwlwifi: remove obsoleted module alias and parameters
From: Cong Wang @ 2011-04-13 11:53 UTC (permalink / raw)
To: John W. Linville
Cc: Stanislaw Gruszka, Johannes Berg, linux-wireless, netdev,
Intel Linux Wireless, Wey-Yi Guy, Meenakshi Venkataraman,
Larry Finger
In-Reply-To: <20110412204941.GD24309@tuxdriver.com>
于 2011年04月13日 04:49, John W. Linville 写道:
> On Wed, Apr 06, 2011 at 02:57:29PM +0200, Stanislaw Gruszka wrote:
>> On Wed, Apr 06, 2011 at 06:42:48PM +0800, Cong Wang wrote:
>>> 于 2011年04月06日 18:09, Johannes Berg 写道:
>>>> On Wed, 2011-04-06 at 17:49 +0800, Amerigo Wang wrote:
>>>>> As scheduled in Documentation/feature-removal-schedule.txt,
>>>>> remove "*50", "disable_hw_scan" module parameters and MODULE_ALIAS("iwl4965").
>>>>
>>>> Mostly fine, but for iwlegacy Stanislaw we want to keep hw scan (and it
>>>> was actually made default now)
>>
>> Indeed, disable_hw_scan should be removed in iwlwifi but leaved in iwlegacy.
>>
>>> Ok, I will wait for Stanislaw's response and then send an updated patch.
>>
>> Have it now :-)
>
> Ping?
>
Huh?
The same patch from Wey-yi was merged as commit#7eaa6a5e964f1ab02d849bda36950c0d30be8ce2,
no?
^ permalink raw reply
* Re: [Bugme-new] [Bug 32832] New: shutdown(2) does not fully shut down socket any more
From: Daniel Baluta @ 2011-04-13 11:57 UTC (permalink / raw)
To: Eric Dumazet
Cc: David Miller, akpm, netdev, bugzilla-daemon, bugme-daemon, kees
In-Reply-To: <1302663608.2811.62.camel@edumazet-laptop>
Hi Eric, Cyril,
>> Since SO_REUSEPORT is not a 'stable fix', I suggest we revert the patch,
>> and eventually work on SO_REUSEPORT on net-next-2.6
>>
>> What do you think ?
>>
>
> Sorry, I should have mentioned commit id : c191a836a908d1dd6
> (tcp: disallow bind() to reuse addr/port)
Cyril's use case looks suspect. I don't think that this is a good
reason for reverting this commit.
I would love to help on adding SO_REUSEPORT option in kernel.
thanks,
Daniel.
^ permalink raw reply
* Re: [PATCH 0/4] [RFC rev2] Implement multiqueue (RX & TX) virtio-net
From: Avi Kivity @ 2011-04-13 12:00 UTC (permalink / raw)
To: Krishna Kumar
Cc: rusty, davem, mst, eric.dumazet, arnd, netdev, horms, anthony,
kvm
In-Reply-To: <20110405150826.20501.39679.sendpatchset@krkumar2.in.ibm.com>
On 04/05/2011 06:08 PM, Krishna Kumar wrote:
> This patchset implements both RX and TX MQ. Patch against virtio-net,
> vhost and qemu are included.
>
> Changes from rev1:
> -------------------
> 1. vqs are allocated as: rx/tx, rx/tx, rx/tx, etc. Lot of code in
> guest/host/qemu changes, but code becomes simpler.
> 2. vhost cache align of vhost_dev correctly.
> 3. virtio-net: cleanup properly on errors (eg detach buf for vq>0 as
> pointed out by Micheal).
> 4. Minor changes:
> - Fixed some typos.
> - Changed vhost_get_thread_index to use MAX_VHOST_THREADS.
> - Removed VIRTIO_MAX_TXQS.
> - Changed capability to VIRTIO_NET_F_MULTIQUEUE.
> - Modified "numtxqs" in virtnet_info to "num_queue_pairs".
> virtnet_info still has numtxqs as it is more convenient.
> - Moved code for VIRTIO_NET_F_CTRL_VLAN into probe function.
> - Improve check for return value of virtio_config_val().
> - Removed cache align directives in guest as it was redundant.
> 5. "If we have a wrapper to init all vqs, pls add a wrapper to clean up
> all vqs as well": I haven't done this as some errors are very
> specific to the failure location (and what was initialized till
> then). So only those errors are cleaned up using goto's like the
> rest of the code. I can change in next version if you feel this is
> still required.
> 6. "I think we should have free_unused_bufs that handles a single queue,
> and call it in a loop": I haven't done this as I think the caller wants
> all rx/tx queues to be cleaned up by calling this function.
>
> TODO's:
> --------
> 1. Reduce vectors for find_vqs().
> 2. Make vhost changes minimal. For now, I have restricted the number of
> vhost threads to 4. This can be either made unrestricted; or if the
> userspace vhost works, it can be removed altogether.
>
> Please review and provide feedback. I am travelling a bit in the next
> few days but will respond at the earliest.
Do you have an update to the virtio-pci spec for this?
--
error compiling committee.c: too many arguments to function
^ permalink raw reply
* RE: [PATCHv4 NEXT 1/1] net: ethtool support to configure number of channels
From: Ben Hutchings @ 2011-04-13 12:03 UTC (permalink / raw)
To: Amit Salecha
Cc: davem@davemloft.net, netdev@vger.kernel.org, Ameen Rahman,
Sucheta Chakraborty, Anirban Chakraborty
In-Reply-To: <99737F4847ED0A48AECC9F4A1974A4B80FD1384031@MNEXMB2.qlogic.org>
On Wed, 2011-04-13 at 04:45 -0500, Amit Salecha wrote:
> > Ethtool support to configure RX, TX and other channels. combined field
> > in struct ethtool_channels to reflect set of channel (RX, TX or other).
> > Other channel can be link interrupts, SR-IOV coordination etc.
> >
> > ETHTOOL_GCHANNELS will report max and current number of RX channels,
> > max and current number of TX channels, max and current number of other
> > channel
> > or max and current number of combined channel.
> >
> > Number of channel can be modify upto max number of channel through
> > ETHTOOL_SCHANNELS command.
> >
> > Ben Hutchings:
> > o define 'combined' and 'other' types. Most multiqueue drivers pair up
> > RX and TX
> > queues so that most channels combine RX and TX work.
> > o Please could you use a kernel-doc comment to describe the structure.
> >
> > Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
>
> Neither I see this patch in http://patchwork.ozlabs.org/project/netdev/list/ nor any comment.
> Just curious, is this patch discarded along with my other garbage patches ?
It's marked as 'deferred'; not sure what that means:
http://patchwork.ozlabs.org/patch/90166/
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [stable] [PATCH NET-2.6 1/1] qlcnic: limit skb frags for non tso packet
From: Greg KH @ 2011-04-13 14:03 UTC (permalink / raw)
To: Amit Salecha
Cc: David Miller, netdev@vger.kernel.org, Anirban Chakraborty,
stable@kernel.org, Ameen Rahman
In-Reply-To: <99737F4847ED0A48AECC9F4A1974A4B80FD1383FDF@MNEXMB2.qlogic.org>
On Wed, Apr 13, 2011 at 12:56:56AM -0500, Amit Salecha wrote:
> > On Tue, Apr 12, 2011 at 09:01:13PM -0500, Amit Salecha wrote:
> > >
> > > This message and any attached documents contain information from
> > QLogic Corporation or its wholly-owned subsidiaries that may be
> > confidential. If you are not the intended recipient, you may not read,
> > copy, distribute, or use this information. If you have received this
> > transmission in error, please notify the sender immediately by reply e-
> > mail and then delete this message.
> >
> > I have received this transmission in error.
> >
> > Please remove this from your footer, otherwise we can not accept any
> > emails sent from you as actually being allowed to contribute to the
> > kernel properly :(
> >
> I have send version two of this patch, that doesn't have this footer.
> Please discard this one.
>
> This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
Your footer is still present, please fix this.
^ permalink raw reply
* [PATCH] mpc5xxx_can: Fix typo causing build failure (of_dev -> ofdev)
From: Jeff Mahoney @ 2011-04-13 14:57 UTC (permalink / raw)
To: Grant Likely, David S. Miller; +Cc: Network Development
The variable is named ofdev, not of_dev.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
drivers/net/can/mscan/mpc5xxx_can.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -260,7 +260,7 @@ static int __devinit mpc5xxx_can_probe(s
if (!ofdev->dev.of_match)
return -EINVAL;
- data = (struct mpc5xxx_can_data *)of_dev->dev.of_match->data;
+ data = (struct mpc5xxx_can_data *)ofdev->dev.of_match->data;
base = of_iomap(np, 0);
if (!base) {
--
Jeff Mahoney
SUSE Labs
^ 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