ixgbe & if_igb RX ring locking

Alexander V. Chernikov melifaro at FreeBSD.org
Sat Oct 13 17:50:20 UTC 2012


Hello list!


Packets receiving code for both ixgbe and if_igb looks like the following:


ixgbe_msix_que

-- ixgbe_rxeof()
    {
       IXGBE_RX_LOCK(rxr);
         while
         {
            get_packet;

            -- ixgbe_rx_input()
               {
                  ++ IXGBE_RX_UNLOCK(rxr);
                  if_input(packet);
                  ++ IXGBE_RX_LOCK(rxr);
               }

         }
       IXGBE_RX_UNLOCK(rxr);
     }

Lines marked with ++ appeared in r209068(igb) and r217593(ixgbe).

These lines probably do LORs masking (if any) well.
However, such change introduce quite significant performance drop:

On my routing setup (nearly the same from previous -Intel 10G thread in 
-net) adding lock/unlock causes 2.8MPPS decrease to 2.3MPPS which is 
nearly 20%.

So my questions are:

Can any real LORs happen in some complex setup? (I can't imagine any).
If so: maybe we can somehow avoid/workaround such cases? (and consider 
removing those locks).



-- 
WBR, Alexander



More information about the freebsd-net mailing list