Commit 86a48a0
virtio_net: Support dynamic rss indirection table size
When reading/writing virtio_net_ctrl_rss, we get the indirection table
size from vi->rss_indir_table_size, which is initialized in
virtnet_probe(). However, the actual size of indirection_table was set
as VIRTIO_NET_RSS_MAX_TABLE_LEN=128. This collision may cause issues if
the vi->rss_indir_table_size exceeds 128.
This patch instead uses dynamic indirection table, allocated with
vi->rss after vi->rss_indir_table_size initialized. And free it in
virtnet_remove().
In virtnet_commit_rss_command(), sgs for rss is initialized differently
with hash_report. So indirection_table is not used if !vi->has_rss, and
then we don't need to alloc indirection_table for hash_report only uses.
Fixes: c7114b1 ("drivers/net/virtio_net: Added basic RSS support.")
Signed-off-by: Philo Lu <[email protected]>
Signed-off-by: Xuan Zhuo <[email protected]>
Acked-by: Joe Damato <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>1 parent 25d7070 commit 86a48a0
1 file changed
+34
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
372 | 371 | | |
373 | 372 | | |
374 | 373 | | |
375 | 374 | | |
376 | | - | |
| 375 | + | |
377 | 376 | | |
378 | 377 | | |
379 | 378 | | |
| 379 | + | |
| 380 | + | |
380 | 381 | | |
381 | 382 | | |
382 | 383 | | |
| |||
512 | 513 | | |
513 | 514 | | |
514 | 515 | | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
515 | 535 | | |
516 | 536 | | |
517 | 537 | | |
| |||
3828 | 3848 | | |
3829 | 3849 | | |
3830 | 3850 | | |
3831 | | - | |
| 3851 | + | |
3832 | 3852 | | |
3833 | 3853 | | |
3834 | | - | |
3835 | | - | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
3836 | 3860 | | |
3837 | 3861 | | |
3838 | 3862 | | |
| |||
6420 | 6444 | | |
6421 | 6445 | | |
6422 | 6446 | | |
| 6447 | + | |
| 6448 | + | |
| 6449 | + | |
6423 | 6450 | | |
6424 | 6451 | | |
6425 | 6452 | | |
| |||
6674 | 6701 | | |
6675 | 6702 | | |
6676 | 6703 | | |
| 6704 | + | |
| 6705 | + | |
6677 | 6706 | | |
6678 | 6707 | | |
6679 | 6708 | | |
| |||
0 commit comments