From patchwork Wed Jun 1 08:23:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Fleytman X-Patchwork-Id: 9146447 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D37E660757 for ; Wed, 1 Jun 2016 08:39:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5424200E7 for ; Wed, 1 Jun 2016 08:39:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA32126785; Wed, 1 Jun 2016 08:39:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 3A340200E7 for ; Wed, 1 Jun 2016 08:39:12 +0000 (UTC) Received: from localhost ([::1]:40907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b81gF-0004et-9E for patchwork-qemu-devel@patchwork.kernel.org; Wed, 01 Jun 2016 04:39:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b81Rn-0000s2-MI for qemu-devel@nongnu.org; Wed, 01 Jun 2016 04:24:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b81Rm-0000B9-MJ for qemu-devel@nongnu.org; Wed, 01 Jun 2016 04:24:15 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b81Rm-0000B3-FK for qemu-devel@nongnu.org; Wed, 01 Jun 2016 04:24:14 -0400 Received: by mail-wm0-x242.google.com with SMTP id e3so4454342wme.2 for ; Wed, 01 Jun 2016 01:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FhMMwMOgI/7F62JtElMV6FfbMNTS6iDW86UWNGGIFuQ=; b=Iwyb+LK4LRLZd8gWEdtIAaJM8+BYRlPN4pkR3NftHcP92mERhgMql5kOsMnriocQHC Zq55D19p3BEIimObQj4A6DaHw/IPd5JU6ENqdfLqnPD0AdxjU4rFt7ifujTbmSf+CXpI KPIyx8CTqXu2F00FZyHUaOwhUC2hw9rBkJLPpCA92jWx0CqeKS2i/00zZWPneAMUoy5l DBb/o9zbskBYn4yx3/5Vdx1THXx/b+7jecqwyFlNzAwVWOf3m9EX9YfdGlV1R/2BkOwP QJgnwUcsjxw8cAaebxcGQT42qoFRofhGQeFeXsVnRSJtasviPBcOCBIB3rmLySn+9OH0 pn9A== 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=FhMMwMOgI/7F62JtElMV6FfbMNTS6iDW86UWNGGIFuQ=; b=GZp+4h2pNwKO9JUaWz8/oHcDY9ndGZsI5A3Ji756d4XIUn/19VfR6BgCkxqlF4WtB0 x1g7sJtpgMU1erPwzgI0z19gin8i32OBEGLds+pxDEIBlgrAe0dw2xhfg6vv8ciF2kVu RJV9IEfgcOJ3XQaIohchtmV29EpibpW0/kMA8Vmufz+j75BV+nt5vkTtJestP7gqD47S nPu0LvvlAzmHGuPMUuN2sfJjlUOhM/gT3NxgEySUISqgHYbJii2EoEVzC26cYjpZOwcd 3mcGlFhLEujAUHhIDrnQE07J6zt7p/RGi2I5nlfEWuy7S8CmgPOjIYiLT/4XAJpPT4Hh fSyQ== X-Gm-Message-State: ALyK8tJtg+givjH7+v3Hq4e3j20nI1cWvSlyv8gZvT4QbBfUo+mvMVG8ThwKIep8qqJbBg== X-Received: by 10.28.125.86 with SMTP id y83mr19373490wmc.8.1464769453916; Wed, 01 Jun 2016 01:24:13 -0700 (PDT) Received: from bark.daynix ([5.102.236.99]) by smtp.gmail.com with ESMTPSA id o10sm29242719wjz.37.2016.06.01.01.24.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jun 2016 01:24:13 -0700 (PDT) From: Dmitry Fleytman To: qemu-devel@nongnu.org Date: Wed, 1 Jun 2016 11:23:40 +0300 Message-Id: <1464769426-22276-12-git-send-email-dmitry@daynix.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464769426-22276-1-git-send-email-dmitry@daynix.com> References: <1464769426-22276-1-git-send-email-dmitry@daynix.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH v8 11/17] rtl8139: Move more TCP definitions to common header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yan Vugenfirer , Jason Wang , Leonid Bloch , Shmulik Ladkani , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Dmitry Fleytman Signed-off-by: Dmitry Fleytman Signed-off-by: Leonid Bloch Reviewed-by: Michael S. Tsirkin --- 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 1e5ec14..562c1fd 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 18d0be3..5a32259 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -67,6 +67,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 */