From: Kevin Traynor <ktraynor@redhat.com>
To: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Cc: stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH 18.11] net/cxgbe: fix L2T leak in filter error and free path
Date: Fri, 4 Sep 2020 15:59:10 +0100 [thread overview]
Message-ID: <8a3a1c4d-f658-3fa1-acb4-ac334ef634d1@redhat.com> (raw)
In-Reply-To: <20200904143034.GA25421@chelsio.com>
On 04/09/2020 15:33, Rahul Lakkireddy wrote:
> On Friday, September 09/04/20, 2020 at 15:10:43 +0100, Kevin Traynor wrote:
>> On 04/09/2020 13:34, Rahul Lakkireddy wrote:
>>> [ upstream commit e0e1496be5fcabd31807ef9981c421963a9f8578 ]
>>>
>>> Free up Layer 2 Table (L2T) entry properly during filter create
>>> failure and filter delete.
>>>
>>> Fixes: 1decc62b1cbe ("net/cxgbe: add flow operations to offload VLAN actions")
>>>
>>> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
>>> ---
>>
>> Thanks Rahul. There was a bit of fuzz when applying because I had
>> rebased below locally.
>>
>> net/cxgbe: fix double MPS alloc by flow validate and create
>>
>> [ upstream commit be5f4d5ced10f9d7edc8ba4b3f1d98b9d476d367 ]
>>
>> Both commits are in the queue, please take a look and let me know if any
>> issue.
>>
>> https://github.com/kevintraynor/dpdk-stable-queue/commit/b82919008c7462a0f2e117e65210754ccb7470f1
>>
>> https://github.com/kevintraynor/dpdk-stable-queue/commit/7d482e8b14c7436f73e0497b6f1a0f00e0dc6eba
>>
>> Kevin.
>>
>
> Hi Kevin,
>
> Could you move the cxgbe_l2t_release() above the cxgbe_mpstcam_remove()?
> Like below:
>
Sure
> if (f->l2t)
> cxgbe_l2t_release(f->l2t);
>
> if (f->fs.mask.macidx)
> cxgbe_mpstcam_remove(pi, f->fs.val.macidx);
>
> Let me know if you want me to resend the patch on top of
> dpdk-stable-queue tree with the fuzz fixed.
>
No need. I've done it here:
https://github.com/kevintraynor/dpdk-stable-queue/commit/02647630a2f0be86f3daea2cc753c90357d46f85
> Thanks,
> Rahul
>
>>> drivers/net/cxgbe/cxgbe_filter.c | 29 ++++++++++++++++-------------
>>> 1 file changed, 16 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c
>>> index 489c23249..0b6629895 100644
>>> --- a/drivers/net/cxgbe/cxgbe_filter.c
>>> +++ b/drivers/net/cxgbe/cxgbe_filter.c
>>> @@ -276,6 +276,9 @@ static void clear_filter(struct filter_entry *f)
>>> if (f->clipt)
>>> cxgbe_clip_release(f->dev, f->clipt);
>>>
>>> + if (f->l2t)
>>> + cxgbe_l2t_release(f->l2t);
>>> +
>>> /* The zeroing of the filter rule below clears the filter valid,
>>> * pending, locked flags etc. so it's all we need for
>>> * this operation.
>>> @@ -711,19 +714,6 @@ static int set_filter_wr(struct rte_eth_dev *dev, unsigned int fidx)
>>> unsigned int port_id = ethdev2pinfo(dev)->port_id;
>>> int ret;
>>>
>>> - /*
>>> - * If the new filter requires loopback Destination MAC and/or VLAN
>>> - * rewriting then we need to allocate a Layer 2 Table (L2T) entry for
>>> - * the filter.
>>> - */
>>> - if (f->fs.newvlan) {
>>> - /* allocate L2T entry for new filter */
>>> - f->l2t = cxgbe_l2t_alloc_switching(f->dev, f->fs.vlan,
>>> - f->fs.eport, f->fs.dmac);
>>> - if (!f->l2t)
>>> - return -ENOMEM;
>>> - }
>>> -
>>> ctrlq = &adapter->sge.ctrlq[port_id];
>>> mbuf = rte_pktmbuf_alloc(ctrlq->mb_pool);
>>> if (!mbuf) {
>>> @@ -1015,6 +1005,19 @@ int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id,
>>> }
>>> }
>>>
>>> + /* If the new filter requires loopback Destination MAC and/or VLAN
>>> + * rewriting then we need to allocate a Layer 2 Table (L2T) entry for
>>> + * the filter.
>>> + */
>>> + if (f->fs.newvlan) {
>>> + f->l2t = cxgbe_l2t_alloc_switching(f->dev, f->fs.vlan,
>>> + f->fs.eport, f->fs.dmac);
>>> + if (!f->l2t) {
>>> + ret = -ENOMEM;
>>> + goto free_tid;
>>> + }
>>> + }
>>> +
>>> /*
>>> * Attempt to set the filter. If we don't succeed, we clear
>>> * it and return the failure.
>>>
>>
>
prev parent reply other threads:[~2020-09-04 14:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-04 12:34 Rahul Lakkireddy
2020-09-04 14:10 ` Kevin Traynor
2020-09-04 14:33 ` Rahul Lakkireddy
2020-09-04 14:59 ` Kevin Traynor [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=8a3a1c4d-f658-3fa1-acb4-ac334ef634d1@redhat.com \
--to=ktraynor@redhat.com \
--cc=rahul.lakkireddy@chelsio.com \
--cc=stable@dpdk.org \
/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).