diff mbox series

[ovs-dev] netdev-dpdk: fix check for "net_nfp" driver

Message ID d0a9e6262d01412759aab0fa00abfffe1191ebb1.1526575501.git.tredaelli@redhat.com
State Accepted
Delegated to: Ian Stokes
Headers show
Series [ovs-dev] netdev-dpdk: fix check for "net_nfp" driver | expand

Commit Message

Timothy Redaelli May 17, 2018, 4:45 p.m. UTC
Currently the check of "net_nfp" driver while enabling scatter compares
only the first 6 bytes, but "net_nfp" is 7 bytes long.

This change fixes the check by comparing the first 7 bytes.

CC: Pablo Cascón <pablo.cascon@netronome.com>
CC: Simon Horman <simon.horman@netronome.com>
Fixes: 65a87968f4cf ("netdev-dpdk: don't enable scatter for jumbo RX support for nfp")
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 lib/netdev-dpdk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pablo Cascón May 18, 2018, 1:39 p.m. UTC | #1
On 17/05/18 17:45, Timothy Redaelli wrote:
> Currently the check of "net_nfp" driver while enabling scatter compares
> only the first 6 bytes, but "net_nfp" is 7 bytes long.
>
> This change fixes the check by comparing the first 7 bytes.
>
> CC: Pablo Cascón <pablo.cascon@netronome.com>
> CC: Simon Horman <simon.horman@netronome.com>
> Fixes: 65a87968f4cf ("netdev-dpdk: don't enable scatter for jumbo RX support for nfp")
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> ---
>  lib/netdev-dpdk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 87152a7b9..cee8961c0 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -785,7 +785,7 @@ dpdk_eth_dev_port_config(struct netdev_dpdk *dev, int n_rxq, int n_txq)
>       * than highlighting the one known not to need scatter */
>      if (dev->mtu > ETHER_MTU) {
>          rte_eth_dev_info_get(dev->port_id, &info);
> -        if (strncmp(info.driver_name, "net_nfp", 6)) {
> +        if (strncmp(info.driver_name, "net_nfp", 7)) {
>              conf.rxmode.enable_scatter = 1;
>          }
>      }

Good catch, sorry for the embarrassing bug :(   Luckily as of now there is no other PMD that starts with "net_nf". Still a bug, thanks for the fix!

Acked-by: Pablo Cascón <pablo.cascon@netronome.com>
Stokes, Ian May 22, 2018, 2:47 p.m. UTC | #2
> On 17/05/18 17:45, Timothy Redaelli wrote:
> > Currently the check of "net_nfp" driver while enabling scatter
> > compares only the first 6 bytes, but "net_nfp" is 7 bytes long.
> >
> > This change fixes the check by comparing the first 7 bytes.
> >

I'll add this to the pull request for this week on DPDK_MERGE.

Thanks
Ian
> > CC: Pablo Cascón <pablo.cascon@netronome.com>
> > CC: Simon Horman <simon.horman@netronome.com>
> > Fixes: 65a87968f4cf ("netdev-dpdk: don't enable scatter for jumbo RX
> > support for nfp")
> > Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> > ---
> >  lib/netdev-dpdk.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index
> > 87152a7b9..cee8961c0 100644
> > --- a/lib/netdev-dpdk.c
> > +++ b/lib/netdev-dpdk.c
> > @@ -785,7 +785,7 @@ dpdk_eth_dev_port_config(struct netdev_dpdk *dev,
> int n_rxq, int n_txq)
> >       * than highlighting the one known not to need scatter */
> >      if (dev->mtu > ETHER_MTU) {
> >          rte_eth_dev_info_get(dev->port_id, &info);
> > -        if (strncmp(info.driver_name, "net_nfp", 6)) {
> > +        if (strncmp(info.driver_name, "net_nfp", 7)) {
> >              conf.rxmode.enable_scatter = 1;
> >          }
> >      }
> 
> Good catch, sorry for the embarrassing bug :(   Luckily as of now there is
> no other PMD that starts with "net_nf". Still a bug, thanks for the fix!
> 
> Acked-by: Pablo Cascón <pablo.cascon@netronome.com>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox series

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 87152a7b9..cee8961c0 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -785,7 +785,7 @@  dpdk_eth_dev_port_config(struct netdev_dpdk *dev, int n_rxq, int n_txq)
      * than highlighting the one known not to need scatter */
     if (dev->mtu > ETHER_MTU) {
         rte_eth_dev_info_get(dev->port_id, &info);
-        if (strncmp(info.driver_name, "net_nfp", 6)) {
+        if (strncmp(info.driver_name, "net_nfp", 7)) {
             conf.rxmode.enable_scatter = 1;
         }
     }