DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Hyong Youb Kim <hyonkim@cisco.com>
Cc: <dev@dpdk.org>, John Daley <johndale@cisco.com>
Subject: Re: [dpdk-dev] [PATCH] net/enic: fix segfault caused by changing MTU
Date: Wed, 3 Nov 2021 18:41:56 +0000	[thread overview]
Message-ID: <c8e01bfd-3e14-118c-b701-79c533b50dee@intel.com> (raw)
In-Reply-To: <20211026000256.11492-1-hyonkim@cisco.com>

On 10/26/2021 1:02 AM, Hyong Youb Kim wrote:
> Changing MTU after the device start causes a segfault in the Rx
> handler. The MTU handler (enic_set_mtu) performs the following steps.
> 1. Stop NIC Rx
> 2. Change Rx handler '(struct rte_eth_dev)->rx_pkt_burst' to
>     the dummy handler and sleep a while to quiesce
> 3. Re-allocate/initialize Rx structures
> 4. Change Rx handler back to the real handler
>     (e.g. enic_noscatter_recv_pkts)
> 
> enic_set_mtu does not update the recently introduced fast-path pointer
> '(struct rte_eth_fp_ops)->rx_pkt_burst'. Since rte_eth_rx_burst only
> uses the fast-path pointer, it keeps invoking the real Rx handler, not
> the dummy one set by (2). And, (3) causes a segfault in the real Rx
> handler (e.g. dereferencing freed structures).
> 
> Fix the segfault by updating the fast-path pointer as well.
> 
> Fixes: c87d435a4d79 ("ethdev: copy fast-path API into separate structure")
> 
> Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
> Reviewed-by: John Daley <johndale@cisco.com>

Applied to dpdk-next-net/main, thanks.


      reply	other threads:[~2021-11-03 18:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26  0:02 Hyong Youb Kim
2021-11-03 18:41 ` Ferruh Yigit [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=c8e01bfd-3e14-118c-b701-79c533b50dee@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=hyonkim@cisco.com \
    --cc=johndale@cisco.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).