Discussion of the implementations of VIRTIO specification
 help / color / mirror / Atom feed
From: "Samudrala, Sridhar" <sridhar.samudrala@intel.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: stephen@networkplumber.org, davem@davemloft.net,
	netdev@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	virtio-dev@lists.oasis-open.org, jesse.brandeburg@intel.com,
	alexander.h.duyck@intel.com, kubakici@wp.pl, jasowang@redhat.com,
	loseweigh@gmail.com, jiri@resnulli.us
Subject: [virtio-dev] Re: [PATCH v7 net-next 2/4] net: Introduce generic failover module
Date: Mon, 23 Apr 2018 10:21:45 -0700	[thread overview]
Message-ID: <c252fc18-51fb-e92c-c37b-55e91b42fdbc@intel.com> (raw)
In-Reply-To: <20180422200259-mutt-send-email-mst@kernel.org>

On 4/22/2018 10:06 AM, Michael S. Tsirkin wrote:
> On Thu, Apr 19, 2018 at 06:42:02PM -0700, Sridhar Samudrala wrote:
>> +#if IS_ENABLED(CONFIG_NET_FAILOVER)
>> +
>> +int failover_create(struct net_device *standby_dev,
>> +		    struct failover **pfailover);
> Should we rename all these structs net_failover?
> It's possible to extend the concept to storage I think.

We could, the only downside is that the names become longer. i think we need
to change the filenames and the function names also to be consistent.


>
>> +void failover_destroy(struct failover *failover);
>> +
>> +int failover_register(struct net_device *standby_dev, struct failover_ops *ops,
>> +		      struct failover **pfailover);
>> +void failover_unregister(struct failover *failover);
>> +
>> +int failover_slave_unregister(struct net_device *slave_dev);
>> +
>> +#else
>> +
>> +static inline
>> +int failover_create(struct net_device *standby_dev,
>> +		    struct failover **pfailover);
>> +{
>> +	return 0;
> Does this make callers do something sane?
> Shouldn't these return an error?

Yes. i think i should return -EOPNOTSUPP here, so that we fail
when CONFIG_NET_FAILOVER is not enabled and the virtio-net driver is trying
to create a failover device.


>> +}
>> +
>> +static inline
>> +void failover_destroy(struct failover *failover)
>> +{
>> +}
>> +
>> +static inline
>> +int failover_register(struct net_device *standby_dev, struct failover_ops *ops,
>> +		      struct pfailover **pfailover);
>> +{
>> +	return 0;
>> +}
> struct pfailover seems like a typo.

yes. will also change the return to -EOPNOTSUPP

>
>> +
>> +static inline
>> +void failover_unregister(struct failover *failover)
>> +{
>> +}
>> +
>> +static inline
>> +int failover_slave_unregister(struct net_device *slave_dev)
>> +{
>> +	return 0;
>> +}
> Does anyone test return value of unregister?
> should this be void?

yes. can be changed to void.


>
>> +
>> +#endif
>> +
>> +#endif /* _NET_FAILOVER_H */


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


  reply	other threads:[~2018-04-23 17:21 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20  1:42 [virtio-dev] [PATCH net-next v7 0/4] Enable virtio_net to act as a standby for a passthru device Sridhar Samudrala
2018-04-20  1:42 ` [virtio-dev] [PATCH v7 net-next 1/4] virtio_net: Introduce VIRTIO_NET_F_STANDBY feature bit Sridhar Samudrala
2018-04-20  1:42 ` [virtio-dev] [PATCH v7 net-next 2/4] net: Introduce generic failover module Sridhar Samudrala
2018-04-20  2:44   ` [virtio-dev] " Michael S. Tsirkin
2018-04-20 15:21     ` Samudrala, Sridhar
2018-04-20 15:34       ` Michael S. Tsirkin
2018-04-20 15:56         ` Alexander Duyck
2018-04-20 16:03           ` Michael S. Tsirkin
2018-04-20  3:34   ` Michael S. Tsirkin
2018-04-22 17:06   ` Michael S. Tsirkin
2018-04-23 17:21     ` Samudrala, Sridhar [this message]
2018-04-20  1:42 ` [virtio-dev] [PATCH v7 net-next 3/4] virtio_net: Extend virtio to use VF datapath when available Sridhar Samudrala
2018-04-20  2:46   ` [virtio-dev] " Michael S. Tsirkin
2018-04-20  1:42 ` [virtio-dev] [PATCH v7 net-next 4/4] netvsc: refactor notifier/event handling code to use the failover framework Sridhar Samudrala
     [not found]   ` <20180420082802.6ca37e4c@xeon-e3>
2018-04-20 15:43     ` [virtio-dev] " Michael S. Tsirkin
2018-04-20 15:46     ` Samudrala, Sridhar
     [not found]     ` <20180420160058.GB2150@nanopsycho.orion>
     [not found]       ` <20180423100406.71b95f74@xeon-e3>
2018-04-23 17:24         ` Michael S. Tsirkin
     [not found]           ` <20180423104440.2fe6cfd2@xeon-e3>
2018-04-23 17:56             ` Michael S. Tsirkin
2018-04-23 19:44               ` Siwei Liu
2018-04-23 20:06                 ` Michael S. Tsirkin
2018-04-25 21:38                   ` Siwei Liu
2018-04-25 22:22                     ` Michael S. Tsirkin
2018-04-25 22:57                       ` Siwei Liu
2018-04-26  2:28                         ` Michael S. Tsirkin
2018-04-26 22:14                           ` Siwei Liu
2018-04-26 23:42                             ` Michael S. Tsirkin
2018-04-28  0:43                               ` Siwei Liu
     [not found]                         ` <20180425171831.785f412b@xeon-e3>
2018-04-26  2:43                           ` Michael S. Tsirkin
     [not found]                 ` <20180423182503.353180c9@xeon-e3>
2018-04-24  1:42                   ` Michael S. Tsirkin

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=c252fc18-51fb-e92c-c37b-55e91b42fdbc@intel.com \
    --to=sridhar.samudrala@intel.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=jasowang@redhat.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=jiri@resnulli.us \
    --cc=kubakici@wp.pl \
    --cc=loseweigh@gmail.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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