]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ice: Change number of XDP Tx queues to match number of Rx queues
authorMarta Plantykow <marta.a.plantykow@intel.com>
Sat, 16 May 2020 00:42:17 +0000 (17:42 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 28 May 2020 00:55:56 +0000 (17:55 -0700)
In current implementation number of XDP Tx queues is the same as
the number of transmit queues, which is not always true. This
patch changes this number to match the number of receive queues.
XDP programs are running on Rx rings, so what we actually need to
provide is the XDP Tx ring per each Rx ring so that the whole XDP
ecosystem is functional, e.g. if the result of XDP prog is XDP_TX
then you have the need to access the XDP Tx ring.

Signed-off-by: Marta Plantykow <marta.a.plantykow@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_lib.c
drivers/net/ethernet/intel/ice/ice_main.c

index 89962c14e31fd5c261a2228bb9840b5260c597be..6f3ee8ac11cef774060466ee4c2aeb9362e5e1b4 100644 (file)
@@ -2785,7 +2785,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
 
                ice_vsi_map_rings_to_vectors(vsi);
                if (ice_is_xdp_ena_vsi(vsi)) {
-                       vsi->num_xdp_txq = vsi->alloc_txq;
+                       vsi->num_xdp_txq = vsi->alloc_rxq;
                        ret = ice_prepare_xdp_rings(vsi, vsi->xdp_prog);
                        if (ret)
                                goto err_vectors;
index 81c5f0ce5b8f44f1f7907bd0e27f7e5be40ce906..b64c4e796636a50f94f4a89b24e2cb16df3a67fd 100644 (file)
@@ -1935,7 +1935,7 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bpf_prog *prog,
        }
 
        if (!ice_is_xdp_ena_vsi(vsi) && prog) {
-               vsi->num_xdp_txq = vsi->alloc_txq;
+               vsi->num_xdp_txq = vsi->alloc_rxq;
                xdp_ring_err = ice_prepare_xdp_rings(vsi, prog);
                if (xdp_ring_err)
                        NL_SET_ERR_MSG_MOD(extack, "Setting up XDP Tx resources failed");