From: David L Stevens <david.stevens@oracle.com>
To: Sowmini Varadhan <sowmini.varadhan@oracle.com>,
davem@davemloft.net, raghuram.kothakota@oracle.com
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/2] sunvnet: vnet_start_xmit() must hold a refcnt on port.
Date: Wed, 01 Oct 2014 15:06:12 -0400 [thread overview]
Message-ID: <542C50A4.30304@oracle.com> (raw)
In-Reply-To: <20141001185622.GI17706@oracle.com>
On 10/01/2014 02:56 PM, Sowmini Varadhan wrote:
> - list_for_each_entry(port, &vp->port_list, list) {
> - if (!port->switch_port)
> - continue;
> - if (!port_is_up(port))
> - continue;
> + port = vp->switch_port;
> + if (port != NULL && port_is_up(port)) {
> + vnet_hold(port);
> return port;
> }
> return NULL;
This "vp->switch_port" addition doesn't appear to be related to the port refcnt
change, and doesn't allow for multiple switch ports.
+-DLS
> @@ -1581,10 +1621,12 @@ static int vnet_port_probe(struct vio_dev *vdev, const struct vio_device_id *id)
> port->switch_port = switch_port;
>
> spin_lock_irqsave(&vp->lock, flags);
> - if (switch_port)
> + if (switch_port) {
> + vp->switch_port = port;
> list_add(&port->list, &vp->port_list);
...and here.
> - else
> + } else {
> list_add_tail(&port->list, &vp->port_list);
> + }
> hlist_add_head(&port->hash, &vp->port_hash[vnet_hashfn(port->raddr)]);
> spin_unlock_irqrestore(&vp->lock, flags);
>
> @@ -1631,11 +1673,14 @@ static int vnet_port_remove(struct vio_dev *vdev)
> */
> spin_lock_irqsave(&vp->lock, flags);
> port->flags |= VNET_PORT_DEAD;
> + if (port->switch_port)
> + vp->switch_port = NULL;
> list_del(&port->list);
> hlist_del(&port->hash);
..and here.
next prev parent reply other threads:[~2014-10-01 19:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 18:56 [PATCH net-next 2/2] sunvnet: vnet_start_xmit() must hold a refcnt on port Sowmini Varadhan
2014-10-01 19:05 ` Eric Dumazet
2014-10-01 19:44 ` Sowmini Varadhan
2014-10-01 20:15 ` Eric Dumazet
2014-10-01 20:19 ` Sowmini Varadhan
2014-10-01 20:24 ` David Miller
2014-10-01 19:06 ` David L Stevens [this message]
2014-10-01 19:23 ` Sowmini Varadhan
2014-10-01 19:31 ` David L Stevens
2014-10-01 19:52 ` David Miller
2014-10-02 3:36 ` Raghuram Kothakota
2014-10-02 3:23 ` Raghuram Kothakota
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=542C50A4.30304@oracle.com \
--to=david.stevens@oracle.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=raghuram.kothakota@oracle.com \
--cc=sowmini.varadhan@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).