Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp294239pxb; Thu, 21 Jan 2021 07:18:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxk1pR3dRJQRdeOJLhXBlI2H0X5uIeXD81akwyMOqoXWFLAJkhVb+tRKCZbI6mFV4DgMq3x X-Received: by 2002:a17:906:11d6:: with SMTP id o22mr7999eja.106.1611242316698; Thu, 21 Jan 2021 07:18:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611242316; cv=none; d=google.com; s=arc-20160816; b=jNUTO9L4nWCqSbgv6mSeagA+8yTi68Q5TR4jCd8hFXYH+QPPLKuUkJYbiAW3zcx5nq MoE9gxql/y8OGGios5nUMy0Q/IkmvQdIiL33NsRpFockSi9Xn/jKrDA7YjkFOiEajjNE /hg15IRPsfcxJVUxFVYirXZrEwYxR1zrWTxa2yiuCudHbQVECY7+EmimCiL74Uuo2kHm WBzUx3MsTkUQI1Z+NifK3WJf6ZfcKUGauPZT9Jv8wNv+ByajDBRl8CjPVWsLSP60YYVD IDoUVGOzCuRtHIgm1/OVyCcyCXepQRx0FhYKy1Bi1fQxD+2cAmTQgsdlsKueFJu5S8di 9TWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=O9TLtHmt2zh8yMakyKLVS/teU5JXK2tqPjP6ofPakhM=; b=hOEWHWBxOC0JBj1pfI/bpDOKdyNftatgxSHaGl0VHINaVhg0WrZ99n9d95HX52OYSi SGGaCNJC6MA3jTw0UeVwCiphAvVQjE6IWPlE/KMu/MhDItTEvyVQZo2gVqAP3arixjuX d1hWR7RcfyJjQFAYYluDSUUawCiWzQCbyxi/r03ELyrGmUgiXgoGjjhvZmAC1UjXVg3S Dfvr7MepaBStvSeeoCz+kgZNEC2bWsy6ShBob5xYWmVXZNsZv1mJzO3RORzAM0VM8yGa 6te3iWtbo5CNLboXoEytpZu+mYxicWd1CBgZDiSNfh8MfXgqffC+XqYO3FfnljnFusaK 8ZqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=eQ8lCved; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u13si2282126edp.96.2021.01.21.07.18.12; Thu, 21 Jan 2021 07:18:36 -0800 (PST) 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=@pm.me header.s=protonmail header.b=eQ8lCved; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732608AbhAUPQq (ORCPT + 99 others); Thu, 21 Jan 2021 10:16:46 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:38859 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732626AbhAUPOe (ORCPT ); Thu, 21 Jan 2021 10:14:34 -0500 Date: Thu, 21 Jan 2021 15:13:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1611242020; bh=O9TLtHmt2zh8yMakyKLVS/teU5JXK2tqPjP6ofPakhM=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=eQ8lCveduUB8ZCLvch3E2Gn7spJr/z2r7aLu5lYla4sMTdqVW54xiHH7tb0qXWML7 5lBAC6tbvoEraRw6HJyJtfehD0pMsgiqSoUyGmEo6gnWks+PydKzRyDYKXHAcXRI4N nyc5GO481bJeDGrR1fXz+2LJks+J/MfbG0hi6C7Wbvd0yIPVOLA1HZ8envfEEVrXWs VtQwmap3nF437RrO4mtEK/GnHipnNNQ/hlVkfEd6aa0loFrY3sMitnhdAe1EWXbnsn /ziYpr9/tR0UCdnqMnZwM7mZNMtAYjIc5df93+cYTeH67zT6Y1vSCsWJELRrC71i0p 0+VhXOPQyCFRw== To: Xuan Zhuo From: Alexander Lobakin Cc: Alexander Lobakin , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Jakub Kicinski , =?utf-8?Q?Bj=C3=B6rn_T=C3=B6pel?= , Magnus Karlsson , Jonathan Lemon , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , virtualization@lists.linux-foundation.org, bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: Re: [PATCH bpf-next v3 1/3] net: add priv_flags for allow tx skb without linear Message-ID: <20210121151320.3018-1-alobakin@pm.me> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xuan Zhuo Date: Thu, 21 Jan 2021 21:47:07 +0800 > In some cases, we hope to construct skb directly based on the existing > memory without copying data. In this case, the page will be placed > directly in the skb, and the linear space of skb is empty. But > unfortunately, many the network card does not support this operation. > For example Mellanox Technologies MT27710 Family [ConnectX-4 Lx] will > get the following error message: >=20 > mlx5_core 0000:3b:00.1 eth1: Error cqe on cqn 0x817, ci 0x8, qn 0x1db= b, opcode 0xd, syndrome 0x1, vendor syndrome 0x68 > 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > 00000030: 00 00 00 00 60 10 68 01 0a 00 1d bb 00 0f 9f d2 > WQE DUMP: WQ size 1024 WQ cur size 0, WQE index 0xf, len: 64 > 00000000: 00 00 0f 0a 00 1d bb 03 00 00 00 08 00 00 00 00 > 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > 00000020: 00 00 00 2b 00 08 00 00 00 00 00 05 9e e3 08 00 > 00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > mlx5_core 0000:3b:00.1 eth1: ERR CQE on SQ: 0x1dbb >=20 > So a priv_flag is added here to indicate whether the network card > supports this feature. >=20 > Signed-off-by: Xuan Zhuo > Suggested-by: Alexander Lobakin Acked-by: Alexander Lobakin > --- > include/linux/netdevice.h | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h > index ef51725..135db8f 100644 > --- a/include/linux/netdevice.h > +++ b/include/linux/netdevice.h > @@ -1525,6 +1525,7 @@ struct net_device_ops { > * @IFF_FAILOVER_SLAVE: device is lower dev of a failover master device > * @IFF_L3MDEV_RX_HANDLER: only invoke the rx handler of L3 master devic= e > * @IFF_LIVE_RENAME_OK: rename is allowed while device is up and running > + * @IFF_TX_SKB_NO_LINEAR: allow tx skb linear is empty > */ > enum netdev_priv_flags { > =09IFF_802_1Q_VLAN=09=09=09=3D 1<<0, > @@ -1558,6 +1559,7 @@ enum netdev_priv_flags { > =09IFF_FAILOVER_SLAVE=09=09=3D 1<<28, > =09IFF_L3MDEV_RX_HANDLER=09=09=3D 1<<29, > =09IFF_LIVE_RENAME_OK=09=09=3D 1<<30, > +=09IFF_TX_SKB_NO_LINEAR=09=09=3D 1<<31, > }; > =20 > #define IFF_802_1Q_VLAN=09=09=09IFF_802_1Q_VLAN > @@ -1590,6 +1592,7 @@ enum netdev_priv_flags { > #define IFF_FAILOVER_SLAVE=09=09IFF_FAILOVER_SLAVE > #define IFF_L3MDEV_RX_HANDLER=09=09IFF_L3MDEV_RX_HANDLER > #define IFF_LIVE_RENAME_OK=09=09IFF_LIVE_RENAME_OK > +#define IFF_TX_SKB_NO_LINEAR=09=09IFF_TX_SKB_NO_LINEAR > =20 > /** > *=09struct net_device - The DEVICE structure. > --=20 > 1.8.3.1 Thanks, Al