From patchwork Mon Jan 8 08:54:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander 'lynxis' Couzens X-Patchwork-Id: 856753 X-Patchwork-Delegate: lynxis@fe80.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NbYGbgnm"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFTdm2bmqz9s7h for ; Mon, 8 Jan 2018 19:56:12 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=oeRMHE5NGsS1XFgHOkJcXdfpHQTtRXiATjVi5NDInUY=; b=NbYGbgnmSgkD+y u4pwbI2JkjNoAS58JMn3AkPsoGeDt5maUE4R2GI8XUC8cbcYqt3iabeOlbLAE1k9SxEUCiLfyh5rw sK80du3aWdPGYiwtENDtR3P4nl8WeaqaUGSYaTro6q3T4KQmj34nHI1WfomefNj3Gao2x7umnp2S4 kTJD1sH2Tnp3pTl/SgaB0NolI6T1Ky31rf3A6knE9RR2TTdt4uPoxn+sz3oxx7q2htzpUed5qWGJ1 f2CasfsugbJ2E6asfyxO15jy9TCdC7Xu1R8pBjjRM8h5jSpj5UJr7kQw71orEJPdpe9eKDY9RZOnX 8zDBpeiX+fbZDbv4VNHA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eYTDz-0001jG-Jg; Mon, 08 Jan 2018 08:56:07 +0000 Received: from mail.base45.de ([2001:67c:2050:320::77]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eYTDB-0000ID-JZ for lede-dev@lists.infradead.org; Mon, 08 Jan 2018 08:55:35 +0000 Received: from x59cc8a04.dyn.telefonica.de ([89.204.138.4] helo=lazus.yip) by mail.base45.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1eYTCw-0004Ye-Pc; Mon, 08 Jan 2018 08:55:03 +0000 From: Alexander Couzens To: lede-dev@lists.infradead.org Date: Mon, 8 Jan 2018 09:54:58 +0100 Message-Id: <20180108085459.9961-1-lynxis@fe80.eu> X-Mailer: git-send-email 2.15.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180108_005518_223264_BF218017 X-CRM114-Status: GOOD ( 20.27 ) X-Spam-Score: -0.4 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [89.204.138.4 listed in dnsbl.sorbs.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH 1/2] ltq-atm: rewrite tx path to use IRQs X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Couzens MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The ATM subsystem is different from the generic ethernet NICs. The ATM subsystem requires a callback when a packet has been sent. It means a tx skb_buff need to be used after it has sent. While the generic NIC can fill up the TX ring and free skb_buffs if it encounter a ring buffer slot with an already sent skbuff. The ATM drivers need call the pop() function after it has send a single ATM package. The ATM subsystem controls via this ways the queuing. The ppe engine use DMA channels for read and write. Every atm_vcc has it's own TX DMA channel and each TX DMA channel has it's own ring buffer. The old driver had multiple issues: - Call the subsystem callback at the beginning of tx function (ppe_send). Didn't allowed the ATM subsystem to control the enqueued package amount. - Filled up the TX ring until full and fail futher - copy or decouple the skb from all other subsystem before giving it over to TX ring The new tx path uses interupts. - call the subsystem callback _after_ it was sent by hardware - no need to copy our decouple the skb any more - gives back control to the atm subsystem over the enqueued packages - use an interupt for every sent atm package Using interupts shouldn't be a problem because of the slow uplink bandwidth of ADSL. The speed _through_ the DSL router was always as high as it should be, only traffic generated on the router itself were affected. After changing to new tx path, the speed of iperf's run on the router itself reached the same speed. The master/trunk wasn't as much affected because of TCP optimisations (reboot-5022-gb2ea46fe236a). The following results are taken on the remote server, which receives the stream over the internet and the DSL line. The sync moves between every sync a litte bit, but is so far stable Latency / Interleave Delay: Down: Fast (0.25 ms) / Up: Fast (0.50 ms) Data Rate: Down: 13.287 Mb/s / Up: 1.151 Mb/s reboot-5521-g9f8d28285d without patch [ ID] Interval Transfer Bandwidth Retr [ 5] 0.00-10.04 sec 947 KBytes 773 Kbits/sec 0 sender [ 5] 0.00-10.04 sec 928 KBytes 757 Kbits/sec receiver reboot-5521-g9f8d28285d with patch [ 5] 0.00-10.06 sec 1.16 MBytes 970 Kbits/sec 0 sender [ 5] 0.00-10.06 sec 1.15 MBytes 959 Kbits/sec receiver v17.01.4-239-g55c23e44f4 without patch [ ID] Interval Transfer Bandwidth Retr [ 5] 0.00-10.04 sec 87.4 KBytes 71.3 Kbits/sec 0 sender [ 5] 0.00-10.04 sec 59.6 KBytes 48.7 Kbits/sec receiver v17.01.4-239-g55c23e44f4 with patch [ ID] Interval Transfer Bandwidth Retr [ 5] 0.00-10.05 sec 1.18 MBytes 983 Kbits/sec 1 sender [ 5] 0.00-10.05 sec 1.15 MBytes 959 Kbits/sec receiver Signed-off-by: Alexander Couzens --- .../kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h | 2 + package/kernel/lantiq/ltq-atm/src/ltq_atm.c | 132 ++++++++++++++------- 2 files changed, 88 insertions(+), 46 deletions(-) diff --git a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h index 2f754c982b2a..398be7d8282a 100644 --- a/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h +++ b/package/kernel/lantiq/ltq-atm/src/ifxmips_atm_core.h @@ -43,6 +43,7 @@ struct ltq_atm_ops { void (*fw_ver)(unsigned int *major, unsigned int *minor); }; +#include #include /* @@ -195,6 +196,7 @@ struct connection { volatile struct tx_descriptor *tx_desc; unsigned int tx_desc_pos; struct sk_buff **tx_skb; + spinlock_t lock; unsigned int aal5_vcc_crc_err; /* number of packets with CRC error */ unsigned int aal5_vcc_oversize_sdu; /* number of packets with oversize error */ diff --git a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c index a08fa22ce24a..f306d19364fd 100644 --- a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c +++ b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c @@ -19,6 +19,8 @@ ** HISTORY ** $Date $Author $Comment ** 07 JUL 2009 Xu Liang Init Version +** +** Copyright 2017 Alexander Couzens *******************************************************************************/ #define IFX_ATM_VER_MAJOR 1 @@ -444,6 +446,9 @@ static int ppe_open(struct atm_vcc *vcc) /* set htu entry */ set_htu_entry(vpi, vci, conn, vcc->qos.aal == ATM_AAL5 ? 1 : 0, 0); + *MBOX_IGU1_ISRC |= (1 << (conn + FIRST_QSB_QID + 16)); + *MBOX_IGU1_IER |= (1 << (conn + FIRST_QSB_QID + 16)); + ret = 0; PPE_OPEN_EXIT: @@ -511,14 +516,18 @@ static int ppe_send(struct atm_vcc *vcc, struct sk_buff *skb) int ret; int conn; int desc_base; + int byteoff; + int required; + /* the len of the data without offset and header */ + int datalen; + unsigned long flags; struct tx_descriptor reg_desc = {0}; + struct tx_inband_header *header; struct sk_buff *new_skb; if ( vcc == NULL || skb == NULL ) return -EINVAL; - skb_get(skb); - atm_free_tx_skb_vcc(skb, vcc); conn = find_vcc(vcc); if ( conn < 0 ) { @@ -532,31 +541,28 @@ static int ppe_send(struct atm_vcc *vcc, struct sk_buff *skb) goto PPE_SEND_FAIL; } - if ( vcc->qos.aal == ATM_AAL5 ) { - int byteoff; - int datalen; - struct tx_inband_header *header; + byteoff = (unsigned int)skb->data & (DATA_BUFFER_ALIGNMENT - 1); + required = sizeof(*header) + byteoff; + if (!skb_clone_writable(skb, required)) { + int expand_by = 0; + int ret; - byteoff = (unsigned int)skb->data & (DATA_BUFFER_ALIGNMENT - 1); - if ( skb_headroom(skb) < byteoff + TX_INBAND_HEADER_LENGTH ) - new_skb = skb_duplicate(skb); - else - new_skb = skb_break_away_from_protocol(skb); - if ( new_skb == NULL ) { - pr_err("either skb_duplicate or skb_break_away_from_protocol fail\n"); - ret = -ENOMEM; - goto PPE_SEND_FAIL; - } - dev_kfree_skb_any(skb); - skb = new_skb; + if (skb_headroom(skb) < required) + expand_by = required - skb_headroom(skb); - datalen = skb->len; - byteoff = (unsigned int)skb->data & (DATA_BUFFER_ALIGNMENT - 1); + ret = pskb_expand_head(skb, expand_by, 0, GFP_ATOMIC); + if (ret) { + printk("pskb_expand_head failed.\n"); + atm_free_tx_skb_vcc(skb, vcc); + return ret; + } + } - skb_push(skb, byteoff + TX_INBAND_HEADER_LENGTH); + datalen = skb->len; + header = (void *)skb_push(skb, byteoff + TX_INBAND_HEADER_LENGTH); - header = (struct tx_inband_header *)skb->data; + if ( vcc->qos.aal == ATM_AAL5 ) { /* setup inband trailer */ header->uu = 0; header->cpi = 0; @@ -576,23 +582,9 @@ static int ppe_send(struct atm_vcc *vcc, struct sk_buff *skb) reg_desc.byteoff = byteoff; reg_desc.iscell = 0; } else { - /* if data pointer is not aligned, allocate new sk_buff */ - if ( ((unsigned int)skb->data & (DATA_BUFFER_ALIGNMENT - 1)) != 0 ) { - pr_err("skb->data not aligned\n"); - new_skb = skb_duplicate(skb); - } else - new_skb = skb_break_away_from_protocol(skb); - if ( new_skb == NULL ) { - pr_err("either skb_duplicate or skb_break_away_from_protocol fail\n"); - ret = -ENOMEM; - goto PPE_SEND_FAIL; - } - dev_kfree_skb_any(skb); - skb = new_skb; - reg_desc.dataptr = (unsigned int)skb->data >> 2; reg_desc.datalen = skb->len; - reg_desc.byteoff = 0; + reg_desc.byteoff = byteoff; reg_desc.iscell = 1; } @@ -600,23 +592,25 @@ static int ppe_send(struct atm_vcc *vcc, struct sk_buff *skb) reg_desc.c = 1; reg_desc.sop = reg_desc.eop = 1; + spin_lock_irqsave(&g_atm_priv_data.conn[conn].lock, flags); desc_base = get_tx_desc(conn); if ( desc_base < 0 ) { + spin_unlock_irqrestore(&g_atm_priv_data.conn[conn].lock, flags); pr_debug("ALLOC_TX_CONNECTION_FAIL\n"); ret = -EIO; goto PPE_SEND_FAIL; } - - if ( vcc->stats ) - atomic_inc(&vcc->stats->tx); - if ( vcc->qos.aal == ATM_AAL5 ) - g_atm_priv_data.wtx_pdu++; - /* update descriptor send pointer */ if ( g_atm_priv_data.conn[conn].tx_skb[desc_base] != NULL ) dev_kfree_skb_any(g_atm_priv_data.conn[conn].tx_skb[desc_base]); g_atm_priv_data.conn[conn].tx_skb[desc_base] = skb; + spin_unlock_irqrestore(&g_atm_priv_data.conn[conn].lock, flags); + + if ( vcc->stats ) + atomic_inc(&vcc->stats->tx); + if ( vcc->qos.aal == ATM_AAL5 ) + g_atm_priv_data.wtx_pdu++; /* write discriptor to memory and write back cache */ g_atm_priv_data.conn[conn].tx_desc[desc_base] = reg_desc; dma_cache_wback((unsigned long)skb->data, skb->len); @@ -900,6 +894,42 @@ static struct sk_buff* skb_break_away_from_protocol(struct sk_buff *skb) return new_skb; } +static void free_tx_ring(unsigned int queue) +{ + unsigned long flags; + int i; + struct connection *conn = &g_atm_priv_data.conn[queue]; + struct sk_buff *skb; + + if (!conn) + return; + + spin_lock_irqsave(&conn->lock, flags); + + for (i = 0; i < dma_tx_descriptor_length; i++) { + if (conn->tx_desc[i].own == 0 && conn->tx_skb[i] != NULL) { + skb = conn->tx_skb[i]; + conn->tx_skb[i] = NULL; + atm_free_tx_skb_vcc(skb, ATM_SKB(skb)->vcc); + } + } + spin_unlock_irqrestore(&conn->lock, flags); +} + +static void mailbox_tx_handler(unsigned int queue_bitmap) +{ + int i; + int bit; + + /* only get valid queues */ + queue_bitmap &= g_atm_priv_data.conn_table; + + for ( i = 0, bit = 1; i < MAX_PVC_NUMBER; i++, bit <<= 1 ) { + if (queue_bitmap & bit) + free_tx_ring(i); + } +} + static inline void mailbox_oam_rx_handler(void) { unsigned int vlddes = WRX_DMA_CHANNEL_CONFIG(RX_DMA_CH_OAM)->vlddes; @@ -1050,12 +1080,22 @@ static inline void mailbox_aal_rx_handler(void) static void do_ppe_tasklet(unsigned long data) { + unsigned int irqs = *MBOX_IGU1_ISR; *MBOX_IGU1_ISRC = *MBOX_IGU1_ISR; - mailbox_oam_rx_handler(); - mailbox_aal_rx_handler(); + + if (irqs & (1 << RX_DMA_CH_AAL)) + mailbox_aal_rx_handler(); + if (irqs & (1 << RX_DMA_CH_OAM)) + mailbox_oam_rx_handler(); + + /* any valid tx irqs */ + if ((irqs >> (FIRST_QSB_QID + 16)) & g_atm_priv_data.conn_table) + mailbox_tx_handler(irqs >> (FIRST_QSB_QID + 16)); if ((*MBOX_IGU1_ISR & ((1 << RX_DMA_CH_AAL) | (1 << RX_DMA_CH_OAM))) != 0) tasklet_schedule(&g_dma_tasklet); + else if (*MBOX_IGU1_ISR >> (FIRST_QSB_QID + 16)) /* TX queue */ + tasklet_schedule(&g_dma_tasklet); else enable_irq(PPE_MAILBOX_IGU1_INT); } @@ -1512,6 +1552,7 @@ static inline int init_priv_data(void) p_tx_desc = (volatile struct tx_descriptor *)((((unsigned int)g_atm_priv_data.tx_desc_base + DESC_ALIGNMENT - 1) & ~(DESC_ALIGNMENT - 1)) | KSEG1); ppskb = (struct sk_buff **)(((unsigned int)g_atm_priv_data.tx_skb_base + 3) & ~3); for ( i = 0; i < MAX_PVC_NUMBER; i++ ) { + spin_lock_init(&g_atm_priv_data.conn[i].lock); g_atm_priv_data.conn[i].tx_desc = &p_tx_desc[i * dma_tx_descriptor_length]; g_atm_priv_data.conn[i].tx_skb = &ppskb[i * dma_tx_descriptor_length]; } @@ -1799,7 +1840,6 @@ static int ltq_atm_probe(struct platform_device *pdev) int ret; int port_num; struct port_cell_info port_cell = {0}; - int i, j; char ver_str[256]; match = of_match_device(ltq_atm_match, &pdev->dev); From patchwork Mon Jan 8 08:54:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander 'lynxis' Couzens X-Patchwork-Id: 856752 X-Patchwork-Delegate: lynxis@fe80.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XYqad5xs"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zFTdX01DTz9s7h for ; Mon, 8 Jan 2018 19:55:59 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+mGJTwG6tKBRNSScixlYHzOclKNYQ1OEKFoNsVlJeHM=; b=XYqad5xsUnCUZL VFVPJ931rfu4FYBA2urQ9HI/uQi7cWLmDw9Slbh1CBRzxGSy4mlILks3Rs2gd8kpooaEboe5HKBqu Evsfbqv720luW12/SfyZSQuizJa+57wrhDt1GQxhxkcBKLMeYTlxA/q1Nlcw/mc4qmHNtOo6SxYOb ULVwbTNXoC0JZFQOuUQRoEMvRYeTJp3b0DdjRsa1u0uexkp3IgmLDzSqXSz6cnLCZO+A5r/mevOet 1DiXMlssx8lartv+I5VWXz5ZOJ2YDdq+4m60ezTvBVka5Lx8ueI/4ZYzWrzVEtfN5bDmyJKgrhaix daamdNy5I7xptizuswfQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eYTDc-0001KM-74; Mon, 08 Jan 2018 08:55:44 +0000 Received: from mail.base45.de ([2001:67c:2050:320::77]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eYTDB-0000iM-JY for lede-dev@lists.infradead.org; Mon, 08 Jan 2018 08:55:26 +0000 Received: from x59cc8a04.dyn.telefonica.de ([89.204.138.4] helo=lazus.yip) by mail.base45.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1eYTD7-0004Ye-Hc; Mon, 08 Jan 2018 08:55:13 +0000 From: Alexander Couzens To: lede-dev@lists.infradead.org Date: Mon, 8 Jan 2018 09:54:59 +0100 Message-Id: <20180108085459.9961-2-lynxis@fe80.eu> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180108085459.9961-1-lynxis@fe80.eu> References: <20180108085459.9961-1-lynxis@fe80.eu> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180108_005518_147100_4D1E2E0E X-CRM114-Status: UNSURE ( 7.95 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.4 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [89.204.138.4 listed in dnsbl.sorbs.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Subject: [LEDE-DEV] [PATCH 2/2] ltq-atm: cleanup unused variables and functions X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Schiller MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Martin Schiller Signed-off-by: Martin Schiller --- package/kernel/lantiq/ltq-atm/src/ltq_atm.c | 41 ----------------------------- 1 file changed, 41 deletions(-) diff --git a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c index f306d19364fd..0b9d7a05aba0 100644 --- a/package/kernel/lantiq/ltq-atm/src/ltq_atm.c +++ b/package/kernel/lantiq/ltq-atm/src/ltq_atm.c @@ -191,8 +191,6 @@ struct sk_buff* atm_alloc_tx(struct atm_vcc *, unsigned int); static inline void atm_free_tx_skb_vcc(struct sk_buff *, struct atm_vcc *); static inline struct sk_buff *get_skb_rx_pointer(unsigned int); static inline int get_tx_desc(unsigned int); -static struct sk_buff* skb_duplicate(struct sk_buff *); -static struct sk_buff* skb_break_away_from_protocol(struct sk_buff *); /* * mailbox handler and signal function @@ -523,7 +521,6 @@ static int ppe_send(struct atm_vcc *vcc, struct sk_buff *skb) unsigned long flags; struct tx_descriptor reg_desc = {0}; struct tx_inband_header *header; - struct sk_buff *new_skb; if ( vcc == NULL || skb == NULL ) return -EINVAL; @@ -856,44 +853,6 @@ static inline int get_tx_desc(unsigned int conn) return desc_base; } -static struct sk_buff* skb_duplicate(struct sk_buff *skb) -{ - struct sk_buff *new_skb; - - new_skb = alloc_skb_tx(skb->len); - if ( new_skb == NULL ) - return NULL; - - skb_put(new_skb, skb->len); - memcpy(new_skb->data, skb->data, skb->len); - - return new_skb; -} - -static struct sk_buff* skb_break_away_from_protocol(struct sk_buff *skb) -{ - struct sk_buff *new_skb; - - if ( skb_shared(skb) ) { - new_skb = skb_clone(skb, GFP_ATOMIC); - if ( new_skb == NULL ) - return NULL; - } else - new_skb = skb_get(skb); - - skb_dst_drop(new_skb); -#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) - nf_conntrack_put(new_skb->nfct); - new_skb->nfct = NULL; - #ifdef CONFIG_BRIDGE_NETFILTER - nf_bridge_put(new_skb->nf_bridge); - new_skb->nf_bridge = NULL; - #endif -#endif - - return new_skb; -} - static void free_tx_ring(unsigned int queue) { unsigned long flags;