Skip to content

Commit aa08a50

Browse files
committed
tgupdate: merge t/upstream base into t/upstream
2 parents 3af32f1 + 8c862ac commit aa08a50

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+868
-613
lines changed

Documentation/networking/napi.rst

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,43 @@ a channel as an IRQ/NAPI which services queues of a given type. For example,
171171
a configuration of 1 ``rx``, 1 ``tx`` and 1 ``combined`` channel is expected
172172
to utilize 3 interrupts, 2 Rx and 2 Tx queues.
173173

174+
Persistent NAPI config
175+
----------------------
176+
177+
Drivers often allocate and free NAPI instances dynamically. This leads to loss
178+
of NAPI-related user configuration each time NAPI instances are reallocated.
179+
The netif_napi_add_config() API prevents this loss of configuration by
180+
associating each NAPI instance with a persistent NAPI configuration based on
181+
a driver defined index value, like a queue number.
182+
183+
Using this API allows for persistent NAPI IDs (among other settings), which can
184+
be beneficial to userspace programs using ``SO_INCOMING_NAPI_ID``. See the
185+
sections below for other NAPI configuration settings.
186+
187+
Drivers should try to use netif_napi_add_config() whenever possible.
188+
174189
User API
175190
========
176191

177192
User interactions with NAPI depend on NAPI instance ID. The instance IDs
178193
are only visible to the user thru the ``SO_INCOMING_NAPI_ID`` socket option.
179-
It's not currently possible to query IDs used by a given device.
194+
195+
Users can query NAPI IDs for a device or device queue using netlink. This can
196+
be done programmatically in a user application or by using a script included in
197+
the kernel source tree: ``tools/net/ynl/pyynl/cli.py``.
198+
199+
For example, using the script to dump all of the queues for a device (which
200+
will reveal each queue's NAPI ID):
201+
202+
.. code-block:: bash
203+
204+
$ kernel-source/tools/net/ynl/pyynl/cli.py \
205+
--spec Documentation/netlink/specs/netdev.yaml \
206+
--dump queue-get \
207+
--json='{"ifindex": 2}'
208+
209+
See ``Documentation/netlink/specs/netdev.yaml`` for more details on
210+
available operations and attributes.
180211

181212
Software IRQ coalescing
182213
-----------------------

drivers/net/dsa/b53/b53_serdes.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ int b53_serdes_init(struct b53_device *dev, int port)
239239
pcs->dev = dev;
240240
pcs->lane = lane;
241241
pcs->pcs.ops = &b53_pcs_ops;
242-
pcs->pcs.neg_mode = true;
243242

244243
return 0;
245244
}

drivers/net/dsa/mt7530.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3104,7 +3104,6 @@ mt753x_setup(struct dsa_switch *ds)
31043104
/* Initialise the PCS devices */
31053105
for (i = 0; i < priv->ds->num_ports; i++) {
31063106
priv->pcs[i].pcs.ops = priv->info->pcs_ops;
3107-
priv->pcs[i].pcs.neg_mode = true;
31083107
priv->pcs[i].priv = priv;
31093108
priv->pcs[i].port = i;
31103109
}

drivers/net/dsa/mv88e6xxx/pcs-6185.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ static int mv88e6185_pcs_init(struct mv88e6xxx_chip *chip, int port)
138138
mpcs->chip = chip;
139139
mpcs->port = port;
140140
mpcs->phylink_pcs.ops = &mv88e6185_phylink_pcs_ops;
141-
mpcs->phylink_pcs.neg_mode = true;
142141

143142
irq = mv88e6xxx_serdes_irq_mapping(chip, port);
144143
if (irq) {

drivers/net/dsa/mv88e6xxx/pcs-6352.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ static struct marvell_c22_pcs *marvell_c22_pcs_alloc(struct device *dev,
275275
mpcs->mdio.bus = bus;
276276
mpcs->mdio.addr = addr;
277277
mpcs->phylink_pcs.ops = &marvell_c22_pcs_ops;
278-
mpcs->phylink_pcs.neg_mode = true;
279278

280279
return mpcs;
281280
}

drivers/net/dsa/mv88e6xxx/pcs-639x.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,7 @@ static int mv88e6390_pcs_init(struct mv88e6xxx_chip *chip, int port)
565565
return -ENOMEM;
566566

567567
mpcs->sgmii_pcs.ops = &mv88e639x_sgmii_pcs_ops;
568-
mpcs->sgmii_pcs.neg_mode = true;
569568
mpcs->xg_pcs.ops = &mv88e6390_xg_pcs_ops;
570-
mpcs->xg_pcs.neg_mode = true;
571569

572570
if (chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6190X ||
573571
chip->info->prod_num == MV88E6XXX_PORT_SWITCH_ID_PROD_6390X)
@@ -945,9 +943,7 @@ static int mv88e6393x_pcs_init(struct mv88e6xxx_chip *chip, int port)
945943
return -ENOMEM;
946944

947945
mpcs->sgmii_pcs.ops = &mv88e6393x_sgmii_pcs_ops;
948-
mpcs->sgmii_pcs.neg_mode = true;
949946
mpcs->xg_pcs.ops = &mv88e6393x_xg_pcs_ops;
950-
mpcs->xg_pcs.neg_mode = true;
951947
mpcs->supports_5g = true;
952948

953949
err = mv88e6393x_erratum_4_6(mpcs);

drivers/net/dsa/qca/qca8k-8xxx.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1634,7 +1634,6 @@ static void qca8k_setup_pcs(struct qca8k_priv *priv, struct qca8k_pcs *qpcs,
16341634
int port)
16351635
{
16361636
qpcs->pcs.ops = &qca8k_pcs_ops;
1637-
qpcs->pcs.neg_mode = true;
16381637

16391638
/* We don't have interrupts for link changes, so we need to poll */
16401639
qpcs->pcs.poll = true;

0 commit comments

Comments
 (0)