All of lore.kernel.org
 help / color / mirror / Atom feed
* problem with function vlan_get_protocol()
@ 2011-07-17  3:51 jiangtao.jit
  2011-07-17  4:17 ` David Miller
  2011-07-17  4:49 ` jiangtao.jit
  0 siblings, 2 replies; 6+ messages in thread
From: jiangtao.jit @ 2011-07-17  3:51 UTC (permalink / raw)
  To: linux-kernel

Hi,all

in file   inclue/linux/if_vlan.h

there is a statement in function vlan_get_protocol()

	if (likely(protop))
		protocol = *protop;

do we need an else branch on pointer protop failed through the else is unlikely 

	if (likely(protop))
		protocol = *protop;
    else
		protocol = proto;

thanks

----------------------
2011-07-17 
jiangtao.jit 


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

* Re: problem with function vlan_get_protocol()
  2011-07-17  3:51 problem with function vlan_get_protocol() jiangtao.jit
@ 2011-07-17  4:17 ` David Miller
  2011-07-17  4:49 ` jiangtao.jit
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2011-07-17  4:17 UTC (permalink / raw)
  To: jiangtao.jit; +Cc: linux-kernel


Networking questions belong on netdev@vger.kernel.org, most of
the networking developers do not read linux-kernel

Thank you.

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

* Re: Re: problem with function vlan_get_protocol()
  2011-07-17  3:51 problem with function vlan_get_protocol() jiangtao.jit
  2011-07-17  4:17 ` David Miller
@ 2011-07-17  4:49 ` jiangtao.jit
  1 sibling, 0 replies; 6+ messages in thread
From: jiangtao.jit @ 2011-07-17  4:49 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 566 bytes --]


i'm sorry for my ignorance
thanks for your reminder
i'll post the question on netdev@vger.kernel.org then
thank you again


·¢¼þÈË£º David Miller 
·¢ËÍʱ¼ä£º 2011-07-17  12:17:23 
ÊÕ¼þÈË£º jiangtao.jit 
³­ËÍ£º linux-kernel 
Ö÷Ì⣺ Re: problem with function vlan_get_protocol() 
 
Networking questions belong on netdev@vger.kernel.org, most of
the networking developers do not read linux-kernel
Thank you.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* problem with function vlan_get_protocol()
@ 2011-07-17  4:53 jiangtao.jit
  2011-07-17  7:34 ` Francois Romieu
  2011-07-17  8:15 ` jiangtao.jit
  0 siblings, 2 replies; 6+ messages in thread
From: jiangtao.jit @ 2011-07-17  4:53 UTC (permalink / raw)
  To: netdev

Hi,all

in file   inclue/linux/if_vlan.h

there is a statement in function vlan_get_protocol()

	if (likely(protop))
		protocol = *protop;

do we need an else branch on pointer protop failed ?  through the else is unlikely 

	if (likely(protop))
		protocol = *protop;
    else
		protocol = proto;

is it necessary ?

thanks


2011-07-17 
jiangtao.jit 


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

* Re: problem with function vlan_get_protocol()
  2011-07-17  4:53 jiangtao.jit
@ 2011-07-17  7:34 ` Francois Romieu
  2011-07-17  8:15 ` jiangtao.jit
  1 sibling, 0 replies; 6+ messages in thread
From: Francois Romieu @ 2011-07-17  7:34 UTC (permalink / raw)
  To: jiangtao.jit; +Cc: netdev

jiangtao.jit <jiangtao.jit@gmail.com> :
[...]
> do we need an else branch on pointer protop failed ?  through the else is unlikely 
> 
> 	if (likely(protop))
> 		protocol = *protop;
>     else
> 		protocol = proto;
> 
> is it necessary ?

The else branch signals that skb_header_pointer uncloaked a really tiny
ethernet frame : the content of proto is not even initialized (stack
allocation), whence irrelevant. In such circumstances the default
initialization value of protocol (0) does not seem too bad.

-- 
Ueimor

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

* Re: problem with function vlan_get_protocol()
  2011-07-17  4:53 jiangtao.jit
  2011-07-17  7:34 ` Francois Romieu
@ 2011-07-17  8:15 ` jiangtao.jit
  1 sibling, 0 replies; 6+ messages in thread
From: jiangtao.jit @ 2011-07-17  8:15 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev


Thanks a lot Francois
thank you for your explanation

--
jiangtao



发件人: Francois Romieu 
发送时间: 2011-07-17  15:49:00 
收件人: jiangtao.jit 
抄送: netdev 
主题: Re: problem with function vlan_get_protocol() 
 
jiangtao.jit <jiangtao.jit@gmail.com> :
[...]
> do we need an else branch on pointer protop failed ?  through the else is unlikely 
> 
>  if (likely(protop))
>  protocol = *protop;
>     else
>  protocol = proto;
> 
> is it necessary ?
The else branch signals that skb_header_pointer uncloaked a really tiny
ethernet frame : the content of proto is not even initialized (stack
allocation), whence irrelevant. In such circumstances the default
initialization value of protocol (0) does not seem too bad.
-- 
Ueimor

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

end of thread, other threads:[~2011-07-17  8:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-17  3:51 problem with function vlan_get_protocol() jiangtao.jit
2011-07-17  4:17 ` David Miller
2011-07-17  4:49 ` jiangtao.jit
  -- strict thread matches above, loose matches on Subject: below --
2011-07-17  4:53 jiangtao.jit
2011-07-17  7:34 ` Francois Romieu
2011-07-17  8:15 ` jiangtao.jit

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.