Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4676442ybg; Mon, 8 Jun 2020 14:05:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUEpzyOPmChvSDAs5/eUETJMQV91wYJEFYDHhzG7YBvIkbA8xejP+D125v9fm+bAlfiJs1 X-Received: by 2002:a05:6402:307c:: with SMTP id bs28mr25059784edb.3.1591650324225; Mon, 08 Jun 2020 14:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591650324; cv=none; d=google.com; s=arc-20160816; b=sSVv4EahAqDcwTC+WdP/Y0xhgzhu4l518ulxfjhd7gmU7jYJDRXCc0UCEvO93W5xuc W9MBxwja6up6E6ItcGsM7Gu5jU+XPXl2zDVaLIM0QSOd3GkqMWXBEqfez0+k3djIN/ZH srRY9N8c2VGAeBjnFVfJRkLEnL0JFCozrOGAgpQK5syeYxGfhB85TupvgK+n/h0NY9wJ ag7086e3dmvBsc9XfhbcEjKR06BpnoFy1peYBjszLqsPC1YS/TCYI8N+V7AugnrO99L/ nvj8cWv4Px5PkvLvn/GuAfAl9GoN6Y6u1D+bPiVb3W+7dB0wa1QpsJg9zuqoUnIDFhP8 E3GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=njC/3EtrSHYr3N+lofsXRFJb5f8U26RH2zCjj0w9AP4=; b=n0fjH1+Iv0yyXxRB2DH99rlDq9pvGTcOjV/x5CQMwNIgVzUChTUMNzJXhaiHm/ncBc eJNHVpqkniKdGIhlTPAVdaurADSB6n/lSVP5EtIz/5INs94jEyZjLbYpr5ckhg87j4ap bPfLQKTdt0c2qnkbJTzH5JKtaOox25T3vo8Xs9G67Cgp+oK/gHxzUXnQ1x+vD5sz0ORQ Bfqc5a4xSAR4GLyGPD6z3ALc+osfmKRFGWSVaqZztcnP5F4uq1m8qCsmR3+NsPqD8aN/ x1j7ffgTj2b5o6rJB5IRRns4/8NIfqal0zWzMOPpz2y+nHkeKKLrfk6mkknva0Lq6bHy 3NoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FBOsFCfA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ar23si9304624ejc.169.2020.06.08.14.05.00; Mon, 08 Jun 2020 14:05:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FBOsFCfA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726850AbgFHVBk (ORCPT + 99 others); Mon, 8 Jun 2020 17:01:40 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:57978 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726612AbgFHVBh (ORCPT ); Mon, 8 Jun 2020 17:01:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591650097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=njC/3EtrSHYr3N+lofsXRFJb5f8U26RH2zCjj0w9AP4=; b=FBOsFCfAOgasYG42IXatRM+q2wzOqMSpiPz4+nxSbM9KtMoL7aRFUq6FNWOb90mpZntevD 0CF4YZfPPTNFxwSTtezv25lK4OO9KwC94fvWRShXYusWGx1HGSJSv7CzAvE/6w0VwUf9Q9 6B0J2pYM5QdJD2msAL87aZmGAz6ze1U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-476-_BQUvvBRO0GcfxK2MtbdNg-1; Mon, 08 Jun 2020 17:01:15 -0400 X-MC-Unique: _BQUvvBRO0GcfxK2MtbdNg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 27478BFD0; Mon, 8 Jun 2020 21:01:13 +0000 (UTC) Received: from hp-dl360pgen8-07.khw2.lab.eng.bos.redhat.com (hp-dl360pgen8-07.khw2.lab.eng.bos.redhat.com [10.16.210.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CAB861169; Mon, 8 Jun 2020 21:01:11 +0000 (UTC) From: Jarod Wilson To: linux-kernel@vger.kernel.org Cc: Jarod Wilson , Boris Pismenny , Saeed Mahameed , Leon Romanovsky , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , Jeff Kirsher , Jakub Kicinski , Steffen Klassert , Herbert Xu , netdev@vger.kernel.org Subject: [PATCH net-next 4/4] mlx5: become aware of when running as a bonding slave Date: Mon, 8 Jun 2020 17:00:58 -0400 Message-Id: <20200608210058.37352-5-jarod@redhat.com> In-Reply-To: <20200608210058.37352-1-jarod@redhat.com> References: <20200608210058.37352-1-jarod@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I've been unable to get my hands on suitable supported hardware to date, but I believe this ought to be all that is needed to enable the mlx5 driver to also work with bonding active-backup crypto offload passthru. CC: Boris Pismenny CC: Saeed Mahameed CC: Leon Romanovsky CC: Jay Vosburgh CC: Veaceslav Falico CC: Andy Gospodarek CC: "David S. Miller" CC: Jeff Kirsher CC: Jakub Kicinski CC: Steffen Klassert CC: Herbert Xu CC: netdev@vger.kernel.org Signed-off-by: Jarod Wilson --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c index 92eb3bad4acd..72ad6664bd73 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c @@ -210,6 +210,9 @@ static inline int mlx5e_xfrm_validate_state(struct xfrm_state *x) struct net_device *netdev = x->xso.dev; struct mlx5e_priv *priv; + if (x->xso.slave_dev) + netdev = x->xso.slave_dev; + priv = netdev_priv(netdev); if (x->props.aalgo != SADB_AALG_NONE) { @@ -291,6 +294,9 @@ static int mlx5e_xfrm_add_state(struct xfrm_state *x) unsigned int sa_handle; int err; + if (x->xso.slave_dev) + netdev = x->xso.slave_dev; + priv = netdev_priv(netdev); err = mlx5e_xfrm_validate_state(x); -- 2.20.1