From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E055CC2D0DB for ; Sun, 26 Jan 2020 13:21:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B40B420716 for ; Sun, 26 Jan 2020 13:21:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729273AbgAZNVh (ORCPT ); Sun, 26 Jan 2020 08:21:37 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:39276 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729246AbgAZNVg (ORCPT ); Sun, 26 Jan 2020 08:21:36 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from maorg@mellanox.com) with ESMTPS (AES256-SHA encrypted); 26 Jan 2020 15:21:29 +0200 Received: from dev-l-vrt-201.mtl.labs.mlnx (dev-l-vrt-201.mtl.labs.mlnx [10.134.201.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00QDLTp3002251; Sun, 26 Jan 2020 15:21:29 +0200 From: Maor Gottlieb To: j.vosburgh@gmail.com, vfalico@gmail.com, andy@greyhouse.net, jiri@mellanox.com, davem@davemloft.net Cc: Maor Gottlieb , netdev@vger.kernel.org, saeedm@mellanox.com, jgg@mellanox.com, leonro@mellanox.com, alexr@mellanox.com, markz@mellanox.com, parav@mellanox.com, eranbe@mellanox.com, linux-rdma@vger.kernel.org Subject: [RFC PATCH 0/4] Introduce master_xmit_slave_get Date: Sun, 26 Jan 2020 15:21:22 +0200 Message-Id: <20200126132126.9981-1-maorg@mellanox.com> X-Mailer: git-send-email 2.17.2 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Hi, This patch series add support to get the LAG master xmit slave by introducing new .ndo - ndo_xmit_slave_get. Every LAG module can implement it. In this RFC, we added the support to the bond module. The main motivation for doing this is for drivers that offload part of the LAG functionality [1]. For example, Mellanox Connect-X hardware implements RoCE LAG which selects the TX affinity when the resources are created and port is remapped when it goes down [2]. Because of that and the fact that the RDMA frames are bypass the bonding driver completely, we need a function to get the xmit slave assume all the slaves are active. The idea is that the same UDP header will get the same hash result so they will be transmitted from the same port. Thanks [1] https://www.spinics.net/lists/netdev/msg624832.html [2] https://www.spinics.net/lists/netdev/msg626758.html Maor Gottlieb (4): net/core: Introduce master_xmit_slave_get bonding: Rename slave_arr to active_slaves bonding: Add helpers to get xmit slave bonding: Implement ndo_xmit_slave_get drivers/net/bonding/bond_alb.c | 41 ++++-- drivers/net/bonding/bond_main.c | 231 ++++++++++++++++++++++---------- include/linux/netdevice.h | 3 + include/net/bond_alb.h | 4 + include/net/bonding.h | 3 +- include/net/lag.h | 19 +++ 6 files changed, 215 insertions(+), 86 deletions(-) -- 2.17.2