From patchwork Wed Dec 2 00:43:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KY Srinivasan X-Patchwork-Id: 551079 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 F202E1402C3 for ; Wed, 2 Dec 2015 10:17:24 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932387AbbLAXP3 (ORCPT ); Tue, 1 Dec 2015 18:15:29 -0500 Received: from p3plsmtps2ded02.prod.phx3.secureserver.net ([208.109.80.59]:56028 "EHLO p3plsmtps2ded02.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932165AbbLAXKe (ORCPT ); Tue, 1 Dec 2015 18:10:34 -0500 Received: from linuxonhyperv.com ([72.167.245.219]) by : HOSTING RELAY : with SMTP id 3u48aYE6cM8XE3u48ayFa9; Tue, 01 Dec 2015 16:10:33 -0700 x-originating-ip: 72.167.245.219 Received: by linuxonhyperv.com (Postfix, from userid 507) id 72F8F19033B; Tue, 1 Dec 2015 16:43:20 -0800 (PST) From: "K. Y. Srinivasan" To: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com Cc: "K. Y. Srinivasan" Subject: [PATCH net-next V3 02/17] hv_netvsc: Rearrange the hv_negtvsc_packet to be space efficient Date: Tue, 1 Dec 2015 16:43:04 -0800 Message-Id: <1449016999-9796-2-git-send-email-kys@microsoft.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1449016999-9796-1-git-send-email-kys@microsoft.com> References: <1449016978-9755-1-git-send-email-kys@microsoft.com> <1449016999-9796-1-git-send-email-kys@microsoft.com> X-CMAE-Envelope: MS4wfNBpzxi8GauCXjZblxzCisHJO96m8+OHgdgmF6R91j7GP3id+/3hLl6dwEiXaWhYdRvpZykcxhO17bog9UkbObOZzw1pLeF5CRxkN2ACArVhe9azRfuM hve7hr6KXAMAmowJbCQ9+BCRZ31Cz8OUCg9vXsiY7p0rfqtMqATdfj0pt3V59jK5efC9Bf2nplFceGbhTCbmBZAsQylE78FFA8/4eeN1biQN0VaE+8Lpxc1H OGfPsANan2WaF2iqXqIC/w2FPIl8dX2V5jwXrdVr59tRsuHjUkTy12oenluiq47llfwzj4ifChqSgcEqk28WYy3waRGtjMESVnZjX4i79bhfzs0TAkJLprO+ p7gXOy7j1xA5UdS7yzvXcKdYAUayDW4dDnEsWqnZmbrsAnbscAqs1gdfVdaTrDYchAUQ/MEA Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Rearrange the elements of struct hv_negtvsc_packet for optimal layout - eliminate unnecessary padding. Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang --- drivers/net/hyperv/hyperv_net.h | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 972e562..7435673 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h @@ -128,32 +128,34 @@ struct ndis_tcp_ip_checksum_info; struct hv_netvsc_packet { /* Bookkeeping stuff */ u8 status; - u8 is_data_pkt; u8 xmit_more; /* from skb */ u8 cp_partial; /* partial copy into send buffer */ - u16 vlan_tci; + u8 rmsg_size; /* RNDIS header and PPI size */ + u8 rmsg_pgcnt; /* page count of RNDIS header and PPI */ + u8 page_buf_cnt; + u8 pad0; + u16 vlan_tci; u16 q_idx; + u32 send_buf_index; + + u32 total_data_buflen; + u32 pad1; + struct vmbus_channel *channel; u64 send_completion_tid; void *send_completion_ctx; void (*send_completion)(void *context); - u32 send_buf_index; /* This points to the memory after page_buf */ struct rndis_message *rndis_msg; - u8 rmsg_size; /* RNDIS header and PPI size */ - u8 rmsg_pgcnt; /* page count of RNDIS header and PPI */ - - u32 total_data_buflen; /* Points to the send/receive buffer where the ethernet frame is */ void *data; - u8 page_buf_cnt; struct hv_page_buffer *page_buf; };