From patchwork Fri Feb 25 17:44:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 84553 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 776A8B70E3 for ; Sat, 26 Feb 2011 04:44:54 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753076Ab1BYRot (ORCPT ); Fri, 25 Feb 2011 12:44:49 -0500 Received: from exht1.emulex.com ([138.239.113.183]:16762 "EHLO exht1.ad.emulex.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752742Ab1BYRot (ORCPT ); Fri, 25 Feb 2011 12:44:49 -0500 Received: from akhaparde-VBox (138.239.154.187) by exht1.ad.emulex.com (138.239.113.183) with Microsoft SMTP Server (TLS) id 8.3.137.0; Fri, 25 Feb 2011 09:44:28 -0800 Date: Fri, 25 Feb 2011 11:44:25 -0600 From: Ajit Khaparde To: Eric Dumazet CC: Subject: Re: [RFC] be2net: add rxhash support Message-ID: <20110225174425.GA11203@akhaparde-VBox> Reply-To: Ajit Khaparde MIME-Version: 1.0 Content-Disposition: inline X-URL: http://www.emulex.com Organization: Emulex Corp User-Agent: "Ajit's Mutt" X-OS: Linux i686 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > -----Original Message----- > From: Eric Dumazet > Sent: Thursday, February 24, 2011 2:25 PM > To: Khaparde, Ajit > Cc: netdev@vger.kernel.org > Subject: [RFC] be2net: add rxhash support > > Ajit, it seems be2net provides RSS hash value in rx compl descriptor ? > > Could we feed skb->rxhash with it ? > > Thanks ! Thanks Eric. Sure. This is a long pending change which fell through the cracks. But then because hashing is enabled in the device only when Number of Rx Queues is > 1, I would suggest the following patch. Unaware of exact conventions, I have added signed-off-by to the patch already. Thanks ----- [PATCH net-next] be2net: add rxhash support Signed-off-by: Eric Dumazet Signed-off-by: Ajit Khaparde --- drivers/net/benet/be_main.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 26f9c56..8c4b782 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c @@ -1038,6 +1038,10 @@ static void be_rx_compl_process(struct be_adapter *adapter, skb->truesize = skb->len + sizeof(struct sk_buff); skb->protocol = eth_type_trans(skb, adapter->netdev); + if (adapter->netdev->features & NETIF_F_RXHASH) + skb->rxhash = AMAP_GET_BITS(struct amap_eth_rx_compl, + rsshash, rxcp); + vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp); vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp); @@ -1099,6 +1103,10 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, return; } + if (adapter->netdev->features & NETIF_F_RXHASH) + skb->rxhash = AMAP_GET_BITS(struct amap_eth_rx_compl, + rsshash, rxcp); + remaining = pkt_size; for (i = 0, j = -1; i < num_rcvd; i++) { page_info = get_rx_page_info(adapter, rxo, rxq_idx); @@ -2619,6 +2627,9 @@ static void be_netdev_init(struct net_device *netdev) NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_GRO | NETIF_F_TSO6; + if (be_multi_rxq(adapter)) + netdev->features |= NETIF_F_RXHASH; + netdev->vlan_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;