From patchwork Mon Feb 22 17:37:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 8381131 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4EA8EC0553 for ; Mon, 22 Feb 2016 17:38:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A799420513 for ; Mon, 22 Feb 2016 17:38:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 08CDA2051A for ; Mon, 22 Feb 2016 17:38:47 +0000 (UTC) Received: from localhost ([::1]:50765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXuRa-0004iU-Ds for patchwork-qemu-devel@patchwork.kernel.org; Mon, 22 Feb 2016 12:38:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXuRD-0004SJ-7C for qemu-devel@nongnu.org; Mon, 22 Feb 2016 12:38:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXuRC-0007pv-7E for qemu-devel@nongnu.org; Mon, 22 Feb 2016 12:38:23 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:38383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXuRC-0007pl-05 for qemu-devel@nongnu.org; Mon, 22 Feb 2016 12:38:22 -0500 Received: by mail-wm0-x22e.google.com with SMTP id a4so173783519wme.1 for ; Mon, 22 Feb 2016 09:38:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravellosystems-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2jS35zCbihRjP5KiIv1wBmjiJml9bqYg0LrscR0pjAc=; b=1LrZH2O4wjRYeHFCK7AZlEf/ieWPCXCqwc2nhYl4sHC2mcflGbax3pnDbjxPpVh29p mAjjaTItUopCN2MY8iyGp4TpJgONtfnsAYpu8rq7Vyh2jOR8ZsDB5he4JiN5xTUB6sn7 9FI6gC7Nc/fU2COf5ngodrikI/4tTKaC0nl1n25cFhEUaPeAOJ0+fO6VDc+PKKE9PauD eTOLv9uh0pnix1Dvu4GyCbehs7M8RoPmFLC7gZr6W+N8uE9ickdhEGiS7+ZR7NZ0SsWz R03scmZJDoBxztLJoNriQe/Jzj2J207uaajF74vA28yqgegwNW5UR+PoTipRAjRMRisD hAmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2jS35zCbihRjP5KiIv1wBmjiJml9bqYg0LrscR0pjAc=; b=jIrHS7LYphcDvOekLl8yVJxKnIg41Tpyoj8hKQKj6Pq+69BmuRBbYw6lUBYsUnpn1p 4R1o/iTew6IexBJ++90ya5pKr3sSSZmEs5KhUEuRBcf4ejk3Tnhz6h0Hw8UyfJmcW1gz wDwnnEFUx8AhATJ23gS6InB5CaAJVVckXXCK70+Bo+wm6FtQ4gWX7f5zn0QsuMQuW8b/ 77usdZ84kutRAMq5d8tIVXuAFvirev1/E5H0iYZwFUK1AHjwq2kp54BQ2Hr8YKT3tx3Y TF7GGYanzbtGiu1mwPE+3RevwqSaVljTo0ckv9PF/qdxP5OOBg2oxDUPY/y3wIfocTFS OSHg== X-Gm-Message-State: AG10YORtvC4NuZyzV0NZDJwJSWx9waFloMlItCxEuSN7wmQWyAyzzCohZ0Hg/9l3JolQr+ZJ X-Received: by 10.194.143.82 with SMTP id sc18mr28442469wjb.14.1456162701453; Mon, 22 Feb 2016 09:38:21 -0800 (PST) Received: from bark.daynix ([5.102.236.99]) by smtp.gmail.com with ESMTPSA id gb9sm25658085wjb.26.2016.02.22.09.38.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Feb 2016 09:38:20 -0800 (PST) From: Leonid Bloch To: qemu-devel@nongnu.org Date: Mon, 22 Feb 2016 19:37:28 +0200 Message-Id: <1456162651-22181-11-git-send-email-leonid.bloch@ravellosystems.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456162651-22181-1-git-send-email-leonid.bloch@ravellosystems.com> References: <1456162651-22181-1-git-send-email-leonid.bloch@ravellosystems.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22e Cc: Dmitry Fleytman , Jason Wang , Leonid Bloch , Shmulik Ladkani , "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH v2 10/13] rtl8139: Move more TCP definitions to common header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dmitry Fleytman Signed-off-by: Dmitry Fleytman Signed-off-by: Leonid Bloch --- hw/net/rtl8139.c | 5 ----- include/net/eth.h | 8 ++++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index fee97bf..262228c 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -1867,11 +1867,6 @@ static int rtl8139_transmit_one(RTL8139State *s, int descriptor) return 1; } -/* structures and macros for task offloading */ -#define TCP_HEADER_DATA_OFFSET(tcp) (((be16_to_cpu(tcp->th_offset_flags) >> 12)&0xf) << 2) -#define TCP_FLAGS_ONLY(flags) ((flags)&0x3f) -#define TCP_HEADER_FLAGS(tcp) TCP_FLAGS_ONLY(be16_to_cpu(tcp->th_offset_flags)) - #define TCP_HEADER_CLEAR_FLAGS(tcp, off) ((tcp)->th_offset_flags &= cpu_to_be16(~TCP_FLAGS_ONLY(off))) /* produces ones' complement sum of data */ diff --git a/include/net/eth.h b/include/net/eth.h index 84384fe..a0645fd 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -69,6 +69,14 @@ typedef struct tcp_header { uint16_t th_urp; /* urgent pointer */ } tcp_header; +#define TCP_FLAGS_ONLY(flags) ((flags) & 0x3f) + +#define TCP_HEADER_FLAGS(tcp) \ + TCP_FLAGS_ONLY(be16_to_cpu((tcp)->th_offset_flags)) + +#define TCP_HEADER_DATA_OFFSET(tcp) \ + (((be16_to_cpu((tcp)->th_offset_flags) >> 12) & 0xf) << 2) + typedef struct udp_header { uint16_t uh_sport; /* source port */ uint16_t uh_dport; /* destination port */