Message ID | 1299551108-23663-6-git-send-email-jeffrey.t.kirsher@intel.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
On Mon, 2011-03-07 at 18:24 -0800, Jeff Kirsher wrote: > From: Yi Zou <yi.zou@intel.com> > > Add the new target ddp offload support ndo_fcoe_ddp_target(). > > Signed-off-by: Yi Zou <yi.zou@intel.com> > Signed-off-by: Kiran Patil <kiran.patil@intel.com> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> > --- > net/8021q/vlan_dev.c | 14 ++++++++++++++ > 1 files changed, 14 insertions(+), 0 deletions(-) > > diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c > index be73753..ae610f0 100644 > --- a/net/8021q/vlan_dev.c > +++ b/net/8021q/vlan_dev.c > @@ -625,6 +625,19 @@ static int vlan_dev_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type) > rc = ops->ndo_fcoe_get_wwn(real_dev, wwn, type); > return rc; > } > + > +static int vlan_dev_fcoe_ddp_target(struct net_device *dev, u16 xid, > + struct scatterlist *sgl, unsigned int sgc) > +{ > + struct net_device *real_dev = vlan_dev_info(dev)->real_dev; > + const struct net_device_ops *ops = real_dev->netdev_ops; > + int rc = 0; > + > + if (ops->ndo_fcoe_ddp_target) > + rc = ops->ndo_fcoe_ddp_target(real_dev, xid, sgl, sgc); > + > + return rc; > +} I can't see a caller or any documentation for this operation, so I don't know what the semantics are supposed to be. But shouldn't the return value be -EOPNOTSUPP if real_dev does not implement the operation? Ben. > #endif > > static void vlan_dev_change_rx_flags(struct net_device *dev, int change) > @@ -858,6 +871,7 @@ static const struct net_device_ops vlan_netdev_ops = { > .ndo_fcoe_enable = vlan_dev_fcoe_enable, > .ndo_fcoe_disable = vlan_dev_fcoe_disable, > .ndo_fcoe_get_wwn = vlan_dev_fcoe_get_wwn, > + .ndo_fcoe_ddp_target = vlan_dev_fcoe_ddp_target, > #endif > }; >
> On Mon, 2011-03-07 at 18:24 -0800, Jeff Kirsher wrote: > > From: Yi Zou <yi.zou@intel.com> > > > > Add the new target ddp offload support ndo_fcoe_ddp_target(). > > > > Signed-off-by: Yi Zou <yi.zou@intel.com> > > Signed-off-by: Kiran Patil <kiran.patil@intel.com> > > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> > > --- > > net/8021q/vlan_dev.c | 14 ++++++++++++++ > > 1 files changed, 14 insertions(+), 0 deletions(-) > > > > diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c > > index be73753..ae610f0 100644 > > --- a/net/8021q/vlan_dev.c > > +++ b/net/8021q/vlan_dev.c > > @@ -625,6 +625,19 @@ static int vlan_dev_fcoe_get_wwn(struct net_device > *dev, u64 *wwn, int type) > > rc = ops->ndo_fcoe_get_wwn(real_dev, wwn, type); > > return rc; > > } > > + > > +static int vlan_dev_fcoe_ddp_target(struct net_device *dev, u16 xid, > > + struct scatterlist *sgl, unsigned int sgc) > > +{ > > + struct net_device *real_dev = vlan_dev_info(dev)->real_dev; > > + const struct net_device_ops *ops = real_dev->netdev_ops; > > + int rc = 0; > > + > > + if (ops->ndo_fcoe_ddp_target) > > + rc = ops->ndo_fcoe_ddp_target(real_dev, xid, sgl, sgc); > > + > > + return rc; > > +} > > I can't see a caller or any documentation for this operation, so I don't > know what the semantics are supposed to be. But shouldn't the return > value be -EOPNOTSUPP if real_dev does not implement the operation? > > Ben. This is similar to existing ndo_fcoe_ddp_setup(), but is for target mode, the two are the same on semantics, but the LLD implementation will/may be different depending on the driver as e.g. ,target works on RX_ID where initiator works on OX_ID. The returning of rc being 0 indicates no DDP was setup for this fc exchange, not necessarily EOPNOTSUPP. Thanks, yi > > > #endif > > > > static void vlan_dev_change_rx_flags(struct net_device *dev, int > change) > > @@ -858,6 +871,7 @@ static const struct net_device_ops vlan_netdev_ops > = { > > .ndo_fcoe_enable = vlan_dev_fcoe_enable, > > .ndo_fcoe_disable = vlan_dev_fcoe_disable, > > .ndo_fcoe_get_wwn = vlan_dev_fcoe_get_wwn, > > + .ndo_fcoe_ddp_target = vlan_dev_fcoe_ddp_target, > > #endif > > }; > > > > -- > Ben Hutchings, Senior Software Engineer, Solarflare Communications > Not speaking for my employer; that's the marketing department's job. > They asked us to note that Solarflare product names are trademarked.
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index be73753..ae610f0 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -625,6 +625,19 @@ static int vlan_dev_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type) rc = ops->ndo_fcoe_get_wwn(real_dev, wwn, type); return rc; } + +static int vlan_dev_fcoe_ddp_target(struct net_device *dev, u16 xid, + struct scatterlist *sgl, unsigned int sgc) +{ + struct net_device *real_dev = vlan_dev_info(dev)->real_dev; + const struct net_device_ops *ops = real_dev->netdev_ops; + int rc = 0; + + if (ops->ndo_fcoe_ddp_target) + rc = ops->ndo_fcoe_ddp_target(real_dev, xid, sgl, sgc); + + return rc; +} #endif static void vlan_dev_change_rx_flags(struct net_device *dev, int change) @@ -858,6 +871,7 @@ static const struct net_device_ops vlan_netdev_ops = { .ndo_fcoe_enable = vlan_dev_fcoe_enable, .ndo_fcoe_disable = vlan_dev_fcoe_disable, .ndo_fcoe_get_wwn = vlan_dev_fcoe_get_wwn, + .ndo_fcoe_ddp_target = vlan_dev_fcoe_ddp_target, #endif };