Jan Kiszka wrote: > Thinus Viljoen wrote: >> On 10/16/06, Jan Kiszka <[EMAIL PROTECTED]> wrote: >>> What about delaying after rtifconfig up? >>> >> Doesn't help. Well, not a few seconds, anyway. > > That's new. > >>> How do you switch? Shutting all nodes down (rtnet stop), changing >>> rtnet.conf files, and restarting them? Could you try to capture the >>> traffic with Ethereal/Wireshark so that I can have look if there are >>> correct TDMA packets exchanged? >>> >> Yes, that is how I switch them. I have attached a capture from a >> successful "rtnet start". The timestamps look a bit funny? > > Indeed. How and on which host did you capture? On the slave, right? Is > it possible to use a third station for this instead (to exclude any > weirdness of the involved driver)? Also, the capture file contains a > cooked format without target addresses. > > Hmm, it looks like the master fails to patch the transmission timestamp > of outgoing packets into that frames. This may cause quite a lot of > confusion. Wait... there is no timestamping code in rt_e1000 at all! > Argh, my code review failed utterly. Needs to be fixed, hold on. > >>> That's very likely some hotplug automatism of your distribution. Watch >>> out for related services/daemons (I don't know Fedora, sorry) and stop >>> them for now. >>> >> I think they use "NetworkManager". The only problem is that it is >> already disabled. For now I just renamed e1000.ko. On a related point >> - I saw that if the Ethernet module is not loaded, and you call >> "ifconfig eth1 down", it actually loads the module and puts eth1 up! >> Took me a while to figure that one out. >> >> Other behaviour that I saw recently (I am pretty sure that it worked >> better previously): >> 1. "rtping" doesn't work - the master reports "ioctl: No buffer space >> available" > > Likely because no packets can be sent (a failing TDMA negotiation would > be a reason). > >> 2. When running "rtnet stop" the slave hangs after calling "rtifconfig >> rteth0 down". If I try to manually remove the tdma module, I get an >> error that it is "in use". I must then reboot. > > While I'm looking into the timestamp issue, can you do the same tests > with the e100 (thus rt_eepro100) on your box? Just to narrow the issue > down to e1000 and make sure there aren't multiple bugs involved. >
Here we go already: Attached patch (also in SVN) adds the required timestamping support to rt_e1000 and should solve some issues. Be warned, only compile-tested! Looking forward to your feedback. Jan
Index: drivers/e1000/e1000_main.c =================================================================== --- drivers/e1000/e1000_main.c (revision 1074) +++ drivers/e1000/e1000_main.c (working copy) @@ -202,7 +202,8 @@ static int e1000_intr(rtdm_irq_t *irq_ha static boolean_t e1000_clean_tx_irq(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring); static boolean_t e1000_clean_rx_irq(struct e1000_adapter *adapter, - struct e1000_rx_ring *rx_ring); + struct e1000_rx_ring *rx_ring, + nanosecs_abs_t *time_stamp); static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter, struct e1000_rx_ring *rx_ring, int cleaned_count); @@ -1709,7 +1710,7 @@ e1000_configure_rx(struct e1000_adapter { rdlen = adapter->rx_ring[0].count * sizeof(struct e1000_rx_desc); - adapter->clean_rx = e1000_clean_rx_irq; + adapter->clean_rx = NULL; /* unused */ adapter->alloc_rx_buf = e1000_alloc_rx_buffers; } @@ -2421,12 +2422,13 @@ e1000_tx_map(struct e1000_adapter *adapt static void e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, - int tx_flags, int count) + int tx_flags, int count, nanosecs_abs_t *xmit_stamp) { struct e1000_tx_desc *tx_desc = NULL; struct e1000_buffer *buffer_info; uint32_t txd_upper = 0, txd_lower = E1000_TXD_CMD_IFCS; unsigned int i; + rtdm_lockctx_t context; if (likely(tx_flags & E1000_TX_FLAGS_CSUM)) { @@ -2449,6 +2451,11 @@ e1000_tx_queue(struct e1000_adapter *ada tx_desc->lower.data |= cpu_to_le32(adapter->txd_cmd); + rtdm_lock_irqsave(context); + + if (xmit_stamp) + *xmit_stamp = cpu_to_be64(rtdm_clock_read() + *xmit_stamp); + /* Force memory writes to complete before letting h/w * know there are new descriptors to fetch. (Only * applicable for weak-ordered memory model archs, @@ -2457,6 +2464,8 @@ e1000_tx_queue(struct e1000_adapter *ada tx_ring->next_to_use = i; writel(i, adapter->hw.hw_addr + tx_ring->tdt); + + rtdm_lock_irqrestore(context); } /** @@ -2608,7 +2617,8 @@ e1000_xmit_frame(struct rtskb *skb, stru e1000_tx_queue(adapter, tx_ring, tx_flags, e1000_tx_map(adapter, tx_ring, skb, first, - max_per_txd, nr_frags, mss)); + max_per_txd, nr_frags, mss), + skb->xmit_stamp); return NETDEV_TX_OK; } @@ -2642,6 +2652,7 @@ e1000_intr(rtdm_irq_t *irq_handle) struct e1000_hw *hw = &adapter->hw; uint32_t rctl, icr = E1000_READ_REG(hw, ICR); int i; + nanosecs_abs_t time_stamp = rtdm_clock_read(); if (unlikely(!icr)) { return RTDM_IRQ_NONE; /* Not our interrupt */ @@ -2682,7 +2693,8 @@ e1000_intr(rtdm_irq_t *irq_handle) adapter->data_received = 0; for (i = 0; i < E1000_MAX_INTR; i++) - if (unlikely(!e1000_clean_rx_irq(adapter, adapter->rx_ring) & + if (unlikely(!e1000_clean_rx_irq(adapter, adapter->rx_ring, + &time_stamp) & !e1000_clean_tx_irq(adapter, adapter->tx_ring))) break; @@ -2839,7 +2851,8 @@ e1000_rx_checksum(struct e1000_adapter * static boolean_t e1000_clean_rx_irq(struct e1000_adapter *adapter, - struct e1000_rx_ring *rx_ring) + struct e1000_rx_ring *rx_ring, + nanosecs_abs_t *time_stamp) { struct rtnet_device *netdev = adapter->netdev; struct pci_dev *pdev = adapter->pdev; @@ -2935,8 +2948,9 @@ e1000_clean_rx_irq(struct e1000_adapter le16_to_cpu(rx_desc->csum), skb); skb->protocol = rt_eth_type_trans(skb, netdev); + skb->time_stamp = *time_stamp; rtnetif_rx(skb); - adapter->data_received = 1; // Set flag for the main interrupt routine + adapter->data_received = 1; // Set flag for the main interrupt routine next_desc: rx_desc->status = 0;
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ RTnet-users mailing list RTnet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rtnet-users