lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9f254fa79f100133319f1ca824becc0cfac38cd3.camel@redhat.com>
Date: Tue, 13 Feb 2024 12:27:52 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Shannon Nelson <shannon.nelson@....com>, netdev@...r.kernel.org, 
	davem@...emloft.net, kuba@...nel.org, edumazet@...gle.com
Cc: brett.creeley@....com, drivers@...sando.io
Subject: Re: [PATCH v3 net-next 7/9] ionic: Add XDP_REDIRECT support

On Fri, 2024-02-09 at 16:48 -0800, Shannon Nelson wrote:
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
> index 6921fd3a1773..6a2067599bd8 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
> @@ -413,7 +413,19 @@ static bool ionic_run_xdp(struct ionic_rx_stats *stats,
>  		break;
>  
>  	case XDP_REDIRECT:
> -		goto out_xdp_abort;
> +		/* unmap the pages before handing them to a different device */
> +		dma_unmap_page(rxq->dev, buf_info->dma_addr,
> +			       IONIC_PAGE_SIZE, DMA_FROM_DEVICE);
> +
> +		err = xdp_do_redirect(netdev, &xdp_buf, xdp_prog);
> +		if (err) {
> +			netdev_dbg(netdev, "xdp_do_redirect err %d\n", err);
> +			goto out_xdp_abort;
> +		}
> +		buf_info->page = NULL;
> +		rxq->xdp_flush = true;
> +		stats->xdp_redirect++;
> +		break;

After this patch, there is a single 'goto out_xdp_abort' statement.

If you re-order the case as:

	case XDP_TX:
	case XDP_REDIRECT:
	case XDP_REDIRECT:
	default:

in patch 4/9, then you will not need to add the mentioned label in the
previous patch and the code after this one will be cleaner.

Cheers,

Paolo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ