I have a situation where tcpdump (libpcap) sees TCP SYNs ... but a sniffer
located on the wire just outside the NIC does not see those TCP SYNs

Any tips on how to follow a frame through netdev.c to figure out where it
gets dropped?

>From http://lxr.linux.no/#linux+v3.8/net/core/dev.c
[...]

2361 <http://lxr.linux.no/linux+*/net/core/dev.c#L2361>
if (!list_empty
<http://lxr.linux.no/linux+*/+code=list_empty>(&ptype_all
<http://lxr.linux.no/linux+*/+code=ptype_all>))2362
<http://lxr.linux.no/linux+*/net/core/dev.c#L2362>
   dev_queue_xmit_nit
<http://lxr.linux.no/linux+*/+code=dev_queue_xmit_nit>(skb
<http://lxr.linux.no/linux+*/+code=skb>, dev
<http://lxr.linux.no/linux+*/+code=dev>);2363
<http://lxr.linux.no/linux+*/net/core/dev.c#L2363>2364
<http://lxr.linux.no/linux+*/net/core/dev.c#L2364>
skb_len <http://lxr.linux.no/linux+*/+code=skb_len> = skb
<http://lxr.linux.no/linux+*/+code=skb>->len
<http://lxr.linux.no/linux+*/+code=len>;2365
<http://lxr.linux.no/linux+*/net/core/dev.c#L2365>                rc
<http://lxr.linux.no/linux+*/+code=rc> = ops
<http://lxr.linux.no/linux+*/+code=ops>->ndo_start_xmit
<http://lxr.linux.no/linux+*/+code=ndo_start_xmit>(skb
<http://lxr.linux.no/linux+*/+code=skb>, dev
<http://lxr.linux.no/linux+*/+code=dev>);2366
<http://lxr.linux.no/linux+*/net/core/dev.c#L2366>
trace_net_dev_xmit
<http://lxr.linux.no/linux+*/+code=trace_net_dev_xmit>(skb
<http://lxr.linux.no/linux+*/+code=skb>, rc
<http://lxr.linux.no/linux+*/+code=rc>, dev
<http://lxr.linux.no/linux+*/+code=dev>, skb_len
<http://lxr.linux.no/linux+*/+code=skb_len>);2367
<http://lxr.linux.no/linux+*/net/core/dev.c#L2367>                if
(rc <http://lxr.linux.no/linux+*/+code=rc> == NETDEV_TX_OK
<http://lxr.linux.no/linux+*/+code=NETDEV_TX_OK>)2368
<http://lxr.linux.no/linux+*/net/core/dev.c#L2368>
   txq_trans_update
<http://lxr.linux.no/linux+*/+code=txq_trans_update>(txq
<http://lxr.linux.no/linux+*/+code=txq>);2369
<http://lxr.linux.no/linux+*/net/core/dev.c#L2369>
return rc <http://lxr.linux.no/linux+*/+code=rc>;2370
<http://lxr.linux.no/linux+*/net/core/dev.c#L2370>        }2371
<http://lxr.linux.no/linux+*/net/core/dev.c#L2371>2372
<http://lxr.linux.no/linux+*/net/core/dev.c#L2372>gso
<http://lxr.linux.no/linux+*/+code=gso>:2373
<http://lxr.linux.no/linux+*/net/core/dev.c#L2373>        do {

[...]

I believe that libpcap gets the frame somewhere inside dev_queue_xmit_nit()
... which suggests to me that the execution reaches Line 2362 just fine ...
which suggests that execution reaches Line 2365:

2365 <http://lxr.linux.no/linux+*/net/core/dev.c#L2365>
rc <http://lxr.linux.no/linux+*/+code=rc> = ops
<http://lxr.linux.no/linux+*/+code=ops>->ndo_start_xmit
<http://lxr.linux.no/linux+*/+code=ndo_start_xmit>(skb
<http://lxr.linux.no/linux+*/+code=skb>, dev
<http://lxr.linux.no/linux+*/+code=dev>);

and ndo_start_xmit() ends up calling e1000_xmit_frame ...which gets
me, I believe, to Line 6039 in e1000e-2.5.4\src\netdev.c


static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
                                    struct net_device *netdev)
{
        struct e1000_adapter *adapter = netdev_priv(netdev);
        struct e1000_ring *tx_ring = adapter->tx_ring;
        unsigned int first;
        unsigned int tx_flags = 0;
        unsigned int len = skb_headlen(skb);
        unsigned int nr_frags;
        unsigned int mss;
        int count = 0;
        int tso;
        unsigned int f;

        if (test_bit(__E1000_DOWN, &adapter->state)) {
                dev_kfree_skb_any(skb);
                return NETDEV_TX_OK;
        }

[...]

So, now I want to figure out which 'if' clause I hit for these particular
TCP SYNs .. I suppose I could add my own 'print' statements:

if (test_bit(__E1000_DOWN, &adapter->state)) {
                dev_kfree_skb_any(skb);
                printf ("Link down, discarding frame");

                return NETDEV_TX_OK;
        }

although ... I doubt that string will go anywhere useful ... I'd rather
send the string to syslog, and I don't know how to do that yet

Anyway, before I started walking this path, I figured I'd ask for tips.
 How would you tackle this?

I'm running kernel 3.8.0-34 (Precise Pangolin / LTS 12.04.3); Intel 82579LM
(rev06)

[Interestingly enough, most TCP conversations pass across this NIC just
fine ... just one particular app (NFS) for which the TCP SYNs don't reach
the wire.]

--sk

Stuart Kendrick
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to