On Thu, Apr 20, 2017 at 12:35:40PM +0000, Jorgen S. Hansen wrote:
> >
> > +/* Packet capture */
> > +void virtio_transport_deliver_tap_pkt(struct virtio_vsock_pkt *pkt)
> > +{
> > + struct sk_buff *skb;
> > + struct af_vsockmon_hdr *hdr;
> > + unsigned char *t_hdr, *payload;
> > +
> > + skb = alloc_skb(sizeof(*hdr) + sizeof(pkt->hdr) + pkt->len,
> > + GFP_ATOMIC);
>
> So with the current API, an skb will always be allocated, even if there are
> no listeners? And we’ll copy the payload into the skb as well, if there is
> any. Would it make sense to introduce a check here (exposed as part of the
> vsock tap API), that skips all that in the case of no listeners? In the
> common case, there won’t be any listeners, so it would save some cycles.Good point, will fix.
signature.asc
Description: PGP signature
