* Re: [PATCH net-next v2] Take care of xfrm policy when checking dst entries
From: David Miller @ 2012-09-10 18:01 UTC (permalink / raw)
To: vyasevich; +Cc: nicolas.dichtel, eric.dumazet, sri, linux-sctp, netdev
In-Reply-To: <504E2A7A.9000003@gmail.com>
From: Vlad Yasevich <vyasevich@gmail.com>
Date: Mon, 10 Sep 2012 13:59:22 -0400
> On 09/10/2012 01:18 PM, David Miller wrote:
>> From: Vlad Yasevich <vyasevich@gmail.com>
>> Date: Mon, 10 Sep 2012 10:35:03 -0400
>>
>>> I am not sure this is right... This has a side-effect that when an
>>> rt_cache_flush() is called, it invalidates IPv6 routes a well....
>>>
>>> Its all fine and good do this when a new policy is added, but not when
>>> IPv4 routing table changes.
>>
>> I disagree.
>>
>
> So you are perfectly ok with invalidating IPv6 cache when IPv4 table
> changes, but not invalidating IPv4 cache if IPv6 table changes?
Due to tunneling I can't see how this is avoidable?
We do ipv6 over ipv4, but not vice-versa.
^ permalink raw reply
* Re: [PATCH v2] lxt PHY: Support for the buggy LXT973 rev A2
From: Lutz Jaenicke @ 2012-09-10 18:17 UTC (permalink / raw)
To: Christophe Leroy; +Cc: David S Miller, netdev, linux-kernel
In-Reply-To: <201209101545.q8AFjn7u021483@localhost.localdomain>
On Mon, Sep 10, 2012 at 05:45:49PM +0200, Christophe Leroy wrote:
> This patch adds proper handling of the buggy revision A2 of LXT973 phy, adding
> precautions linked to ERRATA Item 4:
>
> Item 4: MDIO Interface and Repeated Polling
> Problem: Repeated polling of odd-numbered registers via the MDIO interface
> randomly returns the contents of the previous even register.
> Implication: Managed applications may not obtain the correct register contents
> when a particular register is monitored for device status.
> Workaround: None.
> Status: This erratum has been previously fixed (in rev A3)
Hmm. Were did you get the hardware from? We have been using LXT973 in
our products and the A2 was replaced by A3 in 2003.
Best regards,
Lutz
--
Dr.-Ing. Lutz Jänicke
CTO
Innominate Security Technologies AG /protecting industrial networks/
tel: +49.30.921028-200
fax: +49.30.921028-020
Rudower Chaussee 13
D-12489 Berlin, Germany
www.innominate.com
Register Court: AG Charlottenburg, HR B 81603
Management Board: Dirk Seewald
Chairman of the Supervisory Board: Christoph Leifer
^ permalink raw reply
* Re: [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
From: Larry Finger @ 2012-09-10 18:34 UTC (permalink / raw)
To: Eric Dumazet
Cc: linville-2XuSBdqkA4R54TAoqtyWWQ,
linux-wireless-u79uwXL29TY76Z2rM5mHXA, netdev, Greg Kroah-Hartman
In-Reply-To: <1347299715.1234.1902.camel@edumazet-glaptop>
On 09/10/2012 12:55 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
>
> 64bit arches have a buggy r8712u driver, let's fix it.
>
> Signed-off-by: Eric Dumazet <edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/staging/rtl8712/recv_linux.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
> index 0e26d5f..495ee12 100644
> --- a/drivers/staging/rtl8712/recv_linux.c
> +++ b/drivers/staging/rtl8712/recv_linux.c
> @@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
> if (skb == NULL)
> goto _recv_indicatepkt_drop;
> skb->data = precv_frame->u.hdr.rx_data;
> -#ifdef NET_SKBUFF_DATA_USES_OFFSET
> - skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail -
> - precv_frame->u.hdr.rx_head);
> -#else
> - skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail;
> -#endif
> skb->len = precv_frame->u.hdr.len;
> + skb_set_tail_pointer(skb, skb->len);
> if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
> skb->ip_summed = CHECKSUM_UNNECESSARY;
> else
Eric,
Thanks for this. It works for me. I had looked at this code a number of times,
but for some reason, I thought that the u.hdr.rx_yyyy parameters were like
32-bit systems and that all 4 values were pointers, and not like 64-bit systems,
thus the funny conversion. Strange that the bug was never triggered until commit
c8628155ece3 - this code has not changed since the driver was accepted into 2.6.37.
A few points on the patch. As the driver is in staging, the patch needs to go to
Greg Kroah-Hartman. In addition, please add the "Cc: Stable
<stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>" line. You may also give an a s-o-b for me. Finally,
this patch should fix https://bugzilla.redhat.com/show_bug.cgi?id=847525, and
https://bugzilla.kernel.org/show_bug.cgi?id=45071.
Larry
--
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
* Re: [PATCHv4] virtio-spec: virtio network device multiqueue support
From: Rick Jones @ 2012-09-10 18:39 UTC (permalink / raw)
To: Rusty Russell
Cc: kvm, Michael S. Tsirkin, netdev, virtualization, levinsasha928,
pbonzini, Tom Herbert
In-Reply-To: <878vcifwxi.fsf@rustcorp.com.au>
On 09/09/2012 07:12 PM, Rusty Russell wrote:
> OK, I read the spec (pasted below for easy of reading), but I'm still
> confused over how this will work.
>
> I thought normal net drivers have the hardware provide an rxhash for
> each packet, and we map that to CPU to queue the packet on[1]. We hope
> that the receiving process migrates to that CPU, so xmit queue
> matches.
>
> For virtio this would mean a new per-packet rxhash value, right?
>
> Why are we doing something different? What am I missing?
>
> Thanks,
> Rusty.
> [1] Everything I Know About Networking I Learned From LWN:
> https://lwn.net/Articles/362339/
In my taxonomy at least, "multi-queue" predates RPS and RFS and is
simply where the NIC via some means, perhaps a headers hash, separates
incoming frames to different queues.
RPS can be thought of as doing something similar inside the host. That
could be used to get a spread from an otherwise "dumb" NIC (certainly
that is what one of its predecessors - Inbound Packet Scheduling - used
it for in HP-UX 10.20), or it could be used to augment the multi-queue
support of a not-so-dump NIC - say if said NIC had a limit of queues
that was rather lower than the number of cores/threads in the host.
Indeed some driver/NIC combinations provide a hash value to the host for
the host to use as it sees fit.
However, there is still the matter of a single thread of an application
servicing multiple connections, each of which would hash to different
locations.
RFS (Receive Flow Steering) then goes one step further, and looks-up
where the flow endpoint was last accessed and steers the traffic there.
The idea being that a thread of execution servicing multiple flows
will have the traffic of those flows sent to the same place. It then
allows the scheduler to decide where things should be run rather than
the networking code.
rick jones
^ permalink raw reply
* Re: Endianess bug fix for sierra_net
From: David Miller @ 2012-09-10 19:06 UTC (permalink / raw)
To: lsorense; +Cc: linux-kernel, bjorn, linux, netdev
In-Reply-To: <20120907221402.GJ15650@csclub.uwaterloo.ca>
From: "Lennart Sorensen" <lsorense@csclub.uwaterloo.ca>
Date: Fri, 7 Sep 2012 18:14:02 -0400
> I discovered I couldn't get sierra_net to work on a powerpc. Turns out
> the firmware attribute check assumes the system is little endian and
> hence fails because the attributes is a 16 bit value.
>
> Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* Re: [PATCH] scsi_netlink: Remove dead and buggy code
From: David Miller @ 2012-09-10 19:07 UTC (permalink / raw)
To: ebiederm; +Cc: netdev, James.Bottomley, James.Smart, linux-scsi
In-Reply-To: <87pq5xjw4m.fsf@xmission.com>
From: ebiederm@xmission.com (Eric W. Biederman)
Date: Fri, 07 Sep 2012 15:39:21 -0700
>
> The scsi netlink code confuses the netlink port id with a process id,
> going so far as to read NETLINK_CREDS(skb)->pid instead of the correct
> NETLINK_CB(skb).pid. Fortunately it does not matter because nothing
> registers to respond to scsi netlink requests.
>
> The only interesting use of the scsi_netlink interface is
> fc_host_post_vendor_event which sends a netlink multicast message.
>
> Since nothing registers to handle scsi netlink messages kill all of the
> registration logic, while retaining the same error handling behavior
> preserving the userspace visible behavior and removing all of the
> confused code that thought a netlink port id was a process id.
>
> This was tested with a kernel allyesconfig build which had no problems.
>
> Cc: James Bottomley <James.Bottomley@parallels.com>
> Cc: James Smart <James.Smart@Emulex.Com>
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
James et al., please review and ACK.
> ---
> drivers/scsi/scsi_netlink.c | 555 ++-----------------------------------------
> include/scsi/scsi_netlink.h | 24 --
> 2 files changed, 15 insertions(+), 564 deletions(-)
>
> diff --git a/drivers/scsi/scsi_netlink.c b/drivers/scsi/scsi_netlink.c
> index 8818dd6..abd43a3 100644
> --- a/drivers/scsi/scsi_netlink.c
> +++ b/drivers/scsi/scsi_netlink.c
> @@ -33,40 +33,6 @@
> struct sock *scsi_nl_sock = NULL;
> EXPORT_SYMBOL_GPL(scsi_nl_sock);
>
> -static DEFINE_SPINLOCK(scsi_nl_lock);
> -static struct list_head scsi_nl_drivers;
> -
> -static u32 scsi_nl_state;
> -#define STATE_EHANDLER_BSY 0x00000001
> -
> -struct scsi_nl_transport {
> - int (*msg_handler)(struct sk_buff *);
> - void (*event_handler)(struct notifier_block *, unsigned long, void *);
> - unsigned int refcnt;
> - int flags;
> -};
> -
> -/* flags values (bit flags) */
> -#define HANDLER_DELETING 0x1
> -
> -static struct scsi_nl_transport transports[SCSI_NL_MAX_TRANSPORTS] =
> - { {NULL, }, };
> -
> -
> -struct scsi_nl_drvr {
> - struct list_head next;
> - int (*dmsg_handler)(struct Scsi_Host *shost, void *payload,
> - u32 len, u32 pid);
> - void (*devt_handler)(struct notifier_block *nb,
> - unsigned long event, void *notify_ptr);
> - struct scsi_host_template *hostt;
> - u64 vendor_id;
> - unsigned int refcnt;
> - int flags;
> -};
> -
> -
> -
> /**
> * scsi_nl_rcv_msg - Receive message handler.
> * @skb: socket receive buffer
> @@ -81,7 +47,6 @@ scsi_nl_rcv_msg(struct sk_buff *skb)
> {
> struct nlmsghdr *nlh;
> struct scsi_nl_hdr *hdr;
> - unsigned long flags;
> u32 rlen;
> int err, tport;
>
> @@ -126,22 +91,24 @@ scsi_nl_rcv_msg(struct sk_buff *skb)
> /*
> * Deliver message to the appropriate transport
> */
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> -
> tport = hdr->transport;
> - if ((tport < SCSI_NL_MAX_TRANSPORTS) &&
> - !(transports[tport].flags & HANDLER_DELETING) &&
> - (transports[tport].msg_handler)) {
> - transports[tport].refcnt++;
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - err = transports[tport].msg_handler(skb);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - transports[tport].refcnt--;
> - } else
> + if (tport == SCSI_NL_TRANSPORT) {
> + switch (hdr->msgtype) {
> + case SCSI_NL_SHOST_VENDOR:
> + /* Locate the driver that corresponds to the message */
> + err = -ESRCH;
> + break;
> + default:
> + err = -EBADR;
> + break;
> + }
> + if (err)
> + printk(KERN_WARNING "%s: Msgtype %d failed - err %d\n",
> + __func__, hdr->msgtype, err);
> + }
> + else
> err = -ENOENT;
>
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> next_msg:
> if ((err) || (nlh->nlmsg_flags & NLM_F_ACK))
> netlink_ack(skb, nlh, err);
> @@ -150,333 +117,6 @@ next_msg:
> }
> }
>
> -
> -/**
> - * scsi_nl_rcv_event - Event handler for a netlink socket.
> - * @this: event notifier block
> - * @event: event type
> - * @ptr: event payload
> - *
> - **/
> -static int
> -scsi_nl_rcv_event(struct notifier_block *this, unsigned long event, void *ptr)
> -{
> - struct netlink_notify *n = ptr;
> - struct scsi_nl_drvr *driver;
> - unsigned long flags;
> - int tport;
> -
> - if (n->protocol != NETLINK_SCSITRANSPORT)
> - return NOTIFY_DONE;
> -
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - scsi_nl_state |= STATE_EHANDLER_BSY;
> -
> - /*
> - * Pass event on to any transports that may be listening
> - */
> - for (tport = 0; tport < SCSI_NL_MAX_TRANSPORTS; tport++) {
> - if (!(transports[tport].flags & HANDLER_DELETING) &&
> - (transports[tport].event_handler)) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - transports[tport].event_handler(this, event, ptr);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> - }
> -
> - /*
> - * Pass event on to any drivers that may be listening
> - */
> - list_for_each_entry(driver, &scsi_nl_drivers, next) {
> - if (!(driver->flags & HANDLER_DELETING) &&
> - (driver->devt_handler)) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - driver->devt_handler(this, event, ptr);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> - }
> -
> - scsi_nl_state &= ~STATE_EHANDLER_BSY;
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> - return NOTIFY_DONE;
> -}
> -
> -static struct notifier_block scsi_netlink_notifier = {
> - .notifier_call = scsi_nl_rcv_event,
> -};
> -
> -
> -/*
> - * GENERIC SCSI transport receive and event handlers
> - */
> -
> -/**
> - * scsi_generic_msg_handler - receive message handler for GENERIC transport messages
> - * @skb: socket receive buffer
> - **/
> -static int
> -scsi_generic_msg_handler(struct sk_buff *skb)
> -{
> - struct nlmsghdr *nlh = nlmsg_hdr(skb);
> - struct scsi_nl_hdr *snlh = NLMSG_DATA(nlh);
> - struct scsi_nl_drvr *driver;
> - struct Scsi_Host *shost;
> - unsigned long flags;
> - int err = 0, match, pid;
> -
> - pid = NETLINK_CREDS(skb)->pid;
> -
> - switch (snlh->msgtype) {
> - case SCSI_NL_SHOST_VENDOR:
> - {
> - struct scsi_nl_host_vendor_msg *msg = NLMSG_DATA(nlh);
> -
> - /* Locate the driver that corresponds to the message */
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - match = 0;
> - list_for_each_entry(driver, &scsi_nl_drivers, next) {
> - if (driver->vendor_id == msg->vendor_id) {
> - match = 1;
> - break;
> - }
> - }
> -
> - if ((!match) || (!driver->dmsg_handler)) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - err = -ESRCH;
> - goto rcv_exit;
> - }
> -
> - if (driver->flags & HANDLER_DELETING) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - err = -ESHUTDOWN;
> - goto rcv_exit;
> - }
> -
> - driver->refcnt++;
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> -
> - /* if successful, scsi_host_lookup takes a shost reference */
> - shost = scsi_host_lookup(msg->host_no);
> - if (!shost) {
> - err = -ENODEV;
> - goto driver_exit;
> - }
> -
> - /* is this host owned by the vendor ? */
> - if (shost->hostt != driver->hostt) {
> - err = -EINVAL;
> - goto vendormsg_put;
> - }
> -
> - /* pass message on to the driver */
> - err = driver->dmsg_handler(shost, (void *)&msg[1],
> - msg->vmsg_datalen, pid);
> -
> -vendormsg_put:
> - /* release reference by scsi_host_lookup */
> - scsi_host_put(shost);
> -
> -driver_exit:
> - /* release our own reference on the registration object */
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - driver->refcnt--;
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - break;
> - }
> -
> - default:
> - err = -EBADR;
> - break;
> - }
> -
> -rcv_exit:
> - if (err)
> - printk(KERN_WARNING "%s: Msgtype %d failed - err %d\n",
> - __func__, snlh->msgtype, err);
> - return err;
> -}
> -
> -
> -/**
> - * scsi_nl_add_transport -
> - * Registers message and event handlers for a transport. Enables
> - * receipt of netlink messages and events to a transport.
> - *
> - * @tport: transport registering handlers
> - * @msg_handler: receive message handler callback
> - * @event_handler: receive event handler callback
> - **/
> -int
> -scsi_nl_add_transport(u8 tport,
> - int (*msg_handler)(struct sk_buff *),
> - void (*event_handler)(struct notifier_block *, unsigned long, void *))
> -{
> - unsigned long flags;
> - int err = 0;
> -
> - if (tport >= SCSI_NL_MAX_TRANSPORTS)
> - return -EINVAL;
> -
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> -
> - if (scsi_nl_state & STATE_EHANDLER_BSY) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - msleep(1);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> -
> - if (transports[tport].msg_handler || transports[tport].event_handler) {
> - err = -EALREADY;
> - goto register_out;
> - }
> -
> - transports[tport].msg_handler = msg_handler;
> - transports[tport].event_handler = event_handler;
> - transports[tport].flags = 0;
> - transports[tport].refcnt = 0;
> -
> -register_out:
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> - return err;
> -}
> -EXPORT_SYMBOL_GPL(scsi_nl_add_transport);
> -
> -
> -/**
> - * scsi_nl_remove_transport -
> - * Disable transport receiption of messages and events
> - *
> - * @tport: transport deregistering handlers
> - *
> - **/
> -void
> -scsi_nl_remove_transport(u8 tport)
> -{
> - unsigned long flags;
> -
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - if (scsi_nl_state & STATE_EHANDLER_BSY) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - msleep(1);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> -
> - if (tport < SCSI_NL_MAX_TRANSPORTS) {
> - transports[tport].flags |= HANDLER_DELETING;
> -
> - while (transports[tport].refcnt != 0) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - schedule_timeout_uninterruptible(HZ/4);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> - transports[tport].msg_handler = NULL;
> - transports[tport].event_handler = NULL;
> - transports[tport].flags = 0;
> - }
> -
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> - return;
> -}
> -EXPORT_SYMBOL_GPL(scsi_nl_remove_transport);
> -
> -
> -/**
> - * scsi_nl_add_driver -
> - * A driver is registering its interfaces for SCSI netlink messages
> - *
> - * @vendor_id: A unique identification value for the driver.
> - * @hostt: address of the driver's host template. Used
> - * to verify an shost is bound to the driver
> - * @nlmsg_handler: receive message handler callback
> - * @nlevt_handler: receive event handler callback
> - *
> - * Returns:
> - * 0 on Success
> - * error result otherwise
> - **/
> -int
> -scsi_nl_add_driver(u64 vendor_id, struct scsi_host_template *hostt,
> - int (*nlmsg_handler)(struct Scsi_Host *shost, void *payload,
> - u32 len, u32 pid),
> - void (*nlevt_handler)(struct notifier_block *nb,
> - unsigned long event, void *notify_ptr))
> -{
> - struct scsi_nl_drvr *driver;
> - unsigned long flags;
> -
> - driver = kzalloc(sizeof(*driver), GFP_KERNEL);
> - if (unlikely(!driver)) {
> - printk(KERN_ERR "%s: allocation failure\n", __func__);
> - return -ENOMEM;
> - }
> -
> - driver->dmsg_handler = nlmsg_handler;
> - driver->devt_handler = nlevt_handler;
> - driver->hostt = hostt;
> - driver->vendor_id = vendor_id;
> -
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - if (scsi_nl_state & STATE_EHANDLER_BSY) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - msleep(1);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> - list_add_tail(&driver->next, &scsi_nl_drivers);
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> - return 0;
> -}
> -EXPORT_SYMBOL_GPL(scsi_nl_add_driver);
> -
> -
> -/**
> - * scsi_nl_remove_driver -
> - * An driver is unregistering with the SCSI netlink messages
> - *
> - * @vendor_id: The unique identification value for the driver.
> - **/
> -void
> -scsi_nl_remove_driver(u64 vendor_id)
> -{
> - struct scsi_nl_drvr *driver;
> - unsigned long flags;
> -
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - if (scsi_nl_state & STATE_EHANDLER_BSY) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - msleep(1);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> -
> - list_for_each_entry(driver, &scsi_nl_drivers, next) {
> - if (driver->vendor_id == vendor_id) {
> - driver->flags |= HANDLER_DELETING;
> - while (driver->refcnt != 0) {
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - schedule_timeout_uninterruptible(HZ/4);
> - spin_lock_irqsave(&scsi_nl_lock, flags);
> - }
> - list_del(&driver->next);
> - kfree(driver);
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> - return;
> - }
> - }
> -
> - spin_unlock_irqrestore(&scsi_nl_lock, flags);
> -
> - printk(KERN_ERR "%s: removal of driver failed - vendor_id 0x%llx\n",
> - __func__, (unsigned long long)vendor_id);
> - return;
> -}
> -EXPORT_SYMBOL_GPL(scsi_nl_remove_driver);
> -
> -
> /**
> * scsi_netlink_init - Called by SCSI subsystem to initialize
> * the SCSI transport netlink interface
> @@ -485,36 +125,19 @@ EXPORT_SYMBOL_GPL(scsi_nl_remove_driver);
> void
> scsi_netlink_init(void)
> {
> - int error;
> struct netlink_kernel_cfg cfg = {
> .input = scsi_nl_rcv_msg,
> .groups = SCSI_NL_GRP_CNT,
> };
>
> - INIT_LIST_HEAD(&scsi_nl_drivers);
> -
> - error = netlink_register_notifier(&scsi_netlink_notifier);
> - if (error) {
> - printk(KERN_ERR "%s: register of event handler failed - %d\n",
> - __func__, error);
> - return;
> - }
> -
> scsi_nl_sock = netlink_kernel_create(&init_net, NETLINK_SCSITRANSPORT,
> THIS_MODULE, &cfg);
> if (!scsi_nl_sock) {
> printk(KERN_ERR "%s: register of receive handler failed\n",
> __func__);
> - netlink_unregister_notifier(&scsi_netlink_notifier);
> return;
> }
>
> - /* Register the entry points for the generic SCSI transport */
> - error = scsi_nl_add_transport(SCSI_NL_TRANSPORT,
> - scsi_generic_msg_handler, NULL);
> - if (error)
> - printk(KERN_ERR "%s: register of GENERIC transport handler"
> - " failed - %d\n", __func__, error);
> return;
> }
>
> @@ -526,158 +149,10 @@ scsi_netlink_init(void)
> void
> scsi_netlink_exit(void)
> {
> - scsi_nl_remove_transport(SCSI_NL_TRANSPORT);
> -
> if (scsi_nl_sock) {
> netlink_kernel_release(scsi_nl_sock);
> - netlink_unregister_notifier(&scsi_netlink_notifier);
> }
>
> return;
> }
>
> -
> -/*
> - * Exported Interfaces
> - */
> -
> -/**
> - * scsi_nl_send_transport_msg -
> - * Generic function to send a single message from a SCSI transport to
> - * a single process
> - *
> - * @pid: receiving pid
> - * @hdr: message payload
> - *
> - **/
> -void
> -scsi_nl_send_transport_msg(u32 pid, struct scsi_nl_hdr *hdr)
> -{
> - struct sk_buff *skb;
> - struct nlmsghdr *nlh;
> - const char *fn;
> - char *datab;
> - u32 len, skblen;
> - int err;
> -
> - if (!scsi_nl_sock) {
> - err = -ENOENT;
> - fn = "netlink socket";
> - goto msg_fail;
> - }
> -
> - len = NLMSG_SPACE(hdr->msglen);
> - skblen = NLMSG_SPACE(len);
> -
> - skb = alloc_skb(skblen, GFP_KERNEL);
> - if (!skb) {
> - err = -ENOBUFS;
> - fn = "alloc_skb";
> - goto msg_fail;
> - }
> -
> - nlh = nlmsg_put(skb, pid, 0, SCSI_TRANSPORT_MSG, len - sizeof(*nlh), 0);
> - if (!nlh) {
> - err = -ENOBUFS;
> - fn = "nlmsg_put";
> - goto msg_fail_skb;
> - }
> - datab = NLMSG_DATA(nlh);
> - memcpy(datab, hdr, hdr->msglen);
> -
> - err = nlmsg_unicast(scsi_nl_sock, skb, pid);
> - if (err < 0) {
> - fn = "nlmsg_unicast";
> - /* nlmsg_unicast already kfree_skb'd */
> - goto msg_fail;
> - }
> -
> - return;
> -
> -msg_fail_skb:
> - kfree_skb(skb);
> -msg_fail:
> - printk(KERN_WARNING
> - "%s: Dropped Message : pid %d Transport %d, msgtype x%x, "
> - "msglen %d: %s : err %d\n",
> - __func__, pid, hdr->transport, hdr->msgtype, hdr->msglen,
> - fn, err);
> - return;
> -}
> -EXPORT_SYMBOL_GPL(scsi_nl_send_transport_msg);
> -
> -
> -/**
> - * scsi_nl_send_vendor_msg - called to send a shost vendor unique message
> - * to a specific process id.
> - *
> - * @pid: process id of the receiver
> - * @host_no: host # sending the message
> - * @vendor_id: unique identifier for the driver's vendor
> - * @data_len: amount, in bytes, of vendor unique payload data
> - * @data_buf: pointer to vendor unique data buffer
> - *
> - * Returns:
> - * 0 on successful return
> - * otherwise, failing error code
> - *
> - * Notes:
> - * This routine assumes no locks are held on entry.
> - */
> -int
> -scsi_nl_send_vendor_msg(u32 pid, unsigned short host_no, u64 vendor_id,
> - char *data_buf, u32 data_len)
> -{
> - struct sk_buff *skb;
> - struct nlmsghdr *nlh;
> - struct scsi_nl_host_vendor_msg *msg;
> - u32 len, skblen;
> - int err;
> -
> - if (!scsi_nl_sock) {
> - err = -ENOENT;
> - goto send_vendor_fail;
> - }
> -
> - len = SCSI_NL_MSGALIGN(sizeof(*msg) + data_len);
> - skblen = NLMSG_SPACE(len);
> -
> - skb = alloc_skb(skblen, GFP_KERNEL);
> - if (!skb) {
> - err = -ENOBUFS;
> - goto send_vendor_fail;
> - }
> -
> - nlh = nlmsg_put(skb, 0, 0, SCSI_TRANSPORT_MSG,
> - skblen - sizeof(*nlh), 0);
> - if (!nlh) {
> - err = -ENOBUFS;
> - goto send_vendor_fail_skb;
> - }
> - msg = NLMSG_DATA(nlh);
> -
> - INIT_SCSI_NL_HDR(&msg->snlh, SCSI_NL_TRANSPORT,
> - SCSI_NL_SHOST_VENDOR, len);
> - msg->vendor_id = vendor_id;
> - msg->host_no = host_no;
> - msg->vmsg_datalen = data_len; /* bytes */
> - memcpy(&msg[1], data_buf, data_len);
> -
> - err = nlmsg_unicast(scsi_nl_sock, skb, pid);
> - if (err)
> - /* nlmsg_multicast already kfree_skb'd */
> - goto send_vendor_fail;
> -
> - return 0;
> -
> -send_vendor_fail_skb:
> - kfree_skb(skb);
> -send_vendor_fail:
> - printk(KERN_WARNING
> - "%s: Dropped SCSI Msg : host %d vendor_unique - err %d\n",
> - __func__, host_no, err);
> - return err;
> -}
> -EXPORT_SYMBOL(scsi_nl_send_vendor_msg);
> -
> -
> diff --git a/include/scsi/scsi_netlink.h b/include/scsi/scsi_netlink.h
> index 5cb20cc..62b4eda 100644
> --- a/include/scsi/scsi_netlink.h
> +++ b/include/scsi/scsi_netlink.h
> @@ -119,29 +119,5 @@ struct scsi_nl_host_vendor_msg {
> (hdr)->msglen = mlen; \
> }
>
> -
> -#ifdef __KERNEL__
> -
> -#include <scsi/scsi_host.h>
> -
> -/* Exported Kernel Interfaces */
> -int scsi_nl_add_transport(u8 tport,
> - int (*msg_handler)(struct sk_buff *),
> - void (*event_handler)(struct notifier_block *, unsigned long, void *));
> -void scsi_nl_remove_transport(u8 tport);
> -
> -int scsi_nl_add_driver(u64 vendor_id, struct scsi_host_template *hostt,
> - int (*nlmsg_handler)(struct Scsi_Host *shost, void *payload,
> - u32 len, u32 pid),
> - void (*nlevt_handler)(struct notifier_block *nb,
> - unsigned long event, void *notify_ptr));
> -void scsi_nl_remove_driver(u64 vendor_id);
> -
> -void scsi_nl_send_transport_msg(u32 pid, struct scsi_nl_hdr *hdr);
> -int scsi_nl_send_vendor_msg(u32 pid, unsigned short host_no, u64 vendor_id,
> - char *data_buf, u32 data_len);
> -
> -#endif /* __KERNEL__ */
> -
> #endif /* SCSI_NETLINK_H */
>
> --
> 1.7.5.4
>
^ permalink raw reply
* Re: ndo_get_stats and rtnl_netlink
From: Or Gerlitz @ 2012-09-10 19:10 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Shlomo Pongartz, netdev
In-Reply-To: <1347268189.1234.1301.camel@edumazet-glaptop>
On Mon, Sep 10, 2012 at 12:09 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> RTNL locking is not needed to fetch stats, and would be overkill.
> Each driver has its own way to protect/gather its stats.
FWIW, again, when dev_get_stats is called from rtnl_fill_ifinfo e.g as
of invocation
of "ip link show <interface>, there IS RTNL locking, is that a problem?
Or.
^ permalink raw reply
* zero length sg in scatterwalk_start.
From: Dave Jones @ 2012-09-10 19:12 UTC (permalink / raw)
To: netdev; +Cc: Fedora Kernel Team, sergei.litvinenko, herbert
In-Reply-To: <bug-855961-176318@bugzilla.redhat.com>
Sergei (Cc'd) just filed this against our 3.6rc4 kernel
It's falling over on the
BUG_ON(!sg->length);
in scatterwalk_start
Dave
On Mon, Sep 10, 2012 at 06:41:07PM +0000, bugzilla@redhat.com wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=855961
>
> Description of problem:
>
> Message with diagnostic and openswan stop to work
>
> Version-Release number of selected component (if applicable):
> kernel-3.6.0-0.rc4.git2.1.fc18.i686
> openswan-2.6.38-3.fc18.i686
>
>
> Steps to Reproduce:
> 1. Install f18 to KVM
> 2. install openswan
> 3. prepare configuration on Host and kvm guest:
>
> conn fedora18
> #----------------------------------
> left=10.x.x.100
> leftrsasigkey=0sAQPHXz0 ...
> #----------------------------------
> right=10.x.x.18
> rightrsasigkey=0sAQOi...
> #----------------------------------
> type=transport
> keyingtries=%forever
> auth=esp
> ike=aes256-sha1-modp1024
> esp=aes256-sha1
> authby=rsasig
> keyexchange=ike
> disablearrivalcheck=yes
> pfs=no
> compress=no
> #-----------------------------
> auto=add
>
> 4. run from host: ipsec auto --up fedora18
>
> Actual results:
>
> Message ... and ipsec service is not accessible any more. Guest do not crash
> and stil work (accessible by ssh).
>
> Expected results:
> ipsec start and work
>
>
> [ 105.063277] ------------[ cut here ]------------
> [ 105.063281] kernel BUG at crypto/scatterwalk.c:37!
> [ 105.063283] invalid opcode: 0000 [#1] SMP
> [ 105.063286] Modules linked in: authenc rmd160 crypto_null camellia_generic lzo cast6 cast5 deflate zlib_deflate cts gcm ccm serpent_sse2_i586 xts serpent_generic lrw gf128mul glue_helper blowfish_generic blowfish_common twofish_generic twofish_i586 twofish_common xcbc sha512_generic des_generic geode_aes ah6 ah4 esp6 esp4 xfrm4_mode_beet xfrm4_tunnel tunnel4 xfrm4_mode_tunnel xfrm4_mode_transport xfrm6_mode_transport xfrm6_mode_ro xfrm6_mode_beet xfrm6_mode_tunnel ipcomp ipcomp6 xfrm6_tunnel tunnel6 xfrm_ipcomp af_key lockd sunrpc bnep bluetooth rfkill ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ppdev microcode virtio_net i2c_piix4 parport_pc i2c_core parport uinput virtio_blk
> [ 105.063327] Pid: 995, comm: cryptomgr_test Not tainted 3.6.0-0.rc4.git2.1.fc18.i686 #1 Bochs Bochs
> [ 105.063329] EIP: 0060:[<c06829e9>] EFLAGS: 00010246 CPU: 0
> [ 105.063363] EIP is at scatterwalk_start+0x19/0x20
> [ 105.063365] EAX: f334bbe0 EBX: f286a5d8 ECX: 00000000 EDX: f286a5d8
> [ 105.063367] ESI: 00000020 EDI: 00000000 EBP: f334bbd0 ESP: f334bbd0
> [ 105.063368] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
> [ 105.063372] CR0: 8005003b CR2: 45cb04bc CR3: 00ede000 CR4: 000006d0
> [ 105.063381] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
> [ 105.063386] DR6: ffff0ff0 DR7: 00000400
> [ 105.063388] Process cryptomgr_test (pid: 995, ti=f334a000 task=f26e5640 task.ti=f334a000)
> [ 105.063389] Stack:
> [ 105.063390] f334bbf4 c0682bfa f334bbe0 f286a640 f286a5d8 f80851a3 f286a5a0 f286a5d8
> [ 105.063395] f3378a50 f334bc38 f80859db 00000014 00000001 f2bd5000 00000000 87654321
> [ 105.063400] 00000668 f54cdc80 00000200 00000000 00000000 f286a5d8 00000020 f286a678
> [ 105.063406] Call Trace:
> [ 105.063409] [<c0682bfa>] scatterwalk_map_and_copy+0x2a/0xa0
> [ 105.063413] [<f80851a3>] ? crypto_authenc_ahash+0x63/0x80 [authenc]
> [ 105.063416] [<f80859db>] crypto_authenc_genicv+0xdb/0x330 [authenc]
> [ 105.063419] [<f8085dbc>] crypto_authenc_encrypt+0x8c/0xa0 [authenc]
> [ 105.063422] [<c068a48a>] test_aead+0x5aa/0xd40
> [ 105.063432] [<c047e685>] ? local_clock+0x65/0x70
> [ 105.063444] [<c055d239>] ? deactivate_slab+0x419/0x540
> [ 105.063449] [<c04a7f84>] ? trace_hardirqs_on_caller+0xf4/0x180
> [ 105.063451] [<c04a801b>] ? trace_hardirqs_on+0xb/0x10
> [ 105.063455] [<c068113d>] ? __crypto_alloc_tfm+0x3d/0x150
> [ 105.063457] [<c068113d>] ? __crypto_alloc_tfm+0x3d/0x150
> [ 105.063460] [<c055e2eb>] ? __kmalloc+0x11b/0x290
> [ 105.063463] [<c068121f>] ? __crypto_alloc_tfm+0x11f/0x150
> [ 105.063466] [<c0681bcd>] ? crypto_spawn_tfm+0x3d/0x70
> [ 105.063468] [<c068f6d2>] ? crypto_cbc_init_tfm+0x22/0x40
> [ 105.063471] [<c06811de>] ? __crypto_alloc_tfm+0xde/0x150
> [ 105.063473] [<c0681bcd>] ? crypto_spawn_tfm+0x3d/0x70
> [ 105.063476] [<c0685022>] ? skcipher_geniv_init+0x22/0x40
> [ 105.063478] [<c0685edb>] ? async_chainiv_init+0x7b/0x90
> [ 105.063481] [<c06811de>] ? __crypto_alloc_tfm+0xde/0x150
> [ 105.063484] [<c068ac68>] alg_test_aead+0x48/0xa0
> [ 105.063487] [<c068992e>] ? alg_find_test+0x2e/0x60
> [ 105.063489] [<c0689a06>] alg_test+0xa6/0x270
> [ 105.063511] [<c09fb836>] ? _raw_spin_unlock_irqrestore+0x36/0x70
> [ 105.063514] [<c04a7f84>] ? trace_hardirqs_on_caller+0xf4/0x180
> [ 105.063517] [<c04a801b>] ? trace_hardirqs_on+0xb/0x10
> [ 105.063519] [<c06886c0>] ? cryptomgr_probe+0xb0/0xb0
> [ 105.063522] [<c0688701>] cryptomgr_test+0x41/0x50
> [ 105.063525] [<c046640d>] kthread+0x7d/0x90
> [ 105.063528] [<c0466390>] ? __init_kthread_worker+0x60/0x60
> [ 105.063532] [<c0a03502>] kernel_thread_helper+0x6/0x10
> [ 105.063533] Code: c3 90 31 f6 83 c4 08 89 f0 5b 5e 5f 5d c3 66 90 66 90 55 89 e5 3e 8d 74 26 00 89 10 8b 4a 0c 85 c9 74 08 8b 52 08 5d 89 50 04 c3 <0f> 0b 90 8d 74 26 00 55 89 e5 53 3e 8d 74 26 00 89 c3 8b 00 81
> [ 105.063565] EIP: [<c06829e9>] scatterwalk_start+0x19/0x20 SS:ESP 0068:f334bbd0
> [ 105.063570] ---[ end trace 5057a14544445946 ]---
> [ 105.063573] BUG: sleeping function called from invalid context at kernel/rwsem.c:20
> [ 105.063574] in_atomic(): 1, irqs_disabled(): 0, pid: 995, name: cryptomgr_test
> [ 105.063575] INFO: lockdep is turned off.
> [ 105.063577] Pid: 995, comm: cryptomgr_test Tainted: G D 3.6.0-0.rc4.git2.1.fc18.i686 #1
> [ 105.063578] Call Trace:
> [ 105.063581] [<c0475227>] __might_sleep+0x167/0x210
> [ 105.063584] [<c09f9230>] down_read+0x20/0x8b
> [ 105.063587] [<c046e6ef>] ? __validate_process_creds+0x6f/0xd0
> [ 105.063590] [<c0457f6e>] exit_signals+0x1e/0x110
> [ 105.063595] [<c0446cef>] do_exit+0x9f/0xa10
> [ 105.063597] [<c0443b11>] ? kmsg_dump+0x21/0x210
> [ 105.063600] [<c0443c80>] ? kmsg_dump+0x190/0x210
> [ 105.063602] [<c0443c94>] ? kmsg_dump+0x1a4/0x210
> [ 105.063605] [<c0443b11>] ? kmsg_dump+0x21/0x210
> [ 105.063607] [<c09fc92a>] oops_end+0x8a/0xd0
> [ 105.063611] [<c04061d4>] die+0x54/0x80
> [ 105.063613] [<c09fc366>] do_trap+0x96/0xd0
> [ 105.063616] [<c0403b70>] ? do_bounds+0x90/0x90
> [ 105.063618] [<c0403c16>] do_invalid_op+0xa6/0xb0
> [ 105.063620] [<c06829e9>] ? scatterwalk_start+0x19/0x20
> [ 105.063623] [<c068c1ed>] ? hmac_final+0x8d/0xa0
> [ 105.063625] [<c0687d67>] ? crypto_shash_final+0x27/0xa0
> [ 105.063628] [<c0688173>] ? shash_ahash_finup+0x73/0x80
> [ 105.063637] [<c06c8dc8>] ? trace_hardirqs_off_thunk+0xc/0x14
> [ 105.063640] [<c09fc0f8>] error_code+0x6c/0x74
> [ 105.063643] [<c06800d8>] ? devcgroup_seq_read+0x2a8/0x2f0
> [ 105.063645] [<c06829e9>] ? scatterwalk_start+0x19/0x20
> [ 105.063648] [<c0682bfa>] scatterwalk_map_and_copy+0x2a/0xa0
> [ 105.063651] [<f80851a3>] ? crypto_authenc_ahash+0x63/0x80 [authenc]
> [ 105.063653] [<f80859db>] crypto_authenc_genicv+0xdb/0x330 [authenc]
> [ 105.063656] [<f8085dbc>] crypto_authenc_encrypt+0x8c/0xa0 [authenc]
> [ 105.063659] [<c068a48a>] test_aead+0x5aa/0xd40
> [ 105.063661] [<c047e685>] ? local_clock+0x65/0x70
> [ 105.063664] [<c055d239>] ? deactivate_slab+0x419/0x540
> [ 105.063667] [<c04a7f84>] ? trace_hardirqs_on_caller+0xf4/0x180
> [ 105.063670] [<c04a801b>] ? trace_hardirqs_on+0xb/0x10
> [ 105.063672] [<c068113d>] ? __crypto_alloc_tfm+0x3d/0x150
> [ 105.063675] [<c068113d>] ? __crypto_alloc_tfm+0x3d/0x150
> [ 105.063678] [<c055e2eb>] ? __kmalloc+0x11b/0x290
> [ 105.063681] [<c068121f>] ? __crypto_alloc_tfm+0x11f/0x150
> [ 105.063683] [<c0681bcd>] ? crypto_spawn_tfm+0x3d/0x70
> [ 105.063685] [<c068f6d2>] ? crypto_cbc_init_tfm+0x22/0x40
> [ 105.063688] [<c06811de>] ? __crypto_alloc_tfm+0xde/0x150
> [ 105.063690] [<c0681bcd>] ? crypto_spawn_tfm+0x3d/0x70
> [ 105.063693] [<c0685022>] ? skcipher_geniv_init+0x22/0x40
> [ 105.063695] [<c0685edb>] ? async_chainiv_init+0x7b/0x90
> [ 105.063698] [<c06811de>] ? __crypto_alloc_tfm+0xde/0x150
> [ 105.063701] [<c068ac68>] alg_test_aead+0x48/0xa0
> [ 105.063703] [<c068992e>] ? alg_find_test+0x2e/0x60
> [ 105.063706] [<c0689a06>] alg_test+0xa6/0x270
> [ 105.063709] [<c09fb836>] ? _raw_spin_unlock_irqrestore+0x36/0x70
> [ 105.063711] [<c04a7f84>] ? trace_hardirqs_on_caller+0xf4/0x180
> [ 105.063713] [<c04a801b>] ? trace_hardirqs_on+0xb/0x10
> [ 105.063716] [<c06886c0>] ? cryptomgr_probe+0xb0/0xb0
> [ 105.063718] [<c0688701>] cryptomgr_test+0x41/0x50
> [ 105.063721] [<c046640d>] kthread+0x7d/0x90
> [ 105.063724] [<c0466390>] ? __init_kthread_worker+0x60/0x60
> [ 105.063726] [<c0a03502>] kernel_thread_helper+0x6/0x10
> [ 105.063728] note: cryptomgr_test[995] exited with preempt_count 1
^ permalink raw reply
* Re: ndo_get_stats and rtnl_netlink
From: Eric Dumazet @ 2012-09-10 19:15 UTC (permalink / raw)
To: Or Gerlitz; +Cc: Shlomo Pongartz, netdev
In-Reply-To: <CAJZOPZKKca6Yea=E9reL+x-cfvX0HwsgLAWKzjonmGwutH0MxA@mail.gmail.com>
On Mon, 2012-09-10 at 22:10 +0300, Or Gerlitz wrote:
> On Mon, Sep 10, 2012 at 12:09 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> > RTNL locking is not needed to fetch stats, and would be overkill.
> > Each driver has its own way to protect/gather its stats.
>
> FWIW, again, when dev_get_stats is called from rtnl_fill_ifinfo e.g as
> of invocation
> of "ip link show <interface>, there IS RTNL locking, is that a problem?
>
> Or.
Why should it be a problem ?
A dev_get_stats() is not allowed to sleep, so its not allowed to use
RTNL by itself.
So caller might use RTNL, we dont care at all.
^ permalink raw reply
* [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
From: Eric Dumazet @ 2012-09-10 19:22 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Larry Finger, netdev, Dave Jones
From: Eric Dumazet <edumazet@google.com>
64bit arches have a buggy r8712u driver, let's fix it.
skb->tail must be set properly or network stack behavior is undefined.
Addresses https://bugzilla.redhat.com/show_bug.cgi?id=847525
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=45071
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Dave Jones <davej@redhat.com>
Cc: stable@vger.kernel.org [2.6.37+]
---
drivers/staging/rtl8712/recv_linux.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
index 0e26d5f..495ee12 100644
--- a/drivers/staging/rtl8712/recv_linux.c
+++ b/drivers/staging/rtl8712/recv_linux.c
@@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
if (skb == NULL)
goto _recv_indicatepkt_drop;
skb->data = precv_frame->u.hdr.rx_data;
-#ifdef NET_SKBUFF_DATA_USES_OFFSET
- skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail -
- precv_frame->u.hdr.rx_head);
-#else
- skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail;
-#endif
skb->len = precv_frame->u.hdr.len;
+ skb_set_tail_pointer(skb, skb->len);
if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
^ permalink raw reply related
* Re: [PATCH] netlink: Rename pid to portid to avoid confusion
From: David Miller @ 2012-09-10 19:31 UTC (permalink / raw)
To: shemminger; +Cc: ebiederm, netdev
In-Reply-To: <20120908095441.359df1d1@s6510.linuxnetplumber.net>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Sat, 8 Sep 2012 09:54:41 -0700
> On Fri, 07 Sep 2012 23:12:54 -0700
> ebiederm@xmission.com (Eric W. Biederman) wrote:
>
>> It is a frequent mistake to confuse the netlink port identifier with a
>> process identifier. Try to reduce this confusion by renaming fields
>> that hold port identifiers portid instead of pid.
>>
>> I have carefully avoided changing the structures exported to
>> userspace to avoid changing the userspace API.
>>
>> I have successfully built an allyesconfig kernel with this change.
>>
>> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
>> ---
>
> Ok. I validated that no header file used by iproute2 is affected.
>
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH] xfrm: Report user triggered expirations against the users socket
From: David Miller @ 2012-09-10 19:34 UTC (permalink / raw)
To: jhs; +Cc: ebiederm, netdev, hadi
In-Reply-To: <504B307E.2030607@mojatatu.com>
From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: Sat, 08 Sep 2012 07:48:14 -0400
> On 12-09-08 03:17 AM, Eric W. Biederman wrote:
>> When a policy expiration is triggered from user space the request
>> travles through km_policy_expired and ultimately into
>> xfrm_exp_policy_notify which calls build_polexpire. build_polexpire
>> uses the netlink port passed to km_policy_expired as the source port
>> for
>> the netlink message it builds.
>>
>> When a state expiration is triggered from user space the request
>> travles
>> through km_state_expired and ultimately into xfrm_exp_state_notify
>> which
>> calls build_expire. build_expire uses the netlink port passed to
>> km_state_expired as the source port for the netlink message it builds.
>>
>> Pass nlh->nlmsg_pid from the user generated netlink message that
>> requested the expiration to km_policy_expired and km_state_expired
>> instead of current->pid which is not a netlink port number.
>>
>> Cc: Jamal Hadi Salim <hadi@cyberus.ca>
>> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
>>
>
> I suppose.
> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH] staging: r8712u: fix bug in r8712_recv_indicatepkt()
From: Larry Finger @ 2012-09-10 19:40 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Greg Kroah-Hartman, netdev, Dave Jones
In-Reply-To: <1347304931.1234.2017.camel@edumazet-glaptop>
On 09/10/2012 02:22 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> 64bit arches have a buggy r8712u driver, let's fix it.
>
> skb->tail must be set properly or network stack behavior is undefined.
>
> Addresses https://bugzilla.redhat.com/show_bug.cgi?id=847525
> Addresses https://bugzilla.kernel.org/show_bug.cgi?id=45071
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Dave Jones <davej@redhat.com>
> Cc: stable@vger.kernel.org [2.6.37+]
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Larry
> ---
> drivers/staging/rtl8712/recv_linux.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8712/recv_linux.c b/drivers/staging/rtl8712/recv_linux.c
> index 0e26d5f..495ee12 100644
> --- a/drivers/staging/rtl8712/recv_linux.c
> +++ b/drivers/staging/rtl8712/recv_linux.c
> @@ -117,13 +117,8 @@ void r8712_recv_indicatepkt(struct _adapter *padapter,
> if (skb == NULL)
> goto _recv_indicatepkt_drop;
> skb->data = precv_frame->u.hdr.rx_data;
> -#ifdef NET_SKBUFF_DATA_USES_OFFSET
> - skb->tail = (sk_buff_data_t)(precv_frame->u.hdr.rx_tail -
> - precv_frame->u.hdr.rx_head);
> -#else
> - skb->tail = (sk_buff_data_t)precv_frame->u.hdr.rx_tail;
> -#endif
> skb->len = precv_frame->u.hdr.len;
> + skb_set_tail_pointer(skb, skb->len);
> if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
> skb->ip_summed = CHECKSUM_UNNECESSARY;
> else
>
>
>
^ permalink raw reply
* Re: [PATCH net-next] filter: add MOD operation
From: David Miller @ 2012-09-10 19:45 UTC (permalink / raw)
To: eric.dumazet; +Cc: ak, gbakos, jschlst, netdev
In-Reply-To: <1347091415.1234.317.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 08 Sep 2012 10:03:35 +0200
> From: Eric Dumazet <edumazet@google.com>
...
> [PATCH net-next] filter: add MOD operation
>
> Add a new ALU opcode, to compute a modulus.
>
> Commit ffe06c17afbbb used an ancillary to implement XOR_X,
> but here we reserve one of the available ALU opcode to implement both
> MOD_X and MOD_K
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Suggested-by: George Bakos <gbakos@alpinista.org>
> Cc: Jay Schulist <jschlst@samba.org>
> Cc: Jiri Pirko <jpirko@redhat.com>
> Cc: Andi Kleen <ak@linux.intel.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH net-next 1/5] cnic: Add functions to allocate and free UIO rings
From: David Miller @ 2012-09-10 19:48 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1347120065-26492-1-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Sat, 8 Sep 2012 09:01:01 -0700
> These functions are needed to free up memory when the rings are no longer
> needed.
>
> Reviewed-by: Eddie Wai <eddie.wai@broadcom.com>
> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 2/5] cnic: Free UIO rings when the device is closed.
From: David Miller @ 2012-09-10 19:48 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1347120065-26492-2-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Sat, 8 Sep 2012 09:01:02 -0700
> This will free up unneeded memory.
>
> Reviewed-by: Eddie Wai <eddie.wai@broadcom.com>
> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 3/5] cnic: Add function pointers to arm IRQ for different devices.
From: David Miller @ 2012-09-10 19:48 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1347120065-26492-3-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Sat, 8 Sep 2012 09:01:03 -0700
> This will make it easier to exit IRQ loop and re-arm IRQ on devices that
> don't support FCoE.
>
> Reviewed-by: Eddie Wai <eddie.wai@broadcom.com>
> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 4/5] cnic: Allocate kcq resource only on devices that support FCoE.
From: David Miller @ 2012-09-10 19:48 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1347120065-26492-4-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Sat, 8 Sep 2012 09:01:04 -0700
> To save memory and to exit IRQ loop quicker on devices that don't support
> FCoE.
>
> Reviewed-by: Eddie Wai <eddie.wai@broadcom.com>
> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next 5/5] cnic: Allocate UIO resources only on devices that support iSCSI.
From: David Miller @ 2012-09-10 19:48 UTC (permalink / raw)
To: mchan; +Cc: netdev
In-Reply-To: <1347120065-26492-5-git-send-email-mchan@broadcom.com>
From: "Michael Chan" <mchan@broadcom.com>
Date: Sat, 8 Sep 2012 09:01:05 -0700
> Update version to 2.5.13.
>
> Reviewed-by: Eddie Wai <eddie.wai@broadcom.com>
> Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] etherdevice: introduce help function eth_zero_addr()
From: David Miller @ 2012-09-10 19:50 UTC (permalink / raw)
To: djduanjiong; +Cc: netdev
In-Reply-To: <504BFFBC.9070209@gmail.com>
From: Duan Jiong <djduanjiong@gmail.com>
Date: Sun, 09 Sep 2012 10:32:28 +0800
> a lot of code has either the memset or an inefficient copy
> from a static array that contains the all-zeros Ethernet address.
> Introduce help function eth_zero_addr() to fill an address with
> all zeros, making the code clearer and allowing us to get rid of
> some constant arrays.
>
> Signed-off-by: Duan Jiong <djduanjiong@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next] r8169: use unlimited DMA burst for TX
From: David Miller @ 2012-09-10 19:50 UTC (permalink / raw)
To: mschmidt; +Cc: netdev, romieu, hayeswang, nic_swsd, ivecera
In-Reply-To: <1347234926-5263-1-git-send-email-mschmidt@redhat.com>
From: Michal Schmidt <mschmidt@redhat.com>
Date: Mon, 10 Sep 2012 01:55:26 +0200
> The r8169 driver currently limits the DMA burst for TX to 1024 bytes. I have
> a box where this prevents the interface from using the gigabit line to its full
> potential. This patch solves the problem by setting TX_DMA_BURST to unlimited.
>
> The box has an ASRock B75M motherboard with on-board RTL8168evl/8111evl
> (XID 0c900880). TSO is enabled.
>
> I used netperf (TCP_STREAM test) to measure the dependency of TX throughput
> on MTU. I did it for three different values of TX_DMA_BURST ('5'=512, '6'=1024,
> '7'=unlimited). This chart shows the results:
> http://michich.fedorapeople.org/r8169/r8169-effects-of-TX_DMA_BURST.png
>
> Interesting points:
> - With the current DMA burst limit (1024):
> - at the default MTU=1500 I get only 842 Mbit/s.
> - when going from small MTU, the performance rises monotonically with
> increasing MTU only up to a peak at MTU=1076 (908 MBit/s). Then there's
> a sudden drop to 762 MBit/s from which the throughput rises monotonically
> again with further MTU increases.
> - With a smaller DMA burst limit (512):
> - there's a similar peak at MTU=1076 and another one at MTU=564.
> - With unlimited DMA burst:
> - at the default MTU=1500 I get nice 940 Mbit/s.
> - the throughput rises monotonically with increasing MTU with no strange
> peaks.
>
> Notice that the peaks occur at MTU sizes that are multiples of the DMA burst
> limit plus 52. Why 52? Because:
> 20 (IP header) + 20 (TCP header) + 12 (TCP options) = 52
>
> The Realtek-provided r8168 driver (v8.032.00) uses unlimited TX DMA burst too,
> except for CFG_METHOD_1 where the TX DMA burst is set to 512 bytes.
> CFG_METHOD_1 appears to be the oldest MAC version of "RTL8168B/8111B",
> i.e. RTL_GIGA_MAC_VER_11 in r8169. Not sure if this MAC version really needs
> the smaller burst limit, or if any other versions have similar requirements.
>
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
I really need Francois et al. to take a look at this before even thinking
about applying it.
^ permalink raw reply
* Re: [PATCH] caif: move the dereference below the NULL test
From: David Miller @ 2012-09-10 20:14 UTC (permalink / raw)
To: weiyj.lk; +Cc: sjur.brandeland, yongjun_wei, netdev
In-Reply-To: <CAPgLHd-MBQnrU9tS0VFw-O7yvs47r3waHqGm1SRS4GA72Pn1hg@mail.gmail.com>
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Mon, 10 Sep 2012 12:38:27 +0800
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> The dereference should be moved below the NULL test.
>
> spatch with a semantic match is used to found this.
> (http://coccinelle.lip6.fr/)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net v2] ixp4xx_hss: fix build failure due to missing linux/module.h inclusion
From: David Miller @ 2012-09-10 20:15 UTC (permalink / raw)
To: florian; +Cc: netdev, khc, joe, stable
In-Reply-To: <1347278818-6913-1-git-send-email-florian@openwrt.org>
From: Florian Fainelli <florian@openwrt.org>
Date: Mon, 10 Sep 2012 14:06:58 +0200
> Commit 36a1211970193ce215de50ed1e4e1272bc814df1 (netprio_cgroup.h:
> dont include module.h from other includes) made the following build
> error on ixp4xx_hss pop up:
>
> CC [M] drivers/net/wan/ixp4xx_hss.o
> drivers/net/wan/ixp4xx_hss.c:1412:20: error: expected ';', ',' or ')'
> before string constant
> drivers/net/wan/ixp4xx_hss.c:1413:25: error: expected ';', ',' or ')'
> before string constant
> drivers/net/wan/ixp4xx_hss.c:1414:21: error: expected ';', ',' or ')'
> before string constant
> drivers/net/wan/ixp4xx_hss.c:1415:19: error: expected ';', ',' or ')'
> before string constant
> make[8]: *** [drivers/net/wan/ixp4xx_hss.o] Error 1
>
> This was previously hidden because ixp4xx_hss includes linux/hdlc.h which
> includes linux/netdevice.h which includes linux/netprio_cgroup.h which
> used to include linux/module.h. The real issue was actually present since
> the initial commit that added this driver since it uses macros from
> linux/module.h without including this file.
>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
Applied and queued up for -stable, thanks.
^ permalink raw reply
* [PATCH net] net: qmi_wwan: call subdriver with control intf only
From: Bjørn Mork @ 2012-09-10 20:15 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Bjørn Mork
This fixes a hang on suspend due to calling wdm_suspend on
the unregistered data interface. The hang should have been
a NULL pointer reference had it not been for a logic error
in the cdc_wdm code.
commit 230718bd net: qmi_wwan: bind to both control and data interface
changed qmi_wwan to use cdc_wdm as a subdriver for devices with
a two-interface QMI/wwan function. The commit failed to update
qmi_wwan_suspend and qmi_wwan_resume, which were written to handle
either a single combined interface function, or no subdriver at all.
The result was that we called into the subdriver both when the
control interface was suspended and when the data interface was
suspended. Calling the subdriver suspend function with an
unregistered interface is not supported and will make the
subdriver bug out.
Signed-off-by: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
---
drivers/net/usb/qmi_wwan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index adfab3f..9d1679f 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -297,7 +297,7 @@ static int qmi_wwan_suspend(struct usb_interface *intf, pm_message_t message)
if (ret < 0)
goto err;
- if (info->subdriver && info->subdriver->suspend)
+ if (intf == info->control && info->subdriver && info->subdriver->suspend)
ret = info->subdriver->suspend(intf, message);
if (ret < 0)
usbnet_resume(intf);
@@ -311,7 +311,7 @@ static int qmi_wwan_resume(struct usb_interface *intf)
struct qmi_wwan_state *info = (void *)&dev->data;
int ret = 0;
- if (info->subdriver && info->subdriver->resume)
+ if (intf == info->control && info->subdriver && info->subdriver->resume)
ret = info->subdriver->resume(intf);
if (ret < 0)
goto err;
--
1.7.10.4
--
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: [PATCH 1/3] ipv6: remove some useless RCU read lock
From: David Miller @ 2012-09-10 20:31 UTC (permalink / raw)
To: amwang; +Cc: netdev
In-Reply-To: <1347281326-26890-1-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Mon, 10 Sep 2012 20:48:44 +0800
> After this commit:
> commit 97cac0821af4474ec4ba3a9e7a36b98ed9b6db88
> Author: David S. Miller <davem@davemloft.net>
> Date: Mon Jul 2 22:43:47 2012 -0700
>
> ipv6: Store route neighbour in rt6_info struct.
>
> we no longer use RCU to protect route neighbour.
>
> Cc: "David S. Miller" <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
Applied to net-next, thanks.
^ 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