[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ethmac] control frame address check issue



i agree with you, just that the quoted example is not really correct:
    48'h0180C2000001 (control addr)
    48'h00123456789a (MAC     addr) 
    48'h008034007801 (ingress addr) should be 48'h0080C4000801

by the way, do you suspect that rxaddrcheck.v has errors as well?
it seems that the last byte of DA will never be checked because both 
RxAbort and UniCastOK are updated synchronously at ByteCntEq7. So 
if first 5 DA bytes are matched while the last DA byte is mis-matched, 
RxAbort will never detect that.

below shows some related codes from rxaddrcheck.v:

assign RxAddressInvalid = ~(UnicastOK | BroadcastOK | MulticastOK | 
r_Pro);
......
......
  else if(RxAddressInvalid & ByteCntEq7 & RxCheckEn)
    RxAbort <= #Tp 1'b1;
......
......
if(RxCheckEn & ByteCntEq7)
    UnicastOK <= #Tp ( RxData[7:0] == MAC[7:0])   & UnicastOK;



 
----- Original Message ----- 
From: yisonglin@s...  
To: ethmac@o...  
Date: Tue, 18 Feb 2003 10:45:02 -0100 
Subject: [ethmac] control frame address check issue 

> 
> 
> I think I find a bug. 
> Please see eth_receivecontrol.v,section about AddressOk. 
> If DA is 48'h0180C2000001 or local MAC address,it is a valid 
> control 
> frame. 
> Think of the following exmple: 
> Suppose the local MAC address is 48'h00123456789a,But if the 
> ingressive DA is 48'h008034007801. 
> AddressOk is asserted!  Isn't is? 
> We need to check the reserved multicast address and the local MAC 
> address individually. 
> 
> The following code will fix this bug. 
> 
> ////////////////////////////////////////////////////////////////// 
> //RMAddrOk:Reserved Multicast address OK 
> // 
> always @ (posedge MRxClk or posedge RxReset) 
> begin 
>   if(RxReset) 
>     begin 
>     	RMAddrOk    <= #Tp 1'b0; 
>     	LocalAddrOk <= #Tp 1'b0; 
>     	AddressOK   <= #Tp 1'b0; 
>     end 
>   else 
>   if(DetectionWindow & ByteCntEq0) 
>     begin 
>     	RMAddrOk    <= #Tp RxData[7:0] == ReservedMulticast
[47:40]; 
>     	LocalAddrOk <= #Tp RxData[7:0] == MAC[47:40]; 
>     end 
>   else 
>   if(DetectionWindow & ByteCntEq1) 
>     begin 
>     	RMAddrOk    <= #Tp RxData[7:0] == ReservedMulticast
[39:32] 
> & RMAddrOk; 
>     	LocalAddrOk <= #Tp RxData[7:0] == MAC[39:32] & 
> LocalAddrOk; 
>     end 
>   else 
>   if(DetectionWindow & ByteCntEq2) 
>     begin 
>     	RMAddrOk    <= #Tp RxData[7:0] == ReservedMulticast
[31:24] 
> & RMAddrOk; 
>     	LocalAddrOk <= #Tp RxData[7:0] == MAC[31:24] & 
> LocalAddrOk; 
>     end 
>   else 
>   if(DetectionWindow & ByteCntEq3) 
>     begin 
>     	RMAddrOk    <= #Tp RxData[7:0] == ReservedMulticast
[23:16] 
> & RMAddrOk; 
>     	LocalAddrOk <= #Tp RxData[7:0] == MAC[23:16] & 
> LocalAddrOk; 
>     end 
>   else 
>   if(DetectionWindow & ByteCntEq4) 
>     begin 
>     	RMAddrOk    <= #Tp RxData[7:0] == ReservedMulticast
[15:8] 
> & RMAddrOk; 
>     	LocalAddrOk <= #Tp RxData[7:0] == MAC[15:8] & 
> LocalAddrOk; 
>     end 
>   else 
>   if(DetectionWindow & ByteCntEq5) 
>     begin 
>     	RMAddrOk    <= #Tp RxData[7:0] == ReservedMulticast[7:0] 
> & 
> RMAddrOk; 
>     	LocalAddrOk <= #Tp RxData[7:0] == MAC[7:0] & 
> LocalAddrOk; 
>     	AddressOK   <= #Tp RxData[7:0] == ReservedMulticast[7:0] 
> & 
> RMAddrOk  | RxData[7:0] == MAC[7:0] & LocalAddrOk; 
>     end 
>   else 
>   if(ReceiveEnd) 
>     begin 
>     	RMAddrOk    <= #Tp 1'b0; 
>     	LocalAddrOk <= #Tp 1'b0; 
>     	AddressOK   <= #Tp 1'b0; 
>     end 
> end 
> 
--
To unsubscribe from ethmac mailing list please visit http://www.opencores.org/mailinglists.shtml