From patchwork Wed May 10 03:36:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 760407 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wN26N3lQkz9s03 for ; Wed, 10 May 2017 13:39:24 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751913AbdEJDgm (ORCPT ); Tue, 9 May 2017 23:36:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32960 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751815AbdEJDgl (ORCPT ); Tue, 9 May 2017 23:36:41 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A542C88E60; Wed, 10 May 2017 03:36:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A542C88E60 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jasowang@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A542C88E60 Received: from jason-ThinkPad-T450s.redhat.com (vpn1-5-81.pek2.redhat.com [10.72.5.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE4BB183AB; Wed, 10 May 2017 03:36:37 +0000 (UTC) From: Jason Wang To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, mst@redhat.com Cc: Jason Wang Subject: [PATCH net-next V4 03/10] skb_array: introduce skb_array_unconsume Date: Wed, 10 May 2017 11:36:15 +0800 Message-Id: <1494387382-19916-4-git-send-email-jasowang@redhat.com> In-Reply-To: <1494387382-19916-1-git-send-email-jasowang@redhat.com> References: <1494387382-19916-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 10 May 2017 03:36:40 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Jason Wang --- include/linux/skb_array.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/skb_array.h b/include/linux/skb_array.h index f4dfade..79850b6 100644 --- a/include/linux/skb_array.h +++ b/include/linux/skb_array.h @@ -156,6 +156,12 @@ static void __skb_array_destroy_skb(void *ptr) kfree_skb(ptr); } +static inline void skb_array_unconsume(struct skb_array *a, + struct sk_buff **skbs, int n) +{ + ptr_ring_unconsume(&a->ring, (void **)skbs, n, __skb_array_destroy_skb); +} + static inline int skb_array_resize(struct skb_array *a, int size, gfp_t gfp) { return ptr_ring_resize(&a->ring, size, gfp, __skb_array_destroy_skb);