Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24d390b2 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'nfp-mtu-buffer-reconfig'



Jakub Kicinski says:

====================
MTU/buffer reconfig changes

I re-discussed MPLS/MTU internally, dropped it from the patch 1,
re-tested everything, found out I forgot about debugfs pointers,
fixed that as well.

v5:
 - don't reserve space in RX buffers for MPLS label stack
   (patch 1);
 - fix debugfs pointers to ring structures (patch 5).
v4:
 - cut down on unrelated patches;
 - don't "close" the device on error path.

--- v4 cover letter

Previous series included some not entirely related patches,
this one is cut down.  Main issue I'm trying to solve here
is that .ndo_change_mtu() in nfpvf driver is doing full
close/open to reallocate buffers - which if open fails
can result in device being basically closed even though
the interface is started.  As suggested by you I try to move
towards a paradigm where the resources are allocated first
and the MTU change is only done once I'm certain (almost)
nothing can fail.  Almost because I need to communicate
with FW and that can always time out.

Patch 1 fixes small issue.  Next 10 patches reorganize things
so that I can easily allocate new rings and sets of buffers
while the device is running.  Patches 13 and 15 reshape the
.ndo_change_mtu() and ethtool's ring-resize operation into
desired form.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 70f767d3 cc7c0333
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -298,6 +298,8 @@ struct nfp_net_rx_buf {
 * @rxds:       Virtual address of FL/RX ring in host memory
 * @dma:        DMA address of the FL/RX ring
 * @size:       Size, in bytes, of the FL/RX ring (needed to free)
 * @bufsz:	Buffer allocation size for convenience of management routines
 *		(NOTE: this is in second cache line, do not use on fast path!)
 */
struct nfp_net_rx_ring {
	struct nfp_net_r_vector *r_vec;
@@ -319,6 +321,7 @@ struct nfp_net_rx_ring {

	dma_addr_t dma;
	unsigned int size;
	unsigned int bufsz;
} ____cacheline_aligned;

/**
@@ -472,6 +475,9 @@ struct nfp_net {

	u32 rx_offset;

	struct nfp_net_tx_ring *tx_rings;
	struct nfp_net_rx_ring *rx_rings;

#ifdef CONFIG_PCI_IOV
	unsigned int num_vfs;
	struct vf_data_storage *vfinfo;
@@ -504,9 +510,6 @@ struct nfp_net {
	int txd_cnt;
	int rxd_cnt;

	struct nfp_net_tx_ring tx_rings[NFP_NET_MAX_TX_RINGS];
	struct nfp_net_rx_ring rx_rings[NFP_NET_MAX_RX_RINGS];

	u8 num_irqs;
	u8 num_r_vecs;
	struct nfp_net_r_vector r_vecs[NFP_NET_MAX_TX_RINGS];
@@ -721,6 +724,7 @@ void nfp_net_rss_write_key(struct nfp_net *nn);
void nfp_net_coalesce_write_cfg(struct nfp_net *nn);
int nfp_net_irqs_alloc(struct nfp_net *nn);
void nfp_net_irqs_disable(struct nfp_net *nn);
int nfp_net_set_ring_size(struct nfp_net *nn, u32 rxd_cnt, u32 txd_cnt);

#ifdef CONFIG_NFP_NET_DEBUG
void nfp_net_debugfs_create(void);