All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next PATCH] net: dcb: add CEE notify calls
@ 2012-04-20 19:49 John Fastabend
  2012-04-23 12:51 ` Shmulik Ravid
  2012-04-24 12:56 ` Shmulik Ravid
  0 siblings, 2 replies; 7+ messages in thread
From: John Fastabend @ 2012-04-20 19:49 UTC (permalink / raw)
  To: davem; +Cc: netdev, eilong, amirv

This adds code to trigger CEE events when an APP change or setall
command is made from user space. This simplifies user space code
significantly by creating a single interface to listen on that
works with both firmware and userland agents.

And if we end up with multiple agents this keeps every thing in
sync userland agents, firmware agents, and kernel notifier consumers.

For an example agent that listens for these events see:

https://github.com/jrfastab/cgdcbxd

cgdcbxd is a daemon used to monitor DCB netlink events and manage
the net_prio control group sub-system.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---

 net/dcb/dcbnl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 8dfa1da..656c7c7 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -704,6 +704,7 @@ static int dcbnl_setapp(struct net_device *netdev, struct nlattr **tb,
 
 	ret = dcbnl_reply(err, RTM_SETDCB, DCB_CMD_SAPP, DCB_ATTR_APP,
 			  pid, seq, flags);
+	dcbnl_cee_notify(netdev, RTM_SETDCB, DCB_CMD_SAPP, seq, 0);
 out:
 	return ret;
 }
@@ -936,6 +937,7 @@ static int dcbnl_setall(struct net_device *netdev, struct nlattr **tb,
 
 	ret = dcbnl_reply(netdev->dcbnl_ops->setall(netdev), RTM_SETDCB,
 	                  DCB_CMD_SET_ALL, DCB_ATTR_SET_ALL, pid, seq, flags);
+	dcbnl_cee_notify(netdev, RTM_SETDCB, DCB_CMD_SET_ALL, seq, 0);
 
 	return ret;
 }

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [net-next PATCH] net: dcb: add CEE notify calls
  2012-04-20 19:49 [net-next PATCH] net: dcb: add CEE notify calls John Fastabend
@ 2012-04-23 12:51 ` Shmulik Ravid
  2012-04-23 13:36   ` John Fastabend
  2012-04-24 12:56 ` Shmulik Ravid
  1 sibling, 1 reply; 7+ messages in thread
From: Shmulik Ravid @ 2012-04-23 12:51 UTC (permalink / raw)
  To: John Fastabend; +Cc: davem, netdev, eilong, amirv

> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
> 
>  net/dcb/dcbnl.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
> index 8dfa1da..656c7c7 100644
> --- a/net/dcb/dcbnl.c
> +++ b/net/dcb/dcbnl.c
> @@ -704,6 +704,7 @@ static int dcbnl_setapp(struct net_device *netdev, struct nlattr **tb,
>  
>  	ret = dcbnl_reply(err, RTM_SETDCB, DCB_CMD_SAPP, DCB_ATTR_APP,
>  			  pid, seq, flags);
> +	dcbnl_cee_notify(netdev, RTM_SETDCB, DCB_CMD_SAPP, seq, 0);
>  out:
>  	return ret;
>  }
> @@ -936,6 +937,7 @@ static int dcbnl_setall(struct net_device *netdev, struct nlattr **tb,
>  
>  	ret = dcbnl_reply(netdev->dcbnl_ops->setall(netdev), RTM_SETDCB,
>  	                  DCB_CMD_SET_ALL, DCB_ATTR_SET_ALL, pid, seq, flags);
> +	dcbnl_cee_notify(netdev, RTM_SETDCB, DCB_CMD_SET_ALL, seq, 0);
>  
>  	return ret;
>  }
> 

In case of a FW DCBx agent these notification could be a bit confusing.
In this case, the dcbnl_setxxx operations are used to set the initial
negotiation parameters. dcbnl_setall triggers the negotiation and some
time after that the FW DCBx agent driver should send a notification with
the newly negotiated values. The notifications sent form within the set
operations will return the current negotiated values which may very soon
change. If we want to keep the user mode code simple and unified maybe
we should send these notifications only if the DCBx agent is host based.

Shmulik 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net-next PATCH] net: dcb: add CEE notify calls
  2012-04-23 12:51 ` Shmulik Ravid
@ 2012-04-23 13:36   ` John Fastabend
  2012-04-23 17:00     ` Shmulik Ravid
  0 siblings, 1 reply; 7+ messages in thread
From: John Fastabend @ 2012-04-23 13:36 UTC (permalink / raw)
  To: Shmulik Ravid; +Cc: davem, netdev, eilong, amirv

On 4/23/2012 5:51 AM, Shmulik Ravid wrote:
>> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
>> ---
>>
>>  net/dcb/dcbnl.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
>> index 8dfa1da..656c7c7 100644
>> --- a/net/dcb/dcbnl.c
>> +++ b/net/dcb/dcbnl.c
>> @@ -704,6 +704,7 @@ static int dcbnl_setapp(struct net_device *netdev, struct nlattr **tb,
>>  
>>  	ret = dcbnl_reply(err, RTM_SETDCB, DCB_CMD_SAPP, DCB_ATTR_APP,
>>  			  pid, seq, flags);
>> +	dcbnl_cee_notify(netdev, RTM_SETDCB, DCB_CMD_SAPP, seq, 0);
>>  out:
>>  	return ret;
>>  }
>> @@ -936,6 +937,7 @@ static int dcbnl_setall(struct net_device *netdev, struct nlattr **tb,
>>  
>>  	ret = dcbnl_reply(netdev->dcbnl_ops->setall(netdev), RTM_SETDCB,
>>  	                  DCB_CMD_SET_ALL, DCB_ATTR_SET_ALL, pid, seq, flags);
>> +	dcbnl_cee_notify(netdev, RTM_SETDCB, DCB_CMD_SET_ALL, seq, 0);
>>  
>>  	return ret;
>>  }
>>
> 
> In case of a FW DCBx agent these notification could be a bit confusing.
> In this case, the dcbnl_setxxx operations are used to set the initial
> negotiation parameters. dcbnl_setall triggers the negotiation and some
> time after that the FW DCBx agent driver should send a notification with
> the newly negotiated values. The notifications sent form within the set
> operations will return the current negotiated values which may very soon
> change. If we want to keep the user mode code simple and unified maybe
> we should send these notifications only if the DCBx agent is host based.
> 
> Shmulik 
> 

No. We want all the firmware agents and host based agents to look the
same from the application. The situation you described is exactly the
same for user space as in firmware. The DCBx state machine starts and may
call dcbnl_setxxx with initial (local) values. At some later point these
may change (possibly because of negotiation with a peer) and we need to
call dcbnl_setxxx again.

I don't see how this complicates any user mode code? Presumably the agent
is listening to DCBx events because it really wants to know the current
state of DCBx. It seems to me skipping notifications will actually cause
more issues this results in the hardware being in some state that did not
trigger any events and the agent will now be out of sync. This is the
problem I am trying to solve.

btw with this patch we can remove the notify calls in bnx2x.

.John

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net-next PATCH] net: dcb: add CEE notify calls
  2012-04-23 17:00     ` Shmulik Ravid
@ 2012-04-23 16:12       ` John Fastabend
  0 siblings, 0 replies; 7+ messages in thread
From: John Fastabend @ 2012-04-23 16:12 UTC (permalink / raw)
  To: Shmulik Ravid; +Cc: davem, netdev, eilong, amirv

On 4/23/2012 10:00 AM, Shmulik Ravid wrote:
> 
>> No. We want all the firmware agents and host based agents to look the
>> same from the application. The situation you described is exactly the
>> same for user space as in firmware. The DCBx state machine starts and may
>> call dcbnl_setxxx with initial (local) values. At some later point these
>> may change (possibly because of negotiation with a peer) and we need to
>> call dcbnl_setxxx again.
>>
>> I don't see how this complicates any user mode code? Presumably the agent
>> is listening to DCBx events because it really wants to know the current
>> state of DCBx. It seems to me skipping notifications will actually cause
>> more issues this results in the hardware being in some state that did not
>> trigger any events and the agent will now be out of sync. This is the
>> problem I am trying to solve.
>>
>> btw with this patch we can remove the notify calls in bnx2x.
>>
>> .John
>>
> OK, I see.
>>From a user mode application monitoring the netlink notification you get
> successive updates each indicating the current valid negotiated
> parameters (and HW state) and that's fine.
> However I don't see how you can remove the notification call form the
> bnx2x. When the FW DCBx agent decides to change the negotiated
> parameters (perhaps in response to a peer request), it alerts the driver
> which configures the HW and then needs to somehow notify the user about
> the newly negotiated parameters.
> 

You are right here. I guess only the notify call after setapp can be removed.
Can you ACK the patch to indicate this addresses your concerns?

.John

> Shmulik  
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net-next PATCH] net: dcb: add CEE notify calls
  2012-04-23 13:36   ` John Fastabend
@ 2012-04-23 17:00     ` Shmulik Ravid
  2012-04-23 16:12       ` John Fastabend
  0 siblings, 1 reply; 7+ messages in thread
From: Shmulik Ravid @ 2012-04-23 17:00 UTC (permalink / raw)
  To: John Fastabend; +Cc: davem, netdev, eilong, amirv


> No. We want all the firmware agents and host based agents to look the
> same from the application. The situation you described is exactly the
> same for user space as in firmware. The DCBx state machine starts and may
> call dcbnl_setxxx with initial (local) values. At some later point these
> may change (possibly because of negotiation with a peer) and we need to
> call dcbnl_setxxx again.
> 
> I don't see how this complicates any user mode code? Presumably the agent
> is listening to DCBx events because it really wants to know the current
> state of DCBx. It seems to me skipping notifications will actually cause
> more issues this results in the hardware being in some state that did not
> trigger any events and the agent will now be out of sync. This is the
> problem I am trying to solve.
> 
> btw with this patch we can remove the notify calls in bnx2x.
> 
> .John
> 
OK, I see.
>From a user mode application monitoring the netlink notification you get
successive updates each indicating the current valid negotiated
parameters (and HW state) and that's fine.
However I don't see how you can remove the notification call form the
bnx2x. When the FW DCBx agent decides to change the negotiated
parameters (perhaps in response to a peer request), it alerts the driver
which configures the HW and then needs to somehow notify the user about
the newly negotiated parameters.

Shmulik  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net-next PATCH] net: dcb: add CEE notify calls
  2012-04-20 19:49 [net-next PATCH] net: dcb: add CEE notify calls John Fastabend
  2012-04-23 12:51 ` Shmulik Ravid
@ 2012-04-24 12:56 ` Shmulik Ravid
  2012-04-25 23:47   ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Shmulik Ravid @ 2012-04-24 12:56 UTC (permalink / raw)
  To: John Fastabend; +Cc: davem, netdev, eilong, amirv


On Fri, 2012-04-20 at 12:49 -0700, John Fastabend wrote:
> This adds code to trigger CEE events when an APP change or setall
> command is made from user space. This simplifies user space code
> significantly by creating a single interface to listen on that
> works with both firmware and userland agents.
> 
> And if we end up with multiple agents this keeps every thing in
> sync userland agents, firmware agents, and kernel notifier consumers.
> 
> For an example agent that listens for these events see:
> 
> https://github.com/jrfastab/cgdcbxd
> 
> cgdcbxd is a daemon used to monitor DCB netlink events and manage
> the net_prio control group sub-system.
> 
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
> 

Acked-by: Shmulik Ravid <shmulikr@broadcom.com>

Thanks John,

Shmulik 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [net-next PATCH] net: dcb: add CEE notify calls
  2012-04-24 12:56 ` Shmulik Ravid
@ 2012-04-25 23:47   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2012-04-25 23:47 UTC (permalink / raw)
  To: shmulikr; +Cc: john.r.fastabend, netdev, eilong, amirv

From: "Shmulik Ravid" <shmulikr@broadcom.com>
Date: Tue, 24 Apr 2012 15:56:19 +0300

> 
> On Fri, 2012-04-20 at 12:49 -0700, John Fastabend wrote:
>> This adds code to trigger CEE events when an APP change or setall
>> command is made from user space. This simplifies user space code
>> significantly by creating a single interface to listen on that
>> works with both firmware and userland agents.
>> 
>> And if we end up with multiple agents this keeps every thing in
>> sync userland agents, firmware agents, and kernel notifier consumers.
>> 
>> For an example agent that listens for these events see:
>> 
>> https://github.com/jrfastab/cgdcbxd
>> 
>> cgdcbxd is a daemon used to monitor DCB netlink events and manage
>> the net_prio control group sub-system.
>> 
>> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
>> ---
>> 
> 
> Acked-by: Shmulik Ravid <shmulikr@broadcom.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-25 23:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20 19:49 [net-next PATCH] net: dcb: add CEE notify calls John Fastabend
2012-04-23 12:51 ` Shmulik Ravid
2012-04-23 13:36   ` John Fastabend
2012-04-23 17:00     ` Shmulik Ravid
2012-04-23 16:12       ` John Fastabend
2012-04-24 12:56 ` Shmulik Ravid
2012-04-25 23:47   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.