[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110819.033613.1959565749346388734.davem@davemloft.net>
Date: Fri, 19 Aug 2011 03:36:13 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: loke.chetan@...il.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next v4 af-packet 2/2] Enhance af-packet to provide
(near zero)lossless packet capture functionality.
From: Chetan Loke <loke.chetan@...il.com>
Date: Thu, 11 Aug 2011 22:31:00 -0400
> +struct kbdq_ft_ops {
> + int num_ops;
> + void (*ft_ops[2])(void *, void *);
> +};
...
> + struct kbdq_ft_ops kfops;
...
> +static void prb_init_ft_ops(struct kbdq_core *p1,
> + union tpacket_req_u *req_u)
> +{
> + p1->kfops.ft_ops[p1->kfops.num_ops++] = prb_fill_vlan_info;
> +
> + if (req_u->req3.tp_feature_req_word) {
> + if (req_u->req3.tp_feature_req_word & TP_FT_REQ_FILL_RXHASH)
> + p1->kfops.ft_ops[p1->kfops.num_ops++] = prb_fill_rxhash;
> + else
> + p1->kfops.ft_ops[p1->kfops.num_ops++] =
> + prb_clear_rxhash;
> + }
> +}
It is a lot cheaper to just test the flags in-line than do indirect calls.
Indirect calls are very expensive on many cpus.
In fact, since the first op (prb_fill_vlan_info) is unconditional, we eat
the indirect call cost for absolutely no reason at all.
This kfops stuff was not present in your previous changes. And I'm
going to tell you that if you keep adding things each revision instead
of just fixing the specific items you've received feedback about, a
set of changes this invasive and of this size will never get merged.
Please resist the urge to further tinker with the code, and just
address the feedback we give you.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists