On 12/1/18 4:22 AM, Jesper Dangaard Brouer wrote:
>>
>> So we should count all XDP RX packets as successful rx packets i.e
>> netdev->stats.rx_packets++; regardless of the XDP program decision ?
>
> Yes.
>
>> this implies that XDP_TX packets will be counted twice once in
>> netdev->stats.rx_packets and once in netdev->stats.tx_packets
>
> Yes, because the packet was RX'ed on the interface, and then TX'ed on
> the interface. Users expect to see these packets (ac)counted.
+1
>
>> I think this is the only valid option if we are going to use standard
>> netdev stats for XDP use cases.
>
> IMHO XDP_DROP should not be accounted as netdev stats drops, this is a
> user installed program like tc/iptables, that can also choose to drop
> packets.
>
sure and both tc and iptables have counters that can see the dropped
packets. A counter in the driver level stats ("xdp_drop" is fine with
with me).