Forum Topic - Udp packet lost: Page 2 of 3 (51 Items)
   
Re: Udp packet lost  
I find excerpt of pcnet driver

/*
 * pcn_intr:
 *
 *	Interrupt service routine.
 */
static int
pcn_intr(void *arg)
{
	struct pcn_softc *sc = arg;
	struct ifnet *ifp = &sc->sc_ethercom.ec_if;
	uint32_t csr0;
	int wantinit, handled = 0;

	for (wantinit = 0; wantinit == 0;) {
		csr0 = pcn_csr_read(sc, LE_CSR0);
		if ((csr0 & LE_C0_INTR) == 0)
			break;

#if NRND > 0
		if (RND_ENABLED(&sc->rnd_source))
			rnd_add_uint32(&sc->rnd_source, csr0);
#endif

		/* ACK the bits and re-enable interrupts. */
		pcn_csr_write(sc, LE_CSR0, csr0 &
		    (LE_C0_INEA|LE_C0_BABL|LE_C0_MISS|LE_C0_MERR|LE_C0_RINT|
		     LE_C0_TINT|LE_C0_IDON));

		handled = 1;

		if (csr0 & LE_C0_RINT) {
			PCN_EVCNT_INCR(&sc->sc_ev_rxintr);
			wantinit = pcn_rxintr(sc);
		}

		if (csr0 & LE_C0_TINT) {
			PCN_EVCNT_INCR(&sc->sc_ev_txintr);
			pcn_txintr(sc);
		}

		if (csr0 & LE_C0_ERR) {
			if (csr0 & LE_C0_BABL) {
				PCN_EVCNT_INCR(&sc->sc_ev_babl);
				ifp->if_oerrors++;
			}
			if (csr0 & LE_C0_MISS) {
				PCN_EVCNT_INCR(&sc->sc_ev_miss);
				ifp->if_ierrors++;
			}
			if (csr0 & LE_C0_MERR) {
				PCN_EVCNT_INCR(&sc->sc_ev_merr);
				printf("%s: memory error\n",
				    sc->sc_dev.dv_xname);
				wantinit = 1;
				break;
			}
		}

		if ((csr0 & LE_C0_RXON) == 0) {
			printf("%s: receiver disabled\n",
			    sc->sc_dev.dv_xname);
			ifp->if_ierrors++;
			wantinit = 1;
		}

		if ((csr0 & LE_C0_TXON) == 0) {
			printf("%s: transmitter disabled\n",
			    sc->sc_dev.dv_xname);
			ifp->if_oerrors++;
			wantinit = 1;
		}
	}

	if (handled) {
		if (wantinit)
			pcn_init(ifp);

		/* Try to get more packets going. */
#ifdef __QNXNTO__
                NW_SIGLOCK(&ifp->if_snd_ex, iopkt_selfp);
#endif
		pcn_start(ifp);
	}

	return (handled);
}




*******************************************************
There is place in driver when "pcnet memory error" occur

			if (csr0 & LE_C0_MERR) {
				PCN_EVCNT_INCR(&sc->sc_ev_merr);
				printf("%s: memory error\n",
				    sc->sc_dev.dv_xname);
				wantinit = 1;
				break;
			}



Re: Udp packet lost  
Oleg Gopov wrote:
> I find excerpt of pcnet driver
>
> /*
>   * pcn_intr:
>   *
>   *	Interrupt service routine.
>   */
> static int
> pcn_intr(void *arg)
> {
> 	struct pcn_softc *sc = arg;
> 	struct ifnet *ifp = &sc->sc_ethercom.ec_if;
> 	uint32_t csr0;
> 	int wantinit, handled = 0;
>
> 	for (wantinit = 0; wantinit == 0;) {
> 		csr0 = pcn_csr_read(sc, LE_CSR0);
> 		if ((csr0 & LE_C0_INTR) == 0)
> 			break;
>
> #if NRND > 0
> 		if (RND_ENABLED(&sc->rnd_source))
> 			rnd_add_uint32(&sc->rnd_source, csr0);
> #endif
>
> 		/* ACK the bits and re-enable interrupts. */
> 		pcn_csr_write(sc, LE_CSR0, csr0 &
> 		    (LE_C0_INEA|LE_C0_BABL|LE_C0_MISS|LE_C0_MERR|LE_C0_RINT|
> 		     LE_C0_TINT|LE_C0_IDON));
>
> 		handled = 1;
>
> 		if (csr0 & LE_C0_RINT) {
> 			PCN_EVCNT_INCR(&sc->sc_ev_rxintr);
> 			wantinit = pcn_rxintr(sc);
> 		}
>
> 		if (csr0 & LE_C0_TINT) {
> 			PCN_EVCNT_INCR(&sc->sc_ev_txintr);
> 			pcn_txintr(sc);
> 		}
>
> 		if (csr0 & LE_C0_ERR) {
> 			if (csr0 & LE_C0_BABL) {
> 				PCN_EVCNT_INCR(&sc->sc_ev_babl);
> 				ifp->if_oerrors++;
> 			}
> 			if (csr0 & LE_C0_MISS) {
> 				PCN_EVCNT_INCR(&sc->sc_ev_miss);
> 				ifp->if_ierrors++;
> 			}
> 			if (csr0 & LE_C0_MERR) {
> 				PCN_EVCNT_INCR(&sc->sc_ev_merr);
> 				printf("%s: memory error\n",
> 				    sc->sc_dev.dv_xname);
> 				wantinit = 1;
> 				break;
> 			}
> 		}
>
> 		if ((csr0 & LE_C0_RXON) == 0) {
> 			printf("%s: receiver disabled\n",
> 			    sc->sc_dev.dv_xname);
> 			ifp->if_ierrors++;
> 			wantinit = 1;
> 		}
>
> 		if ((csr0 & LE_C0_TXON) == 0) {
> 			printf("%s: transmitter disabled\n",
> 			    sc->sc_dev.dv_xname);
> 			ifp->if_oerrors++;
> 			wantinit = 1;
> 		}
> 	}
>
> 	if (handled) {
> 		if (wantinit)
> 			pcn_init(ifp);
>
> 		/* Try to get more packets going. */
> #ifdef __QNXNTO__
>                  NW_SIGLOCK(&ifp->if_snd_ex, iopkt_selfp);
> #endif
> 		pcn_start(ifp);
> 	}
>
> 	return (handled);
> }
>
>
>
>
> *******************************************************
> There is place in driver when "pcnet memory error" occur
>
> 			if (csr0 & LE_C0_MERR) {
> 				PCN_EVCNT_INCR(&sc->sc_ev_merr);
> 				printf("%s: memory error\n",
> 				    sc->sc_dev.dv_xname);
> 				wantinit = 1;
> 				break;
> 			}
>
LINUX:

         if (csr0 & LE_C0_MERR) {
                 printk("%s: *Bus master arbitration failure*, status 
%4.4x.\n",
                        dev->name, csr0);
                 /* Restart the chip. */
                 WRITERDP(lp, LE_C0_STRT);
         }




>
>
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98334
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>

Attachment: HTML sf-attachment-mime8657 3.95 KB
Re: Udp packet lost  
Oleg Gopov wrote:
LINUX:

         if (csr0 & LE_C0_MERR) {
                 printk("%s: *Bus master arbitration failure*, status 
%4.4x.\n",
                        dev->name, csr0);
                 /* Restart the chip. */
                 WRITERDP(lp, LE_C0_STRT);
         }

Reasons:  an other PCI device blocks the PCI bus or the bus request for 
more than 50us  or the PCI slot doesn't support bus mastering !


>
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98334
> To cancel your subscription to this discussion, please e-maildrivers-networking-unsubscribe@community.qnx.com
>

Attachment: HTML sf-attachment-mime8660 1.9 KB
Re: Udp packet lost  
Hello Armin. Happy New Year. Thanks for answers.


I locate a problem. My Application work with pci-to-vme bridge Tundra Universe II. 
"pcnet memory error" occur when I try read/write to no-exist address on vme bus. (my applicatoin act as pci target) 
Re: Udp packet lost  
Hello Oleg,

all the best in 2013 !

is the bridge "Tundra Iniverse II" fully supported ?

--Armin

Oleg Gopov wrote:
> Hello Armin. Happy New Year. Thanks for answers.
>
>
> I locate a problem. My Application work with pci-to-vme bridge Tundra Universe II.
> "pcnet memory error" occur when I try read/write to no-exist address on vme bus. (my applicatoin act as pci target)
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98367
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>

Re: Udp packet lost  
> is the bridge "Tundra Iniverse II" fully supported ?

No , I wrote myself this driver. 
Re: Udp packet lost  
> Reasons:  an other PCI device blocks the PCI bus or the bus request for 
> more than 50us  or the PCI slot doesn't support bus mastering !
I want to mention , that BIOS distribute to PCNET NIC -> IRQ 7, PCI2VME BRIDGE - IRQ 11.

One moment bothers me, how write/read action to pci2vme bridge cause interrupt generation on my nic driver. I don't 
understant. 
Re: Udp packet lost  
Because "pcnet memory error" generate in interrupt handler of pcnet driver. I am right?????????
Re: Udp packet lost  
Oleg Gopov wrote:
>> Reasons:  an other PCI device blocks the PCI bus or the bus request for
>> more than 50us  or the PCI slot doesn't support bus mastering !
> I want to mention , that BIOS distribute to PCNET NIC -> IRQ 7,

  ... and the IRQ 7 isn't shared by an other device ?

>   PCI2VME BRIDGE - IRQ 11.

That means all VME device are trigering the IRQ 11 ?

>
> One moment bothers me, how write/read action to pci2vme bridge cause interrupt generation on my nic driver. I don't 
understant.

Is it really the pci2vme bridge or is it an other PCI device ??

--Armin

>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98397
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>

Re: Udp packet lost  
>   ... and the IRQ 7 isn't shared by an other device ?
There is no devices , that shared IRQ 7
> That means all VME device are trigering the IRQ 11 ?
I think YES.

> Is it really the pci2vme bridge or is it an other PCI device ??
Yes. It is realy pci2vme bridge - Tundra Universe II.
Re: Udp packet lost  
Oleg,

I hope you are not using QNX6.5 ... it well known for its esoteric PCI 
problems !

Oleg Gopov wrote:
>>    ... and the IRQ 7 isn't shared by an other device ?
> There is no devices , that shared IRQ 7
>> That means all VME device are trigering the IRQ 11 ?
> I think YES.
>
>> Is it really the pci2vme bridge or is it an other PCI device ??
> Yes. It is realy pci2vme bridge - Tundra Universe II.
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98400
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>

Re: Udp packet lost  
> 
> Oleg,
> 
> I hope you are not using QNX6.5 ... it well known for its esoteric PCI 
> problems !
> 

I point in the first post , that I use 6.4.0 version
 

Re: Udp packet lost  
Oleg Gopov wrote:
>> Oleg,
>>
>> I hope you are not using QNX6.5 ... it well known for its esoteric PCI
>> problems !
>>
> I point in the first post , that I use 6.4.0 version

OK.
Could this be helpful?
http://community.qnx.com/sf/discussion/do/listPosts/projects.bsp/discussion.bsp.topc3672?_pagenum=1

>   
>
>
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98402
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>

Re: Udp packet lost  
Thanks Armin. I will study info under links you suggest and surely write results to this post.
Re: Udp packet lost  
> OK.
> Could this be helpful?
> http://community.qnx.com/sf/discussion/do/listPosts/projects.bsp/discussion.
> bsp.topc3672?_pagenum=1
One thing I may write that this post is not my case. Our system work for years and we don't have problems with 
allocating Tundra base address. All more difficult. Only one board (vp7) with only one NIC (amd pcnet32) cause problem 
as I wrote on the first post.
Re: Udp packet lost  
You know it ?

http://www.tldp.org/HOWTO/VME-HOWTO.html#toc4

Oleg Gopov wrote:
>>    ... and the IRQ 7 isn't shared by an other device ?
> There is no devices , that shared IRQ 7
>> That means all VME device are trigering the IRQ 11 ?
> I think YES.
>
>> Is it really the pci2vme bridge or is it an other PCI device ??
> Yes. It is realy pci2vme bridge - Tundra Universe II.
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98400
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>

Re: Udp packet lost  
> You know it ?
> 
> http://www.tldp.org/HOWTO/VME-HOWTO.html#toc4
> 

I already learn this linux driver for vme bridge. I try some things after holidays and write to this topic.



Re: Udp packet lost  
Hello Armin. Our investigation is continue))))))))))))
Please, what you say???????

> Reasons:  an other PCI device blocks the PCI bus or the bus request for 
> more than 50us  or the PCI slot doesn't support bus mastering !

Where you take 50us from???????????? What is the time??????????????


Re: Udp packet lost  
Oleg Gopov wrote:
> Hello Armin. Our investigation is continue))))))))))))
> Please, what you say???????
>
>> Reasons:  an other PCI device blocks the PCI bus or the bus request for
>> more than 50us  or the PCI slot doesn't support bus mastering !
> Where you take 50us from????????????

   Should be specified by the PCI standard.

> What is the time??????????????

tineout for requesting as a master the bus.

Do you have a corrupted keyboard ??????????????????????????????

>
>
>
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98560
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>

Re: Udp packet lost  
> Do you have a corrupted keyboard ??????????????????????????????

Keyboard work properly.
Re: Udp packet lost  
Armin, I prepare some sweets)))))))

Please see to attachment.

Armin, what you say??????????
Attachment: Image Issue.jpg 519.63 KB
Re: Udp packet lost  
Oleg Gopov wrote:
> Armin, I prepare some sweets)))))))
>
> Please see to attachment.
>
> Armin, what you say??????????
Interesting !
Are there any hardware related delays or was the IRQ 9 disabled for lots 
of us ?

Is the IRQ 2 used ? If yes, you shouldn't use IRQ 9 ...

--Armin

>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98571
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com

Re: Udp packet lost  
> or was the IRQ 9 disabled for lots 
> of us ?
How I can figure out this????????



> Is the IRQ 2 used ? If yes, you shouldn't use IRQ 9 ...
No. I don't use IRQ 2.
Re: Udp packet lost  
Oleg Gopov wrote:
>> You have a corrupted board sharing the same IRQ with io-usb -> that's
>> the best wayto loose interrupts.
>> io-usb is known for blocking/disabling its (shared) interrupt for a
>> longer time !
>>
>> --Armin
>>
> But, Armin. How You conclude this??? You find out issue in tracebuffer.kev file??????????

Yes ... you can see that io-usb is sharing the same interrupt ... that 
means in all cases of an active interrupt is the ISR of io-usb active!!!!


> I analyze tracelog and see that io-usb thread eat processor time only ~ 30us. Nothing criminal in that.

Handling - that means disabling/enabling - of interrupts are normally 
done in the ISR! Should be critical enough .... even if there is no data 
traffic.

--Armin

>   
>
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post98305
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>

Re: Udp packet lost  
Oleg,

UDP is a unsecure protocol ... that means when the driver is loosing 
interrupts it will loose packets.

This can happen if the interrupt is shared by other devices and one of 
these device driver is disabling the shared interrupt for a longer time.
We had a similar problem with a CAN communication ( similar to UDP 
communication) and there was interrupt disabled for ~8ms !!

Best Regards

Armin Steinhoff

http://www.steinhoff-automation.com


Oleg Gopov wrote:
> I see nicinfo output - > pcnet32 network adapter work in half-duplex. How I can lost packets??? I don't understand.
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post97593
> To cancel your subscription to this discussion, please e-mail drivers-networking-unsubscribe@community.qnx.com
>