From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 1894AA0C46;
	Fri, 23 Jul 2021 10:29:17 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id F299740040;
	Fri, 23 Jul 2021 10:29:16 +0200 (CEST)
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com
 [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 5F39B4003C
 for <dev@dpdk.org>; Fri, 23 Jul 2021 10:29:15 +0200 (CEST)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.nyi.internal (Postfix) with ESMTP id 509725C00B1;
 Fri, 23 Jul 2021 04:29:12 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute2.internal (MEProxy); Fri, 23 Jul 2021 04:29:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding:content-type; s=fm1; bh=
 zfcYKlHPWMSuvK9FhnyTWmuza5uj1J7NNFdyxaeZR+0=; b=qR4GR9o9nCJk0Ics
 iS4Bm1EKterjY4LCRzH8mGKWwXesfDfhlEAISa/1rYVHdjrkSqvguhGqEQfi0eEd
 m58UHy2WdOnUg4LGa+BBM9E/TRywzJ7Zr4CexSCNglmreLAEdwXvvr0Yu9SmvsCM
 oDzGl3Fuwy+l7VU4tcHeLz3VlzvxT9Z+xondc2QtK2OEdt4xjePO1vf+lZ5DJaPd
 w2GqozTXxw18tCHAtxXeExLoZqHY7OE3DBo2DT40BR3IXDH1PPFyFD1r6v/d/Nq9
 He7Ss9OsXW+A5B+iJ+mGGbBcLN/pvelpNJa8RPJzAa2JKoDbvWfM8qkHefkyRa00
 lCa0FQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm3; bh=zfcYKlHPWMSuvK9FhnyTWmuza5uj1J7NNFdyxaeZR
 +0=; b=IRUP9vraWx2/uR6XnHdrublA75cRFdIIz0N3g+/TqqQpNlZl66k6LGOvp
 Wqv28uyLHuEZSTpraqTdvaspfM8xmZY/9hGu+mHkxuBvOQ2T5Tb321a0MThbXMlp
 SpQCsZ3zNL2ovAnABcNopX699YWH5+kc75TZNpowh1kv1vi43a3nRPXkwoKIoucz
 GjRUTzhUaCoCHmHMQElPqX/E8Y7nz4I/OCcRXPGDyCbAlpRfv65ay8uezIY2jMpf
 F0/+K9YhzoEcxuufWKeTExvbikfWfPyIHXkY9Y/lOAcY4LSkPOf46wM9YJI5b3R1
 tfT51PK4IPOdMLYkeBW5Iw51CcptA==
X-ME-Sender: <xms:1336YBSZFK9-Rs8rxF2FRaVKvaaSlr17p79NDLNR8jskVxaqh0Nh-w>
 <xme:1336YKxBs8urXrAKm7mEaBwmSFNVS_z7CEcKxtUwkXx_jRt-CPrB7_jwBXXJlAMIi
 OJBzywNZ4N7nvfZsw>
X-ME-Received: <xmr:1336YG3WQ3I0oHZZmiMLhjp9qptbI6Dc2gvG-RdZFlSIJD7nIfAVtGx73H9sXs_CXPwoM_yRH9XJ8TBRhX2sXxkqpQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfeekgddtgecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs
 ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf
 frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei
 iedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh
 hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght
X-ME-Proxy: <xmx:1336YJCm5xD9-t2Lb1kAG-HXosEHRtf87yeFyNmAR8FiTE9dVuZukw>
 <xmx:1336YKgPS_tKpRbEgkz1HHmrikYgdEO4me7sqLU1eMdKXkIw01fqXw>
 <xmx:1336YNo2zQ43KV0L4CcfCjebwZUdi821FFfHSAyR_5mbajZxh615-A>
 <xmx:2H36YNtpeVt_euGB4wicV-ijppfRFP4CxuNAJbIjToubk3xh5Tq4VQ>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 23 Jul 2021 04:29:10 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Tudor Cornea <tudor.cornea@keysight.com>,
 Tudor Cornea <tudor.cornea.keysight@gmail.com>
Cc: ferruh.yigit@intel.com, dev@dpdk.org
Date: Fri, 23 Jul 2021 10:29:31 +0200
Message-ID: <5070621.dIzG9W4QbC@thomas>
In-Reply-To: <1626254891-65085-1-git-send-email-tudor.cornea@keysight.com>
References: <1626254891-65085-1-git-send-email-tudor.cornea@keysight.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH] net/af_packet: run on kernels without qdisc
 bypass support
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

I did a change in the patch while applying. See below:

14/07/2021 11:28, Tudor Cornea:
> Some older kernels do not support the PACKET_QDISC_BYPASS socket
> option. Such an example is the CentOS 7 kernel (3.10).
> 
> If we only check for the definition of PACKET_QDISC_BYPASS, it might mean
> that we will not be able to compile the PMD driver on a newer platform,
> and run in on a machine with an older kernel.
> 
> Setting the socket option only if it is specifically requested from
> the EAL arguments, allows us to have a way to run the PMD compiled
> against newer kernel headers, on platforms having older kernels.
> 
> Signed-off-by: Tudor Cornea <tudor.cornea@keysight.com>
> ---
> --- a/drivers/net/af_packet/rte_eth_af_packet.c
> +++ b/drivers/net/af_packet/rte_eth_af_packet.c
> @@ -749,13 +749,15 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
>  		}
>  
>  #if defined(PACKET_QDISC_BYPASS)

I move this #if below...

> -		rc = setsockopt(qsockfd, SOL_PACKET, PACKET_QDISC_BYPASS,
> -				&qdisc_bypass, sizeof(qdisc_bypass));
> -		if (rc == -1) {
> -			PMD_LOG_ERRNO(ERR,
> -				"%s: could not set PACKET_QDISC_BYPASS on AF_PACKET socket for %s",
> -				name, pair->value);
> -			goto error;
> +		if (qdisc_bypass) {

... here so we can...

> +			rc = setsockopt(qsockfd, SOL_PACKET, PACKET_QDISC_BYPASS,
> +					&qdisc_bypass, sizeof(qdisc_bypass));
> +			if (rc == -1) {
> +				PMD_LOG_ERRNO(ERR,
> +					"%s: could not set PACKET_QDISC_BYPASS on AF_PACKET socket for %s",
> +					name, pair->value);
> +				goto error;
> +			}
>  		}
>  #else
>  		RTE_SET_USED(qdisc_bypass);

... drop this #else