DPDK patches and discussions
 help / color / mirror / Atom feed
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
Subject: Re: [dpdk-dev] [PATCH] net/af_packet: run on kernels without qdisc bypass support
Date: Fri, 23 Jul 2021 10:29:31 +0200	[thread overview]
Message-ID: <5070621.dIzG9W4QbC@thomas> (raw)
In-Reply-To: <1626254891-65085-1-git-send-email-tudor.cornea@keysight.com>

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




      parent reply	other threads:[~2021-07-23  8:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14  9:28 Tudor Cornea
2021-07-23  8:21 ` Thomas Monjalon
2021-07-23  8:29 ` Thomas Monjalon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5070621.dIzG9W4QbC@thomas \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=tudor.cornea.keysight@gmail.com \
    --cc=tudor.cornea@keysight.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).