From: Jiri Pirko <jpirko@redhat.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: netdev@vger.kernel.org
Subject: Re: [patch net-next 2/6] net: make vlan ndo_vlan_rx_[add/kill]_vid return error value
Date: Fri, 9 Dec 2011 11:41:40 +0100 [thread overview]
Message-ID: <20111209104139.GA2193@minipsycho.brq.redhat.com> (raw)
In-Reply-To: <87iplqfgcz.fsf@rustcorp.com.au>
Fri, Dec 09, 2011 at 06:45:16AM CET, rusty@rustcorp.com.au wrote:
>On Thu, 8 Dec 2011 15:11:16 +0100, Jiri Pirko <jpirko@redhat.com> wrote:
>> Let caller know the result of adding/removing vlan id to/from vlan
>> filter.
>>
>> In some drivers I make those functions to just return 0. But in those
>> where there is able to see if hw setup went correctly, return value is
>> set appropriately.
>...
>> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
>> index 5a96172..609c51f 100644
>> --- a/drivers/net/virtio_net.c
>> +++ b/drivers/net/virtio_net.c
>> @@ -855,7 +855,7 @@ static void virtnet_set_rx_mode(struct net_device *dev)
>> kfree(buf);
>> }
>>
>> -static void virtnet_vlan_rx_add_vid(struct net_device *dev, u16 vid)
>> +static int virtnet_vlan_rx_add_vid(struct net_device *dev, u16 vid)
>> {
>> struct virtnet_info *vi = netdev_priv(dev);
>> struct scatterlist sg;
>> @@ -865,9 +865,10 @@ static void virtnet_vlan_rx_add_vid(struct net_device *dev, u16 vid)
>> if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN,
>> VIRTIO_NET_CTRL_VLAN_ADD, &sg, 1, 0))
>> dev_warn(&dev->dev, "Failed to add VLAN ID %d.\n", vid);
>> + return 0;
>> }
>>
>> -static void virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid)
>> +static int virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid)
>> {
>> struct virtnet_info *vi = netdev_priv(dev);
>> struct scatterlist sg;
>> @@ -877,6 +878,7 @@ static void virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid)
>> if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN,
>> VIRTIO_NET_CTRL_VLAN_DEL, &sg, 1, 0))
>> dev_warn(&dev->dev, "Failed to kill VLAN ID %d.\n", vid);
>> + return 0;
>> }
>
>Hmm, see that virtnet_send_command? That's what you're after. You
>could even replace the dev_warn(), if you're doing something more useful
>with the result.
I was not sure what value to return here so I let that be as it was.
Feel free to post follow-up.
Thanks
Jirka
>
>Thanks,
>Rusty.
prev parent reply other threads:[~2011-12-09 10:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-08 14:11 [patch net-next 0/6] vlan: introduce per-device vlan id list Jiri Pirko
2011-12-08 14:11 ` [patch net-next 1/6] vlan: rename vlan_dev_info to vlan_dev_priv Jiri Pirko
2011-12-08 14:11 ` [patch net-next 3/6] net: introduce vlan_vid_[add/del] and use them instead of direct [add/kill]_vid ndo calls Jiri Pirko
2011-12-08 14:11 ` [patch net-next 4/6] vlan: introduce vid list with reference counting Jiri Pirko
2011-12-08 14:11 ` [patch net-next 5/6] vlan: introduce functions to do mass addition/deletion of vids by another device Jiri Pirko
2011-12-08 14:11 ` [patch net-next 6/6] team: use vlan_vids_[addr/del]_by_dev Jiri Pirko
2011-12-09 0:53 ` [patch net-next 0/6] vlan: introduce per-device vlan id list David Miller
[not found] ` <1323353480-1900-3-git-send-email-jpirko@redhat.com>
[not found] ` <87iplqfgcz.fsf@rustcorp.com.au>
2011-12-09 10:41 ` Jiri Pirko [this message]
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=20111209104139.GA2193@minipsycho.brq.redhat.com \
--to=jpirko@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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).