On Thu, Oct 4, 2018 at 4:42 PM Eric Dumazet <eric.duma...@gmail.com> wrote:
>
> How have you decided some counters can be 'slow' and other 'fast' ?
>
> I can tell you I see many ultra-fast candidates in your 'slow' list :/

Based on what others have categorized based on what's in the code and
IMHO they make sense:

enum
{
     IPSTATS_MIB_NUM = 0,
     /* frequently written fields in fast path, kept in same cache line */
     IPSTATS_MIB_INPKTS, /* InReceives */
     IPSTATS_MIB_INOCTETS, /* InOctets */
     IPSTATS_MIB_INDELIVERS, /* InDelivers */
     IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */
     IPSTATS_MIB_OUTPKTS, /* OutRequests */
     IPSTATS_MIB_OUTOCTETS, /* OutOctets */
     /* other fields */
     IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */
     ...
     __IPSTATS_MIB_MAX
};

>
> Also think about DDOS.
>
> After your patch, all these 'wrong packets' will incur an expensive
> operation on a shared and highly contented cache line,
> effectively making the attack easier to conduct.
>

I agree about it is becoming more expensive to hit the slow counters
due to the check whether they are enabled or not.
Do you think it should just be enabled always? Then the cost to hit
the slow counters is the same as what it is right now.

Stephen.

Reply via email to